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 03e4e49ccae5..b51cc6169e9f 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -120,7 +120,7 @@ - name: Cart.com sourceDefinitionId: bb1a6d31-6879-4819-a2bd-3eed299ea8e2 dockerRepository: airbyte/source-cart - dockerImageTag: 0.1.5 + dockerImageTag: 0.1.6 documentationUrl: https://docs.airbyte.io/integrations/sources/cart icon: cart.svg sourceType: api 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 7b9f9aa4a2c8..ad4cf2581dca 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -1036,7 +1036,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-cart:0.1.5" +- dockerImage: "airbyte/source-cart:0.1.6" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/cart" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-cart/Dockerfile b/airbyte-integrations/connectors/source-cart/Dockerfile index c49305c8cad9..185a26f8b2f8 100644 --- a/airbyte-integrations/connectors/source-cart/Dockerfile +++ b/airbyte-integrations/connectors/source-cart/Dockerfile @@ -21,5 +21,5 @@ COPY source_cart ./source_cart ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.5 +LABEL io.airbyte.version=0.1.6 LABEL io.airbyte.name=airbyte/source-cart diff --git a/airbyte-integrations/connectors/source-cart/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-cart/integration_tests/abnormal_state.json index f6b575666d9d..b2ac1dfbda27 100644 --- a/airbyte-integrations/connectors/source-cart/integration_tests/abnormal_state.json +++ b/airbyte-integrations/connectors/source-cart/integration_tests/abnormal_state.json @@ -4,5 +4,6 @@ "order_payments": { "updated_at": "2051-07-01T08:59:28.457-05:00" }, "order_items": { "updated_at": "2051-07-01T08:59:28.457-05:00" }, "products": { "updated_at": "2051-07-01T08:59:28.457-05:00" }, - "addresses": { "updated_at": "2051-07-01T08:59:28.457-05:00" } + "addresses": { "updated_at": "2051-07-01T08:59:28.457-05:00" }, + "order_statuses": { "updated_at": "2051-07-01T08:59:28.457-05:00" } } diff --git a/airbyte-integrations/connectors/source-cart/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-cart/integration_tests/configured_catalog.json index aa213fa76677..df0da2333993 100644 --- a/airbyte-integrations/connectors/source-cart/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-cart/integration_tests/configured_catalog.json @@ -60,6 +60,18 @@ "cursor_field": ["updated_at"], "destination_sync_mode": "append" }, + { + "stream": { + "name": "order_statuses", + "json_schema": {}, + "supported_sync_modes": ["full_refresh", "incremental"], + "source_defined_cursor": true, + "default_cursor_field": ["updated_at"] + }, + "sync_mode": "incremental", + "cursor_field": ["updated_at"], + "destination_sync_mode": "append" + }, { "stream": { "name": "products", diff --git a/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_payments.json b/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_payments.json index 82643c21cc02..f4dee9743008 100644 --- a/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_payments.json +++ b/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_payments.json @@ -20,10 +20,10 @@ "type": ["string", "null"] }, "is_approved": { - "type": "boolean" + "type": ["boolean", "null"] }, "is_declined": { - "type": "boolean" + "type": ["boolean", "null"] }, "card_type": { "type": ["string", "null"] @@ -65,16 +65,16 @@ "type": ["string", "null"] }, "updated_at": { - "type": "string" + "type": ["string", "null"] }, "created_at": { - "type": "string" + "type": ["string", "null"] }, "gift_certificate_id": { "type": ["integer", "null"] }, "is_captured": { - "type": "boolean" + "type": ["boolean", "null"] }, "transaction_id": { "type": ["string", "null"] @@ -83,7 +83,7 @@ "type": ["string", "null"] }, "is_void": { - "type": "boolean" + "type": ["boolean", "null"] }, "gateway_response_code": { "type": ["string", "null"] @@ -92,7 +92,7 @@ "type": ["string", "null"] }, "sent_to_spark_pay": { - "type": "boolean" + "type": ["boolean", "null"] }, "token": { "type": ["string", "null"] diff --git a/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_statuses.json b/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_statuses.json new file mode 100644 index 000000000000..eb7182c2f368 --- /dev/null +++ b/airbyte-integrations/connectors/source-cart/source_cart/schemas/order_statuses.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "id": { "type": "integer" }, + "name": { "type": ["null", "string"] }, + "is_open": { "type": ["null", "boolean"] }, + "is_declined": { "type": ["null", "boolean"] }, + "is_cancelled": { "type": ["null", "boolean"] }, + "is_shipped": { "type": ["null", "boolean"] }, + "color": { "type": ["null", "string"] }, + "email_template_id": { "type": ["null", "integer"] }, + "updated_at": { "type": ["null", "string"] }, + "created_at": { "type": ["null", "string"] }, + "is_fully_refunded": { "type": ["null", "boolean"] }, + "is_partially_refunded": { "type": ["null", "boolean"] }, + "is_quote_status": { "type": ["null", "boolean"] } + } +} diff --git a/airbyte-integrations/connectors/source-cart/source_cart/schemas/orders.json b/airbyte-integrations/connectors/source-cart/source_cart/schemas/orders.json index 8952e1177298..e5e7091efda4 100644 --- a/airbyte-integrations/connectors/source-cart/source_cart/schemas/orders.json +++ b/airbyte-integrations/connectors/source-cart/source_cart/schemas/orders.json @@ -68,7 +68,7 @@ "type": ["string", "null"] }, "is_ppc": { - "type": "boolean" + "type": ["boolean", "null"] }, "ppc_keyword": { "type": ["string", "null"] @@ -86,7 +86,7 @@ "type": ["number", "null"] }, "is_payment_order_only": { - "type": "boolean" + "type": ["boolean", "null"] }, "selected_shipping_provider_service": { "type": ["string", "null"] @@ -98,13 +98,13 @@ "type": ["integer", "null"] }, "updated_at": { - "type": "string" + "type": ["string", "null"] }, "created_at": { - "type": "string" + "type": ["string", "null"] }, "is_gift": { - "type": "boolean" + "type": ["boolean", "null"] }, "gift_message": { "type": ["string", "null"] @@ -143,7 +143,7 @@ "type": ["string", "null"] }, "expires": { - "type": "boolean" + "type": ["boolean", "null"] }, "from_quote_id": { "type": ["integer", "null"] @@ -152,7 +152,7 @@ "type": ["string", "null"] }, "reward_points_credited": { - "type": "boolean" + "type": ["boolean", "null"] }, "channel": { "type": ["string", "null"] @@ -167,7 +167,7 @@ "type": ["number", "null"] }, "manufacturer_invoice_paid": { - "type": "boolean" + "type": ["boolean", "null"] }, "entered_by": { "type": ["string", "null"] diff --git a/airbyte-integrations/connectors/source-cart/source_cart/source.py b/airbyte-integrations/connectors/source-cart/source_cart/source.py index 5d073b8ac990..8938b43e19b7 100644 --- a/airbyte-integrations/connectors/source-cart/source_cart/source.py +++ b/airbyte-integrations/connectors/source-cart/source_cart/source.py @@ -14,7 +14,7 @@ from airbyte_cdk.sources.streams.http.auth import HttpAuthenticator from pendulum.parsing.exceptions import ParserError -from .streams import Addresses, CustomersCart, OrderItems, OrderPayments, Orders, Products +from .streams import Addresses, CustomersCart, OrderItems, OrderPayments, Orders, OrderStatuses, Products class CustomHeaderAuthenticator(HttpAuthenticator): @@ -74,4 +74,12 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: "store_name": config["store_name"], "end_date": config.get("end_date"), } - return [CustomersCart(**args), Orders(**args), OrderPayments(**args), OrderItems(**args), Products(**args), Addresses(**args)] + return [ + CustomersCart(**args), + Orders(**args), + OrderPayments(**args), + OrderStatuses(**args), + OrderItems(**args), + Products(**args), + Addresses(**args), + ] diff --git a/airbyte-integrations/connectors/source-cart/source_cart/streams.py b/airbyte-integrations/connectors/source-cart/source_cart/streams.py index 5b7f06c36623..2a3556854ad1 100644 --- a/airbyte-integrations/connectors/source-cart/source_cart/streams.py +++ b/airbyte-integrations/connectors/source-cart/source_cart/streams.py @@ -61,7 +61,7 @@ def parse_response(self, response: requests.Response, stream_state: Mapping[str, def request_params( self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None ) -> MutableMapping[str, Any]: - params = {"count": 100} + params = {"count": 1000} if next_page_token: params.update(next_page_token) return params @@ -134,6 +134,14 @@ class OrderItems(IncrementalCartStream): data_field = "items" +class OrderStatuses(IncrementalCartStream): + """ + Docs: https://developers.cart.com/docs/rest-api/ff5ada86bc8a0-get-order-statuses + """ + + data_field = "order_statuses" + + class Products(IncrementalCartStream): """ Docs: https://developers.cart.com/docs/rest-api/restapi.json/paths/~1products/get diff --git a/docs/integrations/sources/cart.md b/docs/integrations/sources/cart.md index 68c9c21b9fd7..0a3362385bfe 100644 --- a/docs/integrations/sources/cart.md +++ b/docs/integrations/sources/cart.md @@ -50,6 +50,7 @@ Please follow these [steps](https://developers.cart.com/docs/rest-api/docs/READM | Version | Date | Pull Request | Subject | | :--- | :--- | :--- | :--- | +| 0.1.6 | 2022-07-15 | [14752](https://github.com/airbytehq/airbyte/pull/14752) | Add `order_statuses` stream | | 0.1.5 | 2021-12-23 | [8434](https://github.com/airbytehq/airbyte/pull/8434) | Update fields in source-connectors specifications | | 0.1.3 | 2021-08-26 | [5465](https://github.com/airbytehq/airbyte/pull/5465) | Add the end\_date option for limitation of the amount of synced data | | 0.1.2 | 2021-08-23 | [1111](https://github.com/airbytehq/airbyte/pull/1111) | Add `order_items` stream |