conductor-node 11.10.1 → 12.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +135 -0
- package/LICENSE +201 -21
- package/README.md +336 -64
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +914 -0
- package/core.js.map +1 -0
- package/core.mjs +882 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +121 -0
- package/index.d.ts +121 -0
- package/index.d.ts.map +1 -0
- package/index.js +133 -0
- package/index.js.map +1 -0
- package/index.mjs +90 -0
- package/index.mjs.map +1 -0
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +280 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/{dist/src/resources → internal/qs}/types.js +1 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +111 -35
- package/pagination.d.ts +18 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +40 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +36 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/auth-sessions.d.ts +75 -0
- package/resources/auth-sessions.d.ts.map +1 -0
- package/resources/auth-sessions.js +17 -0
- package/resources/auth-sessions.js.map +1 -0
- package/resources/auth-sessions.mjs +13 -0
- package/resources/auth-sessions.mjs.map +1 -0
- package/resources/end-users.d.ts +142 -0
- package/resources/end-users.d.ts.map +1 -0
- package/resources/end-users.js +40 -0
- package/resources/end-users.js.map +1 -0
- package/resources/end-users.mjs +36 -0
- package/resources/end-users.mjs.map +1 -0
- package/resources/index.d.ts +4 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +11 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -0
- package/resources/qbd/accounts.d.ts +579 -0
- package/resources/qbd/accounts.d.ts.map +1 -0
- package/resources/qbd/accounts.js +54 -0
- package/resources/qbd/accounts.js.map +1 -0
- package/resources/qbd/accounts.mjs +50 -0
- package/resources/qbd/accounts.mjs.map +1 -0
- package/resources/qbd/bill-check-payments.d.ts +831 -0
- package/resources/qbd/bill-check-payments.d.ts.map +1 -0
- package/resources/qbd/bill-check-payments.js +70 -0
- package/resources/qbd/bill-check-payments.js.map +1 -0
- package/resources/qbd/bill-check-payments.mjs +65 -0
- package/resources/qbd/bill-check-payments.mjs.map +1 -0
- package/resources/qbd/bill-credit-card-payments.d.ts +641 -0
- package/resources/qbd/bill-credit-card-payments.d.ts.map +1 -0
- package/resources/qbd/bill-credit-card-payments.js +55 -0
- package/resources/qbd/bill-credit-card-payments.js.map +1 -0
- package/resources/qbd/bill-credit-card-payments.mjs +50 -0
- package/resources/qbd/bill-credit-card-payments.mjs.map +1 -0
- package/resources/qbd/bills.d.ts +2561 -0
- package/resources/qbd/bills.d.ts.map +1 -0
- package/resources/qbd/bills.js +69 -0
- package/resources/qbd/bills.js.map +1 -0
- package/resources/qbd/bills.mjs +64 -0
- package/resources/qbd/bills.mjs.map +1 -0
- package/resources/qbd/checks.d.ts +2528 -0
- package/resources/qbd/checks.d.ts.map +1 -0
- package/resources/qbd/checks.js +69 -0
- package/resources/qbd/checks.js.map +1 -0
- package/resources/qbd/checks.mjs +64 -0
- package/resources/qbd/checks.mjs.map +1 -0
- package/resources/qbd/classes.d.ts +289 -0
- package/resources/qbd/classes.d.ts.map +1 -0
- package/resources/qbd/classes.js +54 -0
- package/resources/qbd/classes.js.map +1 -0
- package/resources/qbd/classes.mjs +50 -0
- package/resources/qbd/classes.mjs.map +1 -0
- package/resources/qbd/credit-card-charges.d.ts +2236 -0
- package/resources/qbd/credit-card-charges.d.ts.map +1 -0
- package/resources/qbd/credit-card-charges.js +69 -0
- package/resources/qbd/credit-card-charges.js.map +1 -0
- package/resources/qbd/credit-card-charges.mjs +64 -0
- package/resources/qbd/credit-card-charges.mjs.map +1 -0
- package/resources/qbd/credit-card-credits.d.ts +2233 -0
- package/resources/qbd/credit-card-credits.d.ts.map +1 -0
- package/resources/qbd/credit-card-credits.js +69 -0
- package/resources/qbd/credit-card-credits.js.map +1 -0
- package/resources/qbd/credit-card-credits.mjs +64 -0
- package/resources/qbd/credit-card-credits.mjs.map +1 -0
- package/resources/qbd/credit-memos.d.ts +2649 -0
- package/resources/qbd/credit-memos.d.ts.map +1 -0
- package/resources/qbd/credit-memos.js +69 -0
- package/resources/qbd/credit-memos.js.map +1 -0
- package/resources/qbd/credit-memos.mjs +64 -0
- package/resources/qbd/credit-memos.mjs.map +1 -0
- package/resources/qbd/customers.d.ts +2106 -0
- package/resources/qbd/customers.d.ts.map +1 -0
- package/resources/qbd/customers.js +58 -0
- package/resources/qbd/customers.js.map +1 -0
- package/resources/qbd/customers.mjs +53 -0
- package/resources/qbd/customers.mjs.map +1 -0
- package/resources/qbd/date-driven-terms.d.ts +242 -0
- package/resources/qbd/date-driven-terms.d.ts.map +1 -0
- package/resources/qbd/date-driven-terms.js +43 -0
- package/resources/qbd/date-driven-terms.js.map +1 -0
- package/resources/qbd/date-driven-terms.mjs +39 -0
- package/resources/qbd/date-driven-terms.mjs.map +1 -0
- package/resources/qbd/discount-items.d.ts +576 -0
- package/resources/qbd/discount-items.d.ts.map +1 -0
- package/resources/qbd/discount-items.js +58 -0
- package/resources/qbd/discount-items.js.map +1 -0
- package/resources/qbd/discount-items.mjs +53 -0
- package/resources/qbd/discount-items.mjs.map +1 -0
- package/resources/qbd/employees.d.ts +1711 -0
- package/resources/qbd/employees.d.ts.map +1 -0
- package/resources/qbd/employees.js +58 -0
- package/resources/qbd/employees.js.map +1 -0
- package/resources/qbd/employees.mjs +53 -0
- package/resources/qbd/employees.mjs.map +1 -0
- package/resources/qbd/estimates.d.ts +2493 -0
- package/resources/qbd/estimates.d.ts.map +1 -0
- package/resources/qbd/estimates.js +69 -0
- package/resources/qbd/estimates.js.map +1 -0
- package/resources/qbd/estimates.mjs +64 -0
- package/resources/qbd/estimates.mjs.map +1 -0
- package/resources/qbd/index.d.ts +38 -0
- package/resources/qbd/index.d.ts.map +1 -0
- package/resources/qbd/index.js +108 -0
- package/resources/qbd/index.js.map +1 -0
- package/resources/qbd/index.mjs +39 -0
- package/resources/qbd/index.mjs.map +1 -0
- package/resources/qbd/inventory-adjustments.d.ts +814 -0
- package/resources/qbd/inventory-adjustments.d.ts.map +1 -0
- package/resources/qbd/inventory-adjustments.js +66 -0
- package/resources/qbd/inventory-adjustments.js.map +1 -0
- package/resources/qbd/inventory-adjustments.mjs +62 -0
- package/resources/qbd/inventory-adjustments.mjs.map +1 -0
- package/resources/qbd/inventory-assembly-items.d.ts +931 -0
- package/resources/qbd/inventory-assembly-items.d.ts.map +1 -0
- package/resources/qbd/inventory-assembly-items.js +54 -0
- package/resources/qbd/inventory-assembly-items.js.map +1 -0
- package/resources/qbd/inventory-assembly-items.mjs +49 -0
- package/resources/qbd/inventory-assembly-items.mjs.map +1 -0
- package/resources/qbd/inventory-items.d.ts +844 -0
- package/resources/qbd/inventory-items.d.ts.map +1 -0
- package/resources/qbd/inventory-items.js +58 -0
- package/resources/qbd/inventory-items.js.map +1 -0
- package/resources/qbd/inventory-items.mjs +53 -0
- package/resources/qbd/inventory-items.mjs.map +1 -0
- package/resources/qbd/inventory-sites.d.ts +477 -0
- package/resources/qbd/inventory-sites.d.ts.map +1 -0
- package/resources/qbd/inventory-sites.js +54 -0
- package/resources/qbd/inventory-sites.js.map +1 -0
- package/resources/qbd/inventory-sites.mjs +50 -0
- package/resources/qbd/inventory-sites.mjs.map +1 -0
- package/resources/qbd/invoices.d.ts +2873 -0
- package/resources/qbd/invoices.d.ts.map +1 -0
- package/resources/qbd/invoices.js +69 -0
- package/resources/qbd/invoices.js.map +1 -0
- package/resources/qbd/invoices.mjs +64 -0
- package/resources/qbd/invoices.mjs.map +1 -0
- package/resources/qbd/journal-entries.d.ts +856 -0
- package/resources/qbd/journal-entries.d.ts.map +1 -0
- package/resources/qbd/journal-entries.js +69 -0
- package/resources/qbd/journal-entries.js.map +1 -0
- package/resources/qbd/journal-entries.mjs +64 -0
- package/resources/qbd/journal-entries.mjs.map +1 -0
- package/resources/qbd/non-inventory-items.d.ts +950 -0
- package/resources/qbd/non-inventory-items.d.ts.map +1 -0
- package/resources/qbd/non-inventory-items.js +58 -0
- package/resources/qbd/non-inventory-items.js.map +1 -0
- package/resources/qbd/non-inventory-items.mjs +53 -0
- package/resources/qbd/non-inventory-items.mjs.map +1 -0
- package/resources/qbd/payroll-wage-items.d.ts +215 -0
- package/resources/qbd/payroll-wage-items.d.ts.map +1 -0
- package/resources/qbd/payroll-wage-items.js +47 -0
- package/resources/qbd/payroll-wage-items.js.map +1 -0
- package/resources/qbd/payroll-wage-items.mjs +42 -0
- package/resources/qbd/payroll-wage-items.mjs.map +1 -0
- package/resources/qbd/purchase-orders.d.ts +2554 -0
- package/resources/qbd/purchase-orders.d.ts.map +1 -0
- package/resources/qbd/purchase-orders.js +69 -0
- package/resources/qbd/purchase-orders.js.map +1 -0
- package/resources/qbd/purchase-orders.mjs +64 -0
- package/resources/qbd/purchase-orders.mjs.map +1 -0
- package/resources/qbd/qbd.d.ts +178 -0
- package/resources/qbd/qbd.d.ts.map +1 -0
- package/resources/qbd/qbd.js +222 -0
- package/resources/qbd/qbd.js.map +1 -0
- package/resources/qbd/qbd.mjs +195 -0
- package/resources/qbd/qbd.mjs.map +1 -0
- package/resources/qbd/receive-payments.d.ts +1282 -0
- package/resources/qbd/receive-payments.d.ts.map +1 -0
- package/resources/qbd/receive-payments.js +70 -0
- package/resources/qbd/receive-payments.js.map +1 -0
- package/resources/qbd/receive-payments.mjs +65 -0
- package/resources/qbd/receive-payments.mjs.map +1 -0
- package/resources/qbd/sales-orders.d.ts +2628 -0
- package/resources/qbd/sales-orders.d.ts.map +1 -0
- package/resources/qbd/sales-orders.js +69 -0
- package/resources/qbd/sales-orders.js.map +1 -0
- package/resources/qbd/sales-orders.mjs +64 -0
- package/resources/qbd/sales-orders.mjs.map +1 -0
- package/resources/qbd/sales-receipts.d.ts +3373 -0
- package/resources/qbd/sales-receipts.d.ts.map +1 -0
- package/resources/qbd/sales-receipts.js +69 -0
- package/resources/qbd/sales-receipts.js.map +1 -0
- package/resources/qbd/sales-receipts.mjs +64 -0
- package/resources/qbd/sales-receipts.mjs.map +1 -0
- package/resources/qbd/sales-representatives.d.ts +251 -0
- package/resources/qbd/sales-representatives.d.ts.map +1 -0
- package/resources/qbd/sales-representatives.js +54 -0
- package/resources/qbd/sales-representatives.js.map +1 -0
- package/resources/qbd/sales-representatives.mjs +50 -0
- package/resources/qbd/sales-representatives.mjs.map +1 -0
- package/resources/qbd/sales-tax-codes.d.ts +306 -0
- package/resources/qbd/sales-tax-codes.d.ts.map +1 -0
- package/resources/qbd/sales-tax-codes.js +54 -0
- package/resources/qbd/sales-tax-codes.js.map +1 -0
- package/resources/qbd/sales-tax-codes.mjs +50 -0
- package/resources/qbd/sales-tax-codes.mjs.map +1 -0
- package/resources/qbd/sales-tax-items.d.ts +458 -0
- package/resources/qbd/sales-tax-items.d.ts.map +1 -0
- package/resources/qbd/sales-tax-items.js +58 -0
- package/resources/qbd/sales-tax-items.js.map +1 -0
- package/resources/qbd/sales-tax-items.mjs +53 -0
- package/resources/qbd/sales-tax-items.mjs.map +1 -0
- package/resources/qbd/service-items.d.ts +923 -0
- package/resources/qbd/service-items.d.ts.map +1 -0
- package/resources/qbd/service-items.js +58 -0
- package/resources/qbd/service-items.js.map +1 -0
- package/resources/qbd/service-items.mjs +53 -0
- package/resources/qbd/service-items.mjs.map +1 -0
- package/resources/qbd/standard-terms.d.ts +225 -0
- package/resources/qbd/standard-terms.d.ts.map +1 -0
- package/resources/qbd/standard-terms.js +43 -0
- package/resources/qbd/standard-terms.js.map +1 -0
- package/resources/qbd/standard-terms.mjs +39 -0
- package/resources/qbd/standard-terms.mjs.map +1 -0
- package/resources/qbd/subtotal-items.d.ts +323 -0
- package/resources/qbd/subtotal-items.d.ts.map +1 -0
- package/resources/qbd/subtotal-items.js +58 -0
- package/resources/qbd/subtotal-items.js.map +1 -0
- package/resources/qbd/subtotal-items.mjs +53 -0
- package/resources/qbd/subtotal-items.mjs.map +1 -0
- package/resources/qbd/time-tracking-activities.d.ts +485 -0
- package/resources/qbd/time-tracking-activities.d.ts.map +1 -0
- package/resources/qbd/time-tracking-activities.js +66 -0
- package/resources/qbd/time-tracking-activities.js.map +1 -0
- package/resources/qbd/time-tracking-activities.mjs +61 -0
- package/resources/qbd/time-tracking-activities.mjs.map +1 -0
- package/resources/qbd/transfers.d.ts +269 -0
- package/resources/qbd/transfers.d.ts.map +1 -0
- package/resources/qbd/transfers.js +58 -0
- package/resources/qbd/transfers.js.map +1 -0
- package/resources/qbd/transfers.mjs +53 -0
- package/resources/qbd/transfers.mjs.map +1 -0
- package/resources/qbd/vendor-credits.d.ts +2298 -0
- package/resources/qbd/vendor-credits.d.ts.map +1 -0
- package/resources/qbd/vendor-credits.js +69 -0
- package/resources/qbd/vendor-credits.js.map +1 -0
- package/resources/qbd/vendor-credits.mjs +64 -0
- package/resources/qbd/vendor-credits.mjs.map +1 -0
- package/resources/qbd/vendors.d.ts +1677 -0
- package/resources/qbd/vendors.d.ts.map +1 -0
- package/resources/qbd/vendors.js +58 -0
- package/resources/qbd/vendors.js.map +1 -0
- package/resources/qbd/vendors.mjs +53 -0
- package/resources/qbd/vendors.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +229 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +60 -0
- package/src/resource.ts +11 -0
- package/src/resources/auth-sessions.ts +92 -0
- package/src/resources/end-users.ts +195 -0
- package/src/resources/index.ts +13 -0
- package/src/resources/qbd/accounts.ts +797 -0
- package/src/resources/qbd/bill-check-payments.ts +1086 -0
- package/src/resources/qbd/bill-credit-card-payments.ts +851 -0
- package/src/resources/qbd/bills.ts +3039 -0
- package/src/resources/qbd/checks.ts +3003 -0
- package/src/resources/qbd/classes.ts +366 -0
- package/src/resources/qbd/credit-card-charges.ts +2646 -0
- package/src/resources/qbd/credit-card-credits.ts +2643 -0
- package/src/resources/qbd/credit-memos.ts +3157 -0
- package/src/resources/qbd/customers.ts +2518 -0
- package/src/resources/qbd/date-driven-terms.ts +314 -0
- package/src/resources/qbd/discount-items.ts +712 -0
- package/src/resources/qbd/employees.ts +2308 -0
- package/src/resources/qbd/estimates.ts +2975 -0
- package/src/resources/qbd/index.ts +357 -0
- package/src/resources/qbd/inventory-adjustments.ts +1008 -0
- package/src/resources/qbd/inventory-assembly-items.ts +1126 -0
- package/src/resources/qbd/inventory-items.ts +1026 -0
- package/src/resources/qbd/inventory-sites.ts +605 -0
- package/src/resources/qbd/invoices.ts +3398 -0
- package/src/resources/qbd/journal-entries.ts +1051 -0
- package/src/resources/qbd/non-inventory-items.ts +1138 -0
- package/src/resources/qbd/payroll-wage-items.ts +304 -0
- package/src/resources/qbd/purchase-orders.ts +3045 -0
- package/src/resources/qbd/qbd.ts +949 -0
- package/src/resources/qbd/receive-payments.ts +1609 -0
- package/src/resources/qbd/sales-orders.ts +3141 -0
- package/src/resources/qbd/sales-receipts.ts +3977 -0
- package/src/resources/qbd/sales-representatives.ts +340 -0
- package/src/resources/qbd/sales-tax-codes.ts +398 -0
- package/src/resources/qbd/sales-tax-items.ts +583 -0
- package/src/resources/qbd/service-items.ts +1105 -0
- package/src/resources/qbd/standard-terms.ts +295 -0
- package/src/resources/qbd/subtotal-items.ts +430 -0
- package/src/resources/qbd/time-tracking-activities.ts +615 -0
- package/src/resources/qbd/transfers.ts +359 -0
- package/src/resources/qbd/vendor-credits.ts +2742 -0
- package/src/resources/qbd/vendors.ts +2017 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/dist/package.json +0 -48
- package/dist/src/Client.d.ts +0 -21
- package/dist/src/Client.js +0 -54
- package/dist/src/index.d.ts +0 -11
- package/dist/src/index.js +0 -59
- package/dist/src/integrations/BaseIntegration.d.ts +0 -9
- package/dist/src/integrations/BaseIntegration.js +0 -14
- package/dist/src/integrations/qbd/QbdIntegration.d.ts +0 -3120
- package/dist/src/integrations/qbd/QbdIntegration.js +0 -3147
- package/dist/src/integrations/qbd/qbdTypes.d.ts +0 -14076
- package/dist/src/integrations/qbd/qbdTypes.js +0 -2
- package/dist/src/interceptors/errorHandling.d.ts +0 -2
- package/dist/src/interceptors/errorHandling.js +0 -53
- package/dist/src/interceptors/logging.d.ts +0 -18
- package/dist/src/interceptors/logging.js +0 -70
- package/dist/src/resources/AuthSessionsResource.d.ts +0 -77
- package/dist/src/resources/AuthSessionsResource.js +0 -26
- package/dist/src/resources/BaseResource.d.ts +0 -6
- package/dist/src/resources/BaseResource.js +0 -9
- package/dist/src/resources/EndUsersResource.d.ts +0 -84
- package/dist/src/resources/EndUsersResource.js +0 -57
- package/dist/src/resources/types.d.ts +0 -40
- package/dist/src/utils/checkForUpdates.d.ts +0 -2
- package/dist/src/utils/checkForUpdates.js +0 -65
- package/dist/src/utils/env.d.ts +0 -1
- package/dist/src/utils/env.js +0 -15
- package/dist/src/utils/error.d.ts +0 -184
- package/dist/src/utils/error.js +0 -254
package/README.md
CHANGED
|
@@ -6,109 +6,381 @@
|
|
|
6
6
|
<img alt="Conductor logo" src="https://github.com/conductor-is/quickbooks-desktop-api/assets/170023/d67464b8-53a7-4d33-afeb-05a2efde1fa8" width="325">
|
|
7
7
|
</picture>
|
|
8
8
|
</a>
|
|
9
|
-
<h3>QuickBooks Desktop API for
|
|
9
|
+
<h3>QuickBooks Desktop/Enterprise real-time API for Node.js, Python, and REST</h3>
|
|
10
10
|
<a href="https://docs.conductor.is/quickstart">Quickstart</a>
|
|
11
11
|
<span> • </span>
|
|
12
12
|
<a href="https://conductor.is">Website</a>
|
|
13
13
|
<span> • </span>
|
|
14
14
|
<a href="https://docs.conductor.is">Docs</a>
|
|
15
15
|
<span> • </span>
|
|
16
|
-
<a href="https://docs.conductor.is/qbd-
|
|
17
|
-
<span> • </span>
|
|
18
|
-
<a href="https://twitter.com/conductor_is">Twitter</a>
|
|
16
|
+
<a href="https://docs.conductor.is/qbd-api">Examples</a>
|
|
19
17
|
<br />
|
|
20
18
|
<br />
|
|
21
19
|
<a href="https://npmjs.com/package/conductor-node"><img src="https://img.shields.io/npm/dm/conductor-node.svg?logo=npm" alt="NPM download count"></a>
|
|
22
|
-
<a href="https://npmjs.org/package/conductor-node"><img src="https://img.shields.io/npm/v/conductor-node.svg?logo=npm" alt="
|
|
20
|
+
<a href="https://npmjs.org/package/conductor-node"><img src="https://img.shields.io/npm/v/conductor-node.svg?logo=npm" alt="NPM version"></a>
|
|
21
|
+
<a href="https://npmjs.org/package/conductor-node"><img src="https://img.shields.io/bundlephobia/minzip/conductor-node" alt="NPM bundle size"></a>
|
|
23
22
|
<img src="https://img.shields.io/badge/coverage-100%25-brightgreen" alt="Code coverage">
|
|
24
23
|
<a href="LICENSE"><img src="https://img.shields.io/npm/l/conductor-node.svg?color=blue&logo=github" alt="License" /></a>
|
|
25
24
|
<hr />
|
|
26
25
|
</div>
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
[Conductor](https://conductor.is) is a real-time, fully-typed API for **QuickBooks Desktop** (sometimes called QuickBooks Enterprise). In just a few lines, get real-time access to fetch, create, or update _any_ QuickBooks Desktop object type and receive a fully-typed response.
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
⭐ **Follow our [Quickstart guide](https://docs.conductor.is/quickstart) to get started.**
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
This repository contains the official Conductor **Node.js** library, which provides convenient access to our QuickBooks Desktop API from any server-side TypeScript or JavaScript application.
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
- For Python, see [conductor-python](https://github.com/conductor-is/quickbooks-desktop-python).
|
|
34
|
+
|
|
35
|
+
## Documentation
|
|
36
|
+
|
|
37
|
+
The REST API documentation can be found on [docs.conductor.is](https://docs.conductor.is/api-ref). The full API of this library can be found in [api.md](api.md).
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm install conductor-node@beta
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> **Note:** Though this version of the Node.js SDK uses an NPM `@beta` tag, it **_is_ stable and ready for production use**! We merely have a few more endpoints to migrate before prompting all existing users to update. **Any new Conductor users should absolutely use the beta version**!
|
|
46
|
+
>
|
|
47
|
+
> If you're migrating from the old `conductor-node` package, see the [migration guide](https://docs.conductor.is/qbd-api/upgrade-node).
|
|
38
48
|
|
|
39
49
|
## Key features
|
|
40
50
|
|
|
41
|
-
- **Any data type
|
|
42
|
-
- **Real-time**: Get real-time updates on your QuickBooks Desktop data. No queues, no
|
|
43
|
-
- **Modern API
|
|
44
|
-
- **Typed client libraries
|
|
45
|
-
- **Request handling
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
51
|
+
- **Any data type**: Query, create, or update any QuickBooks Desktop data type.
|
|
52
|
+
- **Real-time**: Get real-time updates on your QuickBooks Desktop data. No queues, no jobs, no cache layer -- just direct access to the data.
|
|
53
|
+
- **Modern API**: JSON-based REST API, replacing the old XML-based SOAP model.
|
|
54
|
+
- **Typed client libraries**: Fully typed libraries in Node.js and Python with autocomplete, inline docs, and type validation for endpoints, parameters, and responses.
|
|
55
|
+
- **Request handling**: Invisibly manages queues, timeouts, retries, and pagination.
|
|
56
|
+
- **Auto-pagination**: Automatically handles paginated responses to retrieve complete datasets.
|
|
57
|
+
- **Multi-company support**: Connects to multiple QuickBooks Desktop company files.
|
|
58
|
+
- **Validation**: Sanitizes and validates all inputs and outputs.
|
|
59
|
+
- **Unified error handling**: Streamlines error handling across the QuickBooks stack.
|
|
60
|
+
- **Authentication flow UI**: Simple UI for securely connecting QuickBooks Desktop accounts.
|
|
50
61
|
- **Dashboard**: UI to monitor and manage your QuickBooks Desktop connections and data.
|
|
51
|
-
- **Error resolution
|
|
62
|
+
- **Error resolution**: Detailed guides and instructions for resolving errors and handling edge cases.
|
|
52
63
|
|
|
53
|
-
##
|
|
54
|
-
|
|
55
|
-
This repository is a library for conveniently accessing Conductor's QuickBooks Desktop API from TypeScript or JavaScript. The library is a wrapper around the Conductor REST API, providing a fully-typed, easy-to-use interface for fetching, creating, and updating QuickBooks Desktop objects.
|
|
64
|
+
## Usage
|
|
56
65
|
|
|
57
|
-
|
|
66
|
+
The full API of this library can be found with code samples at [docs.conductor.is/qbd-api](https://docs.conductor.is/qbd-api).
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
<!-- prettier-ignore -->
|
|
69
|
+
```js
|
|
70
|
+
import Conductor from 'conductor-node';
|
|
61
71
|
|
|
62
|
-
|
|
72
|
+
const conductor = new Conductor({
|
|
73
|
+
apiKey: process.env['CONDUCTOR_SECRET_KEY'], // This is the default and can be omitted
|
|
74
|
+
});
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
4. [Error Handling](https://docs.conductor.is/usage/error-handling)
|
|
76
|
+
async function main() {
|
|
77
|
+
const page = await conductor.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' });
|
|
78
|
+
const invoice = page.data[0];
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
console.log(invoice.id);
|
|
81
|
+
}
|
|
70
82
|
|
|
71
|
-
|
|
72
|
-
npm install conductor-node
|
|
73
|
-
# or
|
|
74
|
-
yarn add conductor-node
|
|
83
|
+
main();
|
|
75
84
|
```
|
|
76
85
|
|
|
77
|
-
|
|
86
|
+
### Request & Response types
|
|
78
87
|
|
|
79
|
-
|
|
88
|
+
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
80
89
|
|
|
90
|
+
<!-- prettier-ignore -->
|
|
81
91
|
```ts
|
|
82
|
-
import Conductor from
|
|
92
|
+
import Conductor from 'conductor-node';
|
|
83
93
|
|
|
84
|
-
const conductor = new Conductor(
|
|
94
|
+
const conductor = new Conductor({
|
|
95
|
+
apiKey: process.env['CONDUCTOR_SECRET_KEY'], // This is the default and can be omitted
|
|
96
|
+
});
|
|
85
97
|
|
|
86
98
|
async function main() {
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
companyName: "{{END_USER_COMPANY_NAME}}",
|
|
90
|
-
sourceId: "{{UNIQUE_ID_FROM_YOUR_DB}}",
|
|
91
|
-
email: "{{END_USER_EMAIL}}",
|
|
92
|
-
});
|
|
93
|
-
console.log("Save this EndUser ID to auth future requests:", endUser.id);
|
|
94
|
-
|
|
95
|
-
// 2. Create an AuthSession to establish the QuickBooks Desktop connection.
|
|
96
|
-
const authSession = await conductor.authSessions.create({
|
|
97
|
-
publishableKey: "{{YOUR_PUBLISHABLE_KEY}}",
|
|
98
|
-
endUserId: endUser.id,
|
|
99
|
-
});
|
|
100
|
-
console.log("Complete the QuickBooks Desktop auth:", authSession.authFlowUrl);
|
|
101
|
-
|
|
102
|
-
// 3. Get a list of invoices from this EndUser's QuickBooks Desktop.
|
|
103
|
-
const qbdInvoices = await conductor.qbd.customer.query(endUser.id, {
|
|
104
|
-
MaxReturned: 10,
|
|
105
|
-
});
|
|
106
|
-
console.log("QuickBooks Desktop invoices:", qbdInvoices);
|
|
99
|
+
const params: Conductor.Qbd.InvoiceListParams = { conductorEndUserId: 'YOUR_END_USER_ID' };
|
|
100
|
+
const [invoice]: [Conductor.Qbd.Invoice] = await conductor.qbd.invoices.list(params);
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
main();
|
|
110
104
|
```
|
|
111
105
|
|
|
112
|
-
|
|
106
|
+
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
107
|
+
|
|
108
|
+
## Handling errors
|
|
109
|
+
|
|
110
|
+
When the library is unable to connect to the API,
|
|
111
|
+
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
|
|
112
|
+
a subclass of `APIError` will be thrown:
|
|
113
|
+
|
|
114
|
+
<!-- prettier-ignore -->
|
|
115
|
+
```ts
|
|
116
|
+
async function main() {
|
|
117
|
+
const page = await conductor.qbd.invoices
|
|
118
|
+
.list({ conductorEndUserId: 'YOUR_END_USER_ID' })
|
|
119
|
+
.catch(async (err) => {
|
|
120
|
+
if (err instanceof Conductor.APIError) {
|
|
121
|
+
console.log(err.status); // 400
|
|
122
|
+
console.log(err.name); // BadRequestError
|
|
123
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
124
|
+
} else {
|
|
125
|
+
throw err;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
main();
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Error codes are as followed:
|
|
134
|
+
|
|
135
|
+
| Status Code | Error Type |
|
|
136
|
+
| ----------- | -------------------------- |
|
|
137
|
+
| 400 | `BadRequestError` |
|
|
138
|
+
| 401 | `AuthenticationError` |
|
|
139
|
+
| 403 | `PermissionDeniedError` |
|
|
140
|
+
| 404 | `NotFoundError` |
|
|
141
|
+
| 422 | `UnprocessableEntityError` |
|
|
142
|
+
| 429 | `RateLimitError` |
|
|
143
|
+
| >=500 | `InternalServerError` |
|
|
144
|
+
| N/A | `APIConnectionError` |
|
|
145
|
+
|
|
146
|
+
### Retries
|
|
147
|
+
|
|
148
|
+
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
|
|
149
|
+
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
|
150
|
+
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
151
|
+
|
|
152
|
+
You can use the `maxRetries` option to configure or disable this:
|
|
153
|
+
|
|
154
|
+
<!-- prettier-ignore -->
|
|
155
|
+
```js
|
|
156
|
+
// Configure the default for all requests:
|
|
157
|
+
const conductor = new Conductor({
|
|
158
|
+
maxRetries: 0, // default is 2
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// Or, configure per-request:
|
|
162
|
+
await conductor.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' }, {
|
|
163
|
+
maxRetries: 5,
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Timeouts
|
|
168
|
+
|
|
169
|
+
Requests time out after 2 minutes by default. You can configure this with a `timeout` option:
|
|
170
|
+
|
|
171
|
+
<!-- prettier-ignore -->
|
|
172
|
+
```ts
|
|
173
|
+
// Configure the default for all requests:
|
|
174
|
+
const conductor = new Conductor({
|
|
175
|
+
timeout: 20 * 1000, // 20 seconds (default is 2 minutes)
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// Override per-request:
|
|
179
|
+
await conductor.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' }, {
|
|
180
|
+
timeout: 5 * 1000,
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
On timeout, an `APIConnectionTimeoutError` is thrown.
|
|
185
|
+
|
|
186
|
+
Note that requests which time out will be [retried twice by default](#retries).
|
|
187
|
+
|
|
188
|
+
## Auto-pagination
|
|
189
|
+
|
|
190
|
+
List methods in the Conductor API are paginated.
|
|
191
|
+
You can use the `for await … of` syntax to iterate through items across all pages:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
async function fetchAllQbdInvoices(params) {
|
|
195
|
+
const allQbdInvoices = [];
|
|
196
|
+
// Automatically fetches more pages as needed.
|
|
197
|
+
for await (const invoice of conductor.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' })) {
|
|
198
|
+
allQbdInvoices.push(invoice);
|
|
199
|
+
}
|
|
200
|
+
return allQbdInvoices;
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Alternatively, you can request a single page at a time:
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
let page = await conductor.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' });
|
|
208
|
+
for (const invoice of page.data) {
|
|
209
|
+
console.log(invoice);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Convenience methods are provided for manually paginating:
|
|
213
|
+
while (page.hasNextPage()) {
|
|
214
|
+
page = await page.getNextPage();
|
|
215
|
+
// ...
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Advanced Usage
|
|
220
|
+
|
|
221
|
+
### Accessing raw Response data (e.g., headers)
|
|
222
|
+
|
|
223
|
+
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
224
|
+
|
|
225
|
+
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
226
|
+
|
|
227
|
+
<!-- prettier-ignore -->
|
|
228
|
+
```ts
|
|
229
|
+
const conductor = new Conductor();
|
|
230
|
+
|
|
231
|
+
const response = await conductor.qbd.invoices.list({ conductorEndUserId: 'YOUR_END_USER_ID' }).asResponse();
|
|
232
|
+
console.log(response.headers.get('X-My-Header'));
|
|
233
|
+
console.log(response.statusText); // access the underlying Response object
|
|
234
|
+
|
|
235
|
+
const { data: page, response: raw } = await conductor.qbd.invoices
|
|
236
|
+
.list({ conductorEndUserId: 'YOUR_END_USER_ID' })
|
|
237
|
+
.withResponse();
|
|
238
|
+
console.log(raw.headers.get('X-My-Header'));
|
|
239
|
+
for await (const invoice of page) {
|
|
240
|
+
console.log(invoice.id);
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Making custom/undocumented requests
|
|
245
|
+
|
|
246
|
+
This library is typed for convenient access to the documented API. If you need to access undocumented
|
|
247
|
+
endpoints, params, or response properties, the library can still be used.
|
|
248
|
+
|
|
249
|
+
#### Undocumented endpoints
|
|
250
|
+
|
|
251
|
+
To make requests to undocumented endpoints, you can use `conductor.get`, `conductor.post`, and other HTTP verbs.
|
|
252
|
+
Options on the client, such as retries, will be respected when making these requests.
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
await conductor.post('/some/path', {
|
|
256
|
+
body: { some_prop: 'foo' },
|
|
257
|
+
query: { some_query_arg: 'bar' },
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
#### Undocumented request params
|
|
262
|
+
|
|
263
|
+
To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
|
|
264
|
+
parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
|
|
265
|
+
send will be sent as-is.
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
conductor.foo.create({
|
|
269
|
+
foo: 'my_param',
|
|
270
|
+
bar: 12,
|
|
271
|
+
// @ts-expect-error baz is not yet public
|
|
272
|
+
baz: 'undocumented option',
|
|
273
|
+
});
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
|
|
277
|
+
extra param in the body.
|
|
278
|
+
|
|
279
|
+
If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
|
|
280
|
+
options.
|
|
281
|
+
|
|
282
|
+
#### Undocumented response properties
|
|
283
|
+
|
|
284
|
+
To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
|
|
285
|
+
the response object, or cast the response object to the requisite type. Like the request params, we do not
|
|
286
|
+
validate or strip extra properties from the response from the API.
|
|
287
|
+
|
|
288
|
+
### Customizing the fetch client
|
|
289
|
+
|
|
290
|
+
By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
|
|
291
|
+
|
|
292
|
+
If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
|
|
293
|
+
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
|
|
294
|
+
add the following import before your first import `from "Conductor"`:
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
|
|
298
|
+
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
|
|
299
|
+
import 'conductor-node/shims/web';
|
|
300
|
+
import Conductor from 'conductor-node';
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
To do the inverse, add `import "conductor-node/shims/node"` (which does import polyfills).
|
|
304
|
+
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/conductor-is/quickbooks-desktop-node/tree/main/src/_shims#readme)).
|
|
305
|
+
|
|
306
|
+
### Logging and middleware
|
|
307
|
+
|
|
308
|
+
You may also provide a custom `fetch` function when instantiating the client,
|
|
309
|
+
which can be used to inspect or alter the `Request` or `Response` before/after each request:
|
|
310
|
+
|
|
311
|
+
```ts
|
|
312
|
+
import { fetch } from 'undici'; // as one example
|
|
313
|
+
import Conductor from 'conductor-node';
|
|
314
|
+
|
|
315
|
+
const conductor = new Conductor({
|
|
316
|
+
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
|
|
317
|
+
console.log('About to make a request', url, init);
|
|
318
|
+
const response = await fetch(url, init);
|
|
319
|
+
console.log('Got response', response);
|
|
320
|
+
return response;
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically.
|
|
326
|
+
This is intended for debugging purposes only and may change in the future without notice.
|
|
327
|
+
|
|
328
|
+
### Configuring an HTTP(S) Agent (e.g., for proxies)
|
|
329
|
+
|
|
330
|
+
By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
|
|
331
|
+
|
|
332
|
+
If you would like to disable or customize this behavior, for example to use the API behind a proxy, you can pass an `httpAgent` which is used for all requests (be they http or https), for example:
|
|
333
|
+
|
|
334
|
+
<!-- prettier-ignore -->
|
|
335
|
+
```ts
|
|
336
|
+
import http from 'http';
|
|
337
|
+
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
338
|
+
|
|
339
|
+
// Configure the default for all requests:
|
|
340
|
+
const conductor = new Conductor({
|
|
341
|
+
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// Override per-request:
|
|
345
|
+
await conductor.qbd.invoices.list(
|
|
346
|
+
{ conductorEndUserId: 'YOUR_END_USER_ID' },
|
|
347
|
+
{
|
|
348
|
+
httpAgent: new http.Agent({ keepAlive: false }),
|
|
349
|
+
},
|
|
350
|
+
);
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Semantic versioning
|
|
354
|
+
|
|
355
|
+
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
356
|
+
|
|
357
|
+
1. Changes that only affect static types, without breaking runtime behavior.
|
|
358
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
359
|
+
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
360
|
+
|
|
361
|
+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
362
|
+
|
|
363
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/conductor-is/quickbooks-desktop-node/issues) with questions, bugs, or suggestions.
|
|
364
|
+
|
|
365
|
+
## Requirements
|
|
366
|
+
|
|
367
|
+
TypeScript >= 4.5 is supported.
|
|
368
|
+
|
|
369
|
+
The following runtimes are supported:
|
|
370
|
+
|
|
371
|
+
- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
|
|
372
|
+
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
373
|
+
- Deno v1.28.0 or higher.
|
|
374
|
+
- Bun 1.0 or later.
|
|
375
|
+
- Cloudflare Workers.
|
|
376
|
+
- Vercel Edge Runtime.
|
|
377
|
+
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
|
|
378
|
+
- Nitro v2.6 or greater.
|
|
379
|
+
|
|
380
|
+
Note that React Native is not supported at this time.
|
|
381
|
+
|
|
382
|
+
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
|
|
383
|
+
|
|
384
|
+
## Contributing
|
|
113
385
|
|
|
114
|
-
|
|
386
|
+
See [the contributing documentation](./CONTRIBUTING.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartBody.d.ts","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,GAAG;gBAAT,IAAI,EAAE,GAAG;IAC5B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultipartBody = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
6
|
+
*/
|
|
7
|
+
class MultipartBody {
|
|
8
|
+
constructor(body) {
|
|
9
|
+
this.body = body;
|
|
10
|
+
}
|
|
11
|
+
get [Symbol.toStringTag]() {
|
|
12
|
+
return 'MultipartBody';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.MultipartBody = MultipartBody;
|
|
16
|
+
//# sourceMappingURL=MultipartBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartBody.js","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AALD,sCAKC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
export class MultipartBody {
|
|
5
|
+
constructor(body) {
|
|
6
|
+
this.body = body;
|
|
7
|
+
}
|
|
8
|
+
get [Symbol.toStringTag]() {
|
|
9
|
+
return 'MultipartBody';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=MultipartBody.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartBody.mjs","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
|
package/_shims/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 👋 Wondering what everything in here does?
|
|
2
|
+
|
|
3
|
+
`conductor-node` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
|
|
4
|
+
edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
|
|
5
|
+
|
|
6
|
+
To do this, `conductor-node` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
|
|
7
|
+
|
|
8
|
+
It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
|
|
9
|
+
automatically select the correct shims for each environment. However, conditional exports are a fairly new
|
|
10
|
+
feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
|
|
11
|
+
|
|
12
|
+
setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
|
|
13
|
+
Unfortunately that's still the default setting, and it can result in errors like
|
|
14
|
+
getting the wrong raw `Response` type from `.asResponse()`, for example.
|
|
15
|
+
|
|
16
|
+
The user can work around these issues by manually importing one of:
|
|
17
|
+
|
|
18
|
+
- `import 'conductor-node/shims/node'`
|
|
19
|
+
- `import 'conductor-node/shims/web'`
|
|
20
|
+
|
|
21
|
+
All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
|
|
22
|
+
|
|
23
|
+
### How it works - Runtime
|
|
24
|
+
|
|
25
|
+
Runtime shims get installed by calling `setShims` exported by `conductor-node/_shims/registry`.
|
|
26
|
+
|
|
27
|
+
Manually importing `conductor-node/shims/node` or `conductor-node/shims/web`, calls `setShims` with the respective runtime shims.
|
|
28
|
+
|
|
29
|
+
All client code imports shims from `conductor-node/_shims/index`, which:
|
|
30
|
+
|
|
31
|
+
- checks if shims have been set manually
|
|
32
|
+
- if not, calls `setShims` with the shims from `conductor-node/_shims/auto/runtime`
|
|
33
|
+
- re-exports the installed shims from `conductor-node/_shims/registry`.
|
|
34
|
+
|
|
35
|
+
`conductor-node/_shims/auto/runtime` exports web runtime shims.
|
|
36
|
+
If the `node` export condition is set, the export map replaces it with `conductor-node/_shims/auto/runtime-node`.
|
|
37
|
+
|
|
38
|
+
### How it works - Type time
|
|
39
|
+
|
|
40
|
+
All client code imports shim types from `conductor-node/_shims/index`, which selects the manual types from `conductor-node/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `conductor-node/_shims/auto/types`.
|
|
41
|
+
|
|
42
|
+
`conductor-node/_shims/manual-types` exports an empty namespace.
|
|
43
|
+
Manually importing `conductor-node/shims/node` or `conductor-node/shims/web` merges declarations into this empty namespace, so they get picked up by `conductor-node/_shims/index`.
|
|
44
|
+
|
|
45
|
+
`conductor-node/_shims/auto/types` exports web type definitions.
|
|
46
|
+
If the `node` export condition is set, the export map replaces it with `conductor-node/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("../bun-runtime.js"), exports);
|
|
21
|
+
//# sourceMappingURL=runtime-bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("../node-runtime.js"), exports);
|
|
21
|
+
//# sourceMappingURL=runtime-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
|