-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
source-hubspot: update to estuary-cdk
- Loading branch information
1 parent
d43d3bd
commit 3c2a8ed
Showing
50 changed files
with
1,229 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
[tool.poetry] | ||
name = "source-hubspot" | ||
name = "source_hubspot" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Johnny Graettinger <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.11,<3.12" | ||
flow-sdk = {path="../python", develop=true} | ||
airbyte-cdk = "0.51.14" | ||
backoff = "^1.11" | ||
pendulum = "^3.0.0" | ||
airbyte-cdk = "^0.52" | ||
estuary-cdk = {path="../estuary-cdk", develop = true} | ||
python = "^3.11" | ||
types-requests = "^2.31" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
debugpy = "^1.8.0" | ||
mypy = "^1.8.0" | ||
pytest = "^7.4.3" | ||
pytest-insta = "^0.2.0" | ||
mock = "^5.1.0" | ||
pytest-mock = "^3.12.0" | ||
pytest-insta = "^0.3.0" | ||
requests-mock = "^1.11.0" | ||
debugpy = "^1.8.0" | ||
pytest-mock = "^3.12.0" | ||
mock = "^5.1.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import estuary_cdk.pydantic_polyfill # Must be first. | ||
|
||
import asyncio | ||
import urllib | ||
from estuary_cdk import shim_airbyte_cdk, flow | ||
from source_hubspot import SourceHubspot | ||
|
||
scopes = [ | ||
"oauth", | ||
"forms", | ||
"files", | ||
"tickets", | ||
"e-commerce", | ||
"sales-email-read", | ||
"forms-uploaded-files", | ||
"crm.lists.read", | ||
"crm.objects.contacts.read", | ||
"files.ui_hidden.read", | ||
"crm.schemas.contacts.read", | ||
"crm.objects.companies.read", | ||
"crm.objects.deals.read", | ||
"crm.schemas.companies.read", | ||
"crm.schemas.deals.read", | ||
"crm.objects.owners.read", | ||
] | ||
|
||
optional_scopes = [ | ||
"content", | ||
"automation", | ||
"crm.objects.feedback_submissions.read", | ||
] | ||
|
||
asyncio.run( | ||
shim_airbyte_cdk.CaptureShim( | ||
delegate=SourceHubspot(), | ||
oauth2=flow.OAuth2Spec( | ||
provider="hubspot", | ||
authUrlTemplate=( | ||
"https://app.hubspot.com/oauth/authorize?" | ||
r"client_id={{#urlencode}}{{{ client_id }}}{{/urlencode}}" | ||
r"&scope=" | ||
+ urllib.parse.quote(" ".join(scopes)) | ||
+ r"&optional_scope=" | ||
+ urllib.parse.quote(" ".join(optional_scopes)) | ||
+ r"&redirect_uri={{#urlencode}}{{{ redirect_uri }}}{{/urlencode}}" | ||
r"&response_type=code&state={{#urlencode}}{{{ state }}}{{/urlencode}}" | ||
), | ||
accessTokenUrlTemplate="https://api.hubapi.com/oauth/v1/token", | ||
accessTokenHeaders={"content-type": "application/x-www-form-urlencoded"}, | ||
accessTokenBody=( | ||
"grant_type=authorization_code" | ||
r"&client_id={{#urlencode}}{{{ client_id }}}{{/urlencode}}" | ||
r"&client_secret={{#urlencode}}{{{ client_secret }}}{{/urlencode}}" | ||
r"&redirect_uri={{#urlencode}}{{{ redirect_uri }}}{{/urlencode}}" | ||
r"&code={{#urlencode}}{{{ code }}}{{/urlencode}}" | ||
), | ||
accessTokenResponseMap={ | ||
"refresh_token": "/refresh_token", | ||
}, | ||
), | ||
schema_inference=False, | ||
).serve() | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.