diff --git a/airbyte-integrations/connectors/source-square/Dockerfile b/airbyte-integrations/connectors/source-square/Dockerfile index 2929b988a5bc..bdac632d5be6 100644 --- a/airbyte-integrations/connectors/source-square/Dockerfile +++ b/airbyte-integrations/connectors/source-square/Dockerfile @@ -34,5 +34,5 @@ COPY source_square ./source_square ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=1.1.3 +LABEL io.airbyte.version=1.2.0 LABEL io.airbyte.name=airbyte/source-square diff --git a/airbyte-integrations/connectors/source-square/acceptance-test-config.yml b/airbyte-integrations/connectors/source-square/acceptance-test-config.yml index 6eaf8a1137aa..3087c1a5876c 100644 --- a/airbyte-integrations/connectors/source-square/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-square/acceptance-test-config.yml @@ -34,6 +34,8 @@ acceptance_tests: bypass_reason: "Not able to fill stream" - name: refunds bypass_reason: "Not able to fill stream" + - name: cash_drawers + bypass_reason: "Not able to fill stream" expect_records: path: "integration_tests/expected_records_oauth.jsonl" ignored_fields: diff --git a/airbyte-integrations/connectors/source-square/integration_tests/configured_catalog.json b/airbyte-integrations/connectors/source-square/integration_tests/configured_catalog.json index be5690c59532..72198c43bc55 100644 --- a/airbyte-integrations/connectors/source-square/integration_tests/configured_catalog.json +++ b/airbyte-integrations/connectors/source-square/integration_tests/configured_catalog.json @@ -155,6 +155,18 @@ "sync_mode": "incremental", "cursor_field": ["updated_at"], "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "cash_drawers", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"], + "source_defined_cursor": true, + "default_cursor_field": ["id"] + }, + "sync_mode": "full_refresh", + "cursor_field": ["id"], + "destination_sync_mode": "overwrite" } ] } diff --git a/airbyte-integrations/connectors/source-square/metadata.yaml b/airbyte-integrations/connectors/source-square/metadata.yaml index 4c7e338478e3..f9559e832224 100644 --- a/airbyte-integrations/connectors/source-square/metadata.yaml +++ b/airbyte-integrations/connectors/source-square/metadata.yaml @@ -9,7 +9,7 @@ data: connectorSubtype: api connectorType: source definitionId: 77225a51-cd15-4a13-af02-65816bd0ecf4 - dockerImageTag: 1.1.3 + dockerImageTag: 1.2.0 dockerRepository: airbyte/source-square documentationUrl: https://docs.airbyte.com/integrations/sources/square githubIssueLabel: source-square diff --git a/airbyte-integrations/connectors/source-square/source_square/manifest.yaml b/airbyte-integrations/connectors/source-square/source_square/manifest.yaml index 255f2a403888..6599c7451846 100644 --- a/airbyte-integrations/connectors/source-square/source_square/manifest.yaml +++ b/airbyte-integrations/connectors/source-square/source_square/manifest.yaml @@ -207,6 +207,32 @@ definitions: primary_key: "id" path: "/locations" + locations_partition_router: + type: SubstreamPartitionRouter + parent_stream_configs: + - stream: "#/definitions/locations_stream" + parent_key: "id" + partition_field: "location_id" + + cash_drawers_stream: + $ref: "#/definitions/base_stream" + $parameters: + name: "cash_drawers" + primary_key: "id" + path: "/cash-drawers/shifts" + retriever: + $ref: "#/definitions/retriever" + partition_router: + $ref: "#/definitions/locations_partition_router" + requester: + $ref: "#/definitions/requester" + request_parameters: + location_id: "{{ stream_partition.location_id }}" + record_selector: + $ref: "#/definitions/selector" + extractor: + field_path: ["cash_drawer_shifts"] + categories_stream: $ref: "#/definitions/base_catalog_objects_stream" $parameters: @@ -303,6 +329,7 @@ streams: - "#/definitions/refunds_stream" - "#/definitions/payments_stream" - "#/definitions/orders_stream" + - "#/definitions/cash_drawers_stream" check: stream_names: diff --git a/airbyte-integrations/connectors/source-square/source_square/schemas/cash_drawers.json b/airbyte-integrations/connectors/source-square/source_square/schemas/cash_drawers.json new file mode 100644 index 000000000000..2881cd872572 --- /dev/null +++ b/airbyte-integrations/connectors/source-square/source_square/schemas/cash_drawers.json @@ -0,0 +1,59 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Cash Drawer Shifts Schema", + "additionalProperties": true, + "type": ["object", "null"], + "properties": { + "id": { + "type": ["string", "null"] + }, + "state": { + "type": ["string", "null"] + }, + "opened_at": { + "type": ["string", "null"] + }, + "ended_at": { + "type": ["string", "null"] + }, + "closed_at": { + "type": ["string", "null"] + }, + "description": { + "type": ["string", "null"] + }, + "opened_cash_money": { + "type": ["object", "null"], + "properties": { + "amount": { + "type": ["number", "null"] + }, + "currency": { + "type": ["string", "null"] + } + } + }, + "expected_cash_money": { + "type": ["object", "null"], + "properties": { + "amount": { + "type": ["number", "null"] + }, + "currency": { + "type": ["string", "null"] + } + } + }, + "closed_cash_money": { + "type": ["object", "null"], + "properties": { + "amount": { + "type": ["number", "null"] + }, + "currency": { + "type": ["string", "null"] + } + } + } + } +} diff --git a/docs/integrations/sources/square.md b/docs/integrations/sources/square.md index fd6d87c112c4..fe9a86105d42 100644 --- a/docs/integrations/sources/square.md +++ b/docs/integrations/sources/square.md @@ -69,6 +69,7 @@ The Square source connector supports the following [ sync modes](https://docs.ai - [Customers](https://developer.squareup.com/explorer/square/customers-api/list-customers) - [Shifts](https://developer.squareup.com/reference/square/labor-api/search-shifts) - [Orders](https://developer.squareup.com/reference/square/orders-api/search-orders) +- [Cash drawers](https://developer.squareup.com/explorer/square/cash-drawers-api/list-cash-drawer-shifts) ## Connector-specific features & highlights @@ -97,6 +98,7 @@ Exponential [Backoff](https://developer.squareup.com/forums/t/current-square-api | Version | Date | Pull Request | Subject | | :------ |:-----------| :------------------------------------------------------- |:--------------------------------------------------------------------------| +| 1.2.0 | 2023-10-10 | [31065](https://github.com/airbytehq/airbyte/pull/31065) | Add new stream Cash drawers shifts | | 1.1.3 | 2023-10-10 | [30960](https://github.com/airbytehq/airbyte/pull/30960) | Update `airbyte-cdk` version to `>=0.51.31` | | 1.1.2 | 2023-07-10 | [28019](https://github.com/airbytehq/airbyte/pull/28019) | fix display order of spec fields | | 1.1.1 | 2023-06-28 | [27762](https://github.com/airbytehq/airbyte/pull/27762) | Update following state breaking changes |