From a95c33cccf9bb57877deca56acc23898b75fed5a Mon Sep 17 00:00:00 2001 From: marcosmarxm Date: Wed, 21 Feb 2024 10:26:26 -0300 Subject: [PATCH] fix schema --- .../connectors/source-quickbooks/Dockerfile | 38 ------------------- .../source-quickbooks/metadata.yaml | 2 + .../source-quickbooks/pyproject.toml | 31 +++++++++++++++ .../schemas/credit_memos.json | 6 +++ .../source_quickbooks/schemas/estimates.json | 9 ++++- .../source_quickbooks/schemas/invoices.json | 14 ++++++- .../schemas/refund_receipts.json | 8 +++- .../schemas/sales_receipts.json | 6 +++ 8 files changed, 72 insertions(+), 42 deletions(-) delete mode 100644 airbyte-integrations/connectors/source-quickbooks/Dockerfile create mode 100644 airbyte-integrations/connectors/source-quickbooks/pyproject.toml diff --git a/airbyte-integrations/connectors/source-quickbooks/Dockerfile b/airbyte-integrations/connectors/source-quickbooks/Dockerfile deleted file mode 100644 index 6b8769dd5327..000000000000 --- a/airbyte-integrations/connectors/source-quickbooks/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM python:3.9.11-alpine3.15 as base - -# build and load all requirements -FROM base as builder -WORKDIR /airbyte/integration_code - -# upgrade pip to the latest version -RUN apk --no-cache upgrade \ - && pip install --upgrade pip \ - && apk --no-cache add tzdata build-base - - -COPY setup.py ./ -# install necessary packages to a temporary folder -RUN pip install --prefix=/install . - -# build a clean environment -FROM base -WORKDIR /airbyte/integration_code - -# copy all loaded and built libraries to a pure basic image -COPY --from=builder /install /usr/local -# add default timezone settings -COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime -RUN echo "Etc/UTC" > /etc/timezone - -# bash is installed for more convenient debugging. -RUN apk --no-cache add bash - -# copy payload code only -COPY main.py ./ -COPY source_quickbooks ./source_quickbooks - -ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" -ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] - -LABEL io.airbyte.version=3.0.2 -LABEL io.airbyte.name=airbyte/source-quickbooks diff --git a/airbyte-integrations/connectors/source-quickbooks/metadata.yaml b/airbyte-integrations/connectors/source-quickbooks/metadata.yaml index 3264633f69e9..ec82e2ce8d74 100644 --- a/airbyte-integrations/connectors/source-quickbooks/metadata.yaml +++ b/airbyte-integrations/connectors/source-quickbooks/metadata.yaml @@ -5,6 +5,8 @@ data: - quickbooks.api.intuit.com - oauth.platform.intuit.com connectorSubtype: api + connectorBuildOptions: + baseImage: docker.io/airbyte/python-connector-base:1.1.0@sha256:bd98f6505c6764b1b5f99d3aedc23dfc9e9af631a62533f60eb32b1d3dbab20c connectorType: source definitionId: cf9c4355-b171-4477-8f2d-6c5cc5fc8b7e dockerImageTag: 3.0.2 diff --git a/airbyte-integrations/connectors/source-quickbooks/pyproject.toml b/airbyte-integrations/connectors/source-quickbooks/pyproject.toml new file mode 100644 index 000000000000..33b9c403e84e --- /dev/null +++ b/airbyte-integrations/connectors/source-quickbooks/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = [ "poetry-core>=1.0.0",] +build-backend = "poetry.core.masonry.api" + +[tool.poetry] +version = "3.0.2" +name = "source-quickbooks" +description = "Source implementation for quickbooks." +authors = [ "Airbyte ",] +license = "MIT" +readme = "README.md" +documentation = "https://docs.airbyte.com/integrations/sources/quickbooks" +homepage = "https://airbyte.com" +repository = "https://github.com/airbytehq/airbyte" +[[tool.poetry.packages]] +include = "source_quickbooks" + +[tool.poetry.dependencies] +python = "^3.9,<3.12" +airbyte-cdk = "==0.63.2" +vcrpy = "==4.1.1" +urllib3 = "==1.26.18" + +[tool.poetry.scripts] +source-quickbooks = "source_quickbooks.run:run" + +[tool.poetry.group.dev.dependencies] +requests-mock = "^1.9.3" +pytest-mock = "^3.6.1" +pytest = "^6.1" + diff --git a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/credit_memos.json b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/credit_memos.json index 91170b2b5fe8..a1fb3ccc9a0c 100644 --- a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/credit_memos.json +++ b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/credit_memos.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "type": ["null", "object"], + "additionalProperties": true, "properties": { "ClassRef": { "properties": { @@ -102,6 +103,11 @@ }, "DetailType": { "type": ["null", "string"] + }, + "SubTotalLineDetail": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": {} } }, "type": ["null", "object"] diff --git a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/estimates.json b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/estimates.json index 9d2eb205046b..12e9946f5105 100644 --- a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/estimates.json +++ b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/estimates.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "type": ["null", "object"], + "additionalProperties": true, "properties": { "BillEmail": { "properties": { @@ -190,6 +191,11 @@ "DetailType": { "type": ["null", "string"] }, + "SubTotalLineDetail": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": {} + }, "Description": { "type": ["null", "string"] }, @@ -227,7 +233,8 @@ "type": ["null", "object"] } }, - "type": ["null", "object"] + "type": ["null", "object"], + "additionalProperties": true }, "type": ["null", "array"] }, diff --git a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/invoices.json b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/invoices.json index 9185d986b532..656b0c5e3209 100644 --- a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/invoices.json +++ b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/invoices.json @@ -80,9 +80,13 @@ "properties": { "value": { "type": ["null", "string"] + }, + "name": { + "type": ["null", "string"] } }, - "type": ["null", "object"] + "type": ["null", "object"], + "additionalProperties": true }, "AllowIPNPayment": { "type": ["null", "boolean"] @@ -157,6 +161,11 @@ "Line": { "items": { "properties": { + "SubTotalLineDetail": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": {} + }, "LinkedTxn": { "items": { "properties": { @@ -254,7 +263,8 @@ "type": ["null", "string"] } }, - "type": ["null", "object"] + "type": ["null", "object"], + "additionalProperties": true }, "type": ["null", "array"] }, diff --git a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/refund_receipts.json b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/refund_receipts.json index e7271b4955c4..2f333006aa61 100644 --- a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/refund_receipts.json +++ b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/refund_receipts.json @@ -38,6 +38,11 @@ "Line": { "items": { "properties": { + "SubTotalLineDetail": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": {} + }, "Id": { "type": ["null", "string"] }, @@ -84,7 +89,8 @@ "type": ["null", "object"] } }, - "type": ["null", "object"] + "type": ["null", "object"], + "additionalProperties": true }, "type": ["null", "array"] }, diff --git a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/sales_receipts.json b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/sales_receipts.json index b9ec030fbd03..e48e7e0a34f4 100644 --- a/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/sales_receipts.json +++ b/airbyte-integrations/connectors/source-quickbooks/source_quickbooks/schemas/sales_receipts.json @@ -116,7 +116,13 @@ "type": ["null", "array"], "items": { "type": ["null", "object"], + "additionalProperties": true, "properties": { + "SubTotalLineDetail": { + "type": ["null", "object"], + "additionalProperties": true, + "properties": {} + }, "DiscountLineDetail": { "type": ["null", "object"], "properties": {