Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Initial tables #1

Merged
merged 13 commits into from
Nov 17, 2023
Merged
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Steampipe version (`steampipe -v`)**
Example: v0.19.3

**Plugin version (`steampipe plugin list`)**
Example: v0.5.0

**To reproduce**
Steps to reproduce the behavior (please include relevant code and/or commands).

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Questions
url: https://steampipe.io/community/join
about: GitHub issues in this repository are only intended for bug reports and feature requests. Other issues will be closed. Please ask and answer questions through the Steampipe Slack community.
- name: Steampipe CLI Bug Reports and Feature Requests
url: https://github.com/turbot/steampipe/issues/new/choose
about: Steampipe CLI has its own codebase. Bug reports and feature requests for those pieces of functionality should be directed to that repository.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request---new-table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature request - New table
about: Suggest a new table for this project
title: Add table hubspot_<resource>
labels: enhancement, new table
assignees: ""
---

**References**
Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Example query results
<details>
<summary>Results</summary>

```
Add example SQL query results here (please include the input queries as well)
```
</details>
14 changes: 14 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci_lint_workflow:
uses: turbot/steampipe-workflows/.github/workflows/golangci-lint.yml@main
with:
timeout: 20m
13 changes: 13 additions & 0 deletions .github/workflows/registry-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build and Deploy OCI Image

on:
push:
tags:
- 'v*'

jobs:
registry_publish_workflow:
uses: turbot/steampipe-workflows/.github/workflows/registry-publish.yml@main
secrets: inherit
with:
releaseTimeout: 60m
17 changes: 17 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Stale Issues and PRs
on:
schedule:
- cron: "30 23 * * *"
workflow_dispatch:
inputs:
dryRun:
description: Set to true for a dry run
required: false
default: "false"
type: string

jobs:
stale_workflow:
uses: turbot/steampipe-workflows/.github/workflows/stale.yml@main
with:
dryRun: ${{ github.event.inputs.dryRun }}
9 changes: 9 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Sync Labels
on:
schedule:
- cron: "30 22 * * 1"
workflow_dispatch:

jobs:
sync_labels_workflow:
uses: turbot/steampipe-workflows/.github/workflows/sync-labels.yml@main
38 changes: 38 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPRIVATE=github.com/turbot
goos:
- linux
- darwin
#- windows #- not yet.....
goarch:
- amd64
- arm64
ignore:
- goos: darwin # docs suggest that darwin arm64 should compile, but doesnt...
goarch: arm64

id: "steampipe-fastly"
binary: "{{ .ProjectName }}.plugin"

archives:
- format: gz
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- none*
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## v0.0.1 [TBD]

_What's new?_

- New tables added
- [hubspot_blog_post](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_blog_post)
- [hubspot_company](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_company)
- [hubspot_contact](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_contact)
- [hubspot_deal](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_deal)
- [hubspot_domain](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_domain)
- [hubspot_hub_db](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_hub_db)
- [hubspot_owner](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_owner)
- [hubspot_ticket](https://hub.steampipe.io/plugins/turbot/hubspot/tables/hubspot_ticket)
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install:
go build -o ~/.steampipe/plugins/hub.steampipe.io/plugins/turbot/hubspot@latest/steampipe-plugin-hubspot.plugin *.go
117 changes: 116 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,116 @@
# steampipe-plugin-hubspot
![image](https://hub.steampipe.io/images/plugins/turbot/hubspot-social-graphic.png)

# HubSpot Plugin for Steampipe

Use SQL to query contacts, deals, tickets and more from HubSpot.

- **[Get started →](https://hub.steampipe.io/plugins/turbot/hubspot)**
- Documentation: [Table definitions & examples](https://hub.steampipe.io/plugins/turbot/hubspot/tables)
- Community: [Join #steampipe on Slack →](https://turbot.com/community/join)
- Get involved: [Issues](https://github.com/turbot/steampipe-plugin-hubspot/issues)

## Quick start

### Install

Download and install the latest HubSpot plugin:

```bash
steampipe plugin install hubspot
```

Configure your [credentials](https://hub.steampipe.io/plugins/turbot/hubspot#credentials) and [config file](https://hub.steampipe.io/plugins/turbot/hubspot#configuration).

Configure your account details in `~/.steampipe/config/hubspot.spc`:

```hcl
connection "hubspot" {
plugin = "hubspot"

# Authentication information
private_app_token = "pat-na1-70271006-11d8-4a5d-9169-b12f4327e5b"
}
```

Or through environment variables:

```sh
export HUBSPOT_PRIVATE_APP_TOKEN=pat-na1-70271006-11d8-4a5d-9169-b12f4327e5b
```

Run steampipe:

```shell
steampipe query
```

List your HubSpot deals:

```sql
select
id,
created_at,
archived,
amount,
dealname,
pipeline,
dealstage
from
hubspot_deal;
```

```
+-------------+---------------------------+----------+--------+----------+----------+----------------------+
| id | created_at | archived | amount | dealname | pipeline | dealstage |
+-------------+---------------------------+----------+--------+----------+----------+----------------------+
| 13432979812 | 2023-05-24T17:09:39+05:30 | false | 10000 | test | default | appointmentscheduled |
+-------------+---------------------------+----------+--------+----------+----------+----------------------+
```

## Developing

Prerequisites:

- [Steampipe](https://steampipe.io/downloads)
- [Golang](https://golang.org/doc/install)

Clone:

```sh
git clone https://github.com/turbot/steampipe-plugin-hubspot.git
cd steampipe-plugin-hubspot
```

Build, which automatically installs the new version to your `~/.steampipe/plugins` directory:

```
make
```

Configure the plugin:

```
cp config/* ~/.steampipe/config
vi ~/.steampipe/config/hubspot.spc
```

Try it!

```
steampipe query
> .inspect hubspot
```

Further reading:

- [Writing plugins](https://steampipe.io/docs/develop/writing-plugins)
- [Writing your first table](https://steampipe.io/docs/develop/writing-your-first-table)

## Contributing

Please see the [contribution guidelines](https://github.com/turbot/steampipe/blob/main/CONTRIBUTING.md) and our [code of conduct](https://github.com/turbot/steampipe/blob/main/CODE_OF_CONDUCT.md). All contributions are subject to the [Apache 2.0 open source license](https://github.com/turbot/steampipe-plugin-hubspot/blob/main/LICENSE).

`help wanted` issues:

- [Steampipe](https://github.com/turbot/steampipe/labels/help%20wanted)
- [HubSpot Plugin](https://github.com/turbot/steampipe-plugin-hubspot/labels/help%20wanted)
8 changes: 8 additions & 0 deletions config/hubspot.spc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
connection "hubspot" {
plugin = "hubspot"

# The HubSpot Private APP Token. Required.
# Get your Private APP token from HubSpot https://developers.hubspot.com/docs/api/private-apps.
# Can also be set with the `HUBSPOT_PRIVATE_APP_TOKEN` environment variable.
# private_app_token = "pat-na1-70271006-11d8-4a5d-9169-b12f4327e5b"
}
Loading