orb-billing 1.21.0 → 1.23.0
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 +32 -0
- package/LICENSE +201 -0
- package/README.md +196 -192
- 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 +90 -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 +239 -0
- package/core.d.ts.map +1 -0
- package/core.js +830 -0
- package/core.js.map +1 -0
- package/core.mjs +799 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +131 -0
- package/error.d.ts.map +1 -0
- package/error.js +298 -0
- package/error.js.map +1 -0
- package/error.mjs +271 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +210 -0
- package/index.d.ts +210 -0
- package/index.d.ts.map +1 -0
- package/index.js +153 -0
- package/index.js.map +1 -0
- package/index.mjs +125 -0
- package/index.mjs.map +1 -0
- package/package.json +90 -27
- package/pagination.d.ts +31 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +34 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +30 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +12 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +17 -0
- package/resource.js.map +1 -0
- package/resource.mjs +13 -0
- package/resource.mjs.map +1 -0
- package/resources/coupons/coupons.d.ts +114 -0
- package/resources/coupons/coupons.d.ts.map +1 -0
- package/resources/coupons/coupons.js +76 -0
- package/resources/coupons/coupons.js.map +1 -0
- package/resources/coupons/coupons.mjs +48 -0
- package/resources/coupons/coupons.mjs.map +1 -0
- package/resources/coupons/index.d.ts +3 -0
- package/resources/coupons/index.d.ts.map +1 -0
- package/resources/coupons/index.js +10 -0
- package/resources/coupons/index.js.map +1 -0
- package/resources/coupons/index.mjs +4 -0
- package/resources/coupons/index.mjs.map +1 -0
- package/resources/coupons/subscriptions.d.ts +23 -0
- package/resources/coupons/subscriptions.d.ts.map +1 -0
- package/resources/coupons/subscriptions.js +20 -0
- package/resources/coupons/subscriptions.js.map +1 -0
- package/resources/coupons/subscriptions.mjs +16 -0
- package/resources/coupons/subscriptions.mjs.map +1 -0
- package/resources/credit-notes.d.ts +136 -0
- package/resources/credit-notes.d.ts.map +1 -0
- package/resources/credit-notes.js +54 -0
- package/resources/credit-notes.js.map +1 -0
- package/resources/credit-notes.mjs +26 -0
- package/resources/credit-notes.mjs.map +1 -0
- package/resources/customers/balance-transactions.d.ts +159 -0
- package/resources/customers/balance-transactions.d.ts.map +1 -0
- package/resources/customers/balance-transactions.js +54 -0
- package/resources/customers/balance-transactions.js.map +1 -0
- package/resources/customers/balance-transactions.mjs +26 -0
- package/resources/customers/balance-transactions.mjs.map +1 -0
- package/resources/customers/costs.d.ts +915 -0
- package/resources/customers/costs.d.ts.map +1 -0
- package/resources/customers/costs.js +24 -0
- package/resources/customers/costs.js.map +1 -0
- package/resources/customers/costs.mjs +20 -0
- package/resources/customers/costs.mjs.map +1 -0
- package/resources/customers/credits/credits.d.ts +58 -0
- package/resources/customers/credits/credits.d.ts.map +1 -0
- package/resources/customers/credits/credits.js +68 -0
- package/resources/customers/credits/credits.js.map +1 -0
- package/resources/customers/credits/credits.mjs +39 -0
- package/resources/customers/credits/credits.mjs.map +1 -0
- package/resources/customers/credits/index.d.ts +3 -0
- package/resources/customers/credits/index.d.ts.map +1 -0
- package/resources/customers/credits/index.js +13 -0
- package/resources/customers/credits/index.js.map +1 -0
- package/resources/customers/credits/index.mjs +4 -0
- package/resources/customers/credits/index.mjs.map +1 -0
- package/resources/customers/credits/ledger.d.ts +1537 -0
- package/resources/customers/credits/ledger.d.ts.map +1 -0
- package/resources/customers/credits/ledger.js +291 -0
- package/resources/customers/credits/ledger.js.map +1 -0
- package/resources/customers/credits/ledger.mjs +262 -0
- package/resources/customers/credits/ledger.mjs.map +1 -0
- package/resources/customers/customers.d.ts +524 -0
- package/resources/customers/customers.d.ts.map +1 -0
- package/resources/customers/customers.js +135 -0
- package/resources/customers/customers.js.map +1 -0
- package/resources/customers/customers.mjs +107 -0
- package/resources/customers/customers.mjs.map +1 -0
- package/resources/customers/index.d.ts +6 -0
- package/resources/customers/index.d.ts.map +1 -0
- package/resources/customers/index.js +19 -0
- package/resources/customers/index.js.map +1 -0
- package/resources/customers/index.mjs +7 -0
- package/resources/customers/index.mjs.map +1 -0
- package/resources/customers/usage.d.ts +306 -0
- package/resources/customers/usage.d.ts.map +1 -0
- package/resources/customers/usage.js +223 -0
- package/resources/customers/usage.js.map +1 -0
- package/resources/customers/usage.mjs +219 -0
- package/resources/customers/usage.mjs.map +1 -0
- package/resources/events/backfills.d.ts +250 -0
- package/resources/events/backfills.d.ts.map +1 -0
- package/resources/events/backfills.js +104 -0
- package/resources/events/backfills.js.map +1 -0
- package/resources/events/backfills.mjs +76 -0
- package/resources/events/backfills.mjs.map +1 -0
- package/resources/events/events.d.ts +547 -0
- package/resources/events/events.d.ts.map +1 -0
- package/resources/events/events.js +354 -0
- package/resources/events/events.js.map +1 -0
- package/resources/events/events.mjs +327 -0
- package/resources/events/events.mjs.map +1 -0
- package/resources/events/index.d.ts +3 -0
- package/resources/events/index.d.ts.map +1 -0
- package/resources/events/index.js +10 -0
- package/resources/events/index.js.map +1 -0
- package/resources/events/index.mjs +4 -0
- package/resources/events/index.mjs.map +1 -0
- package/resources/index.d.ts +13 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +39 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +14 -0
- package/resources/index.mjs.map +1 -0
- package/resources/invoice-line-items.d.ts +434 -0
- package/resources/invoice-line-items.d.ts.map +1 -0
- package/resources/invoice-line-items.js +18 -0
- package/resources/invoice-line-items.js.map +1 -0
- package/resources/invoice-line-items.mjs +14 -0
- package/resources/invoice-line-items.mjs.map +1 -0
- package/resources/invoices.d.ts +1541 -0
- package/resources/invoices.d.ts.map +1 -0
- package/resources/invoices.js +96 -0
- package/resources/invoices.js.map +1 -0
- package/resources/invoices.mjs +68 -0
- package/resources/invoices.mjs.map +1 -0
- package/resources/items.d.ts +61 -0
- package/resources/items.d.ts.map +1 -0
- package/resources/items.js +53 -0
- package/resources/items.js.map +1 -0
- package/resources/items.mjs +25 -0
- package/resources/items.mjs.map +1 -0
- package/resources/metrics.d.ts +176 -0
- package/resources/metrics.d.ts.map +1 -0
- package/resources/metrics.js +63 -0
- package/resources/metrics.js.map +1 -0
- package/resources/metrics.mjs +35 -0
- package/resources/metrics.mjs.map +1 -0
- package/resources/plans/external-plan-id.d.ts +50 -0
- package/resources/plans/external-plan-id.d.ts.map +1 -0
- package/resources/plans/external-plan-id.js +35 -0
- package/resources/plans/external-plan-id.js.map +1 -0
- package/resources/plans/external-plan-id.mjs +31 -0
- package/resources/plans/external-plan-id.mjs.map +1 -0
- package/resources/plans/index.d.ts +3 -0
- package/resources/plans/index.d.ts.map +1 -0
- package/resources/plans/index.js +10 -0
- package/resources/plans/index.js.map +1 -0
- package/resources/plans/index.mjs +4 -0
- package/resources/plans/index.mjs.map +1 -0
- package/resources/plans/plans.d.ts +256 -0
- package/resources/plans/plans.d.ts.map +1 -0
- package/resources/plans/plans.js +87 -0
- package/resources/plans/plans.js.map +1 -0
- package/resources/plans/plans.mjs +59 -0
- package/resources/plans/plans.mjs.map +1 -0
- package/resources/prices/external-price-id.d.ts +12 -0
- package/resources/prices/external-price-id.d.ts.map +1 -0
- package/resources/prices/external-price-id.js +17 -0
- package/resources/prices/external-price-id.js.map +1 -0
- package/resources/prices/external-price-id.mjs +13 -0
- package/resources/prices/external-price-id.mjs.map +1 -0
- package/resources/prices/index.d.ts +3 -0
- package/resources/prices/index.d.ts.map +1 -0
- package/resources/prices/index.js +10 -0
- package/resources/prices/index.js.map +1 -0
- package/resources/prices/index.mjs +4 -0
- package/resources/prices/index.mjs.map +1 -0
- package/resources/prices/prices.d.ts +1872 -0
- package/resources/prices/prices.d.ts.map +1 -0
- package/resources/prices/prices.js +74 -0
- package/resources/prices/prices.js.map +1 -0
- package/resources/prices/prices.mjs +46 -0
- package/resources/prices/prices.mjs.map +1 -0
- package/resources/subscriptions.d.ts +3752 -0
- package/resources/subscriptions.d.ts.map +1 -0
- package/resources/subscriptions.js +254 -0
- package/resources/subscriptions.js.map +1 -0
- package/resources/subscriptions.mjs +225 -0
- package/resources/subscriptions.mjs.map +1 -0
- package/resources/top-level.d.ts +21 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +22 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +18 -0
- package/resources/top-level.mjs.map +1 -0
- package/shims/node.d.ts +29 -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 +83 -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 +1099 -0
- package/src/error.ts +469 -0
- package/src/index.ts +305 -0
- package/src/pagination.ts +63 -0
- package/src/resource.ts +24 -0
- package/src/resources/coupons/coupons.ts +150 -0
- package/src/resources/coupons/index.ts +4 -0
- package/src/resources/coupons/subscriptions.ts +45 -0
- package/src/resources/credit-notes.ts +184 -0
- package/src/resources/customers/balance-transactions.ts +222 -0
- package/src/resources/customers/costs.ts +991 -0
- package/src/resources/customers/credits/credits.ts +113 -0
- package/src/resources/customers/credits/index.ts +24 -0
- package/src/resources/customers/credits/ledger.ts +2254 -0
- package/src/resources/customers/customers.ts +734 -0
- package/src/resources/customers/index.ts +42 -0
- package/src/resources/customers/usage.ts +350 -0
- package/src/resources/events/backfills.ts +324 -0
- package/src/resources/events/events.ts +635 -0
- package/src/resources/events/index.ts +23 -0
- package/src/resources/index.ts +72 -0
- package/src/resources/invoice-line-items.ts +502 -0
- package/src/resources/invoices.ts +1906 -0
- package/src/resources/items.ts +106 -0
- package/src/resources/metrics.ts +264 -0
- package/src/resources/plans/external-plan-id.ts +73 -0
- package/src/resources/plans/index.ts +4 -0
- package/src/resources/plans/plans.ts +350 -0
- package/src/resources/prices/external-price-id.ts +16 -0
- package/src/resources/prices/index.ts +4 -0
- package/src/resources/prices/prices.ts +2466 -0
- package/src/resources/subscriptions.ts +4590 -0
- package/src/resources/top-level.ts +27 -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 +246 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +162 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +149 -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/LICENSE.md +0 -21
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -20
- package/dist/internal/utils/contenttype.d.ts +0 -1
- package/dist/internal/utils/contenttype.js +0 -33
- package/dist/internal/utils/headers.d.ts +0 -4
- package/dist/internal/utils/headers.js +0 -92
- package/dist/internal/utils/index.d.ts +0 -8
- package/dist/internal/utils/index.js +0 -27
- package/dist/internal/utils/pathparams.d.ts +0 -2
- package/dist/internal/utils/pathparams.js +0 -53
- package/dist/internal/utils/queryparams.d.ts +0 -2
- package/dist/internal/utils/queryparams.js +0 -178
- package/dist/internal/utils/requestbody.d.ts +0 -2
- package/dist/internal/utils/requestbody.js +0 -318
- package/dist/internal/utils/retries.d.ts +0 -20
- package/dist/internal/utils/retries.js +0 -250
- package/dist/internal/utils/security.d.ts +0 -5
- package/dist/internal/utils/security.js +0 -188
- package/dist/internal/utils/utils.d.ts +0 -37
- package/dist/internal/utils/utils.js +0 -370
- package/dist/sdk/availability.d.ts +0 -18
- package/dist/sdk/availability.js +0 -186
- package/dist/sdk/coupon.d.ts +0 -62
- package/dist/sdk/coupon.js +0 -629
- package/dist/sdk/credit.d.ts +0 -348
- package/dist/sdk/credit.js +0 -1020
- package/dist/sdk/creditnote.d.ts +0 -29
- package/dist/sdk/creditnote.js +0 -293
- package/dist/sdk/customer.d.ts +0 -529
- package/dist/sdk/customer.js +0 -1882
- package/dist/sdk/event.d.ts +0 -353
- package/dist/sdk/event.js +0 -1314
- package/dist/sdk/index.d.ts +0 -1
- package/dist/sdk/index.js +0 -20
- package/dist/sdk/invoice.d.ts +0 -89
- package/dist/sdk/invoice.js +0 -945
- package/dist/sdk/item.d.ts +0 -27
- package/dist/sdk/item.js +0 -291
- package/dist/sdk/metric.d.ts +0 -39
- package/dist/sdk/metric.js +0 -418
- package/dist/sdk/models/errors/fivehundrederror.d.ts +0 -11
- package/dist/sdk/models/errors/fivehundrederror.js +0 -88
- package/dist/sdk/models/errors/fourhundredandoneerror.d.ts +0 -11
- package/dist/sdk/models/errors/fourhundredandoneerror.js +0 -88
- package/dist/sdk/models/errors/fourhundredandtwentynineerror.d.ts +0 -11
- package/dist/sdk/models/errors/fourhundredandtwentynineerror.js +0 -88
- package/dist/sdk/models/errors/index.d.ts +0 -4
- package/dist/sdk/models/errors/index.js +0 -23
- package/dist/sdk/models/errors/sdkerror.d.ts +0 -7
- package/dist/sdk/models/errors/sdkerror.js +0 -40
- package/dist/sdk/models/operations/addeditpriceintervals.d.ts +0 -25
- package/dist/sdk/models/operations/addeditpriceintervals.js +0 -95
- package/dist/sdk/models/operations/amendevent.d.ts +0 -25
- package/dist/sdk/models/operations/amendevent.js +0 -95
- package/dist/sdk/models/operations/amendusage.d.ts +0 -27
- package/dist/sdk/models/operations/amendusage.js +0 -103
- package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +0 -27
- package/dist/sdk/models/operations/amendusageexternalcustomerid.js +0 -103
- package/dist/sdk/models/operations/archivecoupon.d.ts +0 -24
- package/dist/sdk/models/operations/archivecoupon.js +0 -91
- package/dist/sdk/models/operations/cancelsubscription.d.ts +0 -25
- package/dist/sdk/models/operations/cancelsubscription.js +0 -95
- package/dist/sdk/models/operations/closebackfill.d.ts +0 -24
- package/dist/sdk/models/operations/closebackfill.js +0 -91
- package/dist/sdk/models/operations/createbackfill.d.ts +0 -21
- package/dist/sdk/models/operations/createbackfill.js +0 -79
- package/dist/sdk/models/operations/createcoupon.d.ts +0 -21
- package/dist/sdk/models/operations/createcoupon.js +0 -79
- package/dist/sdk/models/operations/createcustomer.d.ts +0 -21
- package/dist/sdk/models/operations/createcustomer.js +0 -79
- package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +0 -25
- package/dist/sdk/models/operations/createcustomerbalancetransaction.js +0 -95
- package/dist/sdk/models/operations/createinvoice.d.ts +0 -21
- package/dist/sdk/models/operations/createinvoice.js +0 -79
- package/dist/sdk/models/operations/createinvoicelineitem.d.ts +0 -21
- package/dist/sdk/models/operations/createinvoicelineitem.js +0 -79
- package/dist/sdk/models/operations/createledgerentry.d.ts +0 -24
- package/dist/sdk/models/operations/createledgerentry.js +0 -71
- package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +0 -24
- package/dist/sdk/models/operations/createledgerentryexternalid.js +0 -71
- package/dist/sdk/models/operations/createmetric.d.ts +0 -21
- package/dist/sdk/models/operations/createmetric.js +0 -79
- package/dist/sdk/models/operations/createplan.d.ts +0 -21
- package/dist/sdk/models/operations/createplan.js +0 -79
- package/dist/sdk/models/operations/createprice.d.ts +0 -20
- package/dist/sdk/models/operations/createprice.js +0 -55
- package/dist/sdk/models/operations/createsubscription.d.ts +0 -21
- package/dist/sdk/models/operations/createsubscription.js +0 -79
- package/dist/sdk/models/operations/deletecustomer.d.ts +0 -24
- package/dist/sdk/models/operations/deletecustomer.js +0 -91
- package/dist/sdk/models/operations/deprecateevent.d.ts +0 -24
- package/dist/sdk/models/operations/deprecateevent.js +0 -91
- package/dist/sdk/models/operations/fetchbackfill.d.ts +0 -24
- package/dist/sdk/models/operations/fetchbackfill.js +0 -91
- package/dist/sdk/models/operations/fetchcoupon.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcoupon.js +0 -91
- package/dist/sdk/models/operations/fetchcreditnote.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcreditnote.js +0 -91
- package/dist/sdk/models/operations/fetchcustomer.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcustomer.js +0 -91
- package/dist/sdk/models/operations/fetchcustomercosts.d.ts +0 -38
- package/dist/sdk/models/operations/fetchcustomercosts.js +0 -115
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +0 -38
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +0 -115
- package/dist/sdk/models/operations/fetchcustomercredits.d.ts +0 -26
- package/dist/sdk/models/operations/fetchcustomercredits.js +0 -99
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +0 -26
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +0 -99
- package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +0 -47
- package/dist/sdk/models/operations/fetchcustomercreditsledger.js +0 -146
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +0 -47
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +0 -146
- package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +0 -24
- package/dist/sdk/models/operations/fetchcustomerexternalid.js +0 -91
- package/dist/sdk/models/operations/fetchinvoice.d.ts +0 -24
- package/dist/sdk/models/operations/fetchinvoice.js +0 -91
- package/dist/sdk/models/operations/fetchitem.d.ts +0 -24
- package/dist/sdk/models/operations/fetchitem.js +0 -91
- package/dist/sdk/models/operations/fetchmetric.d.ts +0 -24
- package/dist/sdk/models/operations/fetchmetric.js +0 -91
- package/dist/sdk/models/operations/fetchplan.d.ts +0 -24
- package/dist/sdk/models/operations/fetchplan.js +0 -91
- package/dist/sdk/models/operations/fetchplanexternalid.d.ts +0 -24
- package/dist/sdk/models/operations/fetchplanexternalid.js +0 -91
- package/dist/sdk/models/operations/fetchprice.d.ts +0 -23
- package/dist/sdk/models/operations/fetchprice.js +0 -67
- package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +0 -23
- package/dist/sdk/models/operations/fetchpriceexternalid.js +0 -67
- package/dist/sdk/models/operations/fetchsubscription.d.ts +0 -24
- package/dist/sdk/models/operations/fetchsubscription.js +0 -91
- package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +0 -38
- package/dist/sdk/models/operations/fetchsubscriptioncosts.js +0 -115
- package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +0 -30
- package/dist/sdk/models/operations/fetchsubscriptionschedule.js +0 -115
- package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +0 -54
- package/dist/sdk/models/operations/fetchsubscriptionusage.js +0 -130
- package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +0 -24
- package/dist/sdk/models/operations/fetchupcominginvoice.js +0 -91
- package/dist/sdk/models/operations/index.d.ts +0 -73
- package/dist/sdk/models/operations/index.js +0 -92
- package/dist/sdk/models/operations/ingest.d.ts +0 -26
- package/dist/sdk/models/operations/ingest.js +0 -99
- package/dist/sdk/models/operations/issueinvoice.d.ts +0 -24
- package/dist/sdk/models/operations/issueinvoice.js +0 -91
- package/dist/sdk/models/operations/listbackfills.d.ts +0 -25
- package/dist/sdk/models/operations/listbackfills.js +0 -95
- package/dist/sdk/models/operations/listbalancetransactions.d.ts +0 -30
- package/dist/sdk/models/operations/listbalancetransactions.js +0 -115
- package/dist/sdk/models/operations/listcoupons.d.ts +0 -27
- package/dist/sdk/models/operations/listcoupons.js +0 -103
- package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +0 -26
- package/dist/sdk/models/operations/listcouponsubscriptions.js +0 -99
- package/dist/sdk/models/operations/listcreditnotes.d.ts +0 -25
- package/dist/sdk/models/operations/listcreditnotes.js +0 -95
- package/dist/sdk/models/operations/listcustomers.d.ts +0 -29
- package/dist/sdk/models/operations/listcustomers.js +0 -111
- package/dist/sdk/models/operations/listinvoices.d.ts +0 -62
- package/dist/sdk/models/operations/listinvoices.js +0 -189
- package/dist/sdk/models/operations/listitems.d.ts +0 -25
- package/dist/sdk/models/operations/listitems.js +0 -95
- package/dist/sdk/models/operations/listmetrics.d.ts +0 -29
- package/dist/sdk/models/operations/listmetrics.js +0 -111
- package/dist/sdk/models/operations/listplans.d.ts +0 -41
- package/dist/sdk/models/operations/listplans.js +0 -124
- package/dist/sdk/models/operations/listprices.d.ts +0 -25
- package/dist/sdk/models/operations/listprices.js +0 -95
- package/dist/sdk/models/operations/listsubscriptions.d.ts +0 -37
- package/dist/sdk/models/operations/listsubscriptions.js +0 -129
- package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +0 -25
- package/dist/sdk/models/operations/markinvoiceaspaid.js +0 -95
- package/dist/sdk/models/operations/ping.d.ts +0 -21
- package/dist/sdk/models/operations/ping.js +0 -79
- package/dist/sdk/models/operations/revertbackfill.d.ts +0 -24
- package/dist/sdk/models/operations/revertbackfill.js +0 -91
- package/dist/sdk/models/operations/scheduleplanchange.d.ts +0 -25
- package/dist/sdk/models/operations/scheduleplanchange.js +0 -95
- package/dist/sdk/models/operations/searchevents.d.ts +0 -30
- package/dist/sdk/models/operations/searchevents.js +0 -115
- package/dist/sdk/models/operations/triggerphase.d.ts +0 -25
- package/dist/sdk/models/operations/triggerphase.js +0 -95
- package/dist/sdk/models/operations/unschedulecancellation.d.ts +0 -24
- package/dist/sdk/models/operations/unschedulecancellation.js +0 -91
- package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +0 -25
- package/dist/sdk/models/operations/unschedulefixedfeequantity.js +0 -95
- package/dist/sdk/models/operations/unscheduleplanchange.d.ts +0 -24
- package/dist/sdk/models/operations/unscheduleplanchange.js +0 -91
- package/dist/sdk/models/operations/updatecustomer.d.ts +0 -25
- package/dist/sdk/models/operations/updatecustomer.js +0 -95
- package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +0 -25
- package/dist/sdk/models/operations/updatecustomerexternalid.js +0 -95
- package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +0 -25
- package/dist/sdk/models/operations/updatefixedfeequantity.js +0 -95
- package/dist/sdk/models/operations/updateplan.d.ts +0 -25
- package/dist/sdk/models/operations/updateplan.js +0 -95
- package/dist/sdk/models/operations/updateplanexternal.d.ts +0 -25
- package/dist/sdk/models/operations/updateplanexternal.js +0 -95
- package/dist/sdk/models/operations/voidinvoice.d.ts +0 -24
- package/dist/sdk/models/operations/voidinvoice.js +0 -91
- package/dist/sdk/models/shared/accountingprovider.d.ts +0 -9
- package/dist/sdk/models/shared/accountingprovider.js +0 -55
- package/dist/sdk/models/shared/accountingproviderconfig.d.ts +0 -5
- package/dist/sdk/models/shared/accountingproviderconfig.js +0 -50
- package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +0 -6
- package/dist/sdk/models/shared/accountingsyncconfiguration.js +0 -52
- package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +0 -13
- package/dist/sdk/models/shared/addeditpriceintervalparams.js +0 -54
- package/dist/sdk/models/shared/addpriceintervalparams.d.ts +0 -40
- package/dist/sdk/models/shared/addpriceintervalparams.js +0 -87
- package/dist/sdk/models/shared/address.d.ts +0 -9
- package/dist/sdk/models/shared/address.js +0 -70
- package/dist/sdk/models/shared/addressinput.d.ts +0 -9
- package/dist/sdk/models/shared/addressinput.js +0 -70
- package/dist/sdk/models/shared/aggregatedcost.d.ts +0 -15
- package/dist/sdk/models/shared/aggregatedcost.js +0 -75
- package/dist/sdk/models/shared/amendedevent.d.ts +0 -28
- package/dist/sdk/models/shared/amendedevent.js +0 -81
- package/dist/sdk/models/shared/amendedusage.d.ts +0 -11
- package/dist/sdk/models/shared/amendedusage.js +0 -50
- package/dist/sdk/models/shared/amendeventresult.d.ts +0 -7
- package/dist/sdk/models/shared/amendeventresult.js +0 -45
- package/dist/sdk/models/shared/autocollection.d.ts +0 -15
- package/dist/sdk/models/shared/autocollection.js +0 -63
- package/dist/sdk/models/shared/backfill.d.ts +0 -27
- package/dist/sdk/models/shared/backfill.js +0 -104
- package/dist/sdk/models/shared/backfills.d.ts +0 -7
- package/dist/sdk/models/shared/backfills.js +0 -54
- package/dist/sdk/models/shared/backfillstatus.d.ts +0 -9
- package/dist/sdk/models/shared/backfillstatus.js +0 -16
- package/dist/sdk/models/shared/billablemetric.d.ts +0 -27
- package/dist/sdk/models/shared/billablemetric.js +0 -84
- package/dist/sdk/models/shared/billablemetrics.d.ts +0 -7
- package/dist/sdk/models/shared/billablemetrics.js +0 -54
- package/dist/sdk/models/shared/billingcyclealignment.d.ts +0 -8
- package/dist/sdk/models/shared/billingcyclealignment.js +0 -15
- package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +0 -19
- package/dist/sdk/models/shared/cancelsubscriptionparams.js +0 -63
- package/dist/sdk/models/shared/changeoption.d.ts +0 -5
- package/dist/sdk/models/shared/changeoption.js +0 -12
- package/dist/sdk/models/shared/coupon.d.ts +0 -40
- package/dist/sdk/models/shared/coupon.js +0 -98
- package/dist/sdk/models/shared/couponredemption.d.ts +0 -6
- package/dist/sdk/models/shared/couponredemption.js +0 -63
- package/dist/sdk/models/shared/coupons.d.ts +0 -7
- package/dist/sdk/models/shared/coupons.js +0 -54
- package/dist/sdk/models/shared/createinvoicelineitemparams.d.ts +0 -28
- package/dist/sdk/models/shared/createinvoicelineitemparams.js +0 -81
- package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +0 -33
- package/dist/sdk/models/shared/createoneoffinvoiceparams.js +0 -86
- package/dist/sdk/models/shared/creditledgerentries.d.ts +0 -6
- package/dist/sdk/models/shared/creditledgerentries.js +0 -52
- package/dist/sdk/models/shared/creditnote.d.ts +0 -83
- package/dist/sdk/models/shared/creditnote.js +0 -171
- package/dist/sdk/models/shared/creditnotelineitem.d.ts +0 -40
- package/dist/sdk/models/shared/creditnotelineitem.js +0 -100
- package/dist/sdk/models/shared/creditnoteminified.d.ts +0 -7
- package/dist/sdk/models/shared/creditnoteminified.js +0 -45
- package/dist/sdk/models/shared/creditnotes.d.ts +0 -7
- package/dist/sdk/models/shared/creditnotes.js +0 -54
- package/dist/sdk/models/shared/creditnotesublineitem.d.ts +0 -6
- package/dist/sdk/models/shared/creditnotesublineitem.js +0 -55
- package/dist/sdk/models/shared/creditnotesummary.d.ts +0 -12
- package/dist/sdk/models/shared/creditnotesummary.js +0 -74
- package/dist/sdk/models/shared/customer.d.ts +0 -76
- package/dist/sdk/models/shared/customer.js +0 -182
- package/dist/sdk/models/shared/customerbalancetransaction.d.ts +0 -42
- package/dist/sdk/models/shared/customerbalancetransaction.js +0 -109
- package/dist/sdk/models/shared/customerbalancetransactions.d.ts +0 -7
- package/dist/sdk/models/shared/customerbalancetransactions.js +0 -54
- package/dist/sdk/models/shared/customercosts.d.ts +0 -5
- package/dist/sdk/models/shared/customercosts.js +0 -47
- package/dist/sdk/models/shared/customercreditbalance.d.ts +0 -7
- package/dist/sdk/models/shared/customercreditbalance.js +0 -64
- package/dist/sdk/models/shared/customercreditbalances.d.ts +0 -7
- package/dist/sdk/models/shared/customercreditbalances.js +0 -54
- package/dist/sdk/models/shared/customerminified.d.ts +0 -5
- package/dist/sdk/models/shared/customerminified.js +0 -50
- package/dist/sdk/models/shared/customers.d.ts +0 -7
- package/dist/sdk/models/shared/customers.js +0 -54
- package/dist/sdk/models/shared/customertaxid.d.ts +0 -6
- package/dist/sdk/models/shared/customertaxid.js +0 -55
- package/dist/sdk/models/shared/debug.d.ts +0 -8
- package/dist/sdk/models/shared/debug.js +0 -53
- package/dist/sdk/models/shared/deletecustomerresponse.d.ts +0 -3
- package/dist/sdk/models/shared/deletecustomerresponse.js +0 -30
- package/dist/sdk/models/shared/deprecatedeventresult.d.ts +0 -7
- package/dist/sdk/models/shared/deprecatedeventresult.js +0 -45
- package/dist/sdk/models/shared/discount.d.ts +0 -33
- package/dist/sdk/models/shared/discount.js +0 -80
- package/dist/sdk/models/shared/editcustomer.d.ts +0 -72
- package/dist/sdk/models/shared/editcustomer.js +0 -151
- package/dist/sdk/models/shared/editplan.d.ts +0 -10
- package/dist/sdk/models/shared/editplan.js +0 -59
- package/dist/sdk/models/shared/editpriceintervalparams.d.ts +0 -20
- package/dist/sdk/models/shared/editpriceintervalparams.js +0 -62
- package/dist/sdk/models/shared/event.d.ts +0 -39
- package/dist/sdk/models/shared/event.js +0 -93
- package/dist/sdk/models/shared/events.d.ts +0 -7
- package/dist/sdk/models/shared/events.js +0 -54
- package/dist/sdk/models/shared/eventsearchcriteria.d.ts +0 -11
- package/dist/sdk/models/shared/eventsearchcriteria.js +0 -50
- package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +0 -25
- package/dist/sdk/models/shared/fixedfeequantitychange.js +0 -75
- package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +0 -7
- package/dist/sdk/models/shared/fixedfeequantityscheduleentry.js +0 -68
- package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +0 -6
- package/dist/sdk/models/shared/fixedfeequantitytransition.js +0 -59
- package/dist/sdk/models/shared/index.d.ts +0 -109
- package/dist/sdk/models/shared/index.js +0 -128
- package/dist/sdk/models/shared/ingestevent.d.ts +0 -32
- package/dist/sdk/models/shared/ingestevent.js +0 -86
- package/dist/sdk/models/shared/ingestionresponse.d.ts +0 -13
- package/dist/sdk/models/shared/ingestionresponse.js +0 -54
- package/dist/sdk/models/shared/ingestrequestbody.d.ts +0 -5
- package/dist/sdk/models/shared/ingestrequestbody.js +0 -47
- package/dist/sdk/models/shared/invoice.d.ts +0 -138
- package/dist/sdk/models/shared/invoice.js +0 -329
- package/dist/sdk/models/shared/invoicelineitem.d.ts +0 -49
- package/dist/sdk/models/shared/invoicelineitem.js +0 -134
- package/dist/sdk/models/shared/invoicelineitemparams.d.ts +0 -26
- package/dist/sdk/models/shared/invoicelineitemparams.js +0 -90
- package/dist/sdk/models/shared/invoiceminified.d.ts +0 -7
- package/dist/sdk/models/shared/invoiceminified.js +0 -45
- package/dist/sdk/models/shared/invoices.d.ts +0 -7
- package/dist/sdk/models/shared/invoices.js +0 -54
- package/dist/sdk/models/shared/item.d.ts +0 -14
- package/dist/sdk/models/shared/item.js +0 -72
- package/dist/sdk/models/shared/itemexternalconnection.d.ts +0 -5
- package/dist/sdk/models/shared/itemexternalconnection.js +0 -50
- package/dist/sdk/models/shared/items.d.ts +0 -7
- package/dist/sdk/models/shared/items.js +0 -54
- package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +0 -16
- package/dist/sdk/models/shared/markaspaidrequestparams.js +0 -61
- package/dist/sdk/models/shared/maximum.d.ts +0 -11
- package/dist/sdk/models/shared/maximum.js +0 -50
- package/dist/sdk/models/shared/maximuminterval.d.ts +0 -23
- package/dist/sdk/models/shared/maximuminterval.js +0 -73
- package/dist/sdk/models/shared/minimum.d.ts +0 -11
- package/dist/sdk/models/shared/minimum.js +0 -50
- package/dist/sdk/models/shared/minimuminterval.d.ts +0 -23
- package/dist/sdk/models/shared/minimuminterval.js +0 -73
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +0 -6
- package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +0 -52
- package/dist/sdk/models/shared/newbackfill.d.ts +0 -27
- package/dist/sdk/models/shared/newbackfill.js +0 -82
- package/dist/sdk/models/shared/newbillablemetric.d.ts +0 -28
- package/dist/sdk/models/shared/newbillablemetric.js +0 -77
- package/dist/sdk/models/shared/newcoupon.d.ts +0 -18
- package/dist/sdk/models/shared/newcoupon.js +0 -69
- package/dist/sdk/models/shared/newcustomer.d.ts +0 -68
- package/dist/sdk/models/shared/newcustomer.js +0 -152
- package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +0 -13
- package/dist/sdk/models/shared/newcustomerbalancetransaction.js +0 -60
- package/dist/sdk/models/shared/newplan.d.ts +0 -26
- package/dist/sdk/models/shared/newplan.js +0 -93
- package/dist/sdk/models/shared/newreportingconfiguration.d.ts +0 -4
- package/dist/sdk/models/shared/newreportingconfiguration.js +0 -45
- package/dist/sdk/models/shared/newsubscription.d.ts +0 -54
- package/dist/sdk/models/shared/newsubscription.js +0 -187
- package/dist/sdk/models/shared/paginationmetadata.d.ts +0 -5
- package/dist/sdk/models/shared/paginationmetadata.js +0 -50
- package/dist/sdk/models/shared/perpricecost.d.ts +0 -224
- package/dist/sdk/models/shared/perpricecost.js +0 -67
- package/dist/sdk/models/shared/phaseoverride.d.ts +0 -17
- package/dist/sdk/models/shared/phaseoverride.js +0 -62
- package/dist/sdk/models/shared/pingresponse.d.ts +0 -4
- package/dist/sdk/models/shared/pingresponse.js +0 -45
- package/dist/sdk/models/shared/plan.d.ts +0 -66
- package/dist/sdk/models/shared/plan.js +0 -188
- package/dist/sdk/models/shared/planminified.d.ts +0 -9
- package/dist/sdk/models/shared/planminified.js +0 -55
- package/dist/sdk/models/shared/planphase.d.ts +0 -28
- package/dist/sdk/models/shared/planphase.js +0 -106
- package/dist/sdk/models/shared/plans.d.ts +0 -7
- package/dist/sdk/models/shared/plans.js +0 -54
- package/dist/sdk/models/shared/pricegroup.d.ts +0 -17
- package/dist/sdk/models/shared/pricegroup.js +0 -65
- package/dist/sdk/models/shared/priceinterval.d.ts +0 -239
- package/dist/sdk/models/shared/priceinterval.js +0 -104
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +0 -11
- package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +0 -54
- package/dist/sdk/models/shared/prices.d.ts +0 -6
- package/dist/sdk/models/shared/prices.js +0 -52
- package/dist/sdk/models/shared/product.d.ts +0 -6
- package/dist/sdk/models/shared/product.js +0 -59
- package/dist/sdk/models/shared/reportingconfiguration.d.ts +0 -4
- package/dist/sdk/models/shared/reportingconfiguration.js +0 -45
- package/dist/sdk/models/shared/security.d.ts +0 -4
- package/dist/sdk/models/shared/security.js +0 -45
- package/dist/sdk/models/shared/subscription.d.ts +0 -128
- package/dist/sdk/models/shared/subscription.js +0 -226
- package/dist/sdk/models/shared/subscriptioncosts.d.ts +0 -5
- package/dist/sdk/models/shared/subscriptioncosts.js +0 -47
- package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -4
- package/dist/sdk/models/shared/subscriptionminified.js +0 -45
- package/dist/sdk/models/shared/subscriptionplanchange.d.ts +0 -59
- package/dist/sdk/models/shared/subscriptionplanchange.js +0 -126
- package/dist/sdk/models/shared/subscriptions.d.ts +0 -7
- package/dist/sdk/models/shared/subscriptions.js +0 -54
- package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +0 -7
- package/dist/sdk/models/shared/subscriptionscheduleitem.js +0 -65
- package/dist/sdk/models/shared/subscriptionscheduleitems.d.ts +0 -7
- package/dist/sdk/models/shared/subscriptionscheduleitems.js +0 -54
- package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +0 -4
- package/dist/sdk/models/shared/subscriptiontrialinfo.js +0 -49
- package/dist/sdk/models/shared/taxamount.d.ts +0 -15
- package/dist/sdk/models/shared/taxamount.js +0 -55
- package/dist/sdk/models/shared/trialconfig.d.ts +0 -8
- package/dist/sdk/models/shared/trialconfig.js +0 -54
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +0 -8
- package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +0 -51
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +0 -7
- package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +0 -45
- package/dist/sdk/models/shared/upcominginvoice.d.ts +0 -130
- package/dist/sdk/models/shared/upcominginvoice.js +0 -321
- package/dist/sdk/models/shared/updateevent.d.ts +0 -28
- package/dist/sdk/models/shared/updateevent.js +0 -81
- package/dist/sdk/models/shared/validationerror.d.ts +0 -11
- package/dist/sdk/models/shared/validationerror.js +0 -50
- package/dist/sdk/plan.d.ts +0 -90
- package/dist/sdk/plan.js +0 -764
- package/dist/sdk/price.d.ts +0 -246
- package/dist/sdk/price.js +0 -715
- package/dist/sdk/priceinterval.d.ts +0 -66
- package/dist/sdk/priceinterval.js +0 -263
- package/dist/sdk/sdk.d.ts +0 -389
- package/dist/sdk/sdk.js +0 -93
- package/dist/sdk/subscription.d.ts +0 -769
- package/dist/sdk/subscription.js +0 -2116
- package/dist/sdk/types/index.d.ts +0 -1
- package/dist/sdk/types/index.js +0 -20
- package/dist/sdk/types/rfcdate.d.ts +0 -9
- package/dist/sdk/types/rfcdate.js +0 -59
- package/docs/models/errors/fivehundrederror.md +0 -12
- package/docs/models/errors/fivehundrederrorheaders.md +0 -7
- package/docs/models/errors/fourhundredandoneerror.md +0 -12
- package/docs/models/errors/fourhundredandoneerrorheaders.md +0 -7
- package/docs/models/errors/fourhundredandtwentynineerror.md +0 -12
- package/docs/models/errors/fourhundredandtwentynineerrorheaders.md +0 -7
- package/docs/models/operations/addeditpriceintervalsrequest.md +0 -9
- package/docs/models/operations/addeditpriceintervalsresponse.md +0 -11
- package/docs/models/operations/amendeventrequest.md +0 -9
- package/docs/models/operations/amendeventresponse.md +0 -11
- package/docs/models/operations/amendusageexternalcustomeridrequest.md +0 -11
- package/docs/models/operations/amendusageexternalcustomeridresponse.md +0 -11
- package/docs/models/operations/amendusagerequest.md +0 -11
- package/docs/models/operations/amendusageresponse.md +0 -11
- package/docs/models/operations/archivecouponrequest.md +0 -8
- package/docs/models/operations/archivecouponresponse.md +0 -11
- package/docs/models/operations/cancelsubscriptionrequest.md +0 -9
- package/docs/models/operations/cancelsubscriptionresponse.md +0 -11
- package/docs/models/operations/closebackfillrequest.md +0 -8
- package/docs/models/operations/closebackfillresponse.md +0 -11
- package/docs/models/operations/createbackfillresponse.md +0 -11
- package/docs/models/operations/createcouponresponse.md +0 -11
- package/docs/models/operations/createcustomerbalancetransactionrequest.md +0 -9
- package/docs/models/operations/createcustomerbalancetransactionresponse.md +0 -11
- package/docs/models/operations/createcustomerresponse.md +0 -11
- package/docs/models/operations/createinvoicelineitemresponse.md +0 -11
- package/docs/models/operations/createinvoiceresponse.md +0 -11
- package/docs/models/operations/createledgerentryexternalidrequest.md +0 -9
- package/docs/models/operations/createledgerentryexternalidresponse.md +0 -11
- package/docs/models/operations/createledgerentryrequest.md +0 -9
- package/docs/models/operations/createledgerentryresponse.md +0 -11
- package/docs/models/operations/createmetricresponse.md +0 -11
- package/docs/models/operations/createplanresponse.md +0 -11
- package/docs/models/operations/createpriceresponse.md +0 -11
- package/docs/models/operations/createsubscriptionresponse.md +0 -11
- package/docs/models/operations/deletecustomerrequest.md +0 -8
- package/docs/models/operations/deletecustomerresponse.md +0 -11
- package/docs/models/operations/deprecateeventrequest.md +0 -8
- package/docs/models/operations/deprecateeventresponse.md +0 -11
- package/docs/models/operations/fetchbackfillrequest.md +0 -8
- package/docs/models/operations/fetchbackfillresponse.md +0 -11
- package/docs/models/operations/fetchcouponrequest.md +0 -8
- package/docs/models/operations/fetchcouponresponse.md +0 -11
- package/docs/models/operations/fetchcreditnoterequest.md +0 -8
- package/docs/models/operations/fetchcreditnoteresponse.md +0 -11
- package/docs/models/operations/fetchcustomercostsexternalidrequest.md +0 -12
- package/docs/models/operations/fetchcustomercostsexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchcustomercostsrequest.md +0 -12
- package/docs/models/operations/fetchcustomercostsresponse.md +0 -11
- package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +0 -10
- package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +0 -9
- package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +0 -14
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +0 -9
- package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +0 -14
- package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +0 -18
- package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomercreditsledgerrequest.md +0 -18
- package/docs/models/operations/fetchcustomercreditsledgerresponse.md +0 -11
- package/docs/models/operations/fetchcustomercreditsrequest.md +0 -10
- package/docs/models/operations/fetchcustomercreditsresponse.md +0 -11
- package/docs/models/operations/fetchcustomerexternalidrequest.md +0 -8
- package/docs/models/operations/fetchcustomerexternalidresponse.md +0 -11
- package/docs/models/operations/fetchcustomerrequest.md +0 -8
- package/docs/models/operations/fetchcustomerresponse.md +0 -11
- package/docs/models/operations/fetchinvoicerequest.md +0 -8
- package/docs/models/operations/fetchinvoiceresponse.md +0 -11
- package/docs/models/operations/fetchitemrequest.md +0 -8
- package/docs/models/operations/fetchitemresponse.md +0 -11
- package/docs/models/operations/fetchmetricrequest.md +0 -8
- package/docs/models/operations/fetchmetricresponse.md +0 -11
- package/docs/models/operations/fetchplanexternalidrequest.md +0 -8
- package/docs/models/operations/fetchplanexternalidresponse.md +0 -11
- package/docs/models/operations/fetchplanrequest.md +0 -8
- package/docs/models/operations/fetchplanresponse.md +0 -11
- package/docs/models/operations/fetchpriceexternalidrequest.md +0 -8
- package/docs/models/operations/fetchpriceexternalidresponse.md +0 -11
- package/docs/models/operations/fetchpricerequest.md +0 -8
- package/docs/models/operations/fetchpriceresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptioncostsrequest.md +0 -12
- package/docs/models/operations/fetchsubscriptioncostsresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchsubscriptionrequest.md +0 -8
- package/docs/models/operations/fetchsubscriptionresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptionschedulerequest.md +0 -14
- package/docs/models/operations/fetchsubscriptionscheduleresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +0 -10
- package/docs/models/operations/fetchsubscriptionusagerequest.md +0 -20
- package/docs/models/operations/fetchsubscriptionusageresponse.md +0 -11
- package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +0 -11
- package/docs/models/operations/fetchupcominginvoicerequest.md +0 -8
- package/docs/models/operations/fetchupcominginvoiceresponse.md +0 -11
- package/docs/models/operations/ingestrequest.md +0 -10
- package/docs/models/operations/ingestresponse.md +0 -11
- package/docs/models/operations/issueinvoicerequest.md +0 -8
- package/docs/models/operations/issueinvoiceresponse.md +0 -11
- package/docs/models/operations/listbackfillsrequest.md +0 -9
- package/docs/models/operations/listbackfillsresponse.md +0 -11
- package/docs/models/operations/listbalancetransactionsrequest.md +0 -14
- package/docs/models/operations/listbalancetransactionsresponse.md +0 -11
- package/docs/models/operations/listcouponsrequest.md +0 -11
- package/docs/models/operations/listcouponsresponse.md +0 -11
- package/docs/models/operations/listcouponsubscriptionsrequest.md +0 -10
- package/docs/models/operations/listcouponsubscriptionsresponse.md +0 -11
- package/docs/models/operations/listcreditnotesrequest.md +0 -9
- package/docs/models/operations/listcreditnotesresponse.md +0 -11
- package/docs/models/operations/listcustomersrequest.md +0 -13
- package/docs/models/operations/listcustomersresponse.md +0 -11
- package/docs/models/operations/listinvoicesdatetypedatetype.md +0 -9
- package/docs/models/operations/listinvoicesrequest.md +0 -27
- package/docs/models/operations/listinvoicesresponse.md +0 -11
- package/docs/models/operations/listinvoicesstatus.md +0 -12
- package/docs/models/operations/listinvoicesstatusstatus.md +0 -12
- package/docs/models/operations/listitemsrequest.md +0 -9
- package/docs/models/operations/listitemsresponse.md +0 -11
- package/docs/models/operations/listmetricsrequest.md +0 -13
- package/docs/models/operations/listmetricsresponse.md +0 -11
- package/docs/models/operations/listplansrequest.md +0 -14
- package/docs/models/operations/listplansresponse.md +0 -11
- package/docs/models/operations/listplansstatusstatus.md +0 -12
- package/docs/models/operations/listpricesrequest.md +0 -9
- package/docs/models/operations/listpricesresponse.md +0 -11
- package/docs/models/operations/listsubscriptionsrequest.md +0 -16
- package/docs/models/operations/listsubscriptionsresponse.md +0 -11
- package/docs/models/operations/listsubscriptionsstatusstatus.md +0 -10
- package/docs/models/operations/markinvoiceaspaidrequest.md +0 -9
- package/docs/models/operations/markinvoiceaspaidresponse.md +0 -11
- package/docs/models/operations/pingresponse.md +0 -11
- package/docs/models/operations/revertbackfillrequest.md +0 -8
- package/docs/models/operations/revertbackfillresponse.md +0 -11
- package/docs/models/operations/scheduleplanchangerequest.md +0 -9
- package/docs/models/operations/scheduleplanchangeresponse.md +0 -11
- package/docs/models/operations/searcheventsrequest.md +0 -14
- package/docs/models/operations/searcheventsresponse.md +0 -11
- package/docs/models/operations/triggerphaserequest.md +0 -9
- package/docs/models/operations/triggerphaseresponse.md +0 -11
- package/docs/models/operations/unschedulecancellationrequest.md +0 -8
- package/docs/models/operations/unschedulecancellationresponse.md +0 -11
- package/docs/models/operations/unschedulefixedfeequantityrequest.md +0 -9
- package/docs/models/operations/unschedulefixedfeequantityresponse.md +0 -11
- package/docs/models/operations/unscheduleplanchangerequest.md +0 -8
- package/docs/models/operations/unscheduleplanchangeresponse.md +0 -11
- package/docs/models/operations/updatecustomerexternalidrequest.md +0 -9
- package/docs/models/operations/updatecustomerexternalidresponse.md +0 -11
- package/docs/models/operations/updatecustomerrequest.md +0 -9
- package/docs/models/operations/updatecustomerresponse.md +0 -11
- package/docs/models/operations/updatefixedfeequantityrequest.md +0 -9
- package/docs/models/operations/updatefixedfeequantityresponse.md +0 -11
- package/docs/models/operations/updateplanexternalrequest.md +0 -9
- package/docs/models/operations/updateplanexternalresponse.md +0 -11
- package/docs/models/operations/updateplanrequest.md +0 -9
- package/docs/models/operations/updateplanresponse.md +0 -11
- package/docs/models/operations/voidinvoicerequest.md +0 -8
- package/docs/models/operations/voidinvoiceresponse.md +0 -11
- package/docs/models/shared/accountingprovider.md +0 -9
- package/docs/models/shared/accountingproviderconfig.md +0 -9
- package/docs/models/shared/accountingproviderprovidertype.md +0 -9
- package/docs/models/shared/accountingsyncconfiguration.md +0 -9
- package/docs/models/shared/addeditpriceintervalparams.md +0 -9
- package/docs/models/shared/addpriceintervalparams.md +0 -16
- package/docs/models/shared/address.md +0 -13
- package/docs/models/shared/addressinput.md +0 -13
- package/docs/models/shared/aggregatedcost.md +0 -12
- package/docs/models/shared/amendedevent.md +0 -12
- package/docs/models/shared/amendedeventproperties.md +0 -9
- package/docs/models/shared/amendedusage.md +0 -9
- package/docs/models/shared/amendeventresult.md +0 -8
- package/docs/models/shared/autocollection.md +0 -10
- package/docs/models/shared/backfill.md +0 -17
- package/docs/models/shared/backfills.md +0 -9
- package/docs/models/shared/backfillstatus.md +0 -13
- package/docs/models/shared/billablemetric.md +0 -16
- package/docs/models/shared/billablemetrics.md +0 -9
- package/docs/models/shared/billablemetricstatus.md +0 -10
- package/docs/models/shared/billingcyclealignment.md +0 -12
- package/docs/models/shared/cancelsubscriptionparams.md +0 -9
- package/docs/models/shared/cancelsubscriptionparamscanceloption.md +0 -12
- package/docs/models/shared/changeoption.md +0 -10
- package/docs/models/shared/coupon.md +0 -21
- package/docs/models/shared/coupondiscount.md +0 -7
- package/docs/models/shared/couponredemption.md +0 -10
- package/docs/models/shared/coupons.md +0 -9
- package/docs/models/shared/createinvoicelineitemparams.md +0 -13
- package/docs/models/shared/createoneoffinvoiceparams.md +0 -15
- package/docs/models/shared/creditledgerentries.md +0 -9
- package/docs/models/shared/creditnote.md +0 -26
- package/docs/models/shared/creditnotediscounts.md +0 -7
- package/docs/models/shared/creditnotelineitem.md +0 -15
- package/docs/models/shared/creditnotelineitemdiscounts.md +0 -7
- package/docs/models/shared/creditnotelineitemtaxamounts.md +0 -7
- package/docs/models/shared/creditnotemaximumamountadjustment.md +0 -9
- package/docs/models/shared/creditnoteminified.md +0 -8
- package/docs/models/shared/creditnotereason.md +0 -11
- package/docs/models/shared/creditnotes.md +0 -9
- package/docs/models/shared/creditnotesublineitem.md +0 -10
- package/docs/models/shared/creditnotesummary.md +0 -13
- package/docs/models/shared/creditnotetype.md +0 -9
- package/docs/models/shared/customer.md +0 -42
- package/docs/models/shared/customerbalancetransaction.md +0 -17
- package/docs/models/shared/customerbalancetransactionaction.md +0 -10
- package/docs/models/shared/customerbalancetransactions.md +0 -9
- package/docs/models/shared/customerbalancetransactiontype.md +0 -9
- package/docs/models/shared/customercosts.md +0 -8
- package/docs/models/shared/customercreditbalance.md +0 -11
- package/docs/models/shared/customercreditbalances.md +0 -9
- package/docs/models/shared/customerminified.md +0 -9
- package/docs/models/shared/customerpaymentprovider.md +0 -14
- package/docs/models/shared/customers.md +0 -9
- package/docs/models/shared/customertaxid.md +0 -10
- package/docs/models/shared/debug.md +0 -11
- package/docs/models/shared/deletecustomerresponse.md +0 -7
- package/docs/models/shared/deprecatedeventresult.md +0 -8
- package/docs/models/shared/discount.md +0 -15
- package/docs/models/shared/discountdiscounttype.md +0 -11
- package/docs/models/shared/editcustomer.md +0 -22
- package/docs/models/shared/editcustomermetadata.md +0 -9
- package/docs/models/shared/editcustomerpaymentprovider.md +0 -16
- package/docs/models/shared/editplan.md +0 -9
- package/docs/models/shared/editplanmetadata.md +0 -7
- package/docs/models/shared/editpriceintervalparams.md +0 -11
- package/docs/models/shared/event.md +0 -17
- package/docs/models/shared/eventproperties.md +0 -9
- package/docs/models/shared/events.md +0 -9
- package/docs/models/shared/eventsearchcriteria.md +0 -9
- package/docs/models/shared/fixedfeequantitychange.md +0 -11
- package/docs/models/shared/fixedfeequantitychangechangeoption.md +0 -12
- package/docs/models/shared/fixedfeequantityscheduleentry.md +0 -11
- package/docs/models/shared/fixedfeequantitytransition.md +0 -10
- package/docs/models/shared/ingestevent.md +0 -13
- package/docs/models/shared/ingesteventproperties.md +0 -9
- package/docs/models/shared/ingestionresponse.md +0 -9
- package/docs/models/shared/ingestrequestbody.md +0 -8
- package/docs/models/shared/invoice.md +0 -51
- package/docs/models/shared/invoicelineitem.md +0 -23
- package/docs/models/shared/invoicelineitemparams.md +0 -14
- package/docs/models/shared/invoicelineitemparamsmodeltype.md +0 -8
- package/docs/models/shared/invoicemetadata.md +0 -7
- package/docs/models/shared/invoiceminified.md +0 -8
- package/docs/models/shared/invoices.md +0 -9
- package/docs/models/shared/invoicestatus.md +0 -12
- package/docs/models/shared/item.md +0 -14
- package/docs/models/shared/itemexternalconnection.md +0 -9
- package/docs/models/shared/items.md +0 -9
- package/docs/models/shared/markaspaidrequestparams.md +0 -10
- package/docs/models/shared/maximum.md +0 -9
- package/docs/models/shared/maximuminterval.md +0 -12
- package/docs/models/shared/minimum.md +0 -9
- package/docs/models/shared/minimuminterval.md +0 -12
- package/docs/models/shared/newaccountingsyncconfiguration.md +0 -9
- package/docs/models/shared/newbackfill.md +0 -13
- package/docs/models/shared/newbillablemetric.md +0 -12
- package/docs/models/shared/newbillablemetricmetadata.md +0 -9
- package/docs/models/shared/newcoupon.md +0 -11
- package/docs/models/shared/newcoupondiscount.md +0 -7
- package/docs/models/shared/newcustomer.md +0 -23
- package/docs/models/shared/newcustomerbalancetransaction.md +0 -10
- package/docs/models/shared/newcustomerbalancetransactiontype.md +0 -9
- package/docs/models/shared/newcustomermetadata.md +0 -9
- package/docs/models/shared/newcustomerpaymentprovider.md +0 -14
- package/docs/models/shared/newplan.md +0 -14
- package/docs/models/shared/newplanmetadata.md +0 -7
- package/docs/models/shared/newplanprices.md +0 -7
- package/docs/models/shared/newreportingconfiguration.md +0 -8
- package/docs/models/shared/newsubscription.md +0 -31
- package/docs/models/shared/newsubscriptionexternalmarketplace.md +0 -10
- package/docs/models/shared/newsubscriptionmetadata.md +0 -7
- package/docs/models/shared/paginationmetadata.md +0 -9
- package/docs/models/shared/perpricecost.md +0 -12
- package/docs/models/shared/phaseoverride.md +0 -11
- package/docs/models/shared/pingresponse.md +0 -8
- package/docs/models/shared/plan.md +0 -33
- package/docs/models/shared/planmetadata.md +0 -7
- package/docs/models/shared/planminified.md +0 -10
- package/docs/models/shared/planphase.md +0 -18
- package/docs/models/shared/planphasedurationunit.md +0 -11
- package/docs/models/shared/plans.md +0 -9
- package/docs/models/shared/planstatus.md +0 -10
- package/docs/models/shared/pricegroup.md +0 -12
- package/docs/models/shared/priceinterval.md +0 -18
- package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +0 -9
- package/docs/models/shared/prices.md +0 -9
- package/docs/models/shared/product.md +0 -10
- package/docs/models/shared/reportingconfiguration.md +0 -8
- package/docs/models/shared/security.md +0 -8
- package/docs/models/shared/subscription.md +0 -44
- package/docs/models/shared/subscriptioncosts.md +0 -8
- package/docs/models/shared/subscriptionmetadata.md +0 -9
- package/docs/models/shared/subscriptionminified.md +0 -8
- package/docs/models/shared/subscriptionplanchange.md +0 -23
- package/docs/models/shared/subscriptions.md +0 -9
- package/docs/models/shared/subscriptionscheduleitem.md +0 -10
- package/docs/models/shared/subscriptionscheduleitems.md +0 -9
- package/docs/models/shared/subscriptionstatus.md +0 -10
- package/docs/models/shared/subscriptiontrialinfo.md +0 -8
- package/docs/models/shared/taxamount.md +0 -10
- package/docs/models/shared/trialconfig.md +0 -9
- package/docs/models/shared/trialconfigtrialperiodunit.md +0 -8
- package/docs/models/shared/triggersubscriptionphaseparams.md +0 -8
- package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +0 -8
- package/docs/models/shared/upcominginvoice.md +0 -46
- package/docs/models/shared/upcominginvoicemetadata.md +0 -7
- package/docs/models/shared/upcominginvoicestatus.md +0 -12
- package/docs/models/shared/updateevent.md +0 -12
- package/docs/models/shared/updateeventproperties.md +0 -9
- package/docs/models/shared/validationerror.md +0 -9
- package/docs/sdks/availability/README.md +0 -46
- package/docs/sdks/coupon/README.md +0 -235
- package/docs/sdks/credit/README.md +0 -565
- package/docs/sdks/creditnote/README.md +0 -94
- package/docs/sdks/customer/README.md +0 -1080
- package/docs/sdks/event/README.md +0 -674
- package/docs/sdks/invoice/README.md +0 -388
- package/docs/sdks/item/README.md +0 -92
- package/docs/sdks/metric/README.md +0 -136
- package/docs/sdks/orb/README.md +0 -21
- package/docs/sdks/plan/README.md +0 -298
- package/docs/sdks/price/README.md +0 -375
- package/docs/sdks/priceinterval/README.md +0 -137
- package/docs/sdks/subscription/README.md +0 -1306
- package/docs/types/rfcdate.md +0 -11
package/dist/sdk/credit.js
DELETED
|
@@ -1,1020 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(o, k2, desc);
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
-
}) : function(o, v) {
|
|
30
|
-
o["default"] = v;
|
|
31
|
-
});
|
|
32
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
40
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
43
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
44
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
45
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
49
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
50
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
51
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
52
|
-
function step(op) {
|
|
53
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
55
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
56
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
-
switch (op[0]) {
|
|
58
|
-
case 0: case 1: t = op; break;
|
|
59
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
60
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
61
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
62
|
-
default:
|
|
63
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
64
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
65
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
66
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
67
|
-
if (t[2]) _.ops.pop();
|
|
68
|
-
_.trys.pop(); continue;
|
|
69
|
-
}
|
|
70
|
-
op = body.call(thisArg, _);
|
|
71
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
72
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
76
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
77
|
-
if (!m) return o;
|
|
78
|
-
var i = m.call(o), r, ar = [], e;
|
|
79
|
-
try {
|
|
80
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
81
|
-
}
|
|
82
|
-
catch (error) { e = { error: error }; }
|
|
83
|
-
finally {
|
|
84
|
-
try {
|
|
85
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
86
|
-
}
|
|
87
|
-
finally { if (e) throw e.error; }
|
|
88
|
-
}
|
|
89
|
-
return ar;
|
|
90
|
-
};
|
|
91
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
92
|
-
exports.Credit = void 0;
|
|
93
|
-
var utils = __importStar(require("../internal/utils"));
|
|
94
|
-
var errors = __importStar(require("./models/errors"));
|
|
95
|
-
var operations = __importStar(require("./models/operations"));
|
|
96
|
-
var shared = __importStar(require("./models/shared"));
|
|
97
|
-
/**
|
|
98
|
-
* The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits within Orb.
|
|
99
|
-
*/
|
|
100
|
-
var Credit = /** @class */ (function () {
|
|
101
|
-
function Credit(sdkConfig) {
|
|
102
|
-
this.sdkConfiguration = sdkConfig;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Create ledger entry by external ID
|
|
106
|
-
*
|
|
107
|
-
* @remarks
|
|
108
|
-
* This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to
|
|
109
|
-
* increment balance, deduct credits, and change the expiry date of existing credits.
|
|
110
|
-
*
|
|
111
|
-
* ## Effects of adding a ledger entry
|
|
112
|
-
* 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that
|
|
113
|
-
* represents the changes (i.e. balance changes or transfers).
|
|
114
|
-
* 2. A ledger entry will be added to the credits ledger for this customer, and therefore returned in the
|
|
115
|
-
* [View Credits Ledger](fetch-customer-credits) response as well as serialized in the response to this request. In
|
|
116
|
-
* the case of deductions without a specified block, multiple ledger entries may be created if the deduction spans
|
|
117
|
-
* credit blocks.
|
|
118
|
-
* 3. If `invoice_settings` is specified, an invoice will be created that reflects the cost of the credits (based on
|
|
119
|
-
* `amount` and `per_unit_cost_basis`).
|
|
120
|
-
*
|
|
121
|
-
* ## Adding credits
|
|
122
|
-
* Adding credits is done by creating an entry of type `increment`. This requires the caller to specify a number of
|
|
123
|
-
* credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb also recommends specifying a description
|
|
124
|
-
* to assist with auditing. When adding credits, the caller can also specify a cost basis per-credit, to indicate
|
|
125
|
-
* how much in USD a customer paid for a single credit in a block. This can later be used for revenue recognition.
|
|
126
|
-
*
|
|
127
|
-
* The following snippet illustrates a sample request body to increment credits which will expire in January of 2022.
|
|
128
|
-
*
|
|
129
|
-
* ```json
|
|
130
|
-
* {
|
|
131
|
-
* "entry_type": "increment",
|
|
132
|
-
* "amount": 100,
|
|
133
|
-
* "expiry_date": "2022-12-28",
|
|
134
|
-
* "per_unit_cost_basis": "0.20",
|
|
135
|
-
* "description": "Purchased 100 credits"
|
|
136
|
-
* }
|
|
137
|
-
* ```
|
|
138
|
-
*
|
|
139
|
-
* Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the
|
|
140
|
-
* remaining amount to the desired credit block.
|
|
141
|
-
*
|
|
142
|
-
* ### Invoicing for credits
|
|
143
|
-
* By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass
|
|
144
|
-
* `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for the customer for the
|
|
145
|
-
* credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the
|
|
146
|
-
* invoice are calculated by multiplying the cost basis with the number of credit units added.
|
|
147
|
-
*
|
|
148
|
-
* ## Deducting Credits
|
|
149
|
-
* Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the
|
|
150
|
-
* algorithm for automatic deductions for determining which credit blocks to decrement from. In the case that the
|
|
151
|
-
* deduction leads to multiple ledger entries, the response from this endpoint will be the final deduction. Orb also
|
|
152
|
-
* optionally allows specifying a description to assist with auditing.
|
|
153
|
-
*
|
|
154
|
-
* The following snippet illustrates a sample request body to decrement credits.
|
|
155
|
-
*
|
|
156
|
-
* ```json
|
|
157
|
-
* {
|
|
158
|
-
* "entry_type": "decrement",
|
|
159
|
-
* "amount": 20,
|
|
160
|
-
* "description": "Removing excess credits"
|
|
161
|
-
* }
|
|
162
|
-
* ```
|
|
163
|
-
*
|
|
164
|
-
* ## Changing credits expiry
|
|
165
|
-
* If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`.
|
|
166
|
-
* For this entry, the required parameter `expiry_date` identifies the _originating_ block, and the required parameter
|
|
167
|
-
* `target_expiry_date` identifies when the transferred credits should now expire. A new credit block will be created
|
|
168
|
-
* with expiry date `target_expiry_date`, with the same cost basis data as the original credit block, if present.
|
|
169
|
-
*
|
|
170
|
-
* Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer
|
|
171
|
-
* amount determined by the `amount` parameter.
|
|
172
|
-
*
|
|
173
|
-
* The following snippet illustrates a sample request body to extend the expiration date of credits by one year:
|
|
174
|
-
*
|
|
175
|
-
* ```json
|
|
176
|
-
* {
|
|
177
|
-
* "entry_type": "expiration_change",
|
|
178
|
-
* "amount": 10,
|
|
179
|
-
* "expiry_date": "2022-12-28",
|
|
180
|
-
* "block_id": "UiUhFWeLHPrBY4Ad",
|
|
181
|
-
* "target_expiry_date": "2023-12-28",
|
|
182
|
-
* "description": "Extending credit validity"
|
|
183
|
-
* }
|
|
184
|
-
* ```
|
|
185
|
-
*
|
|
186
|
-
* ## Voiding credits
|
|
187
|
-
*
|
|
188
|
-
* If you'd like to void a credit block, create a ledger entry of type `void`. For this entry, `block_id` is required
|
|
189
|
-
* to identify the block, and `amount` indicates how many credits to void, up to the block's initial balance. Pass
|
|
190
|
-
* in a `void_reason` of `refund` if the void is due to a refund.
|
|
191
|
-
*
|
|
192
|
-
* ## Amendment
|
|
193
|
-
*
|
|
194
|
-
* If you'd like to undo a decrement on a credit block, create a ledger entry of type `amendment`. For this entry, `block_id`
|
|
195
|
-
* is required to identify the block that was originally decremented from, and `amount` indicates how many credits to return
|
|
196
|
-
* to the customer, up to the block's initial balance.
|
|
197
|
-
*/
|
|
198
|
-
Credit.prototype.addByExternalId = function (externalCustomerId, requestBody, config) {
|
|
199
|
-
var _a, _b;
|
|
200
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
|
|
202
|
-
var _d;
|
|
203
|
-
return __generator(this, function (_e) {
|
|
204
|
-
switch (_e.label) {
|
|
205
|
-
case 0:
|
|
206
|
-
req = new operations.CreateLedgerEntryExternalIdRequest({
|
|
207
|
-
externalCustomerId: externalCustomerId,
|
|
208
|
-
requestBody: requestBody,
|
|
209
|
-
});
|
|
210
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
211
|
-
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/credits/ledger_entry", req);
|
|
212
|
-
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
213
|
-
try {
|
|
214
|
-
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
215
|
-
}
|
|
216
|
-
catch (e) {
|
|
217
|
-
if (e instanceof Error) {
|
|
218
|
-
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
client = this.sdkConfiguration.defaultClient;
|
|
222
|
-
globalSecurity = this.sdkConfiguration.security;
|
|
223
|
-
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
224
|
-
return [4 /*yield*/, globalSecurity()];
|
|
225
|
-
case 1:
|
|
226
|
-
globalSecurity = _e.sent();
|
|
227
|
-
_e.label = 2;
|
|
228
|
-
case 2:
|
|
229
|
-
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
230
|
-
globalSecurity = new shared.Security(globalSecurity);
|
|
231
|
-
}
|
|
232
|
-
properties = utils.parseSecurityProperties(globalSecurity);
|
|
233
|
-
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
234
|
-
headers["Accept"] = "application/json";
|
|
235
|
-
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
236
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
237
|
-
case 3:
|
|
238
|
-
httpRes = _e.sent();
|
|
239
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
240
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
241
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
242
|
-
}
|
|
243
|
-
res = new operations.CreateLedgerEntryExternalIdResponse({
|
|
244
|
-
statusCode: httpRes.status,
|
|
245
|
-
contentType: contentType,
|
|
246
|
-
rawResponse: httpRes,
|
|
247
|
-
});
|
|
248
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
249
|
-
switch (true) {
|
|
250
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 201:
|
|
251
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
252
|
-
res.creditLedgerEntry = JSON.parse(decodedRes);
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
256
|
-
}
|
|
257
|
-
break;
|
|
258
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
|
|
259
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
|
|
260
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
|
|
261
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
|
|
262
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
263
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
264
|
-
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
265
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
266
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
267
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
|
|
268
|
-
err.rawResponse = httpRes;
|
|
269
|
-
throw new errors.FourHundredAndOneError(err);
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
273
|
-
}
|
|
274
|
-
break;
|
|
275
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
276
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
277
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
|
|
278
|
-
err.rawResponse = httpRes;
|
|
279
|
-
throw new errors.FourHundredAndTwentyNineError(err);
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
283
|
-
}
|
|
284
|
-
break;
|
|
285
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
286
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
287
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
|
|
288
|
-
err.rawResponse = httpRes;
|
|
289
|
-
throw new errors.FiveHundredError(err);
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
293
|
-
}
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
return [2 /*return*/, res];
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
};
|
|
301
|
-
/**
|
|
302
|
-
* Create ledger entry
|
|
303
|
-
*
|
|
304
|
-
* @remarks
|
|
305
|
-
* This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to
|
|
306
|
-
* increment balance, deduct credits, and change the expiry date of existing credits.
|
|
307
|
-
*
|
|
308
|
-
* ## Effects of adding a ledger entry
|
|
309
|
-
* 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that
|
|
310
|
-
* represents the changes (i.e. balance changes or transfers).
|
|
311
|
-
* 2. A ledger entry will be added to the credits ledger for this customer, and therefore returned in the
|
|
312
|
-
* [View Credits Ledger](fetch-customer-credits) response as well as serialized in the response to this request. In
|
|
313
|
-
* the case of deductions without a specified block, multiple ledger entries may be created if the deduction spans
|
|
314
|
-
* credit blocks.
|
|
315
|
-
* 3. If `invoice_settings` is specified, an invoice will be created that reflects the cost of the credits (based on
|
|
316
|
-
* `amount` and `per_unit_cost_basis`).
|
|
317
|
-
*
|
|
318
|
-
* ## Adding credits
|
|
319
|
-
* Adding credits is done by creating an entry of type `increment`. This requires the caller to specify a number of
|
|
320
|
-
* credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb also recommends specifying a description
|
|
321
|
-
* to assist with auditing. When adding credits, the caller can also specify a cost basis per-credit, to indicate
|
|
322
|
-
* how much in USD a customer paid for a single credit in a block. This can later be used for revenue recognition.
|
|
323
|
-
*
|
|
324
|
-
* The following snippet illustrates a sample request body to increment credits which will expire in January of 2022.
|
|
325
|
-
*
|
|
326
|
-
* ```json
|
|
327
|
-
* {
|
|
328
|
-
* "entry_type": "increment",
|
|
329
|
-
* "amount": 100,
|
|
330
|
-
* "expiry_date": "2022-12-28",
|
|
331
|
-
* "per_unit_cost_basis": "0.20",
|
|
332
|
-
* "description": "Purchased 100 credits"
|
|
333
|
-
* }
|
|
334
|
-
* ```
|
|
335
|
-
*
|
|
336
|
-
* Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the
|
|
337
|
-
* remaining amount to the desired credit block.
|
|
338
|
-
*
|
|
339
|
-
* ### Invoicing for credits
|
|
340
|
-
* By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass
|
|
341
|
-
* `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for the customer for the
|
|
342
|
-
* credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the
|
|
343
|
-
* invoice are calculated by multiplying the cost basis with the number of credit units added.
|
|
344
|
-
*
|
|
345
|
-
* ## Deducting Credits
|
|
346
|
-
* Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the
|
|
347
|
-
* algorithm for automatic deductions for determining which credit blocks to decrement from. In the case that the
|
|
348
|
-
* deduction leads to multiple ledger entries, the response from this endpoint will be the final deduction. Orb also
|
|
349
|
-
* optionally allows specifying a description to assist with auditing.
|
|
350
|
-
*
|
|
351
|
-
* The following snippet illustrates a sample request body to decrement credits.
|
|
352
|
-
*
|
|
353
|
-
* ```json
|
|
354
|
-
* {
|
|
355
|
-
* "entry_type": "decrement",
|
|
356
|
-
* "amount": 20,
|
|
357
|
-
* "description": "Removing excess credits"
|
|
358
|
-
* }
|
|
359
|
-
* ```
|
|
360
|
-
*
|
|
361
|
-
* ## Changing credits expiry
|
|
362
|
-
* If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`.
|
|
363
|
-
* For this entry, the required parameter `expiry_date` identifies the _originating_ block, and the required parameter
|
|
364
|
-
* `target_expiry_date` identifies when the transferred credits should now expire. A new credit block will be created
|
|
365
|
-
* with expiry date `target_expiry_date`, with the same cost basis data as the original credit block, if present.
|
|
366
|
-
*
|
|
367
|
-
* Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer
|
|
368
|
-
* amount determined by the `amount` parameter.
|
|
369
|
-
*
|
|
370
|
-
* The following snippet illustrates a sample request body to extend the expiration date of credits by one year:
|
|
371
|
-
*
|
|
372
|
-
* ```json
|
|
373
|
-
* {
|
|
374
|
-
* "entry_type": "expiration_change",
|
|
375
|
-
* "amount": 10,
|
|
376
|
-
* "expiry_date": "2022-12-28",
|
|
377
|
-
* "block_id": "UiUhFWeLHPrBY4Ad",
|
|
378
|
-
* "target_expiry_date": "2023-12-28",
|
|
379
|
-
* "description": "Extending credit validity"
|
|
380
|
-
* }
|
|
381
|
-
* ```
|
|
382
|
-
*
|
|
383
|
-
* ## Voiding credits
|
|
384
|
-
*
|
|
385
|
-
* If you'd like to void a credit block, create a ledger entry of type `void`. For this entry, `block_id` is required
|
|
386
|
-
* to identify the block, and `amount` indicates how many credits to void, up to the block's initial balance. Pass
|
|
387
|
-
* in a `void_reason` of `refund` if the void is due to a refund.
|
|
388
|
-
*
|
|
389
|
-
* ## Amendment
|
|
390
|
-
*
|
|
391
|
-
* If you'd like to undo a decrement on a credit block, create a ledger entry of type `amendment`. For this entry, `block_id`
|
|
392
|
-
* is required to identify the block that was originally decremented from, and `amount` indicates how many credits to return
|
|
393
|
-
* to the customer, up to the block's initial balance.
|
|
394
|
-
*/
|
|
395
|
-
Credit.prototype.create = function (customerId, requestBody, config) {
|
|
396
|
-
var _a, _b;
|
|
397
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
398
|
-
var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes, err, err, err;
|
|
399
|
-
var _d;
|
|
400
|
-
return __generator(this, function (_e) {
|
|
401
|
-
switch (_e.label) {
|
|
402
|
-
case 0:
|
|
403
|
-
req = new operations.CreateLedgerEntryRequest({
|
|
404
|
-
customerId: customerId,
|
|
405
|
-
requestBody: requestBody,
|
|
406
|
-
});
|
|
407
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
408
|
-
url = utils.generateURL(baseURL, "/customers/{customer_id}/credits/ledger_entry", req);
|
|
409
|
-
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
410
|
-
try {
|
|
411
|
-
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
412
|
-
}
|
|
413
|
-
catch (e) {
|
|
414
|
-
if (e instanceof Error) {
|
|
415
|
-
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
client = this.sdkConfiguration.defaultClient;
|
|
419
|
-
globalSecurity = this.sdkConfiguration.security;
|
|
420
|
-
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
421
|
-
return [4 /*yield*/, globalSecurity()];
|
|
422
|
-
case 1:
|
|
423
|
-
globalSecurity = _e.sent();
|
|
424
|
-
_e.label = 2;
|
|
425
|
-
case 2:
|
|
426
|
-
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
427
|
-
globalSecurity = new shared.Security(globalSecurity);
|
|
428
|
-
}
|
|
429
|
-
properties = utils.parseSecurityProperties(globalSecurity);
|
|
430
|
-
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
431
|
-
headers["Accept"] = "application/json";
|
|
432
|
-
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
433
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
434
|
-
case 3:
|
|
435
|
-
httpRes = _e.sent();
|
|
436
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
437
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
438
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
439
|
-
}
|
|
440
|
-
res = new operations.CreateLedgerEntryResponse({
|
|
441
|
-
statusCode: httpRes.status,
|
|
442
|
-
contentType: contentType,
|
|
443
|
-
rawResponse: httpRes,
|
|
444
|
-
});
|
|
445
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
446
|
-
switch (true) {
|
|
447
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 201:
|
|
448
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
449
|
-
res.creditLedgerEntry = JSON.parse(decodedRes);
|
|
450
|
-
}
|
|
451
|
-
else {
|
|
452
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
453
|
-
}
|
|
454
|
-
break;
|
|
455
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
|
|
456
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
|
|
457
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
|
|
458
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
|
|
459
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
460
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
461
|
-
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
462
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
463
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
464
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
|
|
465
|
-
err.rawResponse = httpRes;
|
|
466
|
-
throw new errors.FourHundredAndOneError(err);
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
470
|
-
}
|
|
471
|
-
break;
|
|
472
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
473
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
474
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
|
|
475
|
-
err.rawResponse = httpRes;
|
|
476
|
-
throw new errors.FourHundredAndTwentyNineError(err);
|
|
477
|
-
}
|
|
478
|
-
else {
|
|
479
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
480
|
-
}
|
|
481
|
-
break;
|
|
482
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
483
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
484
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
|
|
485
|
-
err.rawResponse = httpRes;
|
|
486
|
-
throw new errors.FiveHundredError(err);
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
489
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
490
|
-
}
|
|
491
|
-
break;
|
|
492
|
-
}
|
|
493
|
-
return [2 /*return*/, res];
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
});
|
|
497
|
-
};
|
|
498
|
-
/**
|
|
499
|
-
* Fetch customer credit balance
|
|
500
|
-
*
|
|
501
|
-
* @remarks
|
|
502
|
-
* Returns a paginated list of unexpired, non-zero credit blocks for a customer.
|
|
503
|
-
*/
|
|
504
|
-
Credit.prototype.fetchBalance = function (customerId, cursor, limit, config) {
|
|
505
|
-
var _a, _b;
|
|
506
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
507
|
-
var req, baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
|
|
508
|
-
return __generator(this, function (_c) {
|
|
509
|
-
switch (_c.label) {
|
|
510
|
-
case 0:
|
|
511
|
-
req = new operations.FetchCustomerCreditsRequest({
|
|
512
|
-
customerId: customerId,
|
|
513
|
-
cursor: cursor,
|
|
514
|
-
limit: limit,
|
|
515
|
-
});
|
|
516
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
517
|
-
url = utils.generateURL(baseURL, "/customers/{customer_id}/credits", req);
|
|
518
|
-
client = this.sdkConfiguration.defaultClient;
|
|
519
|
-
globalSecurity = this.sdkConfiguration.security;
|
|
520
|
-
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
521
|
-
return [4 /*yield*/, globalSecurity()];
|
|
522
|
-
case 1:
|
|
523
|
-
globalSecurity = _c.sent();
|
|
524
|
-
_c.label = 2;
|
|
525
|
-
case 2:
|
|
526
|
-
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
527
|
-
globalSecurity = new shared.Security(globalSecurity);
|
|
528
|
-
}
|
|
529
|
-
properties = utils.parseSecurityProperties(globalSecurity);
|
|
530
|
-
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
531
|
-
queryParams = utils.serializeQueryParams(req);
|
|
532
|
-
headers["Accept"] = "application/json";
|
|
533
|
-
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
534
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
535
|
-
case 3:
|
|
536
|
-
httpRes = _c.sent();
|
|
537
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
538
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
539
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
540
|
-
}
|
|
541
|
-
res = new operations.FetchCustomerCreditsResponse({
|
|
542
|
-
statusCode: httpRes.status,
|
|
543
|
-
contentType: contentType,
|
|
544
|
-
rawResponse: httpRes,
|
|
545
|
-
});
|
|
546
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
547
|
-
switch (true) {
|
|
548
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
549
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
550
|
-
res.customerCreditBalances = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerCreditBalances);
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
554
|
-
}
|
|
555
|
-
break;
|
|
556
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
|
|
557
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
|
|
558
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
|
|
559
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
|
|
560
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
561
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
562
|
-
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
563
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
564
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
565
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
|
|
566
|
-
err.rawResponse = httpRes;
|
|
567
|
-
throw new errors.FourHundredAndOneError(err);
|
|
568
|
-
}
|
|
569
|
-
else {
|
|
570
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
571
|
-
}
|
|
572
|
-
break;
|
|
573
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
574
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
575
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
|
|
576
|
-
err.rawResponse = httpRes;
|
|
577
|
-
throw new errors.FourHundredAndTwentyNineError(err);
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
581
|
-
}
|
|
582
|
-
break;
|
|
583
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
584
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
585
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
|
|
586
|
-
err.rawResponse = httpRes;
|
|
587
|
-
throw new errors.FiveHundredError(err);
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
591
|
-
}
|
|
592
|
-
break;
|
|
593
|
-
}
|
|
594
|
-
return [2 /*return*/, res];
|
|
595
|
-
}
|
|
596
|
-
});
|
|
597
|
-
});
|
|
598
|
-
};
|
|
599
|
-
/**
|
|
600
|
-
* Fetch customer credit balance by external customer id
|
|
601
|
-
*
|
|
602
|
-
* @remarks
|
|
603
|
-
* Returns a paginated list of unexpired, non-zero credit blocks for a customer.
|
|
604
|
-
*/
|
|
605
|
-
Credit.prototype.fetchBalanceByExternalId = function (externalCustomerId, cursor, limit, config) {
|
|
606
|
-
var _a, _b;
|
|
607
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
608
|
-
var req, baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
|
|
609
|
-
return __generator(this, function (_c) {
|
|
610
|
-
switch (_c.label) {
|
|
611
|
-
case 0:
|
|
612
|
-
req = new operations.FetchCustomerCreditsExternalIdRequest({
|
|
613
|
-
externalCustomerId: externalCustomerId,
|
|
614
|
-
cursor: cursor,
|
|
615
|
-
limit: limit,
|
|
616
|
-
});
|
|
617
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
618
|
-
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/credits", req);
|
|
619
|
-
client = this.sdkConfiguration.defaultClient;
|
|
620
|
-
globalSecurity = this.sdkConfiguration.security;
|
|
621
|
-
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
622
|
-
return [4 /*yield*/, globalSecurity()];
|
|
623
|
-
case 1:
|
|
624
|
-
globalSecurity = _c.sent();
|
|
625
|
-
_c.label = 2;
|
|
626
|
-
case 2:
|
|
627
|
-
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
628
|
-
globalSecurity = new shared.Security(globalSecurity);
|
|
629
|
-
}
|
|
630
|
-
properties = utils.parseSecurityProperties(globalSecurity);
|
|
631
|
-
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
632
|
-
queryParams = utils.serializeQueryParams(req);
|
|
633
|
-
headers["Accept"] = "application/json";
|
|
634
|
-
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
635
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
636
|
-
case 3:
|
|
637
|
-
httpRes = _c.sent();
|
|
638
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
639
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
640
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
641
|
-
}
|
|
642
|
-
res = new operations.FetchCustomerCreditsExternalIdResponse({
|
|
643
|
-
statusCode: httpRes.status,
|
|
644
|
-
contentType: contentType,
|
|
645
|
-
rawResponse: httpRes,
|
|
646
|
-
});
|
|
647
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
648
|
-
switch (true) {
|
|
649
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
650
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
651
|
-
res.customerCreditBalances = utils.objectToClass(JSON.parse(decodedRes), shared.CustomerCreditBalances);
|
|
652
|
-
}
|
|
653
|
-
else {
|
|
654
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
655
|
-
}
|
|
656
|
-
break;
|
|
657
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
|
|
658
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
|
|
659
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
|
|
660
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
|
|
661
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
662
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
663
|
-
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
664
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
665
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
666
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
|
|
667
|
-
err.rawResponse = httpRes;
|
|
668
|
-
throw new errors.FourHundredAndOneError(err);
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
672
|
-
}
|
|
673
|
-
break;
|
|
674
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
675
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
676
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
|
|
677
|
-
err.rawResponse = httpRes;
|
|
678
|
-
throw new errors.FourHundredAndTwentyNineError(err);
|
|
679
|
-
}
|
|
680
|
-
else {
|
|
681
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
682
|
-
}
|
|
683
|
-
break;
|
|
684
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
685
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
686
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
|
|
687
|
-
err.rawResponse = httpRes;
|
|
688
|
-
throw new errors.FiveHundredError(err);
|
|
689
|
-
}
|
|
690
|
-
else {
|
|
691
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
692
|
-
}
|
|
693
|
-
break;
|
|
694
|
-
}
|
|
695
|
-
return [2 /*return*/, res];
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
});
|
|
699
|
-
};
|
|
700
|
-
/**
|
|
701
|
-
* Fetch customer credits ledger
|
|
702
|
-
*
|
|
703
|
-
* @remarks
|
|
704
|
-
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have
|
|
705
|
-
* taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these
|
|
706
|
-
* entries, starting from the most recent ledger entry.
|
|
707
|
-
*
|
|
708
|
-
* More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).
|
|
709
|
-
*
|
|
710
|
-
* There are four major types of modifications to credit balance, detailed below.
|
|
711
|
-
*
|
|
712
|
-
* ## Increment
|
|
713
|
-
* Credits (which optionally expire on a future date) can be added via the API
|
|
714
|
-
* ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
|
|
715
|
-
* eligible starting and ending balance for the customer at the time the entry was added to the ledger.
|
|
716
|
-
*
|
|
717
|
-
* ## Decrement
|
|
718
|
-
* Deductions can occur as a result of an API call to create a ledger entry (see
|
|
719
|
-
* [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries
|
|
720
|
-
* present the `decrement` entry type.
|
|
721
|
-
*
|
|
722
|
-
* As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan
|
|
723
|
-
* configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending
|
|
724
|
-
* balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each
|
|
725
|
-
* automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took
|
|
726
|
-
* place and to ensure that credits are never deducted without an associated usage event.
|
|
727
|
-
*
|
|
728
|
-
* By default, Orb uses an algorithm that automatically deducts from the *soonest expiring credit block* first in
|
|
729
|
-
* order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date
|
|
730
|
-
* of 2 weeks from now are present for a customer, they will be used before any deductions take place from a
|
|
731
|
-
* non-expiring credit block.
|
|
732
|
-
*
|
|
733
|
-
* If there are multiple blocks with the same expiration date, Orb will deduct from the block with the
|
|
734
|
-
* *lower cost basis* first (ex. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).
|
|
735
|
-
*
|
|
736
|
-
* It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from
|
|
737
|
-
* the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead
|
|
738
|
-
* to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit
|
|
739
|
-
* balance in Orb can be negative as a result of a decrement.
|
|
740
|
-
*
|
|
741
|
-
* ## Expiration change
|
|
742
|
-
* The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will
|
|
743
|
-
* create a ledger entry that specifies the balance as well as the initial and target expiry dates.
|
|
744
|
-
*
|
|
745
|
-
* Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the
|
|
746
|
-
* balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an
|
|
747
|
-
* expiration change
|
|
748
|
-
*
|
|
749
|
-
* ## Credits expiry
|
|
750
|
-
* When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change
|
|
751
|
-
* and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date
|
|
752
|
-
* boundary in the customer's timezone.
|
|
753
|
-
*
|
|
754
|
-
* ## Void initiated
|
|
755
|
-
* Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were
|
|
756
|
-
* remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.
|
|
757
|
-
*
|
|
758
|
-
* ## Void
|
|
759
|
-
* When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the
|
|
760
|
-
* ledger indicating this event.
|
|
761
|
-
*
|
|
762
|
-
* ## Amendment
|
|
763
|
-
* When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger
|
|
764
|
-
* to indicate the adjustment of credits.
|
|
765
|
-
*/
|
|
766
|
-
Credit.prototype.fetchLedger = function (req, config) {
|
|
767
|
-
var _a, _b;
|
|
768
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
769
|
-
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
|
|
770
|
-
return __generator(this, function (_c) {
|
|
771
|
-
switch (_c.label) {
|
|
772
|
-
case 0:
|
|
773
|
-
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
774
|
-
req = new operations.FetchCustomerCreditsLedgerRequest(req);
|
|
775
|
-
}
|
|
776
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
777
|
-
url = utils.generateURL(baseURL, "/customers/{customer_id}/credits/ledger", req);
|
|
778
|
-
client = this.sdkConfiguration.defaultClient;
|
|
779
|
-
globalSecurity = this.sdkConfiguration.security;
|
|
780
|
-
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
781
|
-
return [4 /*yield*/, globalSecurity()];
|
|
782
|
-
case 1:
|
|
783
|
-
globalSecurity = _c.sent();
|
|
784
|
-
_c.label = 2;
|
|
785
|
-
case 2:
|
|
786
|
-
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
787
|
-
globalSecurity = new shared.Security(globalSecurity);
|
|
788
|
-
}
|
|
789
|
-
properties = utils.parseSecurityProperties(globalSecurity);
|
|
790
|
-
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
791
|
-
queryParams = utils.serializeQueryParams(req);
|
|
792
|
-
headers["Accept"] = "application/json";
|
|
793
|
-
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
794
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
795
|
-
case 3:
|
|
796
|
-
httpRes = _c.sent();
|
|
797
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
798
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
799
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
800
|
-
}
|
|
801
|
-
res = new operations.FetchCustomerCreditsLedgerResponse({
|
|
802
|
-
statusCode: httpRes.status,
|
|
803
|
-
contentType: contentType,
|
|
804
|
-
rawResponse: httpRes,
|
|
805
|
-
});
|
|
806
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
807
|
-
switch (true) {
|
|
808
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
809
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
810
|
-
res.creditLedgerEntries = utils.objectToClass(JSON.parse(decodedRes), shared.CreditLedgerEntries);
|
|
811
|
-
}
|
|
812
|
-
else {
|
|
813
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
814
|
-
}
|
|
815
|
-
break;
|
|
816
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
|
|
817
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
|
|
818
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
|
|
819
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
|
|
820
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
821
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
822
|
-
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
823
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
824
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
825
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
|
|
826
|
-
err.rawResponse = httpRes;
|
|
827
|
-
throw new errors.FourHundredAndOneError(err);
|
|
828
|
-
}
|
|
829
|
-
else {
|
|
830
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
831
|
-
}
|
|
832
|
-
break;
|
|
833
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
834
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
835
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
|
|
836
|
-
err.rawResponse = httpRes;
|
|
837
|
-
throw new errors.FourHundredAndTwentyNineError(err);
|
|
838
|
-
}
|
|
839
|
-
else {
|
|
840
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
841
|
-
}
|
|
842
|
-
break;
|
|
843
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
844
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
845
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
|
|
846
|
-
err.rawResponse = httpRes;
|
|
847
|
-
throw new errors.FiveHundredError(err);
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
850
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
851
|
-
}
|
|
852
|
-
break;
|
|
853
|
-
}
|
|
854
|
-
return [2 /*return*/, res];
|
|
855
|
-
}
|
|
856
|
-
});
|
|
857
|
-
});
|
|
858
|
-
};
|
|
859
|
-
/**
|
|
860
|
-
* Fetch customer credits ledger by external ID
|
|
861
|
-
*
|
|
862
|
-
* @remarks
|
|
863
|
-
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have
|
|
864
|
-
* taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these
|
|
865
|
-
* entries, starting from the most recent ledger entry.
|
|
866
|
-
*
|
|
867
|
-
* More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).
|
|
868
|
-
*
|
|
869
|
-
* There are four major types of modifications to credit balance, detailed below.
|
|
870
|
-
*
|
|
871
|
-
* ## Increment
|
|
872
|
-
* Credits (which optionally expire on a future date) can be added via the API
|
|
873
|
-
* ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
|
|
874
|
-
* eligible starting and ending balance for the customer at the time the entry was added to the ledger.
|
|
875
|
-
*
|
|
876
|
-
* ## Decrement
|
|
877
|
-
* Deductions can occur as a result of an API call to create a ledger entry (see
|
|
878
|
-
* [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries
|
|
879
|
-
* present the `decrement` entry type.
|
|
880
|
-
*
|
|
881
|
-
* As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan
|
|
882
|
-
* configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending
|
|
883
|
-
* balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each
|
|
884
|
-
* automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took
|
|
885
|
-
* place and to ensure that credits are never deducted without an associated usage event.
|
|
886
|
-
*
|
|
887
|
-
* By default, Orb uses an algorithm that automatically deducts from the *soonest expiring credit block* first in
|
|
888
|
-
* order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date
|
|
889
|
-
* of 2 weeks from now are present for a customer, they will be used before any deductions take place from a
|
|
890
|
-
* non-expiring credit block.
|
|
891
|
-
*
|
|
892
|
-
* If there are multiple blocks with the same expiration date, Orb will deduct from the block with the
|
|
893
|
-
* *lower cost basis* first (ex. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).
|
|
894
|
-
*
|
|
895
|
-
* It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from
|
|
896
|
-
* the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead
|
|
897
|
-
* to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit
|
|
898
|
-
* balance in Orb can be negative as a result of a decrement.
|
|
899
|
-
*
|
|
900
|
-
* ## Expiration change
|
|
901
|
-
* The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will
|
|
902
|
-
* create a ledger entry that specifies the balance as well as the initial and target expiry dates.
|
|
903
|
-
*
|
|
904
|
-
* Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the
|
|
905
|
-
* balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an
|
|
906
|
-
* expiration change
|
|
907
|
-
*
|
|
908
|
-
* ## Credits expiry
|
|
909
|
-
* When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change
|
|
910
|
-
* and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date
|
|
911
|
-
* boundary in the customer's timezone.
|
|
912
|
-
*
|
|
913
|
-
* ## Void initiated
|
|
914
|
-
* Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were
|
|
915
|
-
* remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.
|
|
916
|
-
*
|
|
917
|
-
* ## Void
|
|
918
|
-
* When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the
|
|
919
|
-
* ledger indicating this event.
|
|
920
|
-
*
|
|
921
|
-
* ## Amendment
|
|
922
|
-
* When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger
|
|
923
|
-
* to indicate the adjustment of credits.
|
|
924
|
-
*/
|
|
925
|
-
Credit.prototype.fetchLedgerByExternalId = function (req, config) {
|
|
926
|
-
var _a, _b;
|
|
927
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
928
|
-
var baseURL, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes, err, err, err;
|
|
929
|
-
return __generator(this, function (_c) {
|
|
930
|
-
switch (_c.label) {
|
|
931
|
-
case 0:
|
|
932
|
-
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
933
|
-
req = new operations.FetchCustomerCreditsLedgerExternalIdRequest(req);
|
|
934
|
-
}
|
|
935
|
-
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
936
|
-
url = utils.generateURL(baseURL, "/customers/external_customer_id/{external_customer_id}/credits/ledger", req);
|
|
937
|
-
client = this.sdkConfiguration.defaultClient;
|
|
938
|
-
globalSecurity = this.sdkConfiguration.security;
|
|
939
|
-
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
940
|
-
return [4 /*yield*/, globalSecurity()];
|
|
941
|
-
case 1:
|
|
942
|
-
globalSecurity = _c.sent();
|
|
943
|
-
_c.label = 2;
|
|
944
|
-
case 2:
|
|
945
|
-
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
946
|
-
globalSecurity = new shared.Security(globalSecurity);
|
|
947
|
-
}
|
|
948
|
-
properties = utils.parseSecurityProperties(globalSecurity);
|
|
949
|
-
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
950
|
-
queryParams = utils.serializeQueryParams(req);
|
|
951
|
-
headers["Accept"] = "application/json";
|
|
952
|
-
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
953
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
954
|
-
case 3:
|
|
955
|
-
httpRes = _c.sent();
|
|
956
|
-
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
957
|
-
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
958
|
-
throw new Error("status code not found in response: ".concat(httpRes));
|
|
959
|
-
}
|
|
960
|
-
res = new operations.FetchCustomerCreditsLedgerExternalIdResponse({
|
|
961
|
-
statusCode: httpRes.status,
|
|
962
|
-
contentType: contentType,
|
|
963
|
-
rawResponse: httpRes,
|
|
964
|
-
});
|
|
965
|
-
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
966
|
-
switch (true) {
|
|
967
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
968
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
969
|
-
res.creditLedgerEntries = utils.objectToClass(JSON.parse(decodedRes), shared.CreditLedgerEntries);
|
|
970
|
-
}
|
|
971
|
-
else {
|
|
972
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
973
|
-
}
|
|
974
|
-
break;
|
|
975
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 400 ||
|
|
976
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404 ||
|
|
977
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 409 ||
|
|
978
|
-
(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 413 ||
|
|
979
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 400 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 500) ||
|
|
980
|
-
((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) >= 500 && (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) < 600):
|
|
981
|
-
throw new errors.SDKError("API error occurred", httpRes.status, decodedRes, httpRes);
|
|
982
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 401:
|
|
983
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
984
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndOneError);
|
|
985
|
-
err.rawResponse = httpRes;
|
|
986
|
-
throw new errors.FourHundredAndOneError(err);
|
|
987
|
-
}
|
|
988
|
-
else {
|
|
989
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
990
|
-
}
|
|
991
|
-
break;
|
|
992
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 429:
|
|
993
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
994
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FourHundredAndTwentyNineError);
|
|
995
|
-
err.rawResponse = httpRes;
|
|
996
|
-
throw new errors.FourHundredAndTwentyNineError(err);
|
|
997
|
-
}
|
|
998
|
-
else {
|
|
999
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1000
|
-
}
|
|
1001
|
-
break;
|
|
1002
|
-
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 500:
|
|
1003
|
-
if (utils.matchContentType(contentType, "application/json")) {
|
|
1004
|
-
err = utils.objectToClass(JSON.parse(decodedRes), errors.FiveHundredError);
|
|
1005
|
-
err.rawResponse = httpRes;
|
|
1006
|
-
throw new errors.FiveHundredError(err);
|
|
1007
|
-
}
|
|
1008
|
-
else {
|
|
1009
|
-
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
1010
|
-
}
|
|
1011
|
-
break;
|
|
1012
|
-
}
|
|
1013
|
-
return [2 /*return*/, res];
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
});
|
|
1017
|
-
};
|
|
1018
|
-
return Credit;
|
|
1019
|
-
}());
|
|
1020
|
-
exports.Credit = Credit;
|