Skip to content

Commit

Permalink
Fixed CI, Removed unused files, Cleaned test.flow.yaml, Added salesfo…
Browse files Browse the repository at this point in the history
…rce to the new CDK
  • Loading branch information
Luishfs committed Mar 11, 2024
1 parent c6b4021 commit a1c34e9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 4,959 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- name: source-salesforce
type: capture
version: v2
usage_rate: "1.0"

steps:
- uses: actions/checkout@v4
Expand Down
132 changes: 0 additions & 132 deletions source-salesforce/README.md

This file was deleted.

1 change: 0 additions & 1 deletion source-salesforce/icon.svg

This file was deleted.

24 changes: 0 additions & 24 deletions source-salesforce/metadata.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion source-salesforce/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
flow-sdk = {path="../python", develop=true}
estuary-cdk = {path="../estuary-cdk", develop = true}
airbyte-cdk = "0.51.14"
backoff = "^1.11"
pendulum = "^3.0.0"
Expand Down
28 changes: 28 additions & 0 deletions source-salesforce/source_salesforce/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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

asyncio.run(
shim_airbyte_cdk.CaptureShim(
delegate=SourceSalesforce(),
oauth2={
"provider": "salesforce",
"authUrlTemplate": (
r"https://{{#config.is_sandbox}}test{{/config.is_sandbox}}{{^config.is_sandbox}}login{{/config.is_sandbox}}.salesforce.com/services/oauth2/authorize?client_id={{#urlencode}}{{{ client_id }}}{{/urlencode}}&redirect_uri={{#urlencode}}{{{ redirect_uri }}}{{/urlencode}}&response_type=code&state={{#urlencode}}{{{ state }}}{{/urlencode}}"
),
"accessTokenUrlTemplate": r"https://{{#config.is_sandbox}}test{{/config.is_sandbox}}{{^config.is_sandbox}}login{{/config.is_sandbox}}.salesforce.com/services/oauth2/token",
"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}}&code={{#urlencode}}{{{ code }}}{{/urlencode}}"
),
"accessTokenHeaders": {"content-type": "application/x-www-form-urlencoded"},
"accessTokenResponseMap": {"refresh_token": "/refresh_token"}
},
usesSchemaInference=False,
).serve()
)
Loading

0 comments on commit a1c34e9

Please sign in to comment.