diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 7709769c0f49..e55f46c207ab 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -1735,11 +1735,14 @@ - name: Stripe sourceDefinitionId: e094cb9a-26de-4645-8761-65c0c425d1de dockerRepository: airbyte/source-stripe - dockerImageTag: 1.0.1 + dockerImageTag: 2.0.0 documentationUrl: https://docs.airbyte.com/integrations/sources/stripe icon: stripe.svg sourceType: api releaseStage: generally_available + allowedHosts: + hosts: + - "api.stripe.com" - name: SurveyCTO sourceDefinitionId: dd4632f4-15e0-4649-9b71-41719fb1fdee dockerRepository: airbyte/source-surveycto diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 07c46b2a7f61..13899009b759 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -14446,7 +14446,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-stripe:1.0.1" +- dockerImage: "airbyte/source-stripe:2.0.0" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/stripe" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-stripe/Dockerfile b/airbyte-integrations/connectors/source-stripe/Dockerfile index 0d787f67a144..e4b3a2514411 100644 --- a/airbyte-integrations/connectors/source-stripe/Dockerfile +++ b/airbyte-integrations/connectors/source-stripe/Dockerfile @@ -12,5 +12,5 @@ COPY main.py ./ ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=1.0.2 +LABEL io.airbyte.version=2.0.0 LABEL io.airbyte.name=airbyte/source-stripe diff --git a/airbyte-integrations/connectors/source-stripe/acceptance-test-config.yml b/airbyte-integrations/connectors/source-stripe/acceptance-test-config.yml index bab87b176a4d..d7c8a6b4fde5 100644 --- a/airbyte-integrations/connectors/source-stripe/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-stripe/acceptance-test-config.yml @@ -12,10 +12,10 @@ tests: discovery: - config_path: "secrets/config.json" backward_compatibility_tests_config: - disable_for_version: "0.1.37" + disable_for_version: "1.0.2" - config_path: "secrets/connected_account_config.json" backward_compatibility_tests_config: - disable_for_version: "0.1.37" + disable_for_version: "1.0.2" basic_read: - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/full_refresh_configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/availability_strategy.py b/airbyte-integrations/connectors/source-stripe/source_stripe/availability_strategy.py index 37734f1cf0be..41189ed0952c 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/availability_strategy.py +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/availability_strategy.py @@ -1,3 +1,7 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + import logging from typing import Optional, Tuple diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/invoices.json b/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/invoices.json index 3024b188a914..0bf4553a7841 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/invoices.json +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/invoices.json @@ -65,14 +65,26 @@ "paid": { "type": ["null", "boolean"] }, - "discount": { - "type": ["null", "string"] - }, "discounts": { "type": ["null", "array"], + "items": { + "type": [ + "null", + "string" + ] + } + }, + "discount": { + "type": ["null", "object"], "properties": { - "end": { - "type": ["null", "integer"] + "id": { + "type": ["null", "string"] + }, + "object": { + "type": ["null", "string"] + }, + "checkout_session": { + "type": ["null", "string"] }, "coupon": { "type": ["null", "object"], @@ -96,9 +108,6 @@ "duration_in_months": { "type": ["null", "integer"] }, - "percent_off_precise": { - "type": ["null", "number"] - }, "max_redemptions": { "type": ["null", "integer"] }, @@ -131,11 +140,20 @@ "customer": { "type": ["null", "string"] }, - "start": { + "end": { "type": ["null", "integer"] }, - "object": { - "type": ["null", "string"] + "invoice": { + "type": ["null", "integer"] + }, + "invoice_item": { + "type": ["null", "integer"] + }, + "promotion_code": { + "type": ["null", "integer"] + }, + "start": { + "type": ["null", "integer"] }, "subscription": { "type": ["null", "string"] diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/openapi_spec.json b/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/openapi_spec.json index 4a8d59a2ff67..b8e90f1cf347 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/openapi_spec.json +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/schemas/openapi_spec.json @@ -497,7 +497,7 @@ "type": "string" }, "timezone": { - "description": "The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones).", + "description": "The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](https://www.iana.org/time-zones).", "maxLength": 5000, "nullable": true, "type": "string" @@ -5948,7 +5948,7 @@ "type": "object" }, "event": { - "description": "Events are our way of letting you know when something interesting happens in\nyour account. When an interesting event occurs, we create a new `Event`\nobject. For example, when a charge succeeds, we create a `charge.succeeded`\nevent; and when an invoice payment attempt fails, we create an\n`invoice.payment_failed` event. Note that many API requests may cause multiple\nevents to be created. For example, if you create a new subscription for a\ncustomer, you will receive both a `customer.subscription.created` event and a\n`charge.succeeded` event.\n\nEvents occur when the state of another API resource changes. The state of that\nresource at the time of the change is embedded in the event's data field. For\nexample, a `charge.succeeded` event will contain a charge, and an\n`invoice.payment_failed` event will contain an invoice.\n\nAs with other API resources, you can use endpoints to retrieve an\n[individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events)\nfrom the API. We also have a separate\n[webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the\n`Event` objects directly to an endpoint on your server. Webhooks are managed\nin your\n[account settings](https://dashboard.stripe.com/account/webhooks),\nand our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up.\n\nWhen using [Connect](https://stripe.com/docs/connect), you can also receive notifications of\nevents that occur in connected accounts. For these events, there will be an\nadditional `account` attribute in the received `Event` object.\n\n**NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is\nguaranteed only for 30 days.", + "description": "Events are our way of letting you know when something interesting happens in\nyour account. When an interesting event occurs, we create a new `Event`\nobject. For example, when a charge succeeds, we create a `charge.succeeded`\nevent; and when an invoice payment attempt fails, we create an\n`invoice.payment_failed` event. Note that many API requests may cause multiple\nevents to be created. For example, if you create a new subscription for a\ncustomer, you will receive both a `customer.subscription.created` event and a\n`charge.succeeded` event.\n\nEvents occur when the state of another API resource changes. The state of that\nresource at the time of the change is embedded in the event's data field. For\nexample, a `charge.succeeded` event will contain a charge, and an\n`invoice.payment_failed` event will contain an invoice.\n\nAs with other API resources, you can use endpoints to retrieve an\n[individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events)\nfrom the API. We also have a separate\n[webhooks](https://en.wikipedia.org/wiki/Webhook) system for sending the\n`Event` objects directly to an endpoint on your server. Webhooks are managed\nin your\n[account settings](https://dashboard.stripe.com/account/webhooks),\nand our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up.\n\nWhen using [Connect](https://stripe.com/docs/connect), you can also receive notifications of\nevents that occur in connected accounts. For these events, there will be an\nadditional `account` attribute in the received `Event` object.\n\n**NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is\nguaranteed only for 30 days.", "properties": { "account": { "description": "The connected account that originated the event.", @@ -6397,7 +6397,7 @@ "type": "string" }, "timezone": { - "description": "Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`.", + "description": "Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](https://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`.", "maxLength": 5000, "type": "string" } @@ -19800,7 +19800,7 @@ "x-expandableFields": [] }, "sku": { - "description": "Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit).\nSKUs describe specific product variations, taking into account any combination of: attributes,\ncurrency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents\nthe `size: large`, `color: red` version of that shirt.\n\nCan also be used to manage inventory.\n\nRelated guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders).", + "description": "Stores representations of [stock keeping units](https://en.wikipedia.org/wiki/Stock_keeping_unit).\nSKUs describe specific product variations, taking into account any combination of: attributes,\ncurrency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents\nthe `size: large`, `color: red` version of that shirt.\n\nCan also be used to manage inventory.\n\nRelated guide: [Tax, Shipping, and Inventory](https://stripe.com/docs/orders).", "properties": { "active": { "description": "Whether the SKU is available for purchase.", diff --git a/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py b/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py index 044a8b69f8b5..0a66c2c2f8a1 100644 --- a/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py +++ b/airbyte-integrations/connectors/source-stripe/source_stripe/streams.py @@ -12,7 +12,6 @@ from airbyte_cdk.models import SyncMode from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy from airbyte_cdk.sources.streams.http import HttpStream - from source_stripe.availability_strategy import StripeSubStreamAvailabilityStrategy STRIPE_ERROR_CODES: List = [ diff --git a/airbyte-integrations/connectors/source-stripe/unit_tests/test_availability_strategy.py b/airbyte-integrations/connectors/source-stripe/unit_tests/test_availability_strategy.py index aaa83c1810e9..76b6d68c556d 100644 --- a/airbyte-integrations/connectors/source-stripe/unit_tests/test_availability_strategy.py +++ b/airbyte-integrations/connectors/source-stripe/unit_tests/test_availability_strategy.py @@ -1,6 +1,9 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + import pendulum from airbyte_cdk.sources.streams.http.availability_strategy import HttpAvailabilityStrategy - from source_stripe.availability_strategy import StripeSubStreamAvailabilityStrategy from source_stripe.streams import InvoiceLineItems, Invoices diff --git a/docs/integrations/sources/stripe.md b/docs/integrations/sources/stripe.md index d4f45b6c5161..6e2b28cf6ace 100644 --- a/docs/integrations/sources/stripe.md +++ b/docs/integrations/sources/stripe.md @@ -82,8 +82,9 @@ The Stripe connector should not run into Stripe API limitations under normal usa | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------| -| 1.0.2 | 2023-02-09 | [22659](https://github.com/airbytehq/airbyte/pull/22659) | Set `AvailabilityStrategy` for all streams | -| 1.0.1 | 2023-01-27 | [22042](https://github.com/airbytehq/airbyte/pull/22042) | Set `AvailabilityStrategy` for streams explicitly to `None` | +| 2.0.0 | 2023-02-14 | [22312](https://github.com/airbytehq/airbyte/pull/22312) | Another fix of `Invoices` stream schema + Remove http urls from openapi_spec.json | +| 1.0.2 | 2023-02-09 | [22659](https://github.com/airbytehq/airbyte/pull/22659) | Set `AvailabilityStrategy` for all streams | +| 1.0.1 | 2023-01-27 | [22042](https://github.com/airbytehq/airbyte/pull/22042) | Set `AvailabilityStrategy` for streams explicitly to `None` | | 1.0.0 | 2023-01-25 | [21858](https://github.com/airbytehq/airbyte/pull/21858) | Update the `Subscriptions` and `Invoices` stream schemas | | 0.1.40 | 2022-10-20 | [18228](https://github.com/airbytehq/airbyte/pull/18228) | Update the `Payment Intents` stream schema | | 0.1.39 | 2022-09-28 | [17304](https://github.com/airbytehq/airbyte/pull/17304) | Migrate to per-stream states. |