diff --git a/airbyte-integrations/connectors/source-captain-data/.dockerignore b/airbyte-integrations/connectors/source-captain-data/.dockerignore new file mode 100644 index 000000000000..f7cb8b7c520a --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/.dockerignore @@ -0,0 +1,6 @@ +* +!Dockerfile +!main.py +!source_captain_data +!setup.py +!secrets diff --git a/airbyte-integrations/connectors/source-captain-data/Dockerfile b/airbyte-integrations/connectors/source-captain-data/Dockerfile new file mode 100644 index 000000000000..3b3a4c8883ab --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/Dockerfile @@ -0,0 +1,38 @@ +FROM python:3.9.11-alpine3.15 as base + +# build and load all requirements +FROM base as builder +WORKDIR /airbyte/integration_code + +# upgrade pip to the latest version +RUN apk --no-cache upgrade \ + && pip install --upgrade pip \ + && apk --no-cache add tzdata build-base + + +COPY setup.py ./ +# install necessary packages to a temporary folder +RUN pip install --prefix=/install . + +# build a clean environment +FROM base +WORKDIR /airbyte/integration_code + +# copy all loaded and built libraries to a pure basic image +COPY --from=builder /install /usr/local +# add default timezone settings +COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime +RUN echo "Etc/UTC" > /etc/timezone + +# bash is installed for more convenient debugging. +RUN apk --no-cache add bash + +# copy payload code only +COPY main.py ./ +COPY source_captain_data ./source_captain_data + +ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" +ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] + +LABEL io.airbyte.version=0.1.0 +LABEL io.airbyte.name=airbyte/source-captain-data diff --git a/airbyte-integrations/connectors/source-captain-data/README.md b/airbyte-integrations/connectors/source-captain-data/README.md new file mode 100644 index 000000000000..0d93d706ca0c --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/README.md @@ -0,0 +1,82 @@ +# Captain Data Source + +This is the repository for the Captain Data configuration based source connector. +For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/captain-data). + +## Local development + +#### Building via Gradle +You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow. + +To build using Gradle, from the Airbyte repository root, run: +``` +./gradlew :airbyte-integrations:connectors:source-captain-data:build +``` + +#### Create credentials +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/captain-data) +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_captain_data/spec.yaml` file. +Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. +See `integration_tests/sample_config.json` for a sample config file. + +**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source captain-data test creds` +and place them into `secrets/config.json`. + +### Locally running the connector docker image + +#### Build +First, make sure you build the latest Docker image: +``` +docker build . -t airbyte/source-captain-data:dev +``` + +You can also build the connector image via Gradle: +``` +./gradlew :airbyte-integrations:connectors:source-captain-data:airbyteDocker +``` +When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in +the Dockerfile. + +#### Run +Then run any of the connector commands as follows: +``` +docker run --rm airbyte/source-captain-data:dev spec +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-captain-data:dev check --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-captain-data:dev discover --config /secrets/config.json +docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-captain-data:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json +``` +## Testing + +#### Acceptance Tests +Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information. +If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py. + +To run your integration tests with Docker, run: +``` +./acceptance-test-docker.sh +``` + +### Using gradle to run tests +All commands should be run from airbyte project root. +To run unit tests: +``` +./gradlew :airbyte-integrations:connectors:source-captain-data:unitTest +``` +To run acceptance and custom integration tests: +``` +./gradlew :airbyte-integrations:connectors:source-captain-data:integrationTest +``` + +## Dependency Management +All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development. +We split dependencies between two groups, dependencies that are: +* required for your connector to work need to go to `MAIN_REQUIREMENTS` list. +* required for the testing need to go to `TEST_REQUIREMENTS` list + +### Publishing a new version of the connector +You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? +1. Make sure your changes are passing unit and integration tests. +1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)). +1. Create a Pull Request. +1. Pat yourself on the back for being an awesome contributor. +1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master. diff --git a/airbyte-integrations/connectors/source-captain-data/__init__.py b/airbyte-integrations/connectors/source-captain-data/__init__.py new file mode 100644 index 000000000000..c941b3045795 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# diff --git a/airbyte-integrations/connectors/source-captain-data/acceptance-test-config.yml b/airbyte-integrations/connectors/source-captain-data/acceptance-test-config.yml new file mode 100644 index 000000000000..9f4ac3d46b6e --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/acceptance-test-config.yml @@ -0,0 +1,27 @@ +# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) +# for more information about how to configure these tests +connector_image: airbyte/source-captain-data:dev +acceptance_tests: + spec: + tests: + - spec_path: "source_captain_data/manifest.yaml" + connection: + tests: + - config_path: "secrets/config.json" + status: "succeed" + - config_path: "integration_tests/invalid_config.json" + status: "failed" + discovery: + tests: + - config_path: "secrets/config.json" + basic_read: + tests: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" + empty_streams: [] + incremental: + bypass_reason: "This connector does not implement incremental sync" + full_refresh: + tests: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-captain-data/acceptance-test-docker.sh b/airbyte-integrations/connectors/source-captain-data/acceptance-test-docker.sh new file mode 100755 index 000000000000..b6d65deeccb4 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/acceptance-test-docker.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +source "$(git rev-parse --show-toplevel)/airbyte-integrations/bases/connector-acceptance-test/acceptance-test-docker.sh" diff --git a/airbyte-integrations/connectors/source-captain-data/build.gradle b/airbyte-integrations/connectors/source-captain-data/build.gradle new file mode 100644 index 000000000000..d92bf8ed87a3 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/build.gradle @@ -0,0 +1,9 @@ +plugins { + id 'airbyte-python' + id 'airbyte-docker' + id 'airbyte-connector-acceptance-test' +} + +airbytePython { + moduleDirectory 'source_captain_data' +} diff --git a/airbyte-integrations/connectors/source-captain-data/icon.svg b/airbyte-integrations/connectors/source-captain-data/icon.svg new file mode 100644 index 000000000000..7a54fe2fc550 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/airbyte-integrations/connectors/source-captain-data/integration_tests/__init__.py b/airbyte-integrations/connectors/source-captain-data/integration_tests/__init__.py new file mode 100644 index 000000000000..c941b3045795 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/integration_tests/__init__.py @@ -0,0 +1,3 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# diff --git a/airbyte-integrations/connectors/source-captain-data/integration_tests/acceptance.py b/airbyte-integrations/connectors/source-captain-data/integration_tests/acceptance.py new file mode 100644 index 000000000000..82823254d266 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/integration_tests/acceptance.py @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + + +import pytest + +pytest_plugins = ("connector_acceptance_test.plugin",) + + +@pytest.fixture(scope="session", autouse=True) +def connector_setup(): + """This fixture is a placeholder for external resources that acceptance test might require.""" + yield diff --git a/airbyte-integrations/connectors/source-captain-data/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-captain-data/integration_tests/configured_catalog.json new file mode 100644 index 000000000000..351c84710677 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/integration_tests/configured_catalog.json @@ -0,0 +1,88 @@ +{ + "streams": [ + { + "cursor_field": null, + "destination_sync_mode": "append", + "primary_key": null, + "stream": { + "default_cursor_field": null, + "json_schema": {}, + "name": "workspace", + "namespace": null, + "source_defined_cursor": null, + "source_defined_primary_key": [ + [ + "name" + ] + ], + "supported_sync_modes": [ + "full_refresh" + ] + }, + "sync_mode": "full_refresh" + }, + { + "cursor_field": null, + "destination_sync_mode": "append", + "primary_key": null, + "stream": { + "default_cursor_field": null, + "json_schema": {}, + "name": "workflows", + "namespace": null, + "source_defined_cursor": null, + "source_defined_primary_key": [ + [ + "uid" + ] + ], + "supported_sync_modes": [ + "full_refresh" + ] + }, + "sync_mode": "full_refresh" + }, + { + "cursor_field": null, + "destination_sync_mode": "append", + "primary_key": null, + "stream": { + "default_cursor_field": null, + "json_schema": {}, + "name": "jobs", + "namespace": null, + "source_defined_cursor": null, + "source_defined_primary_key": [ + [ + "uid" + ] + ], + "supported_sync_modes": [ + "full_refresh" + ] + }, + "sync_mode": "full_refresh" + }, + { + "cursor_field": null, + "destination_sync_mode": "append", + "primary_key": null, + "stream": { + "default_cursor_field": null, + "json_schema": {}, + "name": "job_results", + "namespace": null, + "source_defined_cursor": null, + "source_defined_primary_key": [ + [ + "job_result_id" + ] + ], + "supported_sync_modes": [ + "full_refresh" + ] + }, + "sync_mode": "full_refresh" + } + ] +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-captain-data/integration_tests/invalid_config.json b/airbyte-integrations/connectors/source-captain-data/integration_tests/invalid_config.json new file mode 100644 index 000000000000..a8a304c99f51 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/integration_tests/invalid_config.json @@ -0,0 +1,4 @@ +{ + "api_key": "bad-api-key", + "project_uid": "bad-project-uid" +} diff --git a/airbyte-integrations/connectors/source-captain-data/integration_tests/sample_config.json b/airbyte-integrations/connectors/source-captain-data/integration_tests/sample_config.json new file mode 100644 index 000000000000..daca574b8635 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/integration_tests/sample_config.json @@ -0,0 +1,4 @@ +{ + "api_key": "api-key", + "project_uid": "project-uid" +} diff --git a/airbyte-integrations/connectors/source-captain-data/main.py b/airbyte-integrations/connectors/source-captain-data/main.py new file mode 100644 index 000000000000..765d967fad15 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/main.py @@ -0,0 +1,13 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + + +import sys + +from airbyte_cdk.entrypoint import launch +from source_captain_data import SourceCaptainData + +if __name__ == "__main__": + source = SourceCaptainData() + launch(source, sys.argv[1:]) diff --git a/airbyte-integrations/connectors/source-captain-data/metadata.yaml b/airbyte-integrations/connectors/source-captain-data/metadata.yaml new file mode 100644 index 000000000000..a1ee258a6ed4 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/metadata.yaml @@ -0,0 +1,21 @@ +data: + connectorSubtype: api + connectorType: source + definitionId: fa290790-1dca-43e7-8ced-6a40b2a66099 + dockerImageTag: 0.1.0 + dockerRepository: airbyte/source-captain-data + githubIssueLabel: source-captain-data + icon: captain-data.svg + license: MIT + name: Captain Data + registries: + cloud: + enabled: false + oss: + enabled: true + releaseStage: alpha + documentationUrl: https://docs.airbyte.com/integrations/sources/captain-data + tags: + - language:low-code + - language:python +metadataSpecVersion: "1.0" diff --git a/airbyte-integrations/connectors/source-captain-data/requirements.txt b/airbyte-integrations/connectors/source-captain-data/requirements.txt new file mode 100644 index 000000000000..cc57334ef619 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/requirements.txt @@ -0,0 +1,2 @@ +-e ../../bases/connector-acceptance-test +-e . diff --git a/airbyte-integrations/connectors/source-captain-data/setup.py b/airbyte-integrations/connectors/source-captain-data/setup.py new file mode 100644 index 000000000000..e74e6b5d45fc --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/setup.py @@ -0,0 +1,29 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + + +from setuptools import find_packages, setup + +MAIN_REQUIREMENTS = [ + "airbyte-cdk~=0.1", +] + +TEST_REQUIREMENTS = [ + "pytest~=6.2", + "pytest-mock~=3.6.1", + "connector-acceptance-test", +] + +setup( + name="source_captain_data", + description="Source implementation for Captain Data.", + author="Elliot Trabac", + author_email="elliot.trabac1@gmail.com", + packages=find_packages(), + install_requires=MAIN_REQUIREMENTS, + package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]}, + extras_require={ + "tests": TEST_REQUIREMENTS, + }, +) diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/__init__.py b/airbyte-integrations/connectors/source-captain-data/source_captain_data/__init__.py new file mode 100644 index 000000000000..bdb8c926c0a8 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/__init__.py @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + + +from .source import SourceCaptainData + +__all__ = ["SourceCaptainData"] diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/manifest.yaml b/airbyte-integrations/connectors/source-captain-data/source_captain_data/manifest.yaml new file mode 100644 index 000000000000..5cb698d2aa9f --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/manifest.yaml @@ -0,0 +1,170 @@ +version: "0.29.0" + +definitions: + selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: [] + requester: + type: HttpRequester + url_base: "https://api.captaindata.co/v3/" + http_method: "GET" + authenticator: + type: ApiKeyAuthenticator + header: "x-api-key" + api_token: "{{ config['api_key'] }}" + request_headers: + x-project-id: "{{ config['project_uid'] }}" + retriever: + type: SimpleRetriever + record_selector: + $ref: "#/definitions/selector" + paginator: + type: NoPagination + requester: + $ref: "#/definitions/requester" + + captain_data_paginator: + type: "DefaultPaginator" + pagination_strategy: + type: "CursorPagination" + cursor_value: "{{ response['paging']['next']}}" + stop_condition: "{{ response['paging']['have_next_page'] is false }}" + page_token_option: + type: "RequestPath" + + # Base stream + base_stream: + type: DeclarativeStream + retriever: + $ref: "#/definitions/retriever" + + # Streams + workspace_stream: + $ref: "#/definitions/base_stream" + $parameters: + name: "workspace" + primary_key: "name" + path: "/workspace" + transformations: + - type: AddFields + fields: + - path: ["project_uid"] + value: "{{ config['project_uid'] }}" + + workflows_stream: + $ref: "#/definitions/base_stream" + $parameters: + name: "workflows" + primary_key: "uid" + path: "/workflows" + + # Sliced streams + jobs_stream: + $ref: "#/definitions/base_stream" + $parameters: + name: "jobs" + primary_key: "uid" + path: "/workflows/{{ stream_slice.parent_id }}/jobs" + retriever: + requester: + $ref: "#/definitions/requester" + partition_router: + type: SubstreamPartitionRouter + parent_stream_configs: + - stream: "#/definitions/workflows_stream" + parent_key: "uid" + partition_field: "parent_id" + record_selector: + $ref: "#/definitions/selector" + + successful_jobs_stream: + $ref: "#/definitions/base_stream" + $parameters: + name: "jobs" + primary_key: "uid" + path: "/workflows/{{ stream_slice.parent_id }}/jobs" + retriever: + requester: + $ref: "#/definitions/requester" + partition_router: + type: SubstreamPartitionRouter + parent_stream_configs: + - stream: "#/definitions/workflows_stream" + parent_key: "uid" + partition_field: "parent_id" + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: [] + record_filter: + condition: "{{ record['total_row_count'] > 0 and record['status'] == 'finished' }}" + + job_results_stream: + $ref: "#/definitions/base_stream" + $parameters: + name: "job_results" + primary_key: "job_result_id" + path: "/jobs/{{ stream_slice.parent_id }}/results" + stream_cursor_field: "extracted_at" + retriever: + requester: + $ref: "#/definitions/requester" + paginator: + $ref: "#/definitions/captain_data_paginator" + partition_router: + type: SubstreamPartitionRouter + parent_stream_configs: + - stream: "#/definitions/successful_jobs_stream" + parent_key: "uid" + partition_field: "parent_id" + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: ["results"] + transformations: + - type: AddFields + fields: + - path: ["results"] + value: "{{ record }}" + - path: ["job_result_id"] + value: "{{ record|hash('md5') }}" + - path: ["job_uid"] + value: "{{ stream_slice.parent_id }}" + - path: ["extracted_at"] + value: "{{ now_utc() }}" + +streams: + - "#/definitions/workspace_stream" + - "#/definitions/workflows_stream" + - "#/definitions/jobs_stream" + - "#/definitions/job_results_stream" + +check: + type: CheckStream + stream_names: + - "workspace" + +spec: + type: Spec + documentationUrl: https://docs.airbyte.com/integrations/sources/captain-data + connection_specification: + title: Captain Data Spec + type: object + required: + - api_key + - project_uid + additionalProperties: true + properties: + api_key: + title: API Key + type: string + description: Your Captain Data project API key. + airbyte_secret: true + project_uid: + title: Project UID + type: string + description: Your Captain Data project uuid. diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/job_results.json b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/job_results.json new file mode 100644 index 000000000000..f487b33fbfdc --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/job_results.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "properties": { + "job_uid": { + "type": ["null", "string"] + }, + "job_result_id": { + "type": ["null", "string"] + }, + "results": { + "type": ["null", "object"] + }, + "extracted_at": { + "type": ["null", "string"], + "format": "datetime" + } + } +} diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/jobs.json b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/jobs.json new file mode 100644 index 000000000000..dd7cf2a8670c --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/jobs.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "properties": { + "accounts": { + "items": { + "type": ["null", "string"] + }, + "type": "array" + }, + "configuration": { + "type": ["null", "object"] + }, + "error_message": { + "type": ["null", "string"] + }, + "finish_time": { + "type": ["null", "string"] + }, + "main_job_uid": { + "type": ["null", "string"] + }, + "main_job_name": { + "type": ["null", "string"] + }, + "name": { + "type": ["null", "string"] + }, + "number_inputs": { + "type": ["null", "integer"] + }, + "row_count": { + "type": ["null", "integer"] + }, + "scheduled_time": { + "type": ["null", "string"] + }, + "start_time": { + "type": ["null", "string"] + }, + "status": { + "type": ["null", "string"] + }, + "step_uid": { + "type": ["null", "string"] + }, + "total_row_count": { + "type": ["null", "integer"] + }, + "uid": { + "type": ["null", "string"] + }, + "workflow_name": { + "type": ["null", "string"] + }, + "workflow_uid": { + "type": ["null", "string"] + } + } +} diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/workflows.json b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/workflows.json new file mode 100644 index 000000000000..4709a5f21f51 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/workflows.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "properties": { + "created_at": { + "type": ["null", "string"] + }, + "name": { + "type": ["null", "string"] + }, + "project_id": { + "type": ["null", "integer"] + }, + "steps": { + "items": { + "properties": { + "name": { + "type": ["null", "string"] + }, + "step_uid": { + "type": ["null", "string"] + }, + "uid": { + "type": ["null", "string"] + } + }, + "type": "object" + }, + "type": "array" + }, + "template_uid": { + "type": ["null", "string"] + }, + "uid": { + "type": ["null", "string"] + } + } +} diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/workspace.json b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/workspace.json new file mode 100644 index 000000000000..7644d353733f --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/schemas/workspace.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "properties": { + "project_uid": { + "type": ["null", "string"] + }, + "current_month_end": { + "type": ["null", "string"] + }, + "current_month_start": { + "type": ["null", "string"] + }, + "email": { + "type": ["null", "string"] + }, + "name": { + "type": ["null", "string"] + }, + "plan_name": { + "type": ["null", "string"] + }, + "tasks_left": { + "type": ["null", "integer"] + }, + "tasks_max": { + "type": ["null", "integer"] + }, + "tasks_used": { + "type": ["null", "integer"] + } + } +} diff --git a/airbyte-integrations/connectors/source-captain-data/source_captain_data/source.py b/airbyte-integrations/connectors/source-captain-data/source_captain_data/source.py new file mode 100644 index 000000000000..648e1fb181b8 --- /dev/null +++ b/airbyte-integrations/connectors/source-captain-data/source_captain_data/source.py @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + +from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource + +""" +This file provides the necessary constructs to interpret a provided declarative YAML configuration file into +source connector. + +WARNING: Do not modify this file. +""" + + +# Declarative Source +class SourceCaptainData(YamlDeclarativeSource): + def __init__(self): + super().__init__(**{"path_to_yaml": "manifest.yaml"}) diff --git a/docs/integrations/sources/captain-data.md b/docs/integrations/sources/captain-data.md new file mode 100644 index 000000000000..dc7fff642f97 --- /dev/null +++ b/docs/integrations/sources/captain-data.md @@ -0,0 +1,65 @@ +# Captain Data + +This page contains the setup guide and reference information for the [Captain Data](https://docs.captaindata.co/#intro) source connector. + +## Prerequisites + +Api key and project UID are mandate for this connector to work, It could be generated from the dashboard settings (ref - https://app.captaindata.co/settings). + +## Setup guide + +### Step 1: Set up Captain Data connection + +- Available params + - api_key: The api_key + - project_uid: The project UID + +## Step 2: Set up the Captain Data connector in Airbyte + +### For Airbyte Cloud: + +1. [Log into your Airbyte Cloud](https://cloud.airbyte.io/workspaces) account. +2. In the left navigation bar, click **Sources**. In the top-right corner, click **+new source**. +3. On the Set up the source page, enter the name for the Captain Data connector and select **Captain Data** from the Source type dropdown. +4. Enter your `api_key` and `project_uid`. +5. Click **Set up source**. + +### For Airbyte OSS: + +1. Navigate to the Airbyte Open Source dashboard. +2. Set the name for your source. +3. Enter your `api_key` and `project_uid`. +4. Click **Set up source**. + +## Supported sync modes + +The Captain Data source connector supports the following [sync modes](https://docs.airbyte.com/cloud/core-concepts#connection-sync-modes): + +| Feature | Supported? | +| :---------------------------- | :--------- | +| Full Refresh Sync | Yes | +| Incremental Sync | No | +| Replicate Incremental Deletes | No | +| SSL connection | Yes | +| Namespaces | No | + +## Supported Streams + +- workspace +- workflows +- jobs +- job_results + +## API method example + +GET https://api.captaindata.co/v3/ + +## Performance considerations + +Captain Data [API reference](https://docs.captaindata.co/#intro) has v3 at present. The connector as default uses v3. + +## Changelog + +| Version | Date | Pull Request | Subject | +| :------ | :--------- | :------------------------------------------------------ | :------------- | +| 0.1.0 | 2023-04-15 | [Init](https://github.com/airbytehq/airbyte/pull/25230) | Initial commit |