forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
583 additions
and
0 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
7 changes: 7 additions & 0 deletions
7
...ain/resources/config/STANDARD_SOURCE_DEFINITION/ed799e2b-2158-4c66-8da4-b40fe63bc72a.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,7 @@ | ||
{ | ||
"sourceDefinitionId": "ed799e2b-2158-4c66-8da4-b40fe63bc72a", | ||
"name": "Plaid", | ||
"dockerRepository": "airbyte/source-plaid", | ||
"dockerImageTag": "0.1.0", | ||
"documentationUrl": "https://hub.docker.com/r/airbyte/source-plaid" | ||
} |
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,8 @@ | ||
* | ||
!Dockerfile | ||
!Dockerfile.test | ||
!package.json | ||
!spec.json | ||
!source.js | ||
!secrets | ||
!fullrefresh_configured_catalog.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 @@ | ||
node_modules |
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,4 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true | ||
} |
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,15 @@ | ||
# node 14 | ||
FROM node:alpine3.12 | ||
|
||
WORKDIR /airbyte/integration_code | ||
# Copy source files | ||
COPY package.json . | ||
COPY source.js . | ||
COPY spec.json . | ||
# Install any needed dependencies | ||
RUN npm install | ||
|
||
ENTRYPOINT ["node", "/airbyte/integration_code/source.js"] | ||
|
||
LABEL io.airbyte.version=0.1.0 | ||
LABEL io.airbyte.name=airbyte/source-plaid |
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,75 @@ | ||
# Plaid Source | ||
|
||
This is the repository for the JavaScript Template source connector, written in JavaScript. | ||
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/javascript-template). | ||
|
||
## Local development | ||
|
||
### Prerequisites | ||
|
||
**To iterate on this connector, make sure to complete this prerequisites section.** | ||
|
||
#### Build & Activate Virtual Environment | ||
|
||
First, build the module by running the following from the `airbyte` project root directory: | ||
|
||
``` | ||
./gradlew :airbyte-integrations:connectors:source-plaid:build | ||
``` | ||
|
||
This will generate a virtualenv for this module in `source-plaid/.venv`. Make sure this venv is active in your | ||
development environment of choice. To activate the venv from the terminal, run: | ||
|
||
``` | ||
cd airbyte-integrations/connectors/source-plaid # cd into the connector directory | ||
source .venv/bin/activate | ||
``` | ||
|
||
If you are in an IDE, follow your IDE's instructions to activate the virtualenv. | ||
|
||
#### Create credentials | ||
|
||
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/javascript-template) | ||
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_javascript_template/spec.json` file. | ||
See `sample_files/sample_config.json` for a sample config file. | ||
|
||
**If you are an Airbyte core member**, copy the credentials in RPass under the secret name `source-plaid-integration-test-config` | ||
and place them into `secrets/config.json`. | ||
|
||
### Locally running the connector | ||
|
||
``` | ||
npm install | ||
node source.js spec | ||
node source.js check --config secrets/config.json | ||
node source.js discover --config secrets/config.json | ||
node source.js read --config secrets/config.json --catalog sample_files/configured_catalog.json | ||
``` | ||
|
||
### Unit Tests (wip) | ||
|
||
To run unit tests locally, from the connector directory run: | ||
|
||
``` | ||
npm test | ||
``` | ||
|
||
### Locally running the connector docker image | ||
|
||
``` | ||
# in airbyte root directory | ||
./gradlew :airbyte-integrations:connectors:source-plaid:airbyteDocker | ||
docker run --rm airbyte/source-plaid:dev spec | ||
docker run --rm -v $(pwd)/airbyte-integrations/connectors/source-plaid/secrets:/secrets airbyte/source-plaid:dev check --config /secrets/config.json | ||
docker run --rm -v $(pwd)/airbyte-integrations/connectors/source-plaid/secrets:/secrets airbyte/source-plaid:dev discover --config /secrets/config.json | ||
docker run --rm -v $(pwd)/airbyte-integrations/connectors/source-plaid/secrets:/secrets -v $(pwd)/airbyte-integrations/connectors/source-plaid/sample_files:/sample_files airbyte/source-plaid:dev read --config /secrets/config.json --catalog /sample_files/fullrefresh_configured_catalog.json | ||
``` | ||
|
||
### Integration Tests | ||
|
||
1. From the airbyte project root, run `./gradlew :airbyte-integrations:connectors:source-plaid:integrationTest` to run the standard integration test suite. | ||
1. To run additional integration tests, place your integration tests in a new directory `integration_tests` and run them with `node test (wip)`. | ||
|
||
## Dependency Management | ||
|
||
All of your dependencies should go in `package.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,42 @@ | ||
plugins { | ||
id 'airbyte-docker' | ||
id 'airbyte-standard-source-test-file' | ||
id 'base' // ? | ||
id 'com.github.node-gradle.node' version '2.2.4' | ||
} | ||
|
||
node { | ||
download = true | ||
version = "14.11.0" | ||
} | ||
|
||
npm_run_build { | ||
inputs.files fileTree('public') | ||
inputs.files fileTree('src') | ||
inputs.file 'package.json' | ||
inputs.file 'package-lock.json' | ||
|
||
outputs.dir project.buildDir | ||
} | ||
assemble.dependsOn npm_run_build | ||
|
||
//task test(type: NpmTask) { | ||
// dependsOn assemble | ||
// | ||
// args = ['run', 'test', '--', '--watchAll=false'] | ||
// inputs.files fileTree('src') | ||
// inputs.file 'package.json' | ||
// inputs.file 'package-lock.json' | ||
//} | ||
|
||
airbyteStandardSourceTestFile { | ||
// All these input paths must live inside this connector's directory (or subdirectories) | ||
configPath = "secrets/config.json" | ||
configuredCatalogPath = "sample_files/fullrefresh_configured_catalog.json" | ||
specPath = "spec.json" | ||
} | ||
|
||
dependencies { | ||
implementation files(project(':airbyte-integrations:bases:base-standard-source-test-file').airbyteDocker.outputs) | ||
implementation files(project(':airbyte-integrations:bases:base').airbyteDocker.outputs) | ||
} |
31 changes: 31 additions & 0 deletions
31
airbyte-integrations/connectors/source-plaid/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,16 @@ | ||
{ | ||
"name": "source-plaid", | ||
"version": "1.0.0", | ||
"description": "Airbyte Plaid Source.", | ||
"main": "source.js", | ||
"scripts": { | ||
"build": "" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"argparse": "^2.0.1", | ||
"axios": "^0.21.1", | ||
"date-fns": "^2.16.1" | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...yte-integrations/connectors/source-plaid/sample_files/fullrefresh_configured_catalog.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,33 @@ | ||
{ | ||
"streams": [ | ||
{ | ||
"stream": { | ||
"name": "balances", | ||
"supported_sync_modes": ["full_refresh"], | ||
"json_schema": { | ||
"properties": { | ||
"account_id": { | ||
"type": "string" | ||
}, | ||
"available": { | ||
"type": "number" | ||
}, | ||
"current": { | ||
"type": "number" | ||
}, | ||
"iso_currency_code": { | ||
"type": "string" | ||
}, | ||
"limit": { | ||
"type": "number" | ||
}, | ||
"unofficial_currency_code": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"sync_mode": "full_refresh" | ||
} | ||
] | ||
} |
Oops, something went wrong.