-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added new connector: Source-Salesforce #1367
Closed
+133,735
−0
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Added tests snapshots
Fixed flow.yaml file configs
commit 9151d4d26e5cc6685c316c0f89675b4e5c255de7
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
credentials: | ||
auth_type: Client | ||
client_id_sops: ENC[AES256_GCM,data:w+QlOJj6HMkY8LXI+rhkU+WGzrC/pz70nnZMpqrYbLcLBBnd4MAvPOJrY9GCa1CazfzavL6ATXZtMO2et7IT8PH5i4OkhHmXrcRpYvoQFYqVPOsXMw==,iv:lto0AF8YNlhb9FIntaqVRcyxaEZSxhefzCcDx/2yQFw=,tag:BAIe1Yezo1mnaxz/uPfbaQ==,type:str] | ||
client_secret_sops: ENC[AES256_GCM,data:MTa+Cv+YH7v8gy/LTsviFW9oocCDWp86g7aB5OVnO6OJLPChbNAuC7qtAzNKiZu2DVKof9tmrjqQcWxhdVEMJA==,iv:oZg6cFFx9Oq3AZCGsGRtusXEZKyMVMKbG6SCANxjwWg=,tag:iyHdLX2mUFKQfo3oJRCneg==,type:str] | ||
refresh_token_sops: ENC[AES256_GCM,data:ao4MuPvTWERkVyPieScomGZnryhEedaVizY1tOIGIXDewe9DD4dvXbBS3s+uMMG1j8mH2QWM5s7ta3LqChAZ+Tq3+o8KktMZ6D/PR7CjNfumrUrXeVgZ,iv:dHVIGWMkalxkcjCCvzeS/wPsJ5SVgfUNoRIKYoq2eTk=,tag:lWOpuMjSZVHn4nFb/UnpjQ==,type:str] | ||
is_sandbox: false | ||
start_date: "2020-01-01" | ||
sops: | ||
kms: [] | ||
gcp_kms: | ||
- resource_id: projects/estuary-theatre/locations/us-central1/keyRings/connector-keyring/cryptoKeys/connector-repository | ||
created_at: "2024-03-08T05:31:16Z" | ||
enc: CiQAdmEdwvWWci8hmYfDEI3t5/hMDMNae/7Pq6THGr3n3y+b8CwSSQCVvC1zN8IPDTYZdbVo11k7xVAeJSNRRAIOPpU+ARe73YpQtoMP92xJs0VasYa6gxjB53wWKIHiGxYJr5rYtJfvE6evYRQFkDY= | ||
azure_kv: [] | ||
hc_vault: [] | ||
age: [] | ||
lastmodified: "2024-03-08T05:31:17Z" | ||
mac: ENC[AES256_GCM,data:f22SroKVPhI6p/24lSCMTSuIjR6orf2jcrGKf1A29MvGpwR9804EaRwnZ6wArq5aqMoeEF4BvZrcbJewqrjNT1qRRPvXb+7e7t/VIPi+8/qH1ID++oLxo/eEvdGMLhtxQSr7x41erqql0izeUyaEU6KgzEo5b0HKM/3FMOQi/z8=,iv:4cjKBY41vOI1ve0ppjbWDp7UWVsnZakEYhDzWTuajLc=,tag:aKpMwjdOnzJ00DNEChRrlw==,type:str] | ||
pgp: [] | ||
encrypted_suffix: _sops | ||
version: 3.8.1 |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[tool.poetry] | ||
name = "source-salesforce" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Luishfs <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[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" | ||
pandas = "^2.2.1" | ||
vcrpy = "4.1.1" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^7.4.3" | ||
pytest-insta = "^0.2.0" | ||
mock = "^5.1.0" | ||
pytest-mock = "^3.12.0" | ||
requests-mock = "^1.11.0" | ||
debugpy = "^1.8.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
107,676 changes: 107,676 additions & 0 deletions
107,676
source-salesforce/tests/snapshots/snapshots__discover__capture.stdout.json
Large diffs are not rendered by default.
Oops, something went wrong.
160 changes: 160 additions & 0 deletions
160
source-salesforce/tests/snapshots/snapshots__spec__capture.stdout.json
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,160 @@ | ||
[ | ||
{ | ||
"configSchema": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"additionalProperties": true, | ||
"properties": { | ||
"credentials": { | ||
"properties": { | ||
"auth_type": { | ||
"const": "Client", | ||
"default": "Client", | ||
"type": "string" | ||
}, | ||
"client_id": { | ||
"airbyte_secret": true, | ||
"description": "Enter your Salesforce developer application's Client ID", | ||
"order": 2, | ||
"title": "Client ID", | ||
"type": "string" | ||
}, | ||
"client_secret": { | ||
"airbyte_secret": true, | ||
"description": "Enter your Salesforce developer application's Client secret", | ||
"order": 3, | ||
"title": "Client Secret", | ||
"type": "string" | ||
}, | ||
"refresh_token": { | ||
"airbyte_secret": true, | ||
"description": "Enter your application's Salesforce Refresh Token used to access your Salesforce account.", | ||
"order": 4, | ||
"title": "Refresh Token", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"client_id", | ||
"client_secret", | ||
"refresh_token" | ||
], | ||
"type": "object", | ||
"x-oauth2-provider": "salesforce" | ||
}, | ||
"is_sandbox": { | ||
"default": false, | ||
"description": "Toggle if you're using a <a href=\"https://help.salesforce.com/s/articleView?id=sf.deploy_sandboxes_parent.htm&type=5\">Salesforce Sandbox</a>", | ||
"order": 1, | ||
"title": "Sandbox", | ||
"type": "boolean" | ||
}, | ||
"start_date": { | ||
"description": "Enter the date in the YYYY-MM-DD format. We will replicate the data added on and after this date. If this field is blank, we will replicate all data.", | ||
"examples": [ | ||
"2021-07-25T00:00:00Z" | ||
], | ||
"format": "date", | ||
"order": 5, | ||
"pattern": "^([0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}:[0-9]{2}Z)?)$", | ||
"title": "Start Date", | ||
"type": "string" | ||
}, | ||
"streams_criteria": { | ||
"description": "Filter streams relevant to you", | ||
"items": { | ||
"properties": { | ||
"criteria": { | ||
"default": "contains", | ||
"enum": [ | ||
"starts with", | ||
"ends with", | ||
"contains", | ||
"exacts", | ||
"starts not with", | ||
"ends not with", | ||
"not contains", | ||
"not exacts" | ||
], | ||
"order": 1, | ||
"title": "Search criteria", | ||
"type": "string" | ||
}, | ||
"value": { | ||
"order": 2, | ||
"title": "Search value", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"criteria", | ||
"value" | ||
], | ||
"type": "object" | ||
}, | ||
"order": 6, | ||
"title": "Filter Salesforce Objects", | ||
"type": "array" | ||
} | ||
}, | ||
"required": [ | ||
"credentials" | ||
], | ||
"title": "Salesforce Source Spec", | ||
"type": "object" | ||
}, | ||
"documentationUrl": "https://go.estuary.dev/AyWXIh", | ||
"oauth2": { | ||
"accessTokenBody": "grant_type=authorization_code&client_id={{#urlencode}}{{{ client_id }}}{{/urlencode}}&client_secret={{#urlencode}}{{{ client_secret }}}{{/urlencode}}&redirect_uri={{#urlencode}}{{{ redirect_uri }}}{{/urlencode}}&code={{#urlencode}}{{{ code }}}{{/urlencode}}", | ||
"accessTokenHeaders": { | ||
"content-type": "application/x-www-form-urlencoded" | ||
}, | ||
"accessTokenResponseMap": { | ||
"refresh_token": "/refresh_token" | ||
}, | ||
"accessTokenUrlTemplate": "https://{{#config.is_sandbox}}test{{/config.is_sandbox}}{{^config.is_sandbox}}login{{/config.is_sandbox}}.salesforce.com/services/oauth2/token", | ||
"authUrlTemplate": "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}}", | ||
"provider": "salesforce" | ||
}, | ||
"protocol": 3032023, | ||
"resourceConfigSchema": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"properties": { | ||
"cursorField": { | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": [ | ||
"array", | ||
"null" | ||
] | ||
}, | ||
"namespace": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"stream": { | ||
"type": "string" | ||
}, | ||
"syncMode": { | ||
"enum": [ | ||
"incremental", | ||
"full_refresh" | ||
], | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"stream", | ||
"syncMode" | ||
], | ||
"title": "ResourceSpec", | ||
"type": "object" | ||
}, | ||
"resourcePathPointers": [ | ||
"/namespace", | ||
"/stream" | ||
] | ||
} | ||
] |
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,58 @@ | ||
import json | ||
import subprocess | ||
|
||
import pytest_insta.format as insta_format | ||
insta_format.FmtJson.dump = lambda _self, path, value: path.write_text(json.dumps(value, sort_keys=True, indent=2) + "\n", "utf-8") | ||
|
||
# def test_capture(request, snapshot): | ||
# result = subprocess.run( | ||
# [ | ||
# "flowctl", | ||
# "preview", | ||
# "--source", | ||
# request.config.rootdir + "/source-hubspot/test.flow.yaml", | ||
# ], | ||
# stdout=subprocess.PIPE, | ||
# text=True, | ||
# ) | ||
# assert result.returncode == 0 | ||
# lines = [json.loads(l) for l in result.stdout.splitlines()] | ||
|
||
# assert snapshot("capture.stdout.json") == lines | ||
|
||
def test_discover(request, snapshot): | ||
result = subprocess.run( | ||
[ | ||
"flowctl", | ||
"raw", | ||
"discover", | ||
"--source", | ||
request.config.rootdir + "/source-salesforce/test.flow.yaml", | ||
"-o", | ||
"json", | ||
"--emit-raw" | ||
], | ||
stdout=subprocess.PIPE, | ||
text=True, | ||
) | ||
assert result.returncode == 0 | ||
lines = [json.loads(l) for l in result.stdout.splitlines()] | ||
|
||
assert snapshot("capture.stdout.json") == lines | ||
|
||
def test_spec(request, snapshot): | ||
result = subprocess.run( | ||
[ | ||
"flowctl", | ||
"raw", | ||
"spec", | ||
"--source", | ||
request.config.rootdir + "/source-salesforce/test.flow.yaml" | ||
], | ||
stdout=subprocess.PIPE, | ||
text=True, | ||
) | ||
assert result.returncode == 0 | ||
lines = [json.loads(l) for l in result.stdout.splitlines()] | ||
|
||
assert snapshot("capture.stdout.json") == lines |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The amount of change in this file is concerning -- it's too large to even review in GitHub. Can you discuss the nature of the changes here? If you re-create this snapshot, after having switched to the estuary-cdk, are there fewer changes (because it was re-orderings introduced by the older
flow-sdk
that have since reverted to their original snapshot order)?