Skip to content

Commit

Permalink
✨Source Secoda: Make Connector Compatible with Builder (#38932)
Browse files Browse the repository at this point in the history
  • Loading branch information
btkcodedev committed Jun 12, 2024
1 parent b208247 commit a720944
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: da9fc6b9-8059-4be0-b204-f56e22e4d52d
dockerImageTag: 0.1.2
dockerImageTag: 0.1.3
dockerRepository: airbyte/source-secoda
githubIssueLabel: source-secoda
icon: secoda.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.1.2"
version = "0.1.3"
name = "source-secoda"
description = "Source implementation for Secoda."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,68 +1,279 @@
version: "0.29.0"
version: 0.79.1

type: DeclarativeSource

check:
type: CheckStream
stream_names:
- tables

definitions:
schema_loader:
type: JsonFileSchemaLoader
file_path: "./source_secoda/schemas/{{ parameters.name }}.json"
selector:
extractor:
field_path: ["results"]
requester:
url_base: "https://api.secoda.co"
http_method: "GET"
streams:
tables:
type: DeclarativeStream
name: tables
primary_key:
- id
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: /table/tables/
http_method: GET
error_handler:
type: CompositeErrorHandler
error_handlers:
- type: DefaultErrorHandler
response_filters:
- type: HttpResponseFilter
http_codes:
- 500
action: FAIL
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- results
paginator:
type: DefaultPaginator
page_token_option:
type: RequestPath
page_size_option:
type: RequestOption
inject_into: body_data
field_name: page_size
pagination_strategy:
type: CursorPagination
page_size: 1
cursor_value: "{{ response.links.next }}"
stop_condition: "{{ response.links.next is none}}"
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/tables"
terms:
type: DeclarativeStream
name: terms
primary_key:
- id
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: /dictionary/terms/
http_method: GET
error_handler:
type: CompositeErrorHandler
error_handlers:
- type: DefaultErrorHandler
response_filters:
- type: HttpResponseFilter
http_codes:
- 500
action: FAIL
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- results
paginator:
type: DefaultPaginator
page_token_option:
type: RequestPath
page_size_option:
type: RequestOption
inject_into: body_data
field_name: page_size
pagination_strategy:
type: CursorPagination
page_size: 1
cursor_value: "{{ response.links.next }}"
stop_condition: "{{ response.links.next is none}}"
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/terms"
collections:
type: DeclarativeStream
name: collections
primary_key:
- id
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/base_requester"
path: /collection/collections/
http_method: GET
error_handler:
type: CompositeErrorHandler
error_handlers:
- type: DefaultErrorHandler
response_filters:
- type: HttpResponseFilter
http_codes:
- 500
action: FAIL
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- results
paginator:
type: DefaultPaginator
page_token_option:
type: RequestPath
page_size_option:
type: RequestOption
inject_into: body_data
field_name: page_size
pagination_strategy:
type: CursorPagination
page_size: 1
cursor_value: "{{ response.links.next }}"
stop_condition: "{{ response.links.next is none}}"
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/schemas/collections"
base_requester:
type: HttpRequester
url_base: https://api.secoda.co
authenticator:
type: BearerAuthenticator
api_token: "{{ config['api_key'] }}"
error_handler:
response_filters:
- http_codes: [500]
action: FAIL
cursor_paginator:
type: DefaultPaginator
page_token_option:
type: RequestPath
page_size_option:
inject_into: body_data
field_name: "page_size"
pagination_strategy:
type: "CursorPagination"
cursor_value: "{{ response.links.next }}"
stop_condition: "{{ response.links.next is none}}"
page_size: 1
retriever:
record_selector:
$ref: "#/definitions/selector"
paginator:
$ref: "#/definitions/cursor_paginator"
requester:
$ref: "#/definitions/requester"
base_stream:
retriever:
$ref: "#/definitions/retriever"
tables_stream:
$ref: "#/definitions/base_stream"
$parameters:
name: "tables"
primary_key: "id"
path: "/table/tables/"
terms_stream:
$ref: "#/definitions/base_stream"
$parameters:
name: "terms"
primary_key: "id"
path: "/dictionary/terms/"
collections_stream:
$ref: "#/definitions/base_stream"
$parameters:
name: "collections"
primary_key: "id"
path: "/collection/collections/"

streams:
- "#/definitions/tables_stream"
- "#/definitions/terms_stream"
- "#/definitions/collections_stream"
- $ref: "#/definitions/streams/tables"
- $ref: "#/definitions/streams/terms"
- $ref: "#/definitions/streams/collections"

check:
stream_names:
- "tables"
spec:
type: Spec
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- api_key
properties:
api_key:
type: string
title: Api Key
airbyte_secret: true
description: >-
Your API Access Key. See <a
href="https://docs.secoda.co/secoda-api/authentication">here</a>. The
key is case sensitive.
order: 0
additionalProperties: true

metadata:
autoImportSchema:
tables: false
terms: false
collections: false

schemas:
tables:
type: object
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: true
properties:
type:
type: string
cluster:
type: string
columns:
type: array
created_at:
type: string
database:
type: string
description:
type:
- "null"
- string
entity_type:
type: string
id:
type: string
integration:
type: string
name:
type: string
owners:
type: array
parent_id:
type: string
pii:
type: boolean
pristine:
type: boolean
published:
type: boolean
schema:
type: string
tags:
type: array
updated_at:
type: string
verified:
type: boolean
terms:
type: object
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: true
properties:
collections:
type: array
created_at:
type: string
description:
type: string
entity_type:
type: string
id:
type: string
owners:
type: array
pristine:
type: boolean
published:
type: boolean
title:
type: string
updated_at:
type: string
viewers_delta:
type: object
collections:
type: object
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: true
properties:
archived:
type: boolean
created_at:
type: string
definition:
type: string
description:
type: string
entity_type:
type: string
id:
type: string
pii:
type: boolean
published:
type: boolean
title:
type: string
updated_at:
type: string
verified:
type: boolean
workspace_id:
type: string
Loading

0 comments on commit a720944

Please sign in to comment.