From be92e65d07086973ee4f66d6bfcd6c5051eb7aa6 Mon Sep 17 00:00:00 2001 From: chriswalker Date: Wed, 11 Sep 2024 08:14:09 +1200 Subject: [PATCH 1/2] Implement alternative refresh token write behaviour --- README.md | 25 ++++++++++++++++++++++++- tap_xero/__init__.py | 17 +++++++++++++---- tap_xero/client.py | 9 ++++++--- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a757148..d0dbc5c 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,30 @@ This tap: ## Limitations - - Only designed to work with Xero [Partner Applications](https://developer.xero.com/documentation/auth-and-limits/partner-applications), not Private Applications. +- Only designed to work with Xero [Partner Applications](https://developer.xero.com/documentation/auth-and-limits/partner-applications), not Private Applications. + +## Authentication + +This tap requires a client id, client secret, tenant id, and refresh token in order to authenticate (and thus receive an +access token). + +See [the Xero documentation](https://developer.xero.com/documentation/guides/oauth2/auth-flow) for more info. + +### Refresh token + +The tap is able to use the refresh token to refresh the access token. Doing so also generates a new refresh token, which +the tap is able to write back to you. + +There are two ways to pass in a refresh token, and two ways to have an updated refresh token written back to you. + +To pass in a refresh token, either use the `refresh_token` arg or the `refresh_token_path` arg. +If `refresh_token` is not set, the refresh token will be read as the entire contents of the file at +`refresh_token_path`. +If `refresh_token_path` is set, a new refresh token will override the entire contents of the file **as well as** being +written to the config JSON (which is the default behavior if `refresh_token_path` is not set). + +This is important for the use of this tap via Meltano. Since Meltano generates an ephemeral config JSON, writing the +new refresh token to it is not very helpful. --- diff --git a/tap_xero/__init__.py b/tap_xero/__init__.py index 529790a..938536f 100644 --- a/tap_xero/__init__.py +++ b/tap_xero/__init__.py @@ -1,8 +1,7 @@ #!/usr/bin/env python3 import os -import json import singer -from singer import metadata, metrics, utils +from singer import metadata, utils from singer.catalog import Catalog, CatalogEntry, Schema from . import streams as streams_ from .client import XeroClient @@ -13,8 +12,8 @@ "client_id", "client_secret", "tenant_id", - "refresh_token", - + # no longer required. can use "refresh_token_path" instead. + # "refresh_token", ] LOGGER = singer.get_logger() @@ -115,6 +114,16 @@ def sync(ctx): def main_impl(): args = utils.parse_args(REQUIRED_CONFIG_KEYS) + + if "refresh_token" not in args.config and "refresh_token_path" not in args.config: + raise Exception( + "Config requires either refresh_token or refresh_token_path to be set." + ) + + if "refresh_token" not in args.config: + with open(args.config["refresh_token_path"], "r") as f: + args.config["refresh_token"] = f.read() + if args.discover: discover(Context(args.config, {}, {}, args.config_path)).dump() print() diff --git a/tap_xero/client.py b/tap_xero/client.py index 17386d5..f9c7093 100644 --- a/tap_xero/client.py +++ b/tap_xero/client.py @@ -5,6 +5,7 @@ import sys import math from os.path import join +from os import environ from datetime import datetime, date, time, timedelta import requests from singer.utils import strftime, strptime_to_utc @@ -204,13 +205,15 @@ def refresh_credentials(self, config, config_path): else: resp = resp.json() - # Write to config file - config['refresh_token'] = resp["refresh_token"] + refresh_token = resp["refresh_token"] + config['refresh_token'] = refresh_token update_config_file(config, config_path) + if "refresh_token_path" in config: + with open(config["refresh_token_path"], "w") as f: + f.write(refresh_token) self.access_token = resp["access_token"] self.tenant_id = config['tenant_id'] - @backoff.on_exception(backoff.expo, (json.decoder.JSONDecodeError, XeroInternalError), max_tries=3) @backoff.on_exception(retry_after_wait_gen, XeroTooManyInMinuteError, giveup=is_not_status_code_fn([429]), jitter=None, max_tries=3) def check_platform_access(self, config, config_path): From 95a8a672c6537e512d2c5bea14fc24df2c53d5f5 Mon Sep 17 00:00:00 2001 From: chriswalker Date: Wed, 11 Sep 2024 14:39:55 +1200 Subject: [PATCH 2/2] Fix incorrect use of exclusiveMinimum and exclusiveMaximum in schema files --- tap_xero/schemas/allocations.json | 8 +- tap_xero/schemas/attachments.json | 3 +- tap_xero/schemas/bank_transactions.json | 32 +-- tap_xero/schemas/bank_transfers.json | 16 +- tap_xero/schemas/credit_notes.json | 48 ++-- tap_xero/schemas/expense_claims.json | 24 +- tap_xero/schemas/invoices.json | 64 ++--- tap_xero/schemas/items.json | 16 +- tap_xero/schemas/line_items.json | 40 ++- tap_xero/schemas/manual_journals.json | 16 +- tap_xero/schemas/nested_invoice.json | 64 ++--- tap_xero/schemas/overpayments.json | 48 ++-- tap_xero/schemas/payment_terms.json | 8 +- tap_xero/schemas/payments.json | 24 +- tap_xero/schemas/prepayments.json | 48 ++-- tap_xero/schemas/purchase_orders.json | 40 ++- tap_xero/schemas/quotes.json | 330 +++++++++++------------ tap_xero/schemas/receipts.json | 24 +- tap_xero/schemas/repeating_invoices.json | 32 +-- tap_xero/schemas/tax_rates.json | 24 +- 20 files changed, 378 insertions(+), 531 deletions(-) diff --git a/tap_xero/schemas/allocations.json b/tap_xero/schemas/allocations.json index 1d8c53e..86caa62 100644 --- a/tap_xero/schemas/allocations.json +++ b/tap_xero/schemas/allocations.json @@ -16,11 +16,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Invoice": { "$ref": "nested_invoice" diff --git a/tap_xero/schemas/attachments.json b/tap_xero/schemas/attachments.json index 8913425..2cea324 100644 --- a/tap_xero/schemas/attachments.json +++ b/tap_xero/schemas/attachments.json @@ -8,8 +8,7 @@ "null", "object" ], - "properties": { - }, + "properties": {}, "additionalProperties": false } } diff --git a/tap_xero/schemas/bank_transactions.json b/tap_xero/schemas/bank_transactions.json index fbe1eb0..c2b7f1d 100644 --- a/tap_xero/schemas/bank_transactions.json +++ b/tap_xero/schemas/bank_transactions.json @@ -62,11 +62,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Url": { "type": [ @@ -91,33 +89,27 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "BankTransactionID": { "type": [ diff --git a/tap_xero/schemas/bank_transfers.json b/tap_xero/schemas/bank_transfers.json index 76b92c6..f690463 100644 --- a/tap_xero/schemas/bank_transfers.json +++ b/tap_xero/schemas/bank_transfers.json @@ -15,11 +15,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Date": { "type": [ @@ -45,11 +43,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "FromBankTransactionID": { "type": [ diff --git a/tap_xero/schemas/credit_notes.json b/tap_xero/schemas/credit_notes.json index 949bb3e..bccfe41 100644 --- a/tap_xero/schemas/credit_notes.json +++ b/tap_xero/schemas/credit_notes.json @@ -60,44 +60,36 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AppliedAmount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "UpdatedDateUTC": { "format": "date-time", @@ -147,22 +139,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "RemainingCredit": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Allocations": { "items": { diff --git a/tap_xero/schemas/expense_claims.json b/tap_xero/schemas/expense_claims.json index e37c7c9..b92a3f7 100644 --- a/tap_xero/schemas/expense_claims.json +++ b/tap_xero/schemas/expense_claims.json @@ -48,33 +48,27 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AmountDue": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AmountPaid": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "PaymentDueDate": { "type": [ diff --git a/tap_xero/schemas/invoices.json b/tap_xero/schemas/invoices.json index bf11104..0a9a4c9 100644 --- a/tap_xero/schemas/invoices.json +++ b/tap_xero/schemas/invoices.json @@ -53,44 +53,36 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalDiscount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "UpdatedDateUTC": { "format": "date-time", @@ -110,11 +102,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "InvoiceID": { "type": [ @@ -226,22 +216,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AmountPaid": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "FullyPaidOnDate": { "format": "date-time", @@ -255,11 +241,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "DueDateString": { "format": "date-time", diff --git a/tap_xero/schemas/items.json b/tap_xero/schemas/items.json index ae5106c..be6887c 100644 --- a/tap_xero/schemas/items.json +++ b/tap_xero/schemas/items.json @@ -64,11 +64,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AccountCode": { "type": [ @@ -96,11 +94,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AccountCode": { "type": [ diff --git a/tap_xero/schemas/line_items.json b/tap_xero/schemas/line_items.json index 91dc4da..ee2d2cd 100644 --- a/tap_xero/schemas/line_items.json +++ b/tap_xero/schemas/line_items.json @@ -15,22 +15,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "UnitAmount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AccountCode": { "type": [ @@ -60,33 +56,27 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TaxAmount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "DiscountRate": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Tracking": { "items": { diff --git a/tap_xero/schemas/manual_journals.json b/tap_xero/schemas/manual_journals.json index bb6bacc..d175b73 100644 --- a/tap_xero/schemas/manual_journals.json +++ b/tap_xero/schemas/manual_journals.json @@ -45,11 +45,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Description": { "type": [ @@ -62,11 +60,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AccountID": { "type": [ diff --git a/tap_xero/schemas/nested_invoice.json b/tap_xero/schemas/nested_invoice.json index cba7880..0f680b8 100644 --- a/tap_xero/schemas/nested_invoice.json +++ b/tap_xero/schemas/nested_invoice.json @@ -53,44 +53,36 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalDiscount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "UpdatedDateUTC": { "format": "date-time", @@ -110,11 +102,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "InvoiceID": { "type": [ @@ -176,22 +166,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AmountPaid": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "FullyPaidOnDate": { "format": "date-time", @@ -205,11 +191,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "DueDateString": { "format": "date-time", diff --git a/tap_xero/schemas/overpayments.json b/tap_xero/schemas/overpayments.json index 8759933..818b2d0 100644 --- a/tap_xero/schemas/overpayments.json +++ b/tap_xero/schemas/overpayments.json @@ -31,11 +31,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "LineAmountTypes": { "type": [ @@ -57,33 +55,27 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "UpdatedDateUTC": { "type": [ @@ -108,22 +100,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "RemainingCredit": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Allocations": { "type": [ diff --git a/tap_xero/schemas/payment_terms.json b/tap_xero/schemas/payment_terms.json index dc07e63..28ef878 100644 --- a/tap_xero/schemas/payment_terms.json +++ b/tap_xero/schemas/payment_terms.json @@ -14,13 +14,13 @@ "type": [ "null", "integer" - ] + ] }, "Type": { "type": [ "null", "string" - ] + ] } }, "additionalProperties": false @@ -35,13 +35,13 @@ "type": [ "null", "integer" - ] + ] }, "Type": { "type": [ "null", "string" - ] + ] } }, "additionalProperties": false diff --git a/tap_xero/schemas/payments.json b/tap_xero/schemas/payments.json index 72ac426..e495fd3 100644 --- a/tap_xero/schemas/payments.json +++ b/tap_xero/schemas/payments.json @@ -16,22 +16,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Amount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Reference": { "type": [ @@ -129,11 +125,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "HasValidationErrors": { "type": [ diff --git a/tap_xero/schemas/prepayments.json b/tap_xero/schemas/prepayments.json index 311287e..21e4f0f 100644 --- a/tap_xero/schemas/prepayments.json +++ b/tap_xero/schemas/prepayments.json @@ -52,22 +52,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "UpdatedDateUTC": { "format": "date-time", @@ -92,11 +88,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Reference": { "type": [ @@ -109,22 +103,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "AppliedAmount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Allocations": { "type": [ @@ -155,11 +145,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "DateString": { "format": "date-time", diff --git a/tap_xero/schemas/purchase_orders.json b/tap_xero/schemas/purchase_orders.json index 421a387..d74274d 100644 --- a/tap_xero/schemas/purchase_orders.json +++ b/tap_xero/schemas/purchase_orders.json @@ -113,55 +113,45 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-10, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 1E-10, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "SubTotal": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalDiscount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "HasAttachments": { "type": [ diff --git a/tap_xero/schemas/quotes.json b/tap_xero/schemas/quotes.json index 255110d..fd5b90b 100644 --- a/tap_xero/schemas/quotes.json +++ b/tap_xero/schemas/quotes.json @@ -1,171 +1,161 @@ { - "type": [ - "null", - "object" - ], - "properties":{ - "Contact": { - "$ref": "contacts" - }, - "Date": { - "type": [ - "null", - "string" - ], - "format": "date-time" - }, - "ExpiryDate": { - "type": [ - "null", - "string" - ], - "format": "date-time" - }, - "Status":{ - "type":[ - "null", - "string" - ] - }, - "LineAmountTypes": { - "type": [ - "null", - "string" - ] - }, - "LineItems": { - "type": [ - "null", - "array" - ], - "items": { - "$ref": "line_items" - } - }, - "SubTotal": { - "type": [ - "null", - "number" - ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true - }, - "TotalTax": { - "type": [ - "null", - "number" - ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true - }, - "Total": { - "type": [ - "null", - "number" - ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true - }, - "TotalDiscount":{ - "type": [ - "null", - "number" - ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true - }, - "UpdatedDateUTC": { - "type": [ - "null", - "string" - ], - "format": "date-time" - }, - "CurrencyCode": { - "type": [ - "null", - "string" - ] - }, - "CurrencyRate": { - "type": [ - "null", - "number" - ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-06, - "exclusiveMinimum": true, - "exclusiveMaximum": true - }, - "QuoteID":{ - "type":[ - "null", - "string" - ] - }, - "QuoteNumber":{ - "type":[ - "null", - "string" - ] - }, - "Reference": { - "type": [ - "null", - "string" - ] - }, - "BrandingThemeID":{ - "type": [ - "null", - "string" - ] - }, - "Title": { - "type": [ - "null", - "string" - ] - }, - "Summary": { - "type": [ - "null", - "string" - ] - }, - "Terms": { - "type": [ - "null", - "string" - ] - }, - "TrackingCategory": { - "type": [ - "null", - "array" - ], - "items": { - "$ref": "tracking_categories" - } - } - }, - "tap_schema_dependencies": [ - "contacts", - "line_items", - "tracking_categories" - ], - "additionalProperties": false - } + "type": [ + "null", + "object" + ], + "properties": { + "Contact": { + "$ref": "contacts" + }, + "Date": { + "type": [ + "null", + "string" + ], + "format": "date-time" + }, + "ExpiryDate": { + "type": [ + "null", + "string" + ], + "format": "date-time" + }, + "Status": { + "type": [ + "null", + "string" + ] + }, + "LineAmountTypes": { + "type": [ + "null", + "string" + ] + }, + "LineItems": { + "type": [ + "null", + "array" + ], + "items": { + "$ref": "line_items" + } + }, + "SubTotal": { + "type": [ + "null", + "number" + ], + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 + }, + "TotalTax": { + "type": [ + "null", + "number" + ], + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 + }, + "Total": { + "type": [ + "null", + "number" + ], + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 + }, + "TotalDiscount": { + "type": [ + "null", + "number" + ], + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 + }, + "UpdatedDateUTC": { + "type": [ + "null", + "string" + ], + "format": "date-time" + }, + "CurrencyCode": { + "type": [ + "null", + "string" + ] + }, + "CurrencyRate": { + "type": [ + "null", + "number" + ], + "multipleOf": 0.000001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 + }, + "QuoteID": { + "type": [ + "null", + "string" + ] + }, + "QuoteNumber": { + "type": [ + "null", + "string" + ] + }, + "Reference": { + "type": [ + "null", + "string" + ] + }, + "BrandingThemeID": { + "type": [ + "null", + "string" + ] + }, + "Title": { + "type": [ + "null", + "string" + ] + }, + "Summary": { + "type": [ + "null", + "string" + ] + }, + "Terms": { + "type": [ + "null", + "string" + ] + }, + "TrackingCategory": { + "type": [ + "null", + "array" + ], + "items": { + "$ref": "tracking_categories" + } + } + }, + "tap_schema_dependencies": [ + "contacts", + "line_items", + "tracking_categories" + ], + "additionalProperties": false +} diff --git a/tap_xero/schemas/receipts.json b/tap_xero/schemas/receipts.json index 0a4343d..e40c0b6 100644 --- a/tap_xero/schemas/receipts.json +++ b/tap_xero/schemas/receipts.json @@ -43,33 +43,27 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "ReceiptID": { "type": [ diff --git a/tap_xero/schemas/repeating_invoices.json b/tap_xero/schemas/repeating_invoices.json index 16ede86..9cb44b9 100644 --- a/tap_xero/schemas/repeating_invoices.json +++ b/tap_xero/schemas/repeating_invoices.json @@ -110,44 +110,36 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalTax": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "TotalDiscount": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "Total": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "RepeatingInvoiceID": { "type": [ diff --git a/tap_xero/schemas/tax_rates.json b/tap_xero/schemas/tax_rates.json index 059f381..bed61d3 100644 --- a/tap_xero/schemas/tax_rates.json +++ b/tap_xero/schemas/tax_rates.json @@ -49,11 +49,9 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 } }, "additionalProperties": false @@ -106,22 +104,18 @@ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 }, "EffectiveRate": { "type": [ "null", "number" ], - "minimum": -1e+33, - "maximum": 1e+33, - "multipleOf": 1e-05, - "exclusiveMinimum": true, - "exclusiveMaximum": true + "multipleOf": 0.00001, + "exclusiveMinimum": -1E+33, + "exclusiveMaximum": 1E+33 } }, "additionalProperties": false