Skip to content

Commit 0ee920e

Browse files
davydov-dalafanechereoctavia-squidington-iii
authored
Source Stripe: fix schema (#22312)
* #1141 source tiktok: chunk advertiser IDs * #1141 source tiktok: upd changelog * #1299 source stripe: fix Invoices schema * #1299 source stripe: upd changelog * #1299 source stripe: upd acceptance test config * source-stripe: no http url in openapi_spec.json * #1299 source stripe: fix SAT config * #1299 source stripe: add allowedHosts * auto-bump connector version --------- Co-authored-by: alafanechere <[email protected]> Co-authored-by: Augustin <[email protected]> Co-authored-by: Octavia Squidington III <[email protected]>
1 parent b03653a commit 0ee920e

File tree

10 files changed

+52
-24
lines changed

10 files changed

+52
-24
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,11 +1735,14 @@
17351735
- name: Stripe
17361736
sourceDefinitionId: e094cb9a-26de-4645-8761-65c0c425d1de
17371737
dockerRepository: airbyte/source-stripe
1738-
dockerImageTag: 1.0.1
1738+
dockerImageTag: 2.0.0
17391739
documentationUrl: https://docs.airbyte.com/integrations/sources/stripe
17401740
icon: stripe.svg
17411741
sourceType: api
17421742
releaseStage: generally_available
1743+
allowedHosts:
1744+
hosts:
1745+
- "api.stripe.com"
17431746
- name: SurveyCTO
17441747
sourceDefinitionId: dd4632f4-15e0-4649-9b71-41719fb1fdee
17451748
dockerRepository: airbyte/source-surveycto

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14446,7 +14446,7 @@
1444614446
supportsNormalization: false
1444714447
supportsDBT: false
1444814448
supported_destination_sync_modes: []
14449-
- dockerImage: "airbyte/source-stripe:1.0.1"
14449+
- dockerImage: "airbyte/source-stripe:2.0.0"
1445014450
spec:
1445114451
documentationUrl: "https://docs.airbyte.com/integrations/sources/stripe"
1445214452
connectionSpecification:

airbyte-integrations/connectors/source-stripe/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ COPY main.py ./
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=1.0.2
15+
LABEL io.airbyte.version=2.0.0
1616
LABEL io.airbyte.name=airbyte/source-stripe

airbyte-integrations/connectors/source-stripe/acceptance-test-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ tests:
1212
discovery:
1313
- config_path: "secrets/config.json"
1414
backward_compatibility_tests_config:
15-
disable_for_version: "0.1.37"
15+
disable_for_version: "1.0.2"
1616
- config_path: "secrets/connected_account_config.json"
1717
backward_compatibility_tests_config:
18-
disable_for_version: "0.1.37"
18+
disable_for_version: "1.0.2"
1919
basic_read:
2020
- config_path: "secrets/config.json"
2121
configured_catalog_path: "integration_tests/full_refresh_configured_catalog.json"

airbyte-integrations/connectors/source-stripe/source_stripe/availability_strategy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#
2+
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3+
#
4+
15
import logging
26
from typing import Optional, Tuple
37

airbyte-integrations/connectors/source-stripe/source_stripe/schemas/invoices.json

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,26 @@
6565
"paid": {
6666
"type": ["null", "boolean"]
6767
},
68-
"discount": {
69-
"type": ["null", "string"]
70-
},
7168
"discounts": {
7269
"type": ["null", "array"],
70+
"items": {
71+
"type": [
72+
"null",
73+
"string"
74+
]
75+
}
76+
},
77+
"discount": {
78+
"type": ["null", "object"],
7379
"properties": {
74-
"end": {
75-
"type": ["null", "integer"]
80+
"id": {
81+
"type": ["null", "string"]
82+
},
83+
"object": {
84+
"type": ["null", "string"]
85+
},
86+
"checkout_session": {
87+
"type": ["null", "string"]
7688
},
7789
"coupon": {
7890
"type": ["null", "object"],
@@ -96,9 +108,6 @@
96108
"duration_in_months": {
97109
"type": ["null", "integer"]
98110
},
99-
"percent_off_precise": {
100-
"type": ["null", "number"]
101-
},
102111
"max_redemptions": {
103112
"type": ["null", "integer"]
104113
},
@@ -131,11 +140,20 @@
131140
"customer": {
132141
"type": ["null", "string"]
133142
},
134-
"start": {
143+
"end": {
135144
"type": ["null", "integer"]
136145
},
137-
"object": {
138-
"type": ["null", "string"]
146+
"invoice": {
147+
"type": ["null", "integer"]
148+
},
149+
"invoice_item": {
150+
"type": ["null", "integer"]
151+
},
152+
"promotion_code": {
153+
"type": ["null", "integer"]
154+
},
155+
"start": {
156+
"type": ["null", "integer"]
139157
},
140158
"subscription": {
141159
"type": ["null", "string"]

airbyte-integrations/connectors/source-stripe/source_stripe/schemas/openapi_spec.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
"type": "string"
498498
},
499499
"timezone": {
500-
"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).",
500+
"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).",
501501
"maxLength": 5000,
502502
"nullable": true,
503503
"type": "string"
@@ -5948,7 +5948,7 @@
59485948
"type": "object"
59495949
},
59505950
"event": {
5951-
"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.",
5951+
"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.",
59525952
"properties": {
59535953
"account": {
59545954
"description": "The connected account that originated the event.",
@@ -6397,7 +6397,7 @@
63976397
"type": "string"
63986398
},
63996399
"timezone": {
6400-
"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`.",
6400+
"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`.",
64016401
"maxLength": 5000,
64026402
"type": "string"
64036403
}
@@ -19800,7 +19800,7 @@
1980019800
"x-expandableFields": []
1980119801
},
1980219802
"sku": {
19803-
"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).",
19803+
"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).",
1980419804
"properties": {
1980519805
"active": {
1980619806
"description": "Whether the SKU is available for purchase.",

airbyte-integrations/connectors/source-stripe/source_stripe/streams.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from airbyte_cdk.models import SyncMode
1313
from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy
1414
from airbyte_cdk.sources.streams.http import HttpStream
15-
1615
from source_stripe.availability_strategy import StripeSubStreamAvailabilityStrategy
1716

1817
STRIPE_ERROR_CODES: List = [

airbyte-integrations/connectors/source-stripe/unit_tests/test_availability_strategy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
#
2+
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3+
#
4+
15
import pendulum
26
from airbyte_cdk.sources.streams.http.availability_strategy import HttpAvailabilityStrategy
3-
47
from source_stripe.availability_strategy import StripeSubStreamAvailabilityStrategy
58
from source_stripe.streams import InvoiceLineItems, Invoices
69

docs/integrations/sources/stripe.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ The Stripe connector should not run into Stripe API limitations under normal usa
8282

8383
| Version | Date | Pull Request | Subject |
8484
|:--------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|
85-
| 1.0.2 | 2023-02-09 | [22659](https://github.com/airbytehq/airbyte/pull/22659) | Set `AvailabilityStrategy` for all streams |
86-
| 1.0.1 | 2023-01-27 | [22042](https://github.com/airbytehq/airbyte/pull/22042) | Set `AvailabilityStrategy` for streams explicitly to `None` |
85+
| 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 |
86+
| 1.0.2 | 2023-02-09 | [22659](https://github.com/airbytehq/airbyte/pull/22659) | Set `AvailabilityStrategy` for all streams |
87+
| 1.0.1 | 2023-01-27 | [22042](https://github.com/airbytehq/airbyte/pull/22042) | Set `AvailabilityStrategy` for streams explicitly to `None` |
8788
| 1.0.0 | 2023-01-25 | [21858](https://github.com/airbytehq/airbyte/pull/21858) | Update the `Subscriptions` and `Invoices` stream schemas |
8889
| 0.1.40 | 2022-10-20 | [18228](https://github.com/airbytehq/airbyte/pull/18228) | Update the `Payment Intents` stream schema |
8990
| 0.1.39 | 2022-09-28 | [17304](https://github.com/airbytehq/airbyte/pull/17304) | Migrate to per-stream states. |

0 commit comments

Comments
 (0)