-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Source Freshsales : Migrate Python CDK to Low-code CDK (#31685)
Co-authored-by: Marcos Marx <[email protected]> Co-authored-by: marcosmarxm <[email protected]>
- Loading branch information
1 parent
53bbac8
commit 855d6a4
Showing
25 changed files
with
409 additions
and
408 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 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,3 @@ | ||
# | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# |
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
78 changes: 39 additions & 39 deletions
78
airbyte-integrations/connectors/source-freshsales/integration_tests/expected_records.jsonl
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
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 |
---|---|---|
|
@@ -6,23 +6,23 @@ | |
from setuptools import find_packages, setup | ||
|
||
MAIN_REQUIREMENTS = [ | ||
"airbyte-cdk", | ||
"airbyte-cdk~=0.1", | ||
] | ||
|
||
TEST_REQUIREMENTS = [ | ||
"requests-mock~=1.9.3", | ||
"pytest", | ||
"pytest-mock", | ||
"pytest~=6.2", | ||
"pytest-mock~=3.6.1", | ||
] | ||
|
||
setup( | ||
name="source_freshsales", | ||
description="Source implementation for Freshsales.", | ||
author="Tuan Nguyen", | ||
author_email="[email protected]", | ||
author="Airbyte", | ||
author_email="[email protected]", | ||
packages=find_packages(), | ||
install_requires=MAIN_REQUIREMENTS, | ||
package_data={"": ["*.json", "schemas/*.json", "schemas/shared/*.json"]}, | ||
package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]}, | ||
extras_require={ | ||
"tests": TEST_REQUIREMENTS, | ||
}, | ||
|
286 changes: 286 additions & 0 deletions
286
airbyte-integrations/connectors/source-freshsales/source_freshsales/manifest.yaml
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,286 @@ | ||
version: 0.51.16 | ||
|
||
type: DeclarativeSource | ||
check: | ||
type: CheckStream | ||
stream_names: | ||
- contacts | ||
definitions: | ||
schema_loader: | ||
type: JsonFileSchemaLoader | ||
file_path: "./source_freshsales/schemas/{{ parameters['name'] }}.json" | ||
selector: | ||
type: RecordSelector | ||
extractor: | ||
type: DpathExtractor | ||
field_path: [] | ||
basic_requester: | ||
type: HttpRequester | ||
url_base: "https://{{ config['domain_name'] }}/crm/sales/api/" | ||
http_method: "GET" | ||
authenticator: | ||
type: ApiKeyAuthenticator | ||
header: "Authorization" | ||
api_token: "Token token={{ config['api_key'] }}" | ||
requester: | ||
$ref: "#/definitions/basic_requester" | ||
request_parameters: | ||
page: "{{ parameters.get('page', None) }}" | ||
filter: "{{ parameters.get('filter', None) }}" | ||
sort_type: "asc" | ||
sort: "updated_at" | ||
default_paginator: | ||
type: "DefaultPaginator" | ||
page_size_option: | ||
type: "RequestOption" | ||
inject_into: "request_parameter" | ||
field_name: "per_page" | ||
pagination_strategy: | ||
type: "PageIncrement" | ||
page_size: 50 | ||
start_from_page: 1 | ||
inject_on_first_request: true | ||
page_token_option: | ||
type: "RequestOption" | ||
inject_into: "request_parameter" | ||
field_name: "page" | ||
retriever: | ||
type: SimpleRetriever | ||
record_selector: | ||
$ref: "#/definitions/selector" | ||
requester: | ||
$ref: "#/definitions/requester" | ||
paginator: | ||
$ref: "#/definitions/default_paginator" | ||
base_stream: | ||
primary_key: "id" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
contacts_filters_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "contact_filters" | ||
path: "contacts/filters" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/basic_requester" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- filters | ||
record_filter: | ||
condition: "{{ record['name'] == parameters['filter'] }}" | ||
contacts_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "contacts" | ||
filter: "All Contacts" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/requester" | ||
path: "contacts/view/{{ stream_slice.view_id }}" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- contacts | ||
partition_router: | ||
type: SubstreamPartitionRouter | ||
parent_stream_configs: | ||
- stream: "#/definitions/contacts_filters_stream" | ||
parent_key: "id" | ||
partition_field: "view_id" | ||
accounts_filters_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "sales_accounts_filter" | ||
path: "sales_accounts/filters" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/basic_requester" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- filters | ||
record_filter: | ||
condition: "{{ record['name'] == parameters['filter'] }}" | ||
accounts_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "accounts" | ||
filter: "All Accounts" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/requester" | ||
path: "sales_accounts/view/{{ stream_slice.view_id }}" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- sales_accounts | ||
partition_router: | ||
type: SubstreamPartitionRouter | ||
parent_stream_configs: | ||
- stream: "#/definitions/accounts_filters_stream" | ||
parent_key: "id" | ||
partition_field: "view_id" | ||
deals_filters_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "deals_filter" | ||
path: "deals/filters" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/basic_requester" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- filters | ||
record_filter: | ||
condition: "{{ record['name'] == parameters['filter'] }}" | ||
open_deals_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "open_deals" | ||
filter: "Open Deals" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/requester" | ||
path: "deals/view/{{ stream_slice.view_id }}" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- deals | ||
partition_router: | ||
type: SubstreamPartitionRouter | ||
parent_stream_configs: | ||
- stream: "#/definitions/deals_filters_stream" | ||
parent_key: "id" | ||
partition_field: "view_id" | ||
transformations: | ||
- type: RemoveFields | ||
field_pointers: | ||
- ["fc_widget_collaboration"] | ||
won_deals_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "won_deals" | ||
filter: "Won Deals" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/requester" | ||
path: "deals/view/{{ stream_slice.view_id }}" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- deals | ||
partition_router: | ||
type: SubstreamPartitionRouter | ||
parent_stream_configs: | ||
- stream: "#/definitions/deals_filters_stream" | ||
parent_key: "id" | ||
partition_field: "view_id" | ||
transformations: | ||
- type: RemoveFields | ||
field_pointers: | ||
- ["fc_widget_collaboration"] | ||
lost_deals_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "lost_deals" | ||
filter: "Lost Deals" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
requester: | ||
$ref: "#/definitions/requester" | ||
path: "deals/view/{{ stream_slice.view_id }}" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- deals | ||
partition_router: | ||
type: SubstreamPartitionRouter | ||
parent_stream_configs: | ||
- stream: "#/definitions/deals_filters_stream" | ||
parent_key: "id" | ||
partition_field: "view_id" | ||
transformations: | ||
- type: RemoveFields | ||
field_pointers: | ||
- ["fc_widget_collaboration"] | ||
open_tasks_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "open_tasks" | ||
path: "tasks" | ||
filter: "open" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- tasks | ||
completed_tasks_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "completed_tasks" | ||
path: "tasks" | ||
filter: "completed" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- tasks | ||
past_appointments_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "past_appointments" | ||
path: "appointments" | ||
filter: "past" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- appointments | ||
upcoming_appointments_stream: | ||
$ref: "#/definitions/base_stream" | ||
$parameters: | ||
name: "upcoming_appointments" | ||
path: "appointments" | ||
filter: "upcoming" | ||
retriever: | ||
$ref: "#/definitions/retriever" | ||
record_selector: | ||
type: RecordSelector | ||
extractor: | ||
field_path: | ||
- appointments | ||
|
||
streams: | ||
- "#/definitions/contacts_stream" | ||
- "#/definitions/accounts_stream" | ||
- "#/definitions/open_deals_stream" | ||
- "#/definitions/won_deals_stream" | ||
- "#/definitions/lost_deals_stream" | ||
- "#/definitions/open_tasks_stream" | ||
- "#/definitions/completed_tasks_stream" | ||
- "#/definitions/past_appointments_stream" | ||
- "#/definitions/upcoming_appointments_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
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
Oops, something went wrong.