Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-create-ap-aging-report",
name: "Create AP Aging Detail Report",
description: "Creates an AP aging report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/apagingdetail#query-a-report)",
version: "0.0.5",
version: "0.0.6",
type: "action",
props: {
quickbooks,
Expand Down
2 changes: 1 addition & 1 deletion components/quickbooks/actions/create-bill/create-bill.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "quickbooks-create-bill",
name: "Create Bill",
description: "Creates a bill. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#create-a-bill)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-create-customer",
name: "Create Customer",
description: "Creates a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#create-a-customer)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "quickbooks-create-estimate",
name: "Create Estimate",
description: "Creates an estimate. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#create-an-estimate)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "quickbooks-create-invoice",
name: "Create Invoice",
description: "Creates an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice)",
version: "0.2.4",
version: "0.2.5",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "quickbooks-create-payment",
name: "Create Payment",
description: "Creates a payment. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#create-a-payment)",
version: "0.0.9",
version: "0.0.10",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "quickbooks-create-pl-report",
name: "Create Profit and Loss Detail Report",
description: "Creates a profit and loss report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/profitandloss#query-a-report)",
version: "0.0.5",
version: "0.0.6",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "quickbooks-create-purchase-order",
name: "Create Purchase Order",
description: "Creates a purchase order. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder#create-a-purchaseorder)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "quickbooks-create-purchase",
name: "Create Purchase",
description: "Creates a new purchase. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#create-a-purchase)",
version: "0.0.8",
version: "0.0.9",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "quickbooks-create-sales-receipt",
name: "Create Sales Receipt",
description: "Creates a sales receipt. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#create-a-salesreceipt)",
version: "0.0.9",
version: "0.0.10",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "quickbooks-delete-purchase",
name: "Delete Purchase",
description: "Delete a specific purchase. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#delete-a-purchase)",
version: "0.0.8",
version: "0.0.9",
type: "action",
props: {
quickbooks,
Expand Down
2 changes: 1 addition & 1 deletion components/quickbooks/actions/get-bill/get-bill.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-bill",
name: "Get Bill",
description: "Returns info about a bill. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/bill#read-a-bill)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-customer",
name: "Get Customer",
description: "Returns info about a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#read-a-customer)",
version: "0.3.10",
version: "0.3.11",
type: "action",
props: {
quickbooks,
Expand Down
2 changes: 1 addition & 1 deletion components/quickbooks/actions/get-invoice/get-invoice.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-invoice",
name: "Get Invoice",
description: "Returns info about an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#read-an-invoice)",
version: "0.2.11",
version: "0.2.12",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "quickbooks-get-my-company",
name: "Get My Company",
description: "Gets info about a company. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/companyinfo)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
2 changes: 1 addition & 1 deletion components/quickbooks/actions/get-payment/get-payment.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-payment",
name: "Get Payment",
description: "Returns info about a payment. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#read-a-payment)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-purchase-order",
name: "Get Purchase Order",
description: "Returns details about a purchase order. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchaseorder#read-a-purchase-order)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-purchase",
name: "Get Purchase",
description: "Returns info about a purchase. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#read-a-purchase)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-sales-receipt",
name: "Get Sales Receipt",
description: "Returns details about a sales receipt. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/salesreceipt#read-a-salesreceipt)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-get-time-activity",
name: "Get Time Activity",
description: "Returns info about an activity. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#read-a-timeactivity-object)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-accounts",
name: "Search Accounts",
description: "Search for accounts. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/account#query-an-account)",
version: "0.2.10",
version: "0.2.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-customers",
name: "Search Customers",
description: "Searches for customers. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#query-a-customer)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-invoices",
name: "Search Invoices",
description: "Searches for invoices. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#query-an-invoice)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-items",
name: "Search Items",
description: "Searches for items. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-products",
name: "Search Products",
description: "Search for products. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "quickbooks-search-purchases",
name: "Search Purchases",
description: "Searches for purchases. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#query-a-purchase)",
version: "0.0.8",
version: "0.0.9",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-query",
name: "Search Query",
description: "Performs a search query against a Quickbooks entity. [See the documentation](https://developer.intuit.com/app/develophttps://developer.intuit.com/app/developer/qbo/docs/develop/explore-the-quickbooks-online-api/data-queries)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-services",
name: "Search Services",
description: "Search for services. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#query-an-item)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-time-activities",
name: "Search Time Activities",
description: "Searches for time activities. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/timeactivity#query-a-timeactivity-object)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-search-vendors",
name: "Search Vendors",
description: "Searches for vendors. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/vendor#query-a-vendor)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down Expand Up @@ -37,7 +37,7 @@ export default {
},
async run({ $ }) {
if (!this.whereClause) {
throw new ConfigurationError("Must provide includeClause, whereClause parameters.");
throw new ConfigurationError("Must provide whereClause parameter.");
}

const orderClause = this.orderClause
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "quickbooks-send-estimate",
name: "Send Estimate",
description: "Sends an estimate by email. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#send-an-estimate)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "quickbooks-send-invoice",
name: "Send Invoice",
description: "Sends an invoice by email. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#send-an-invoice)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "quickbooks-sparse-update-invoice",
name: "Sparse Update Invoice",
description: "Sparse updating provides the ability to update a subset of properties for a given object; only elements specified in the request are updated. Missing elements are left untouched. The ID of the object to update is specified in the request body.​ [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#sparse-update-an-invoice)",
version: "0.1.8",
version: "0.1.9",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-update-customer",
name: "Update Customer",
description: "Updates a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#full-update-a-customer)",
version: "0.1.10",
version: "0.1.11",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "quickbooks-update-estimate",
name: "Update Estimate",
description: "Updates an estimate. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/estimate#update-an-estimate)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
key: "quickbooks-update-invoice",
name: "Update Invoice",
description: "Updates an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#update-an-invoice)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
2 changes: 1 addition & 1 deletion components/quickbooks/actions/update-item/update-item.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-update-item",
name: "Update Item",
description: "Updates an item. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item#full-update-an-item)",
version: "0.0.4",
version: "0.0.5",
type: "action",
props: {
quickbooks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "quickbooks-void-invoice",
name: "Void Invoice",
description: "Voids an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#void-an-invoice)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
quickbooks,
Expand Down
2 changes: 1 addition & 1 deletion components/quickbooks/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const LIMIT = 100;
export const MAX_RETRIES = 5;
export const INITIAL_BACKOFF_MILLISECONDS = 1500;
export const INITIAL_BACKOFF_MILLISECONDS = 2000;

export const AP_AGING_REPORT_COLUMNS = [
"create_by",
Expand Down
29 changes: 24 additions & 5 deletions components/quickbooks/common/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,35 @@ export function parseObject(obj) {
}

export async function retryWithExponentialBackoff(
requestFn, retries = MAX_RETRIES, backoff = INITIAL_BACKOFF_MILLISECONDS,
requestFn,
retries = MAX_RETRIES,
backoff = INITIAL_BACKOFF_MILLISECONDS,
) {
try {
return await requestFn();
} catch (error) {
if (retries > 0 && error.response?.status === 429) {
console.warn(`Rate limit exceeded. Retrying in ${backoff}ms...`);
await new Promise((resolve) => setTimeout(resolve, backoff));
return retryWithExponentialBackoff(requestFn, retries - 1, backoff * 2);
const status = error.response?.status;
const errorCode = error.response?.data?.Fault?.Error?.[0]?.code;
const errorCodeStr = errorCode == null
? undefined
: String(errorCode);

const isRateLimit = status === 429 ||
status === 503 ||
errorCodeStr === "3200" || // Rate limit exceeded
errorCodeStr === "10001"; // Throttle limit exceeded

if (retries > 0 && isRateLimit) {
const retryAfter = error.response?.headers?.["retry-after"];
const delay = retryAfter
? parseInt(retryAfter) * 1000
: backoff;

console.warn(`QuickBooks rate limit exceeded. Retrying in ${delay}ms... (${retries} retries left)`);
await new Promise((resolve) => setTimeout(resolve, delay));
return retryWithExponentialBackoff(requestFn, retries - 1, Math.min(backoff * 2, 60000));
}

throw error;
}
}
Expand Down
Loading
Loading