From 7e2193ce3a6c68b7a1fd76c338e131a89641df5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Denquin?= Date: Wed, 27 Sep 2023 23:26:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Source=20Getlago=20-=20Support=20cu?= =?UTF-8?q?stom=20API=20URL=20(#30572)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sajarin --- .../connectors/source-getlago/Dockerfile | 2 +- .../connectors/source-getlago/README.md | 4 +- .../connectors/source-getlago/metadata.yaml | 4 +- .../source_getlago/manifest.yaml | 2 +- .../source_getlago/schemas/add_ons.json | 3 + .../schemas/billable_metrics.json | 15 ++ .../source_getlago/schemas/coupons.json | 24 +++ .../source_getlago/schemas/customers.json | 56 +++++- .../source_getlago/schemas/invoices.json | 168 ++++++++++++++++++ .../source_getlago/schemas/plans.json | 66 +++++++ .../source_getlago/schemas/subscriptions.json | 6 + .../source-getlago/source_getlago/spec.yaml | 7 +- docs/integrations/sources/getlago.md | 9 +- 13 files changed, 354 insertions(+), 12 deletions(-) diff --git a/airbyte-integrations/connectors/source-getlago/Dockerfile b/airbyte-integrations/connectors/source-getlago/Dockerfile index 8c1e400964bb..cf93a2a17967 100644 --- a/airbyte-integrations/connectors/source-getlago/Dockerfile +++ b/airbyte-integrations/connectors/source-getlago/Dockerfile @@ -34,5 +34,5 @@ COPY source_getlago ./source_getlago 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.version=0.2.0 LABEL io.airbyte.name=airbyte/source-getlago diff --git a/airbyte-integrations/connectors/source-getlago/README.md b/airbyte-integrations/connectors/source-getlago/README.md index fd1225f162b0..353b101b5ad5 100644 --- a/airbyte-integrations/connectors/source-getlago/README.md +++ b/airbyte-integrations/connectors/source-getlago/README.md @@ -1,6 +1,6 @@ -# Getlago Source +# Lago Source -This is the repository for the Getlago configuration based source connector. +This is the repository for the Lago configuration based source connector. For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/getlago). ## Local development diff --git a/airbyte-integrations/connectors/source-getlago/metadata.yaml b/airbyte-integrations/connectors/source-getlago/metadata.yaml index 539d110e928a..fff3ca41f956 100644 --- a/airbyte-integrations/connectors/source-getlago/metadata.yaml +++ b/airbyte-integrations/connectors/source-getlago/metadata.yaml @@ -2,12 +2,12 @@ data: connectorSubtype: api connectorType: source definitionId: e1a3866b-d3b2-43b6-b6d7-8c1ee4d7f53f - dockerImageTag: 0.1.0 + dockerImageTag: 0.2.0 dockerRepository: airbyte/source-getlago githubIssueLabel: source-getlago icon: getlago.svg license: MIT - name: GetLago + name: Lago registries: cloud: enabled: true diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/manifest.yaml b/airbyte-integrations/connectors/source-getlago/source_getlago/manifest.yaml index 13accde4d905..6be81f5a9d0d 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/manifest.yaml +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/manifest.yaml @@ -5,7 +5,7 @@ definitions: extractor: field_path: ["{{ parameters['name'] }}"] requester: - url_base: "https://api.getlago.com/api/v1" + url_base: "{{ config.get('api_url', 'https://api.getlago.com/api/v1') }}" http_method: "GET" authenticator: type: BearerAuthenticator diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/add_ons.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/add_ons.json index 81185dc445c6..d30f9e4230f0 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/add_ons.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/add_ons.json @@ -22,6 +22,9 @@ }, "amount_currency": { "type": ["null", "string"] + }, + "taxes": { + "type": ["array", "null"] } } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/billable_metrics.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/billable_metrics.json index 3c65d5b9f05a..131f426fb2a1 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/billable_metrics.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/billable_metrics.json @@ -25,6 +25,21 @@ }, "group": { "type": ["null", "object"] + }, + "active_subscriptions_count": { + "type": ["null", "integer"] + }, + "draft_invoices_count": { + "type": ["null", "integer"] + }, + "plans_count": { + "type": ["null", "integer"] + }, + "recurring": { + "type": ["null", "boolean"] + }, + "weighted_interval": { + "type": ["null", "integer"] } } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/coupons.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/coupons.json index 2fcae9c85b38..88b383b7e4de 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/coupons.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/coupons.json @@ -37,6 +37,30 @@ }, "expiration_date": { "type": ["null", "string"] + }, + "billable_metric_codes": { + "type": ["null", "array"] + }, + "description": { + "type": ["null", "string"] + }, + "expiration_at": { + "type": ["null", "string"] + }, + "limited_billable_metrics": { + "type": ["null", "boolean"] + }, + "limited_plans": { + "type": ["null", "boolean"] + }, + "plan_codes": { + "type": ["null", "array"] + }, + "reusable": { + "type": ["null", "boolean"] + }, + "terminated_at": { + "type": ["null", "string"] } } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/customers.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/customers.json index 415d75f01bdd..c5f6e04896dc 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/customers.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/customers.json @@ -56,8 +56,62 @@ "currency": { "type": ["null", "string"] }, + "applicable_timezone": { + "type": ["null", "string"] + }, "billing_configuration": { - "type": ["null", "object"] + "additionalProperties": true, + "properties": { + "document_locale": { + "type": ["null", "string"] + }, + "invoice_grace_period": { + "type": ["null", "integer"] + }, + "payment_provider": { + "type": ["null", "string"] + }, + "provider_customer_id": { + "type": ["null", "string"] + }, + "provider_payment_methods": { + "items": { + "type": ["null", "string"] + }, + "type": ["null", "array"] + }, + "vat_rate": { + "type": ["null", "integer"] + } + }, + "type": "object" + }, + "country": { + "type": ["null", "string"] + }, + "external_salesforce_id": { + "type": ["null", "integer"] + }, + "metadata": { + "type": ["null", "array"] + }, + "net_payment_term": { + "type": ["null", "integer"] + }, + "tax_identification_number": { + "type": ["null", "integer"] + }, + "taxes": { + "type": ["null", "array"] + }, + "timezone": { + "type": ["null", "string"] + }, + "updated_at": { + "type": ["null", "string"] + }, + "zipcode": { + "type": ["null", "string"] } } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/invoices.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/invoices.json index 198fb2b0d8a6..f6ff4679f49c 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/invoices.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/invoices.json @@ -40,6 +40,174 @@ }, "file_url": { "type": ["null", "string"] + }, + "applied_taxes": { + "type": ["null", "array"] + }, + "coupons_amount_cents": { + "type": ["null", "integer"] + }, + "credit_amount_cents": { + "type": ["null", "integer"] + }, + "credit_amount_currency": { + "type": ["null", "string"] + }, + "credit_notes_amount_cents": { + "type": ["null", "integer"] + }, + "currency": { + "type": ["null", "string"] + }, + "customer": { + "additionalProperties": true, + "properties": { + "address_line1": { + "type": ["null", "string"] + }, + "address_line2": { + "type": ["null", "string"] + }, + "applicable_timezone": { + "type": ["null", "string"] + }, + "billing_configuration": { + "additionalProperties": true, + "properties": { + "document_locale": { + "type": ["null", "string"] + }, + "invoice_grace_period": { + "type": ["null", "integer"] + }, + "payment_provider": { + "type": ["null", "string"] + }, + "provider_customer_id": { + "type": ["null", "integer"] + }, + "provider_payment_methods": { + "items": { + "type": ["null", "string"] + }, + "type": ["null", "array"] + }, + "vat_rate": { + "type": ["null", "integer"] + } + }, + "type": "object" + }, + "city": { + "type": ["null", "string"] + }, + "country": { + "type": ["null", "string"] + }, + "created_at": { + "type": ["null", "string"] + }, + "currency": { + "type": ["null", "string"] + }, + "email": { + "type": ["null", "string"] + }, + "external_id": { + "type": ["null", "string"] + }, + "external_salesforce_id": { + "type": ["null", "integer"] + }, + "lago_id": { + "type": ["null", "string"] + }, + "legal_name": { + "type": ["null", "string"] + }, + "legal_number": { + "type": ["null", "string"] + }, + "logo_url": { + "type": ["null", "string"] + }, + "metadata": { + "type": ["null", "array"] + }, + "name": { + "type": ["null", "string"] + }, + "net_payment_term": { + "type": ["null", "integer"] + }, + "phone": { + "type": ["null", "string"] + }, + "sequential_id": { + "type": ["null", "integer"] + }, + "slug": { + "type": ["null", "string"] + }, + "state": { + "type": ["null", "string"] + }, + "tax_identification_number": { + "type": ["null", "integer"] + }, + "timezone": { + "type": ["null", "string"] + }, + "updated_at": { + "type": ["null", "string"] + }, + "url": { + "type": "null" + }, + "zipcode": { + "type": ["null", "string"] + } + }, + "type": "object" + }, + "fees_amount_cents": { + "type": ["null", "integer"] + }, + "legacy": { + "type": ["null", "boolean"] + }, + "metadata": { + "type": ["null", "array"] + }, + "net_payment_term": { + "type": ["null", "integer"] + }, + "payment_due_date": { + "type": ["null", "string"] + }, + "payment_status": { + "type": ["null", "string"] + }, + "prepaid_credit_amount_cents": { + "type": ["null", "integer"] + }, + "sub_total_excluding_taxes_amount_cents": { + "type": ["null", "integer"] + }, + "sub_total_including_taxes_amount_cents": { + "type": ["null", "integer"] + }, + "sub_total_vat_excluded_amount_cents": { + "type": ["null", "integer"] + }, + "sub_total_vat_included_amount_cents": { + "type": ["null", "integer"] + }, + "taxes_amount_cents": { + "type": ["null", "integer"] + }, + "version_number": { + "type": ["null", "integer"] } } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/plans.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/plans.json index 57385fe75d95..8ed49e9ac38f 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/plans.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/plans.json @@ -35,7 +35,73 @@ "bill_charges_monthly": { "type": ["null", "boolean"] }, + "active_subscriptions_count": { + "type": ["null", "integer"] + }, "charges": { + "items": { + "additionalProperties": true, + "properties": { + "billable_metric_code": { + "type": ["null", "string"] + }, + "charge_model": { + "type": ["null", "string"] + }, + "created_at": { + "type": ["null", "string"] + }, + "group_properties": { + "type": ["null", "array"] + }, + "invoiceable": { + "type": ["null", "boolean"] + }, + "lago_billable_metric_id": { + "type": ["null", "string"] + }, + "lago_id": { + "type": ["null", "string"] + }, + "min_amount_cents": { + "type": ["null", "integer"] + }, + "pay_in_advance": { + "type": ["null", "boolean"] + }, + "properties": { + "additionalProperties": true, + "properties": { + "amount": { + "type": ["null", "string"] + } + }, + "type": ["null", "object"] + }, + "prorated": { + "type": ["null", "boolean"] + }, + "taxes": { + "type": ["null", "array"] + } + }, + "type": ["null", "object"] + }, + "type": ["null", "array"] + }, + "customers_count": { + "type": ["null", "integer"] + }, + "draft_invoices_count": { + "type": ["null", "integer"] + }, + "invoice_display_name": { + "type": ["null", "string"] + }, + "parent_id": { + "type": ["null", "integer"] + }, + "taxes": { "type": ["null", "array"] } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/subscriptions.json b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/subscriptions.json index 82c35e69bac7..a409c5489437 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/subscriptions.json +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/schemas/subscriptions.json @@ -49,6 +49,12 @@ }, "downgrade_plan_date": { "type": ["null", "string"] + }, + "ending_at": { + "type": ["null", "string"] + }, + "subscription_at": { + "type": ["null", "string"] } } } diff --git a/airbyte-integrations/connectors/source-getlago/source_getlago/spec.yaml b/airbyte-integrations/connectors/source-getlago/source_getlago/spec.yaml index 2f9d5311e536..04921b0ecbf2 100644 --- a/airbyte-integrations/connectors/source-getlago/source_getlago/spec.yaml +++ b/airbyte-integrations/connectors/source-getlago/source_getlago/spec.yaml @@ -1,12 +1,17 @@ documentationUrl: https://docs.airbyte.com/integrations/sources/getlago connectionSpecification: $schema: http://json-schema.org/draft-07/schema# - title: Getlago Spec + title: Lago Spec type: object required: - api_key additionalProperties: true properties: + api_url: + title: API Url + type: string + description: Your Lago API URL + default: https://api.getlago.com/api/v1 api_key: title: API Key type: string diff --git a/docs/integrations/sources/getlago.md b/docs/integrations/sources/getlago.md index 056ad3c566c8..17ec4d7260de 100644 --- a/docs/integrations/sources/getlago.md +++ b/docs/integrations/sources/getlago.md @@ -1,8 +1,8 @@ -# getLago API +# Lago API ## Sync overview -This source can sync data from the [getLago API](https://doc.getlago.com/docs/guide/intro/welcome). At present this connector only supports full refresh syncs meaning that each time you use the connector it will sync all available records from scratch. Please use cautiously if you expect your API to have a lot of records. +This source can sync data from the [Lago API](https://doc.getlago.com/docs/guide/intro/welcome). At present this connector only supports full refresh syncs meaning that each time you use the connector it will sync all available records from scratch. Please use cautiously if you expect your API to have a lot of records. ## This Source Supports the Following Streams @@ -25,11 +25,12 @@ This source can sync data from the [getLago API](https://doc.getlago.com/docs/gu ## Getting started ### Requirements - -* getLago API KEY +* Lago API URL +* Lago API KEY ## Changelog | Version | Date | Pull Request | Subject | | :------ | :--------- | :-------------------------------------------------------- | :----------------------------------------- | +| 0.2.0 | 2023-09-19 | [#30572](https://github.com/airbytehq/airbyte/pull/30572) | Source GetLago: Support API URL | | 0.1.0 | 2022-10-26 | [#18727](https://github.com/airbytehq/airbyte/pull/18727) | 🎉 New Source: getLago API [low-code CDK] | \ No newline at end of file