dodopayments 1.53.2 → 2.0.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 +10 -0
- package/README.md +114 -44
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/bin/cli +53 -0
- package/bin/migration-config.json +6 -0
- package/client.d.mts +259 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +259 -0
- package/client.d.ts.map +1 -0
- package/client.js +536 -0
- package/client.js.map +1 -0
- package/client.mjs +532 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +70 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +70 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +129 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +122 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +3 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -190
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -189
- package/index.d.ts.map +1 -1
- package/index.js +14 -195
- package/index.js.map +1 -1
- package/index.mjs +6 -168
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +115 -66
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -34
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -71
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -68
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/addons.d.mts +113 -0
- package/resources/addons.d.mts.map +1 -0
- package/resources/addons.d.ts +11 -12
- package/resources/addons.d.ts.map +1 -1
- package/resources/addons.js +8 -15
- package/resources/addons.js.map +1 -1
- package/resources/addons.mjs +7 -13
- package/resources/addons.mjs.map +1 -1
- package/resources/brands.d.mts +66 -0
- package/resources/brands.d.mts.map +1 -0
- package/resources/brands.d.ts +8 -7
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js +5 -4
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs +5 -4
- package/resources/brands.mjs.map +1 -1
- package/resources/checkout-sessions.d.mts +349 -0
- package/resources/checkout-sessions.d.mts.map +1 -0
- package/resources/checkout-sessions.d.ts +4 -3
- package/resources/checkout-sessions.d.ts.map +1 -1
- package/resources/checkout-sessions.js +1 -1
- package/resources/checkout-sessions.js.map +1 -1
- package/resources/checkout-sessions.mjs +1 -1
- package/resources/checkout-sessions.mjs.map +1 -1
- package/resources/customers/customer-portal.d.mts +17 -0
- package/resources/customers/customer-portal.d.mts.map +1 -0
- package/resources/customers/customer-portal.d.ts +4 -4
- package/resources/customers/customer-portal.d.ts.map +1 -1
- package/resources/customers/customer-portal.js +5 -8
- package/resources/customers/customer-portal.js.map +1 -1
- package/resources/customers/customer-portal.mjs +5 -8
- package/resources/customers/customer-portal.mjs.map +1 -1
- package/resources/customers/customers.d.mts +49 -0
- package/resources/customers/customers.d.mts.map +1 -0
- package/resources/customers/customers.d.ts +10 -11
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +15 -41
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +11 -14
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/index.d.mts +4 -0
- package/resources/customers/index.d.mts.map +1 -0
- package/resources/customers/index.d.ts +1 -1
- package/resources/customers/index.d.ts.map +1 -1
- package/resources/customers/index.js +1 -2
- package/resources/customers/index.js.map +1 -1
- package/resources/customers/index.mjs +1 -1
- package/resources/customers/index.mjs.map +1 -1
- package/resources/customers/wallets/index.d.mts +3 -0
- package/resources/customers/wallets/index.d.mts.map +1 -0
- package/resources/customers/wallets/index.d.ts +1 -1
- package/resources/customers/wallets/index.d.ts.map +1 -1
- package/resources/customers/wallets/index.js +1 -2
- package/resources/customers/wallets/index.js.map +1 -1
- package/resources/customers/wallets/index.mjs +1 -1
- package/resources/customers/wallets/index.mjs.map +1 -1
- package/resources/customers/wallets/ledger-entries.d.mts +51 -0
- package/resources/customers/wallets/ledger-entries.d.mts.map +1 -0
- package/resources/customers/wallets/ledger-entries.d.ts +8 -9
- package/resources/customers/wallets/ledger-entries.d.ts.map +1 -1
- package/resources/customers/wallets/ledger-entries.js +8 -16
- package/resources/customers/wallets/ledger-entries.js.map +1 -1
- package/resources/customers/wallets/ledger-entries.mjs +7 -14
- package/resources/customers/wallets/ledger-entries.mjs.map +1 -1
- package/resources/customers/wallets/wallets.d.mts +29 -0
- package/resources/customers/wallets/wallets.d.mts.map +1 -0
- package/resources/customers/wallets/wallets.d.ts +5 -4
- package/resources/customers/wallets/wallets.d.ts.map +1 -1
- package/resources/customers/wallets/wallets.js +6 -29
- package/resources/customers/wallets/wallets.js.map +1 -1
- package/resources/customers/wallets/wallets.mjs +5 -6
- package/resources/customers/wallets/wallets.mjs.map +1 -1
- package/resources/customers/wallets.d.mts +2 -0
- package/resources/customers/wallets.d.mts.map +1 -0
- package/resources/customers/wallets.d.ts.map +1 -1
- package/resources/customers/wallets.js +2 -15
- package/resources/customers/wallets.js.map +1 -1
- package/resources/customers.d.mts +2 -0
- package/resources/customers.d.mts.map +1 -0
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.js +2 -15
- package/resources/customers.js.map +1 -1
- package/resources/discounts.d.mts +168 -0
- package/resources/discounts.d.mts.map +1 -0
- package/resources/discounts.d.ts +11 -12
- package/resources/discounts.d.ts.map +1 -1
- package/resources/discounts.js +19 -19
- package/resources/discounts.js.map +1 -1
- package/resources/discounts.mjs +18 -17
- package/resources/discounts.mjs.map +1 -1
- package/resources/disputes.d.mts +159 -0
- package/resources/disputes.d.mts.map +1 -0
- package/resources/disputes.d.ts +8 -9
- package/resources/disputes.d.ts.map +1 -1
- package/resources/disputes.js +7 -14
- package/resources/disputes.js.map +1 -1
- package/resources/disputes.mjs +6 -12
- package/resources/disputes.mjs.map +1 -1
- package/resources/index.d.mts +21 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +14 -14
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -20
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +14 -14
- package/resources/index.mjs.map +1 -1
- package/resources/invoices/index.d.mts +3 -0
- package/resources/invoices/index.d.mts.map +1 -0
- package/resources/invoices/index.d.ts.map +1 -1
- package/resources/invoices/invoices.d.mts +10 -0
- package/resources/invoices/invoices.d.mts.map +1 -0
- package/resources/invoices/invoices.d.ts +1 -1
- package/resources/invoices/invoices.d.ts.map +1 -1
- package/resources/invoices/invoices.js +3 -25
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs +1 -1
- package/resources/invoices/payments.d.mts +8 -0
- package/resources/invoices/payments.d.mts.map +1 -0
- package/resources/invoices/payments.d.ts +5 -5
- package/resources/invoices/payments.d.ts.map +1 -1
- package/resources/invoices/payments.js +9 -7
- package/resources/invoices/payments.js.map +1 -1
- package/resources/invoices/payments.mjs +9 -7
- package/resources/invoices/payments.mjs.map +1 -1
- package/resources/invoices.d.mts +2 -0
- package/resources/invoices.d.mts.map +1 -0
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +2 -15
- package/resources/invoices.js.map +1 -1
- package/resources/license-key-instances.d.mts +55 -0
- package/resources/license-key-instances.d.mts.map +1 -0
- package/resources/license-key-instances.d.ts +9 -10
- package/resources/license-key-instances.d.ts.map +1 -1
- package/resources/license-key-instances.js +16 -18
- package/resources/license-key-instances.js.map +1 -1
- package/resources/license-key-instances.mjs +15 -16
- package/resources/license-key-instances.mjs.map +1 -1
- package/resources/license-keys.d.mts +122 -0
- package/resources/license-keys.d.mts.map +1 -0
- package/resources/license-keys.d.ts +9 -10
- package/resources/license-keys.d.ts.map +1 -1
- package/resources/license-keys.js +16 -14
- package/resources/license-keys.js.map +1 -1
- package/resources/license-keys.mjs +15 -12
- package/resources/license-keys.mjs.map +1 -1
- package/resources/licenses.d.mts +99 -0
- package/resources/licenses.d.mts.map +1 -0
- package/resources/licenses.d.ts +6 -5
- package/resources/licenses.d.ts.map +1 -1
- package/resources/licenses.js +3 -2
- package/resources/licenses.js.map +1 -1
- package/resources/licenses.mjs +3 -2
- package/resources/licenses.mjs.map +1 -1
- package/resources/meters.d.mts +191 -0
- package/resources/meters.d.mts.map +1 -0
- package/resources/meters.d.ts +11 -12
- package/resources/meters.d.ts.map +1 -1
- package/resources/meters.js +11 -17
- package/resources/meters.js.map +1 -1
- package/resources/meters.mjs +10 -15
- package/resources/meters.mjs.map +1 -1
- package/resources/misc.d.mts +21 -0
- package/resources/misc.d.mts.map +1 -0
- package/resources/misc.d.ts +4 -3
- package/resources/misc.d.ts.map +1 -1
- package/resources/misc.js +1 -1
- package/resources/misc.js.map +1 -1
- package/resources/misc.mjs +1 -1
- package/resources/misc.mjs.map +1 -1
- package/resources/payments.d.mts +420 -0
- package/resources/payments.d.mts.map +1 -0
- package/resources/payments.d.ts +10 -11
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +9 -16
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +8 -14
- package/resources/payments.mjs.map +1 -1
- package/resources/payouts.d.mts +76 -0
- package/resources/payouts.d.mts.map +1 -0
- package/resources/payouts.d.ts +6 -8
- package/resources/payouts.d.ts.map +1 -1
- package/resources/payouts.js +4 -12
- package/resources/payouts.js.map +1 -1
- package/resources/payouts.mjs +3 -10
- package/resources/payouts.mjs.map +1 -1
- package/resources/products/images.d.mts +17 -0
- package/resources/products/images.d.mts.map +1 -0
- package/resources/products/images.d.ts +4 -4
- package/resources/products/images.d.ts.map +1 -1
- package/resources/products/images.js +4 -7
- package/resources/products/images.js.map +1 -1
- package/resources/products/images.mjs +4 -7
- package/resources/products/images.mjs.map +1 -1
- package/resources/products/index.d.mts +3 -0
- package/resources/products/index.d.mts.map +1 -0
- package/resources/products/index.d.ts +1 -1
- package/resources/products/index.d.ts.map +1 -1
- package/resources/products/index.js +1 -2
- package/resources/products/index.js.map +1 -1
- package/resources/products/index.mjs +1 -1
- package/resources/products/index.mjs.map +1 -1
- package/resources/products/products.d.mts +535 -0
- package/resources/products/products.d.mts.map +1 -0
- package/resources/products/products.d.ts +13 -14
- package/resources/products/products.d.ts.map +1 -1
- package/resources/products/products.js +16 -44
- package/resources/products/products.js.map +1 -1
- package/resources/products/products.mjs +13 -18
- package/resources/products/products.mjs.map +1 -1
- package/resources/products.d.mts +2 -0
- package/resources/products.d.mts.map +1 -0
- package/resources/products.d.ts.map +1 -1
- package/resources/products.js +2 -15
- package/resources/products.js.map +1 -1
- package/resources/refunds.d.mts +145 -0
- package/resources/refunds.d.mts.map +1 -0
- package/resources/refunds.d.ts +9 -10
- package/resources/refunds.d.ts.map +1 -1
- package/resources/refunds.js +7 -14
- package/resources/refunds.js.map +1 -1
- package/resources/refunds.mjs +6 -12
- package/resources/refunds.mjs.map +1 -1
- package/resources/subscriptions.d.mts +626 -0
- package/resources/subscriptions.d.mts.map +1 -0
- package/resources/subscriptions.d.ts +14 -17
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +61 -32
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +60 -29
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/usage-events.d.mts +192 -0
- package/resources/usage-events.d.mts.map +1 -0
- package/resources/usage-events.d.ts +9 -10
- package/resources/usage-events.d.ts.map +1 -1
- package/resources/usage-events.js +42 -14
- package/resources/usage-events.js.map +1 -1
- package/resources/usage-events.mjs +41 -12
- package/resources/usage-events.mjs.map +1 -1
- package/resources/webhook-events.d.mts +52 -0
- package/resources/webhook-events.d.mts.map +1 -0
- package/resources/webhook-events.d.ts +1 -1
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-events.js +1 -1
- package/resources/webhook-events.js.map +1 -1
- package/resources/webhook-events.mjs +1 -1
- package/resources/webhooks/headers.d.mts +42 -0
- package/resources/webhooks/headers.d.mts.map +1 -0
- package/resources/webhooks/headers.d.ts +5 -4
- package/resources/webhooks/headers.d.ts.map +1 -1
- package/resources/webhooks/headers.js +8 -6
- package/resources/webhooks/headers.js.map +1 -1
- package/resources/webhooks/headers.mjs +8 -6
- package/resources/webhooks/headers.mjs.map +1 -1
- package/resources/webhooks/index.d.mts +3 -0
- package/resources/webhooks/index.d.mts.map +1 -0
- package/resources/webhooks/index.d.ts +1 -1
- package/resources/webhooks/index.d.ts.map +1 -1
- package/resources/webhooks/index.js +1 -2
- package/resources/webhooks/index.js.map +1 -1
- package/resources/webhooks/index.mjs +1 -1
- package/resources/webhooks/index.mjs.map +1 -1
- package/resources/webhooks/webhooks.d.mts +155 -0
- package/resources/webhooks/webhooks.d.mts.map +1 -0
- package/resources/webhooks/webhooks.d.ts +12 -13
- package/resources/webhooks/webhooks.d.ts.map +1 -1
- package/resources/webhooks/webhooks.js +20 -45
- package/resources/webhooks/webhooks.js.map +1 -1
- package/resources/webhooks/webhooks.mjs +17 -19
- package/resources/webhooks/webhooks.mjs.map +1 -1
- package/resources/webhooks.d.mts +2 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +2 -15
- package/resources/webhooks.js.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1206 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +218 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +6 -658
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/pagination.ts +2 -125
- package/src/resource.ts +2 -11
- package/src/resources/addons.ts +23 -30
- package/src/resources/brands.ts +12 -10
- package/src/resources/checkout-sessions.ts +7 -9
- package/src/resources/customers/customer-portal.ts +11 -22
- package/src/resources/customers/customers.ts +27 -32
- package/src/resources/customers/index.ts +4 -4
- package/src/resources/customers/wallets/index.ts +3 -3
- package/src/resources/customers/wallets/ledger-entries.ts +24 -33
- package/src/resources/customers/wallets/wallets.ts +10 -10
- package/src/resources/customers/wallets.ts +1 -1
- package/src/resources/customers.ts +1 -1
- package/src/resources/discounts.ts +27 -32
- package/src/resources/disputes.ts +19 -25
- package/src/resources/index.ts +42 -42
- package/src/resources/invoices/index.ts +2 -2
- package/src/resources/invoices/invoices.ts +3 -3
- package/src/resources/invoices/payments.ts +11 -9
- package/src/resources/invoices.ts +1 -1
- package/src/resources/license-key-instances.ts +24 -31
- package/src/resources/license-keys.ts +19 -28
- package/src/resources/licenses.ts +9 -13
- package/src/resources/meters.ts +25 -29
- package/src/resources/misc.ts +4 -3
- package/src/resources/payments.ts +26 -32
- package/src/resources/payouts.ts +14 -23
- package/src/resources/products/images.ts +9 -17
- package/src/resources/products/index.ts +3 -3
- package/src/resources/products/products.ts +37 -41
- package/src/resources/products.ts +1 -1
- package/src/resources/refunds.ts +20 -27
- package/src/resources/subscriptions.ts +44 -72
- package/src/resources/usage-events.ts +18 -26
- package/src/resources/webhook-events.ts +6 -6
- package/src/resources/webhooks/headers.ts +10 -7
- package/src/resources/webhooks/index.ts +3 -3
- package/src/resources/webhooks/webhooks.ts +25 -39
- package/src/resources/webhooks.ts +1 -1
- package/src/resources.ts +1 -1
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -255
- package/core.d.ts.map +0 -1
- package/core.js +0 -924
- package/core.js.map +0 -1
- package/core.mjs +0 -892
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1237
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { APIResource } from "../resource.js";
|
|
2
|
-
import * as Core from "../core.js";
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
3
2
|
import * as MiscAPI from "./misc.js";
|
|
4
3
|
import * as PaymentsAPI from "./payments.js";
|
|
5
|
-
import {
|
|
4
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
5
|
+
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
6
7
|
export declare class Subscriptions extends APIResource {
|
|
7
|
-
create(body: SubscriptionCreateParams, options?:
|
|
8
|
-
retrieve(
|
|
9
|
-
update(
|
|
10
|
-
list(query?: SubscriptionListParams, options?:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
charge(subscriptionId: string, body: SubscriptionChargeParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionChargeResponse>;
|
|
8
|
+
create(body: SubscriptionCreateParams, options?: RequestOptions): APIPromise<SubscriptionCreateResponse>;
|
|
9
|
+
retrieve(subscriptionID: string, options?: RequestOptions): APIPromise<Subscription>;
|
|
10
|
+
update(subscriptionID: string, body: SubscriptionUpdateParams, options?: RequestOptions): APIPromise<Subscription>;
|
|
11
|
+
list(query?: SubscriptionListParams | null | undefined, options?: RequestOptions): PagePromise<SubscriptionListResponsesDefaultPageNumberPagination, SubscriptionListResponse>;
|
|
12
|
+
changePlan(subscriptionID: string, body: SubscriptionChangePlanParams, options?: RequestOptions): APIPromise<void>;
|
|
13
|
+
charge(subscriptionID: string, body: SubscriptionChargeParams, options?: RequestOptions): APIPromise<SubscriptionChargeResponse>;
|
|
14
14
|
/**
|
|
15
15
|
* Get detailed usage history for a subscription that includes usage-based billing
|
|
16
16
|
* (metered components). This endpoint provides insights into customer usage
|
|
@@ -55,13 +55,10 @@ export declare class Subscriptions extends APIResource {
|
|
|
55
55
|
* - Paginate results: `?page_size=20&page_number=1`
|
|
56
56
|
* - Recent usage: `?start_date=2024-03-01T00:00:00Z` (from March 1st to now)
|
|
57
57
|
*/
|
|
58
|
-
retrieveUsageHistory(
|
|
59
|
-
retrieveUsageHistory(subscriptionId: string, options?: Core.RequestOptions): Core.PagePromise<SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination, SubscriptionRetrieveUsageHistoryResponse>;
|
|
60
|
-
}
|
|
61
|
-
export declare class SubscriptionListResponsesDefaultPageNumberPagination extends DefaultPageNumberPagination<SubscriptionListResponse> {
|
|
62
|
-
}
|
|
63
|
-
export declare class SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination extends DefaultPageNumberPagination<SubscriptionRetrieveUsageHistoryResponse> {
|
|
58
|
+
retrieveUsageHistory(subscriptionID: string, query?: SubscriptionRetrieveUsageHistoryParams | null | undefined, options?: RequestOptions): PagePromise<SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination, SubscriptionRetrieveUsageHistoryResponse>;
|
|
64
59
|
}
|
|
60
|
+
export type SubscriptionListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<SubscriptionListResponse>;
|
|
61
|
+
export type SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<SubscriptionRetrieveUsageHistoryResponse>;
|
|
65
62
|
/**
|
|
66
63
|
* Response struct representing subscription details
|
|
67
64
|
*/
|
|
@@ -624,6 +621,6 @@ export interface SubscriptionRetrieveUsageHistoryParams extends DefaultPageNumbe
|
|
|
624
621
|
start_date?: string | null;
|
|
625
622
|
}
|
|
626
623
|
export declare namespace Subscriptions {
|
|
627
|
-
export { type AddonCartResponseItem as AddonCartResponseItem, type AttachAddon as AttachAddon, type OnDemandSubscription as OnDemandSubscription, type Subscription as Subscription, type SubscriptionStatus as SubscriptionStatus, type TimeInterval as TimeInterval, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionChargeResponse as SubscriptionChargeResponse, type SubscriptionRetrieveUsageHistoryResponse as SubscriptionRetrieveUsageHistoryResponse, SubscriptionListResponsesDefaultPageNumberPagination as SubscriptionListResponsesDefaultPageNumberPagination, SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination as SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionChangePlanParams as SubscriptionChangePlanParams, type SubscriptionChargeParams as SubscriptionChargeParams, type SubscriptionRetrieveUsageHistoryParams as SubscriptionRetrieveUsageHistoryParams, };
|
|
624
|
+
export { type AddonCartResponseItem as AddonCartResponseItem, type AttachAddon as AttachAddon, type OnDemandSubscription as OnDemandSubscription, type Subscription as Subscription, type SubscriptionStatus as SubscriptionStatus, type TimeInterval as TimeInterval, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionChargeResponse as SubscriptionChargeResponse, type SubscriptionRetrieveUsageHistoryResponse as SubscriptionRetrieveUsageHistoryResponse, type SubscriptionListResponsesDefaultPageNumberPagination as SubscriptionListResponsesDefaultPageNumberPagination, type SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination as SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination, type SubscriptionCreateParams as SubscriptionCreateParams, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionChangePlanParams as SubscriptionChangePlanParams, type SubscriptionChargeParams as SubscriptionChargeParams, type SubscriptionRetrieveUsageHistoryParams as SubscriptionRetrieveUsageHistoryParams, };
|
|
628
625
|
}
|
|
629
626
|
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAA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,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sCAAsC,IAAI,sCAAsC,GACtF,CAAC;CACH"}
|
|
@@ -1,55 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
const resource_1 = require("../resource.js");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
exports.Subscriptions = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../internal/headers.js");
|
|
8
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
9
|
class Subscriptions extends resource_1.APIResource {
|
|
9
10
|
create(body, options) {
|
|
10
11
|
return this._client.post('/subscriptions', { body, ...options });
|
|
11
12
|
}
|
|
12
|
-
retrieve(
|
|
13
|
-
return this._client.get(`/subscriptions/${
|
|
13
|
+
retrieve(subscriptionID, options) {
|
|
14
|
+
return this._client.get((0, path_1.path) `/subscriptions/${subscriptionID}`, options);
|
|
14
15
|
}
|
|
15
|
-
update(
|
|
16
|
-
return this._client.patch(`/subscriptions/${
|
|
16
|
+
update(subscriptionID, body, options) {
|
|
17
|
+
return this._client.patch((0, path_1.path) `/subscriptions/${subscriptionID}`, { body, ...options });
|
|
17
18
|
}
|
|
18
19
|
list(query = {}, options) {
|
|
19
|
-
|
|
20
|
-
return this.list({}, query);
|
|
21
|
-
}
|
|
22
|
-
return this._client.getAPIList('/subscriptions', SubscriptionListResponsesDefaultPageNumberPagination, {
|
|
20
|
+
return this._client.getAPIList('/subscriptions', (pagination_1.DefaultPageNumberPagination), {
|
|
23
21
|
query,
|
|
24
22
|
...options,
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
|
-
changePlan(
|
|
28
|
-
return this._client.post(`/subscriptions/${
|
|
25
|
+
changePlan(subscriptionID, body, options) {
|
|
26
|
+
return this._client.post((0, path_1.path) `/subscriptions/${subscriptionID}/change-plan`, {
|
|
29
27
|
body,
|
|
30
28
|
...options,
|
|
31
|
-
headers: { Accept: '*/*',
|
|
29
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
|
-
charge(
|
|
35
|
-
return this._client.post(`/subscriptions/${
|
|
32
|
+
charge(subscriptionID, body, options) {
|
|
33
|
+
return this._client.post((0, path_1.path) `/subscriptions/${subscriptionID}/charge`, { body, ...options });
|
|
36
34
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Get detailed usage history for a subscription that includes usage-based billing
|
|
37
|
+
* (metered components). This endpoint provides insights into customer usage
|
|
38
|
+
* patterns and billing calculations over time.
|
|
39
|
+
*
|
|
40
|
+
* ## What You'll Get:
|
|
41
|
+
*
|
|
42
|
+
* - **Billing periods**: Each item represents a billing cycle with start and end
|
|
43
|
+
* dates
|
|
44
|
+
* - **Meter usage**: Detailed breakdown of usage for each meter configured on the
|
|
45
|
+
* subscription
|
|
46
|
+
* - **Usage calculations**: Total units consumed, free threshold units, and
|
|
47
|
+
* chargeable units
|
|
48
|
+
* - **Historical tracking**: Complete audit trail of usage-based charges
|
|
49
|
+
*
|
|
50
|
+
* ## Use Cases:
|
|
51
|
+
*
|
|
52
|
+
* - **Customer support**: Investigate billing questions and usage discrepancies
|
|
53
|
+
* - **Usage analytics**: Analyze customer consumption patterns over time
|
|
54
|
+
* - **Billing transparency**: Provide customers with detailed usage breakdowns
|
|
55
|
+
* - **Revenue optimization**: Identify usage trends to optimize pricing strategies
|
|
56
|
+
*
|
|
57
|
+
* ## Filtering Options:
|
|
58
|
+
*
|
|
59
|
+
* - **Date range filtering**: Get usage history for specific time periods
|
|
60
|
+
* - **Meter-specific filtering**: Focus on usage for a particular meter
|
|
61
|
+
* - **Pagination**: Navigate through large usage histories efficiently
|
|
62
|
+
*
|
|
63
|
+
* ## Important Notes:
|
|
64
|
+
*
|
|
65
|
+
* - Only returns data for subscriptions with usage-based (metered) components
|
|
66
|
+
* - Usage history is organized by billing periods (subscription cycles)
|
|
67
|
+
* - Free threshold units are calculated and displayed separately from chargeable
|
|
68
|
+
* units
|
|
69
|
+
* - Historical data is preserved even if meter configurations change
|
|
70
|
+
*
|
|
71
|
+
* ## Example Query Patterns:
|
|
72
|
+
*
|
|
73
|
+
* - Get last 3 months:
|
|
74
|
+
* `?start_date=2024-01-01T00:00:00Z&end_date=2024-03-31T23:59:59Z`
|
|
75
|
+
* - Filter by meter: `?meter_id=mtr_api_requests`
|
|
76
|
+
* - Paginate results: `?page_size=20&page_number=1`
|
|
77
|
+
* - Recent usage: `?start_date=2024-03-01T00:00:00Z` (from March 1st to now)
|
|
78
|
+
*/
|
|
79
|
+
retrieveUsageHistory(subscriptionID, query = {}, options) {
|
|
80
|
+
return this._client.getAPIList((0, path_1.path) `/subscriptions/${subscriptionID}/usage-history`, (pagination_1.DefaultPageNumberPagination), { query, ...options });
|
|
42
81
|
}
|
|
43
82
|
}
|
|
44
83
|
exports.Subscriptions = Subscriptions;
|
|
45
|
-
class SubscriptionListResponsesDefaultPageNumberPagination extends pagination_1.DefaultPageNumberPagination {
|
|
46
|
-
}
|
|
47
|
-
exports.SubscriptionListResponsesDefaultPageNumberPagination = SubscriptionListResponsesDefaultPageNumberPagination;
|
|
48
|
-
class SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination extends pagination_1.DefaultPageNumberPagination {
|
|
49
|
-
}
|
|
50
|
-
exports.SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination = SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination;
|
|
51
|
-
Subscriptions.SubscriptionListResponsesDefaultPageNumberPagination =
|
|
52
|
-
SubscriptionListResponsesDefaultPageNumberPagination;
|
|
53
|
-
Subscriptions.SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination =
|
|
54
|
-
SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination;
|
|
55
84
|
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAI4B;AAC5B,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,aAAc,SAAQ,sBAAW;IAC5C,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED,MAAM,CACJ,cAAsB,EACtB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,wCAAqD,CAAA,EAAE;YACtG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED,UAAU,CACR,cAAsB,EACtB,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,cAAc,EAAE;YAC3E,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CACJ,cAAsB,EACtB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,cAAc,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,oBAAoB,CAClB,cAAsB,EACtB,QAAmE,EAAE,EACrE,OAAwB;QAKxB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,kBAAkB,cAAc,gBAAgB,EACpD,CAAA,wCAAqE,CAAA,EACrE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAzGD,sCAyGC"}
|
|
@@ -1,49 +1,80 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../resource.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { DefaultPageNumberPagination, } from "../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
5
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
6
|
export class Subscriptions extends APIResource {
|
|
6
7
|
create(body, options) {
|
|
7
8
|
return this._client.post('/subscriptions', { body, ...options });
|
|
8
9
|
}
|
|
9
|
-
retrieve(
|
|
10
|
-
return this._client.get(`/subscriptions/${
|
|
10
|
+
retrieve(subscriptionID, options) {
|
|
11
|
+
return this._client.get(path `/subscriptions/${subscriptionID}`, options);
|
|
11
12
|
}
|
|
12
|
-
update(
|
|
13
|
-
return this._client.patch(`/subscriptions/${
|
|
13
|
+
update(subscriptionID, body, options) {
|
|
14
|
+
return this._client.patch(path `/subscriptions/${subscriptionID}`, { body, ...options });
|
|
14
15
|
}
|
|
15
16
|
list(query = {}, options) {
|
|
16
|
-
|
|
17
|
-
return this.list({}, query);
|
|
18
|
-
}
|
|
19
|
-
return this._client.getAPIList('/subscriptions', SubscriptionListResponsesDefaultPageNumberPagination, {
|
|
17
|
+
return this._client.getAPIList('/subscriptions', (DefaultPageNumberPagination), {
|
|
20
18
|
query,
|
|
21
19
|
...options,
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
|
-
changePlan(
|
|
25
|
-
return this._client.post(`/subscriptions/${
|
|
22
|
+
changePlan(subscriptionID, body, options) {
|
|
23
|
+
return this._client.post(path `/subscriptions/${subscriptionID}/change-plan`, {
|
|
26
24
|
body,
|
|
27
25
|
...options,
|
|
28
|
-
headers: { Accept: '*/*',
|
|
26
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
|
-
charge(
|
|
32
|
-
return this._client.post(`/subscriptions/${
|
|
29
|
+
charge(subscriptionID, body, options) {
|
|
30
|
+
return this._client.post(path `/subscriptions/${subscriptionID}/charge`, { body, ...options });
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Get detailed usage history for a subscription that includes usage-based billing
|
|
34
|
+
* (metered components). This endpoint provides insights into customer usage
|
|
35
|
+
* patterns and billing calculations over time.
|
|
36
|
+
*
|
|
37
|
+
* ## What You'll Get:
|
|
38
|
+
*
|
|
39
|
+
* - **Billing periods**: Each item represents a billing cycle with start and end
|
|
40
|
+
* dates
|
|
41
|
+
* - **Meter usage**: Detailed breakdown of usage for each meter configured on the
|
|
42
|
+
* subscription
|
|
43
|
+
* - **Usage calculations**: Total units consumed, free threshold units, and
|
|
44
|
+
* chargeable units
|
|
45
|
+
* - **Historical tracking**: Complete audit trail of usage-based charges
|
|
46
|
+
*
|
|
47
|
+
* ## Use Cases:
|
|
48
|
+
*
|
|
49
|
+
* - **Customer support**: Investigate billing questions and usage discrepancies
|
|
50
|
+
* - **Usage analytics**: Analyze customer consumption patterns over time
|
|
51
|
+
* - **Billing transparency**: Provide customers with detailed usage breakdowns
|
|
52
|
+
* - **Revenue optimization**: Identify usage trends to optimize pricing strategies
|
|
53
|
+
*
|
|
54
|
+
* ## Filtering Options:
|
|
55
|
+
*
|
|
56
|
+
* - **Date range filtering**: Get usage history for specific time periods
|
|
57
|
+
* - **Meter-specific filtering**: Focus on usage for a particular meter
|
|
58
|
+
* - **Pagination**: Navigate through large usage histories efficiently
|
|
59
|
+
*
|
|
60
|
+
* ## Important Notes:
|
|
61
|
+
*
|
|
62
|
+
* - Only returns data for subscriptions with usage-based (metered) components
|
|
63
|
+
* - Usage history is organized by billing periods (subscription cycles)
|
|
64
|
+
* - Free threshold units are calculated and displayed separately from chargeable
|
|
65
|
+
* units
|
|
66
|
+
* - Historical data is preserved even if meter configurations change
|
|
67
|
+
*
|
|
68
|
+
* ## Example Query Patterns:
|
|
69
|
+
*
|
|
70
|
+
* - Get last 3 months:
|
|
71
|
+
* `?start_date=2024-01-01T00:00:00Z&end_date=2024-03-31T23:59:59Z`
|
|
72
|
+
* - Filter by meter: `?meter_id=mtr_api_requests`
|
|
73
|
+
* - Paginate results: `?page_size=20&page_number=1`
|
|
74
|
+
* - Recent usage: `?start_date=2024-03-01T00:00:00Z` (from March 1st to now)
|
|
75
|
+
*/
|
|
76
|
+
retrieveUsageHistory(subscriptionID, query = {}, options) {
|
|
77
|
+
return this._client.getAPIList(path `/subscriptions/${subscriptionID}/usage-history`, (DefaultPageNumberPagination), { query, ...options });
|
|
39
78
|
}
|
|
40
79
|
}
|
|
41
|
-
export class SubscriptionListResponsesDefaultPageNumberPagination extends DefaultPageNumberPagination {
|
|
42
|
-
}
|
|
43
|
-
export class SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination extends DefaultPageNumberPagination {
|
|
44
|
-
}
|
|
45
|
-
Subscriptions.SubscriptionListResponsesDefaultPageNumberPagination =
|
|
46
|
-
SubscriptionListResponsesDefaultPageNumberPagination;
|
|
47
|
-
Subscriptions.SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination =
|
|
48
|
-
SubscriptionRetrieveUsageHistoryResponsesDefaultPageNumberPagination;
|
|
49
80
|
//# sourceMappingURL=subscriptions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EACL,2BAA2B,GAG5B;OACM,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,QAAQ,CAAC,cAAsB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,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
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
export declare class UsageEvents extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Fetch detailed information about a single event using its unique event ID. This
|
|
8
|
+
* endpoint is useful for:
|
|
9
|
+
*
|
|
10
|
+
* - Debugging specific event ingestion issues
|
|
11
|
+
* - Retrieving event details for customer support
|
|
12
|
+
* - Validating that events were processed correctly
|
|
13
|
+
* - Getting the complete metadata for an event
|
|
14
|
+
*
|
|
15
|
+
* ## Event ID Format:
|
|
16
|
+
*
|
|
17
|
+
* The event ID should be the same value that was provided during event ingestion
|
|
18
|
+
* via the `/events/ingest` endpoint. Event IDs are case-sensitive and must match
|
|
19
|
+
* exactly.
|
|
20
|
+
*
|
|
21
|
+
* ## Response Details:
|
|
22
|
+
*
|
|
23
|
+
* The response includes all event data including:
|
|
24
|
+
*
|
|
25
|
+
* - Complete metadata key-value pairs
|
|
26
|
+
* - Original timestamp (preserved from ingestion)
|
|
27
|
+
* - Customer and business association
|
|
28
|
+
* - Event name and processing information
|
|
29
|
+
*
|
|
30
|
+
* ## Example Usage:
|
|
31
|
+
*
|
|
32
|
+
* ```text
|
|
33
|
+
* GET /events/api_call_12345
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
retrieve(eventID: string, options?: RequestOptions): APIPromise<Event>;
|
|
37
|
+
/**
|
|
38
|
+
* Fetch events from your account with powerful filtering capabilities. This
|
|
39
|
+
* endpoint is ideal for:
|
|
40
|
+
*
|
|
41
|
+
* - Debugging event ingestion issues
|
|
42
|
+
* - Analyzing customer usage patterns
|
|
43
|
+
* - Building custom analytics dashboards
|
|
44
|
+
* - Auditing billing-related events
|
|
45
|
+
*
|
|
46
|
+
* ## Filtering Options:
|
|
47
|
+
*
|
|
48
|
+
* - **Customer filtering**: Filter by specific customer ID
|
|
49
|
+
* - **Event name filtering**: Filter by event type/name
|
|
50
|
+
* - **Meter-based filtering**: Use a meter ID to apply the meter's event name and
|
|
51
|
+
* filter criteria automatically
|
|
52
|
+
* - **Time range filtering**: Filter events within a specific date range
|
|
53
|
+
* - **Pagination**: Navigate through large result sets
|
|
54
|
+
*
|
|
55
|
+
* ## Meter Integration:
|
|
56
|
+
*
|
|
57
|
+
* When using `meter_id`, the endpoint automatically applies:
|
|
58
|
+
*
|
|
59
|
+
* - The meter's configured `event_name` filter
|
|
60
|
+
* - The meter's custom filter criteria (if any)
|
|
61
|
+
* - If you also provide `event_name`, it must match the meter's event name
|
|
62
|
+
*
|
|
63
|
+
* ## Example Queries:
|
|
64
|
+
*
|
|
65
|
+
* - Get all events for a customer: `?customer_id=cus_abc123`
|
|
66
|
+
* - Get API request events: `?event_name=api_request`
|
|
67
|
+
* - Get events from last 24 hours:
|
|
68
|
+
* `?start=2024-01-14T10:30:00Z&end=2024-01-15T10:30:00Z`
|
|
69
|
+
* - Get events with meter filtering: `?meter_id=mtr_xyz789`
|
|
70
|
+
* - Paginate results: `?page_size=50&page_number=2`
|
|
71
|
+
*/
|
|
72
|
+
list(query?: UsageEventListParams | null | undefined, options?: RequestOptions): PagePromise<EventsDefaultPageNumberPagination, Event>;
|
|
73
|
+
/**
|
|
74
|
+
* This endpoint allows you to ingest custom events that can be used for:
|
|
75
|
+
*
|
|
76
|
+
* - Usage-based billing and metering
|
|
77
|
+
* - Analytics and reporting
|
|
78
|
+
* - Customer behavior tracking
|
|
79
|
+
*
|
|
80
|
+
* ## Important Notes:
|
|
81
|
+
*
|
|
82
|
+
* - **Duplicate Prevention**:
|
|
83
|
+
* - Duplicate `event_id` values within the same request are rejected (entire
|
|
84
|
+
* request fails)
|
|
85
|
+
* - Subsequent requests with existing `event_id` values are ignored (idempotent
|
|
86
|
+
* behavior)
|
|
87
|
+
* - **Rate Limiting**: Maximum 1000 events per request
|
|
88
|
+
* - **Time Validation**: Events with timestamps older than 1 hour or more than 5
|
|
89
|
+
* minutes in the future will be rejected
|
|
90
|
+
* - **Metadata Limits**: Maximum 50 key-value pairs per event, keys max 100 chars,
|
|
91
|
+
* values max 500 chars
|
|
92
|
+
*
|
|
93
|
+
* ## Example Usage:
|
|
94
|
+
*
|
|
95
|
+
* ```json
|
|
96
|
+
* {
|
|
97
|
+
* "events": [
|
|
98
|
+
* {
|
|
99
|
+
* "event_id": "api_call_12345",
|
|
100
|
+
* "customer_id": "cus_abc123",
|
|
101
|
+
* "event_name": "api_request",
|
|
102
|
+
* "timestamp": "2024-01-15T10:30:00Z",
|
|
103
|
+
* "metadata": {
|
|
104
|
+
* "endpoint": "/api/v1/users",
|
|
105
|
+
* "method": "GET",
|
|
106
|
+
* "tokens_used": "150"
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
* ]
|
|
110
|
+
* }
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
ingest(body: UsageEventIngestParams, options?: RequestOptions): APIPromise<UsageEventIngestResponse>;
|
|
114
|
+
}
|
|
115
|
+
export type EventsDefaultPageNumberPagination = DefaultPageNumberPagination<Event>;
|
|
116
|
+
export interface Event {
|
|
117
|
+
business_id: string;
|
|
118
|
+
customer_id: string;
|
|
119
|
+
event_id: string;
|
|
120
|
+
event_name: string;
|
|
121
|
+
timestamp: string;
|
|
122
|
+
/**
|
|
123
|
+
* Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
124
|
+
*/
|
|
125
|
+
metadata?: {
|
|
126
|
+
[key: string]: string | number | boolean;
|
|
127
|
+
} | null;
|
|
128
|
+
}
|
|
129
|
+
export interface EventInput {
|
|
130
|
+
/**
|
|
131
|
+
* customer_id of the customer whose usage needs to be tracked
|
|
132
|
+
*/
|
|
133
|
+
customer_id: string;
|
|
134
|
+
/**
|
|
135
|
+
* Event Id acts as an idempotency key. Any subsequent requests with the same
|
|
136
|
+
* event_id will be ignored
|
|
137
|
+
*/
|
|
138
|
+
event_id: string;
|
|
139
|
+
/**
|
|
140
|
+
* Name of the event
|
|
141
|
+
*/
|
|
142
|
+
event_name: string;
|
|
143
|
+
/**
|
|
144
|
+
* Custom metadata. Only key value pairs are accepted, objects or arrays submitted
|
|
145
|
+
* will be rejected.
|
|
146
|
+
*/
|
|
147
|
+
metadata?: {
|
|
148
|
+
[key: string]: string | number | boolean;
|
|
149
|
+
} | null;
|
|
150
|
+
/**
|
|
151
|
+
* Custom Timestamp. Defaults to current timestamp in UTC. Timestamps that are
|
|
152
|
+
* older that 1 hour or after 5 mins, from current timestamp, will be rejected.
|
|
153
|
+
*/
|
|
154
|
+
timestamp?: string | null;
|
|
155
|
+
}
|
|
156
|
+
export interface UsageEventIngestResponse {
|
|
157
|
+
ingested_count: number;
|
|
158
|
+
}
|
|
159
|
+
export interface UsageEventListParams extends DefaultPageNumberPaginationParams {
|
|
160
|
+
/**
|
|
161
|
+
* Filter events by customer ID
|
|
162
|
+
*/
|
|
163
|
+
customer_id?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Filter events created before this timestamp
|
|
166
|
+
*/
|
|
167
|
+
end?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Filter events by event name. If both event_name and meter_id are provided, they
|
|
170
|
+
* must match the meter's configured event_name
|
|
171
|
+
*/
|
|
172
|
+
event_name?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Filter events by meter ID. When provided, only events that match the meter's
|
|
175
|
+
* event_name and filter criteria will be returned
|
|
176
|
+
*/
|
|
177
|
+
meter_id?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Filter events created after this timestamp
|
|
180
|
+
*/
|
|
181
|
+
start?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface UsageEventIngestParams {
|
|
184
|
+
/**
|
|
185
|
+
* List of events to be pushed
|
|
186
|
+
*/
|
|
187
|
+
events: Array<EventInput>;
|
|
188
|
+
}
|
|
189
|
+
export declare namespace UsageEvents {
|
|
190
|
+
export { type Event as Event, type EventInput as EventInput, type UsageEventIngestResponse as UsageEventIngestResponse, type EventsDefaultPageNumberPagination as EventsDefaultPageNumberPagination, type UsageEventListParams as UsageEventListParams, type UsageEventIngestParams as UsageEventIngestParams, };
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=usage-events.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-events.d.mts","sourceRoot":"","sources":["../src/resources/usage-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,WAAW,EACZ;OACM,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;IAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iCAAiC,EAAE,KAAK,CAAC;IAIxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrG;AAED,MAAM,MAAM,iCAAiC,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;AAEnF,MAAM,WAAW,KAAK;IACpB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAElB;;OA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@
|
|
|
1
|
-
import { APIResource } from "../resource.js";
|
|
2
|
-
import
|
|
3
|
-
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams } from "../pagination.js";
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
5
|
export declare class UsageEvents extends APIResource {
|
|
5
6
|
/**
|
|
6
7
|
* Fetch detailed information about a single event using its unique event ID. This
|
|
@@ -32,7 +33,7 @@ export declare class UsageEvents extends APIResource {
|
|
|
32
33
|
* GET /events/api_call_12345
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
|
-
retrieve(
|
|
36
|
+
retrieve(eventID: string, options?: RequestOptions): APIPromise<Event>;
|
|
36
37
|
/**
|
|
37
38
|
* Fetch events from your account with powerful filtering capabilities. This
|
|
38
39
|
* endpoint is ideal for:
|
|
@@ -68,8 +69,7 @@ export declare class UsageEvents extends APIResource {
|
|
|
68
69
|
* - Get events with meter filtering: `?meter_id=mtr_xyz789`
|
|
69
70
|
* - Paginate results: `?page_size=50&page_number=2`
|
|
70
71
|
*/
|
|
71
|
-
list(query?: UsageEventListParams, options?:
|
|
72
|
-
list(options?: Core.RequestOptions): Core.PagePromise<EventsDefaultPageNumberPagination, Event>;
|
|
72
|
+
list(query?: UsageEventListParams | null | undefined, options?: RequestOptions): PagePromise<EventsDefaultPageNumberPagination, Event>;
|
|
73
73
|
/**
|
|
74
74
|
* This endpoint allows you to ingest custom events that can be used for:
|
|
75
75
|
*
|
|
@@ -110,10 +110,9 @@ export declare class UsageEvents extends APIResource {
|
|
|
110
110
|
* }
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
|
-
ingest(body: UsageEventIngestParams, options?:
|
|
114
|
-
}
|
|
115
|
-
export declare class EventsDefaultPageNumberPagination extends DefaultPageNumberPagination<Event> {
|
|
113
|
+
ingest(body: UsageEventIngestParams, options?: RequestOptions): APIPromise<UsageEventIngestResponse>;
|
|
116
114
|
}
|
|
115
|
+
export type EventsDefaultPageNumberPagination = DefaultPageNumberPagination<Event>;
|
|
117
116
|
export interface Event {
|
|
118
117
|
business_id: string;
|
|
119
118
|
customer_id: string;
|
|
@@ -188,6 +187,6 @@ export interface UsageEventIngestParams {
|
|
|
188
187
|
events: Array<EventInput>;
|
|
189
188
|
}
|
|
190
189
|
export declare namespace UsageEvents {
|
|
191
|
-
export { type Event as Event, type EventInput as EventInput, type UsageEventIngestResponse as UsageEventIngestResponse, EventsDefaultPageNumberPagination as EventsDefaultPageNumberPagination, type UsageEventListParams as UsageEventListParams, type UsageEventIngestParams as UsageEventIngestParams, };
|
|
190
|
+
export { type Event as Event, type EventInput as EventInput, type UsageEventIngestResponse as UsageEventIngestResponse, type EventsDefaultPageNumberPagination as EventsDefaultPageNumberPagination, type UsageEventListParams as UsageEventListParams, type UsageEventIngestParams as UsageEventIngestParams, };
|
|
192
191
|
}
|
|
193
192
|
//# sourceMappingURL=usage-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-events.d.ts","sourceRoot":"","sources":["../src/resources/usage-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usage-events.d.ts","sourceRoot":"","sources":["../src/resources/usage-events.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,WAAW,EACZ;OACM,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;IAItE;;;;;;;;;;;;;;;;;;;;;;;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