@metronome/sdk 0.3.0 → 1.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 +48 -28
- package/README.md +123 -51
- 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 +232 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +232 -0
- package/client.d.ts.map +1 -0
- package/client.js +464 -0
- package/client.js.map +1 -0
- package/client.mjs +460 -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 +137 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +137 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +158 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +150 -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 -144
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -143
- package/index.d.ts.map +1 -1
- package/index.js +14 -120
- package/index.js.map +1 -1
- package/index.mjs +6 -93
- 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 +26 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +26 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +120 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +112 -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/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +1 -0
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/formats.js +4 -2
- package/internal/qs/formats.js.map +1 -1
- package/internal/qs/formats.mjs +2 -1
- package/internal/qs/formats.mjs.map +1 -1
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.js +16 -19
- package/internal/qs/stringify.js.map +1 -1
- package/internal/qs/stringify.mjs +17 -19
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +1 -0
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.js +22 -21
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs +12 -12
- package/internal/qs/utils.mjs.map +1 -1
- 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 +113 -64
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -36
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -40
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -38
- 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/index.d.mts +5 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -15
- package/resources/index.js.map +1 -1
- package/resources/shared.d.mts +2239 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +1404 -523
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +203 -0
- package/resources/v1/alerts.d.mts.map +1 -0
- package/resources/v1/alerts.d.ts +78 -7
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +73 -3
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +73 -3
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts +108 -0
- package/resources/v1/audit-logs.d.mts.map +1 -0
- package/resources/v1/audit-logs.d.ts +45 -12
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js +53 -12
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs +52 -10
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts +293 -0
- package/resources/v1/billable-metrics.d.mts.map +1 -0
- package/resources/v1/billable-metrics.d.ts +70 -15
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +70 -16
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +69 -14
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +2984 -0
- package/resources/v1/contracts/contracts.d.mts.map +1 -0
- package/resources/v1/contracts/contracts.d.ts +401 -1294
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +268 -50
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +266 -26
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +5 -0
- package/resources/v1/contracts/index.d.mts.map +1 -0
- package/resources/v1/contracts/index.d.ts +3 -3
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js +1 -3
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs +2 -2
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.mts +82 -0
- package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
- package/resources/v1/contracts/named-schedules.d.ts +5 -4
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +3 -2
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +3 -2
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +502 -0
- package/resources/v1/contracts/products.d.mts.map +1 -0
- package/resources/v1/contracts/products.d.ts +44 -17
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +41 -17
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +40 -15
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
- package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js +1 -3
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs +2 -2
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +13 -9
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards.d.mts +2 -0
- package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
- package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards.js +2 -15
- package/resources/v1/contracts/rate-cards.js.map +1 -1
- package/resources/v1/contracts.d.mts +2 -0
- package/resources/v1/contracts.d.mts.map +1 -0
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.js +2 -15
- package/resources/v1/contracts.js.map +1 -1
- package/resources/v1/credit-grants.d.mts +505 -0
- package/resources/v1/credit-grants.d.mts.map +1 -0
- package/resources/v1/credit-grants.d.ts +73 -74
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +52 -18
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +51 -16
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts +151 -0
- package/resources/v1/custom-fields.d.mts.map +1 -0
- package/resources/v1/custom-fields.d.ts +69 -38
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +66 -22
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +66 -22
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +288 -0
- package/resources/v1/customers/alerts.d.mts.map +1 -0
- package/resources/v1/customers/alerts.d.ts +128 -23
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +112 -10
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +112 -10
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +125 -0
- package/resources/v1/customers/billing-config.d.mts.map +1 -0
- package/resources/v1/customers/billing-config.d.ts +8 -7
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +8 -6
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +8 -6
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +456 -0
- package/resources/v1/customers/commits.d.mts.map +1 -0
- package/resources/v1/customers/commits.d.ts +139 -47
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +131 -12
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +131 -12
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts +310 -0
- package/resources/v1/customers/credits.d.mts.map +1 -0
- package/resources/v1/customers/credits.d.ts +124 -46
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +116 -11
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +116 -11
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +818 -0
- package/resources/v1/customers/customers.d.mts.map +1 -0
- package/resources/v1/customers/customers.d.ts +304 -41
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +214 -73
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +207 -41
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +9 -0
- package/resources/v1/customers/index.d.mts.map +1 -0
- package/resources/v1/customers/index.d.ts +6 -6
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +1 -8
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +3 -3
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +710 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -0
- package/resources/v1/customers/invoices.d.ts +193 -24
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +131 -22
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +130 -19
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts +82 -0
- package/resources/v1/customers/named-schedules.d.mts.map +1 -0
- package/resources/v1/customers/named-schedules.d.ts +5 -4
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +3 -2
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +3 -2
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +281 -0
- package/resources/v1/customers/plans.d.mts.map +1 -0
- package/resources/v1/customers/plans.d.ts +14 -12
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +8 -15
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +7 -12
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/customers.d.mts +2 -0
- package/resources/v1/customers.d.mts.map +1 -0
- package/resources/v1/customers.d.ts.map +1 -1
- package/resources/v1/customers.js +2 -15
- package/resources/v1/customers.js.map +1 -1
- package/resources/v1/dashboards.d.mts +133 -0
- package/resources/v1/dashboards.d.mts.map +1 -0
- package/resources/v1/dashboards.d.ts +33 -6
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +30 -4
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +30 -4
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +15 -0
- package/resources/v1/index.d.mts.map +1 -0
- package/resources/v1/index.d.ts +9 -9
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +1 -12
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +7 -7
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts +83 -0
- package/resources/v1/invoices.d.mts.map +1 -0
- package/resources/v1/invoices.d.ts +28 -6
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +24 -3
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +24 -3
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/plans.d.mts +240 -0
- package/resources/v1/plans.d.mts.map +1 -0
- package/resources/v1/plans.d.ts +24 -15
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +19 -26
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +18 -22
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts +34 -0
- package/resources/v1/pricing-units.d.mts.map +1 -0
- package/resources/v1/pricing-units.d.ts +12 -9
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js +20 -12
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs +19 -10
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts +33 -0
- package/resources/v1/services.d.mts.map +1 -0
- package/resources/v1/services.d.ts +10 -7
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +7 -5
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +7 -5
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.mts +488 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +220 -57
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +212 -26
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +211 -24
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +58 -0
- package/resources/v1/v1.d.mts.map +1 -0
- package/resources/v1/v1.d.ts +15 -15
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +15 -48
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +8 -19
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1.d.mts +2 -0
- package/resources/v1.d.mts.map +1 -0
- package/resources/v1.d.ts.map +1 -1
- package/resources/v1.js +2 -15
- package/resources/v1.js.map +1 -1
- package/resources/v2/contracts.d.mts +2794 -0
- package/resources/v2/contracts.d.mts.map +1 -0
- package/resources/v2/contracts.d.ts +333 -3870
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +102 -12
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +102 -12
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/v2/index.d.mts +3 -0
- package/resources/v2/index.d.mts.map +1 -0
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/v2.d.mts +10 -0
- package/resources/v2/v2.d.mts.map +1 -0
- package/resources/v2/v2.d.ts +1 -1
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.js +3 -25
- package/resources/v2/v2.js.map +1 -1
- package/resources/v2/v2.mjs +1 -1
- package/resources/v2.d.mts +2 -0
- package/resources/v2.d.mts.map +1 -0
- package/resources/v2.d.ts.map +1 -1
- package/resources/v2.js +2 -15
- package/resources/v2.js.map +1 -1
- package/resources/webhooks.d.mts +22 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +1 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +3 -3
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +1 -1
- package/resources/webhooks.mjs.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 +809 -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 +319 -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 -221
- 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 +144 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/formats.ts +3 -2
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +18 -21
- package/src/internal/qs/utils.ts +16 -16
- 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 -82
- package/src/resource.ts +2 -11
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +1794 -534
- package/src/resources/v1/alerts.ts +79 -8
- package/src/resources/v1/audit-logs.ts +48 -26
- package/src/resources/v1/billable-metrics.ts +79 -34
- package/src/resources/v1/contracts/contracts.ts +465 -1633
- package/src/resources/v1/contracts/index.ts +7 -6
- package/src/resources/v1/contracts/named-schedules.ts +8 -6
- package/src/resources/v1/contracts/products.ts +50 -38
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
- package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +100 -112
- package/src/resources/v1/custom-fields.ts +106 -74
- package/src/resources/v1/customers/alerts.ts +147 -28
- package/src/resources/v1/customers/billing-config.ts +27 -13
- package/src/resources/v1/customers/commits.ts +146 -54
- package/src/resources/v1/customers/credits.ts +131 -53
- package/src/resources/v1/customers/customers.ts +390 -101
- package/src/resources/v1/customers/index.ts +19 -18
- package/src/resources/v1/customers/invoices.ts +202 -42
- package/src/resources/v1/customers/named-schedules.ts +8 -6
- package/src/resources/v1/customers/plans.ts +24 -22
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +34 -7
- package/src/resources/v1/index.ts +32 -25
- package/src/resources/v1/invoices.ts +28 -9
- package/src/resources/v1/plans.ts +42 -43
- package/src/resources/v1/pricing-units.ts +15 -23
- package/src/resources/v1/services.ts +10 -7
- package/src/resources/v1/usage.ts +244 -72
- package/src/resources/v1/v1.ts +52 -49
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +420 -5022
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +2 -2
- 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.js +1 -1
- package/version.mjs +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 -1236
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -4,40 +4,35 @@ export {
|
|
|
4
4
|
Alerts,
|
|
5
5
|
type CustomerAlert,
|
|
6
6
|
type AlertRetrieveResponse,
|
|
7
|
-
type AlertListResponse,
|
|
8
7
|
type AlertRetrieveParams,
|
|
9
8
|
type AlertListParams,
|
|
10
9
|
type AlertResetParams,
|
|
11
|
-
|
|
10
|
+
type CustomerAlertsCursorPageWithoutLimit,
|
|
11
|
+
} from './alerts';
|
|
12
12
|
export {
|
|
13
13
|
BillingConfig,
|
|
14
14
|
type BillingConfigRetrieveResponse,
|
|
15
15
|
type BillingConfigCreateParams,
|
|
16
16
|
type BillingConfigRetrieveParams,
|
|
17
17
|
type BillingConfigDeleteParams,
|
|
18
|
-
} from
|
|
18
|
+
} from './billing-config';
|
|
19
19
|
export {
|
|
20
20
|
Commits,
|
|
21
21
|
type CommitCreateResponse,
|
|
22
|
-
type CommitListResponse,
|
|
23
22
|
type CommitUpdateEndDateResponse,
|
|
24
23
|
type CommitCreateParams,
|
|
25
24
|
type CommitListParams,
|
|
26
25
|
type CommitUpdateEndDateParams,
|
|
27
|
-
} from
|
|
26
|
+
} from './commits';
|
|
28
27
|
export {
|
|
29
28
|
Credits,
|
|
30
29
|
type CreditCreateResponse,
|
|
31
|
-
type CreditListResponse,
|
|
32
30
|
type CreditUpdateEndDateResponse,
|
|
33
31
|
type CreditCreateParams,
|
|
34
32
|
type CreditListParams,
|
|
35
33
|
type CreditUpdateEndDateParams,
|
|
36
|
-
} from
|
|
34
|
+
} from './credits';
|
|
37
35
|
export {
|
|
38
|
-
CustomerDetailsCursorPage,
|
|
39
|
-
CustomerListBillableMetricsResponsesCursorPage,
|
|
40
|
-
CustomerListCostsResponsesCursorPage,
|
|
41
36
|
Customers,
|
|
42
37
|
type Customer,
|
|
43
38
|
type CustomerDetail,
|
|
@@ -47,6 +42,7 @@ export {
|
|
|
47
42
|
type CustomerListBillableMetricsResponse,
|
|
48
43
|
type CustomerListCostsResponse,
|
|
49
44
|
type CustomerPreviewEventsResponse,
|
|
45
|
+
type CustomerRetrieveBillingConfigurationsResponse,
|
|
50
46
|
type CustomerSetNameResponse,
|
|
51
47
|
type CustomerCreateParams,
|
|
52
48
|
type CustomerRetrieveParams,
|
|
@@ -55,13 +51,16 @@ export {
|
|
|
55
51
|
type CustomerListBillableMetricsParams,
|
|
56
52
|
type CustomerListCostsParams,
|
|
57
53
|
type CustomerPreviewEventsParams,
|
|
54
|
+
type CustomerRetrieveBillingConfigurationsParams,
|
|
55
|
+
type CustomerSetBillingConfigurationsParams,
|
|
58
56
|
type CustomerSetIngestAliasesParams,
|
|
59
57
|
type CustomerSetNameParams,
|
|
60
58
|
type CustomerUpdateConfigParams,
|
|
61
|
-
|
|
59
|
+
type CustomerDetailsCursorPage,
|
|
60
|
+
type CustomerListBillableMetricsResponsesCursorPage,
|
|
61
|
+
type CustomerListCostsResponsesCursorPage,
|
|
62
|
+
} from './customers';
|
|
62
63
|
export {
|
|
63
|
-
InvoicesCursorPage,
|
|
64
|
-
InvoiceListBreakdownsResponsesCursorPage,
|
|
65
64
|
Invoices,
|
|
66
65
|
type Invoice,
|
|
67
66
|
type InvoiceRetrieveResponse,
|
|
@@ -71,16 +70,16 @@ export {
|
|
|
71
70
|
type InvoiceListParams,
|
|
72
71
|
type InvoiceAddChargeParams,
|
|
73
72
|
type InvoiceListBreakdownsParams,
|
|
74
|
-
|
|
73
|
+
type InvoicesCursorPage,
|
|
74
|
+
type InvoiceListBreakdownsResponsesCursorPage,
|
|
75
|
+
} from './invoices';
|
|
75
76
|
export {
|
|
76
77
|
NamedSchedules,
|
|
77
78
|
type NamedScheduleRetrieveResponse,
|
|
78
79
|
type NamedScheduleRetrieveParams,
|
|
79
80
|
type NamedScheduleUpdateParams,
|
|
80
|
-
} from
|
|
81
|
+
} from './named-schedules';
|
|
81
82
|
export {
|
|
82
|
-
PlanListResponsesCursorPage,
|
|
83
|
-
PlanListPriceAdjustmentsResponsesCursorPage,
|
|
84
83
|
Plans,
|
|
85
84
|
type PlanListResponse,
|
|
86
85
|
type PlanAddResponse,
|
|
@@ -90,4 +89,6 @@ export {
|
|
|
90
89
|
type PlanAddParams,
|
|
91
90
|
type PlanEndParams,
|
|
92
91
|
type PlanListPriceAdjustmentsParams,
|
|
93
|
-
|
|
92
|
+
type PlanListResponsesCursorPage,
|
|
93
|
+
type PlanListPriceAdjustmentsResponsesCursorPage,
|
|
94
|
+
} from './plans';
|
|
@@ -1,13 +1,54 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { CursorPage, type CursorPageParams } from
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
7
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
+
import { path } from '../../../internal/utils/path';
|
|
7
9
|
|
|
8
10
|
export class Invoices extends APIResource {
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
12
|
+
* Retrieve detailed information for a specific invoice by its unique identifier.
|
|
13
|
+
* This endpoint returns comprehensive invoice data including line items, applied
|
|
14
|
+
* credits, totals, and billing period details for both finalized and draft
|
|
15
|
+
* invoices.
|
|
16
|
+
*
|
|
17
|
+
* ### Use this endpoint to:
|
|
18
|
+
*
|
|
19
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
20
|
+
* portals.
|
|
21
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
22
|
+
* spend.
|
|
23
|
+
* - Access finalized invoices for historical billing records and payment
|
|
24
|
+
* reconciliation.
|
|
25
|
+
* - Validate customer pricing and credit applications for customer support
|
|
26
|
+
* queries.
|
|
27
|
+
*
|
|
28
|
+
* ### Key response fields:
|
|
29
|
+
*
|
|
30
|
+
* Invoice status (DRAFT, FINALIZED, VOID) Billing period start and end dates Total
|
|
31
|
+
* amount and amount due after credits Detailed line items broken down by:
|
|
32
|
+
*
|
|
33
|
+
* - Customer and contract information
|
|
34
|
+
* - Invoice line item type
|
|
35
|
+
* - Product/service name and ID
|
|
36
|
+
* - Quantity consumed
|
|
37
|
+
* - Unit and total price
|
|
38
|
+
* - Time period for usage-based charges
|
|
39
|
+
* - Applied credits or prepaid commitments
|
|
40
|
+
*
|
|
41
|
+
* ### Usage guidelines:
|
|
42
|
+
*
|
|
43
|
+
* - Draft invoices update in real-time as usage is reported and may change before
|
|
44
|
+
* finalization
|
|
45
|
+
* - The response includes both usage-based line items (e.g., API calls, data
|
|
46
|
+
* processed) and scheduled charges (e.g., monthly subscriptions, commitment
|
|
47
|
+
* fees)
|
|
48
|
+
* - Credit and commitment applications are shown as separate line items with
|
|
49
|
+
* negative amounts
|
|
50
|
+
* - For voided invoices, the response will indicate VOID status but retain all
|
|
51
|
+
* original line item details
|
|
11
52
|
*
|
|
12
53
|
* @example
|
|
13
54
|
* ```ts
|
|
@@ -19,17 +60,58 @@ export class Invoices extends APIResource {
|
|
|
19
60
|
* );
|
|
20
61
|
* ```
|
|
21
62
|
*/
|
|
22
|
-
retrieve(
|
|
23
|
-
params: InvoiceRetrieveParams,
|
|
24
|
-
options?: Core.RequestOptions,
|
|
25
|
-
): Core.APIPromise<InvoiceRetrieveResponse> {
|
|
63
|
+
retrieve(params: InvoiceRetrieveParams, options?: RequestOptions): APIPromise<InvoiceRetrieveResponse> {
|
|
26
64
|
const { customer_id, invoice_id, ...query } = params;
|
|
27
|
-
return this._client.get(`/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
65
|
+
return this._client.get(path`/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
28
66
|
}
|
|
29
67
|
|
|
30
68
|
/**
|
|
31
|
-
*
|
|
32
|
-
* range,
|
|
69
|
+
* Retrieves a paginated list of invoices for a specific customer, with flexible
|
|
70
|
+
* filtering options to narrow results by status, date range, credit type, and
|
|
71
|
+
* more. This endpoint provides a comprehensive view of a customer's billing
|
|
72
|
+
* history and current charges, supporting both real-time billing dashboards and
|
|
73
|
+
* historical reporting needs.
|
|
74
|
+
*
|
|
75
|
+
* ### Use this endpoint to:
|
|
76
|
+
*
|
|
77
|
+
* - Display historical invoice details in customer-facing dashboards or billing
|
|
78
|
+
* portals.
|
|
79
|
+
* - Retrieve current month draft invoices to show customers their month-to-date
|
|
80
|
+
* spend.
|
|
81
|
+
* - Access finalized invoices for historical billing records and payment
|
|
82
|
+
* reconciliation.
|
|
83
|
+
* - Validate customer pricing and credit applications for customer support
|
|
84
|
+
* queries.
|
|
85
|
+
* - Generate financial reports by filtering invoices within specific date ranges
|
|
86
|
+
*
|
|
87
|
+
* ### Key response fields:
|
|
88
|
+
*
|
|
89
|
+
* Array of invoice objects containing:
|
|
90
|
+
*
|
|
91
|
+
* - Invoice ID and status (DRAFT, FINALIZED, VOID)
|
|
92
|
+
* - Invoice type (USAGE, SCHEDULED)
|
|
93
|
+
* - Billing period start and end dates
|
|
94
|
+
* - Issue date and due date
|
|
95
|
+
* - Total amount, subtotal, and amount due
|
|
96
|
+
* - Applied credits summary
|
|
97
|
+
* - Contract ID reference
|
|
98
|
+
* - External billing provider status (if integrated with Stripe, etc.)
|
|
99
|
+
* - Pagination metadata `next_page` cursor
|
|
100
|
+
*
|
|
101
|
+
* ### Usage guidelines:
|
|
102
|
+
*
|
|
103
|
+
* - The endpoint returns invoice summaries; use the Get Invoice endpoint for
|
|
104
|
+
* detailed line items
|
|
105
|
+
* - Draft invoices are continuously updated as new usage is reported and will show
|
|
106
|
+
* real-time spend
|
|
107
|
+
* - Results are ordered by creation date descending by default (newest first)
|
|
108
|
+
* - When filtering by date range, the filter applies to the billing period, not
|
|
109
|
+
* the issue date
|
|
110
|
+
* - For customers with many invoices, implement pagination to ensure all results
|
|
111
|
+
* are retrieved External billing provider statuses (like Stripe payment status)
|
|
112
|
+
* are included when applicable
|
|
113
|
+
* - Voided invoices are included in results by default unless filtered out by
|
|
114
|
+
* status
|
|
33
115
|
*
|
|
34
116
|
* @example
|
|
35
117
|
* ```ts
|
|
@@ -41,12 +123,9 @@ export class Invoices extends APIResource {
|
|
|
41
123
|
* }
|
|
42
124
|
* ```
|
|
43
125
|
*/
|
|
44
|
-
list(
|
|
45
|
-
params: InvoiceListParams,
|
|
46
|
-
options?: Core.RequestOptions,
|
|
47
|
-
): Core.PagePromise<InvoicesCursorPage, Invoice> {
|
|
126
|
+
list(params: InvoiceListParams, options?: RequestOptions): PagePromise<InvoicesCursorPage, Invoice> {
|
|
48
127
|
const { customer_id, ...query } = params;
|
|
49
|
-
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices`,
|
|
128
|
+
return this._client.getAPIList(path`/v1/customers/${customer_id}/invoices`, CursorPage<Invoice>, {
|
|
50
129
|
query,
|
|
51
130
|
...options,
|
|
52
131
|
});
|
|
@@ -70,20 +149,50 @@ export class Invoices extends APIResource {
|
|
|
70
149
|
* });
|
|
71
150
|
* ```
|
|
72
151
|
*/
|
|
73
|
-
addCharge(
|
|
74
|
-
params: InvoiceAddChargeParams,
|
|
75
|
-
options?: Core.RequestOptions,
|
|
76
|
-
): Core.APIPromise<InvoiceAddChargeResponse> {
|
|
152
|
+
addCharge(params: InvoiceAddChargeParams, options?: RequestOptions): APIPromise<InvoiceAddChargeResponse> {
|
|
77
153
|
const { customer_id, ...body } = params;
|
|
78
|
-
return this._client.post(`/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
154
|
+
return this._client.post(path`/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
79
155
|
}
|
|
80
156
|
|
|
81
157
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
158
|
+
* Retrieve granular time-series breakdowns of invoice data at hourly or daily
|
|
159
|
+
* intervals. This endpoint transforms standard invoices into detailed timelines,
|
|
160
|
+
* enabling you to track usage patterns, identify consumption spikes, and provide
|
|
161
|
+
* customers with transparency into their billing details throughout the billing
|
|
162
|
+
* period.
|
|
163
|
+
*
|
|
164
|
+
* ### Use this endpoint to:
|
|
165
|
+
*
|
|
166
|
+
* - Build usage analytics dashboards showing daily or hourly consumption trends
|
|
167
|
+
* - Identify peak usage periods for capacity planning and cost optimization
|
|
168
|
+
* - Generate detailed billing reports for finance teams and customer success
|
|
169
|
+
* - Troubleshoot billing disputes by examining usage patterns at specific times
|
|
170
|
+
* - Power real-time cost monitoring and alerting systems
|
|
171
|
+
*
|
|
172
|
+
* ### Key response fields:
|
|
173
|
+
*
|
|
174
|
+
* An array of BreakdownInvoice objects, each containing:
|
|
84
175
|
*
|
|
85
|
-
* -
|
|
86
|
-
*
|
|
176
|
+
* - All standard invoice fields (ID, customer, commit, line items, totals, status)
|
|
177
|
+
* - Line items with quantities and costs for that specific period
|
|
178
|
+
* - `breakdown_start_timestamp`: Start of the specific time window
|
|
179
|
+
* - `breakdown_end_timestamp`: End of the specific time window
|
|
180
|
+
* - `next_page`: Pagination cursor for large result sets
|
|
181
|
+
*
|
|
182
|
+
* ### Usage guidelines:
|
|
183
|
+
*
|
|
184
|
+
* - Time granularity: Set `window_size` to hour or day based on your analysis
|
|
185
|
+
* needs
|
|
186
|
+
* - Response limits: Daily breakdowns return up to 35 days; hourly breakdowns
|
|
187
|
+
* return up to 24 hours per request
|
|
188
|
+
* - Date filtering: Use `starting_on` and `ending_before` to focus on specific
|
|
189
|
+
* periods
|
|
190
|
+
* - Performance: For large date ranges, use pagination to retrieve all data
|
|
191
|
+
* efficiently
|
|
192
|
+
* - Backdated usage: If usage events arrive after invoice finalization, breakdowns
|
|
193
|
+
* will reflect the updated usage
|
|
194
|
+
* - Zero quantity filtering: Use `skip_zero_qty_line_items=true` to exclude
|
|
195
|
+
* periods with no usage
|
|
87
196
|
*
|
|
88
197
|
* @example
|
|
89
198
|
* ```ts
|
|
@@ -101,20 +210,20 @@ export class Invoices extends APIResource {
|
|
|
101
210
|
*/
|
|
102
211
|
listBreakdowns(
|
|
103
212
|
params: InvoiceListBreakdownsParams,
|
|
104
|
-
options?:
|
|
105
|
-
):
|
|
213
|
+
options?: RequestOptions,
|
|
214
|
+
): PagePromise<InvoiceListBreakdownsResponsesCursorPage, InvoiceListBreakdownsResponse> {
|
|
106
215
|
const { customer_id, ...query } = params;
|
|
107
216
|
return this._client.getAPIList(
|
|
108
|
-
`/v1/customers/${customer_id}/invoices/breakdowns`,
|
|
109
|
-
|
|
217
|
+
path`/v1/customers/${customer_id}/invoices/breakdowns`,
|
|
218
|
+
CursorPage<InvoiceListBreakdownsResponse>,
|
|
110
219
|
{ query, ...options },
|
|
111
220
|
);
|
|
112
221
|
}
|
|
113
222
|
}
|
|
114
223
|
|
|
115
|
-
export
|
|
224
|
+
export type InvoicesCursorPage = CursorPage<Invoice>;
|
|
116
225
|
|
|
117
|
-
export
|
|
226
|
+
export type InvoiceListBreakdownsResponsesCursorPage = CursorPage<InvoiceListBreakdownsResponse>;
|
|
118
227
|
|
|
119
228
|
export interface Invoice {
|
|
120
229
|
id: string;
|
|
@@ -138,6 +247,9 @@ export interface Invoice {
|
|
|
138
247
|
*/
|
|
139
248
|
billable_status?: 'billable' | 'unbillable';
|
|
140
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
252
|
+
*/
|
|
141
253
|
contract_custom_fields?: { [key: string]: string };
|
|
142
254
|
|
|
143
255
|
contract_id?: string;
|
|
@@ -152,6 +264,9 @@ export interface Invoice {
|
|
|
152
264
|
|
|
153
265
|
custom_fields?: { [key: string]: unknown };
|
|
154
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
269
|
+
*/
|
|
155
270
|
customer_custom_fields?: { [key: string]: string };
|
|
156
271
|
|
|
157
272
|
/**
|
|
@@ -175,6 +290,9 @@ export interface Invoice {
|
|
|
175
290
|
*/
|
|
176
291
|
netsuite_sales_order_id?: string;
|
|
177
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
295
|
+
*/
|
|
178
296
|
plan_custom_fields?: { [key: string]: string };
|
|
179
297
|
|
|
180
298
|
plan_id?: string;
|
|
@@ -208,11 +326,29 @@ export namespace Invoice {
|
|
|
208
326
|
total: number;
|
|
209
327
|
|
|
210
328
|
/**
|
|
211
|
-
* The type of line item.
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
329
|
+
* The type of line item.
|
|
330
|
+
*
|
|
331
|
+
* - `scheduled`: Line item is associated with a scheduled charge. View the
|
|
332
|
+
* scheduled_charge_id on the line item.
|
|
333
|
+
* - `commit_purchase`: Line item is associated with a payment for a prepaid
|
|
334
|
+
* commit. View the commit_id on the line item.
|
|
335
|
+
* - `usage`: Line item is associated with a usage product or composite product.
|
|
336
|
+
* View the product_id on the line item to determine which product.
|
|
337
|
+
* - `subscription`: Line item is associated with a subscription. e.g. monthly
|
|
338
|
+
* recurring payment for an in-advance subscription.
|
|
339
|
+
* - `applied_commit_or_credit`: On metronome invoices, applied commits and credits
|
|
340
|
+
* are associated with their own line items. These line items have negative
|
|
341
|
+
* totals. Use the applied_commit_or_credit object on the line item to understand
|
|
342
|
+
* the id of the applied commit or credit, and its type. Note that the
|
|
343
|
+
* application of a postpaid commit is associated with a line item, but the total
|
|
344
|
+
* on the line item is not included in the invoice's total as postpaid commits
|
|
345
|
+
* are paid in-arrears.
|
|
346
|
+
* - `cpu_conversion`: Line item converting between a custom pricing unit and fiat
|
|
347
|
+
* currency, using the conversion rate set on the rate card. This line item will
|
|
348
|
+
* appear when there are products priced in custom pricing units, and there is
|
|
349
|
+
* insufficient prepaid commit/credit in that custom pricing unit to fully cover
|
|
350
|
+
* the spend. Then, the outstanding spend in custom pricing units will be
|
|
351
|
+
* converted to fiat currency using a cpu_conversion line item.
|
|
216
352
|
*/
|
|
217
353
|
type: string;
|
|
218
354
|
|
|
@@ -223,6 +359,9 @@ export namespace Invoice {
|
|
|
223
359
|
*/
|
|
224
360
|
applied_commit_or_credit?: LineItem.AppliedCommitOrCredit;
|
|
225
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
364
|
+
*/
|
|
226
365
|
commit_custom_fields?: { [key: string]: string };
|
|
227
366
|
|
|
228
367
|
/**
|
|
@@ -245,8 +384,14 @@ export namespace Invoice {
|
|
|
245
384
|
*/
|
|
246
385
|
commit_type?: string;
|
|
247
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
389
|
+
*/
|
|
248
390
|
custom_fields?: { [key: string]: string };
|
|
249
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
394
|
+
*/
|
|
250
395
|
discount_custom_fields?: { [key: string]: string };
|
|
251
396
|
|
|
252
397
|
/**
|
|
@@ -306,6 +451,9 @@ export namespace Invoice {
|
|
|
306
451
|
*/
|
|
307
452
|
pricing_group_values?: { [key: string]: string };
|
|
308
453
|
|
|
454
|
+
/**
|
|
455
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
456
|
+
*/
|
|
309
457
|
product_custom_fields?: { [key: string]: string };
|
|
310
458
|
|
|
311
459
|
/**
|
|
@@ -327,6 +475,9 @@ export namespace Invoice {
|
|
|
327
475
|
*/
|
|
328
476
|
product_type?: string;
|
|
329
477
|
|
|
478
|
+
/**
|
|
479
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
480
|
+
*/
|
|
330
481
|
professional_service_custom_fields?: { [key: string]: string };
|
|
331
482
|
|
|
332
483
|
professional_service_id?: string;
|
|
@@ -338,6 +489,9 @@ export namespace Invoice {
|
|
|
338
489
|
|
|
339
490
|
reseller_type?: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
|
|
340
491
|
|
|
492
|
+
/**
|
|
493
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
494
|
+
*/
|
|
341
495
|
scheduled_charge_custom_fields?: { [key: string]: string };
|
|
342
496
|
|
|
343
497
|
/**
|
|
@@ -352,6 +506,9 @@ export namespace Invoice {
|
|
|
352
506
|
|
|
353
507
|
sub_line_items?: Array<LineItem.SubLineItem>;
|
|
354
508
|
|
|
509
|
+
/**
|
|
510
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
511
|
+
*/
|
|
355
512
|
subscription_custom_fields?: { [key: string]: string };
|
|
356
513
|
|
|
357
514
|
/**
|
|
@@ -385,6 +542,9 @@ export namespace Invoice {
|
|
|
385
542
|
}
|
|
386
543
|
|
|
387
544
|
export interface SubLineItem {
|
|
545
|
+
/**
|
|
546
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
547
|
+
*/
|
|
388
548
|
custom_fields: { [key: string]: string };
|
|
389
549
|
|
|
390
550
|
name: string;
|
|
@@ -534,6 +694,9 @@ export namespace Invoice {
|
|
|
534
694
|
|
|
535
695
|
total: number;
|
|
536
696
|
|
|
697
|
+
/**
|
|
698
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
699
|
+
*/
|
|
537
700
|
credit_grant_custom_fields?: { [key: string]: string };
|
|
538
701
|
|
|
539
702
|
credit_grant_id?: string;
|
|
@@ -728,17 +891,14 @@ export interface InvoiceListBreakdownsParams extends CursorPageParams {
|
|
|
728
891
|
window_size?: 'HOUR' | 'DAY';
|
|
729
892
|
}
|
|
730
893
|
|
|
731
|
-
Invoices.InvoicesCursorPage = InvoicesCursorPage;
|
|
732
|
-
Invoices.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
733
|
-
|
|
734
894
|
export declare namespace Invoices {
|
|
735
895
|
export {
|
|
736
896
|
type Invoice as Invoice,
|
|
737
897
|
type InvoiceRetrieveResponse as InvoiceRetrieveResponse,
|
|
738
898
|
type InvoiceAddChargeResponse as InvoiceAddChargeResponse,
|
|
739
899
|
type InvoiceListBreakdownsResponse as InvoiceListBreakdownsResponse,
|
|
740
|
-
InvoicesCursorPage as InvoicesCursorPage,
|
|
741
|
-
InvoiceListBreakdownsResponsesCursorPage as InvoiceListBreakdownsResponsesCursorPage,
|
|
900
|
+
type InvoicesCursorPage as InvoicesCursorPage,
|
|
901
|
+
type InvoiceListBreakdownsResponsesCursorPage as InvoiceListBreakdownsResponsesCursorPage,
|
|
742
902
|
type InvoiceRetrieveParams as InvoiceRetrieveParams,
|
|
743
903
|
type InvoiceListParams as InvoiceListParams,
|
|
744
904
|
type InvoiceAddChargeParams as InvoiceAddChargeParams,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
5
7
|
|
|
6
8
|
export class NamedSchedules extends APIResource {
|
|
7
9
|
/**
|
|
@@ -20,8 +22,8 @@ export class NamedSchedules extends APIResource {
|
|
|
20
22
|
*/
|
|
21
23
|
retrieve(
|
|
22
24
|
body: NamedScheduleRetrieveParams,
|
|
23
|
-
options?:
|
|
24
|
-
):
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<NamedScheduleRetrieveResponse> {
|
|
25
27
|
return this._client.post('/v1/customers/getNamedSchedule', { body, ...options });
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -40,11 +42,11 @@ export class NamedSchedules extends APIResource {
|
|
|
40
42
|
* });
|
|
41
43
|
* ```
|
|
42
44
|
*/
|
|
43
|
-
update(body: NamedScheduleUpdateParams, options?:
|
|
45
|
+
update(body: NamedScheduleUpdateParams, options?: RequestOptions): APIPromise<void> {
|
|
44
46
|
return this._client.post('/v1/customers/updateNamedSchedule', {
|
|
45
47
|
body,
|
|
46
48
|
...options,
|
|
47
|
-
headers: { Accept: '*/*',
|
|
49
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { CursorPage, type CursorPageParams } from
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
7
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
+
import { path } from '../../../internal/utils/path';
|
|
7
9
|
|
|
8
10
|
export class Plans extends APIResource {
|
|
9
11
|
/**
|
|
@@ -21,10 +23,10 @@ export class Plans extends APIResource {
|
|
|
21
23
|
*/
|
|
22
24
|
list(
|
|
23
25
|
params: PlanListParams,
|
|
24
|
-
options?:
|
|
25
|
-
):
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): PagePromise<PlanListResponsesCursorPage, PlanListResponse> {
|
|
26
28
|
const { customer_id, ...query } = params;
|
|
27
|
-
return this._client.getAPIList(`/v1/customers/${customer_id}/plans`,
|
|
29
|
+
return this._client.getAPIList(path`/v1/customers/${customer_id}/plans`, CursorPage<PlanListResponse>, {
|
|
28
30
|
query,
|
|
29
31
|
...options,
|
|
30
32
|
});
|
|
@@ -45,9 +47,9 @@ export class Plans extends APIResource {
|
|
|
45
47
|
* });
|
|
46
48
|
* ```
|
|
47
49
|
*/
|
|
48
|
-
add(params: PlanAddParams, options?:
|
|
50
|
+
add(params: PlanAddParams, options?: RequestOptions): APIPromise<PlanAddResponse> {
|
|
49
51
|
const { customer_id, ...body } = params;
|
|
50
|
-
return this._client.post(`/v1/customers/${customer_id}/plans/add`, { body, ...options });
|
|
52
|
+
return this._client.post(path`/v1/customers/${customer_id}/plans/add`, { body, ...options });
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
/**
|
|
@@ -62,9 +64,9 @@ export class Plans extends APIResource {
|
|
|
62
64
|
* });
|
|
63
65
|
* ```
|
|
64
66
|
*/
|
|
65
|
-
end(params: PlanEndParams, options?:
|
|
67
|
+
end(params: PlanEndParams, options?: RequestOptions): APIPromise<PlanEndResponse> {
|
|
66
68
|
const { customer_id, customer_plan_id, ...body } = params;
|
|
67
|
-
return this._client.post(`/v1/customers/${customer_id}/plans/${customer_plan_id}/end`, {
|
|
69
|
+
return this._client.post(path`/v1/customers/${customer_id}/plans/${customer_plan_id}/end`, {
|
|
68
70
|
body,
|
|
69
71
|
...options,
|
|
70
72
|
});
|
|
@@ -91,20 +93,20 @@ export class Plans extends APIResource {
|
|
|
91
93
|
*/
|
|
92
94
|
listPriceAdjustments(
|
|
93
95
|
params: PlanListPriceAdjustmentsParams,
|
|
94
|
-
options?:
|
|
95
|
-
):
|
|
96
|
+
options?: RequestOptions,
|
|
97
|
+
): PagePromise<PlanListPriceAdjustmentsResponsesCursorPage, PlanListPriceAdjustmentsResponse> {
|
|
96
98
|
const { customer_id, customer_plan_id, ...query } = params;
|
|
97
99
|
return this._client.getAPIList(
|
|
98
|
-
`/v1/customers/${customer_id}/plans/${customer_plan_id}/priceAdjustments`,
|
|
99
|
-
|
|
100
|
+
path`/v1/customers/${customer_id}/plans/${customer_plan_id}/priceAdjustments`,
|
|
101
|
+
CursorPage<PlanListPriceAdjustmentsResponse>,
|
|
100
102
|
{ query, ...options },
|
|
101
103
|
);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
export
|
|
107
|
+
export type PlanListResponsesCursorPage = CursorPage<PlanListResponse>;
|
|
106
108
|
|
|
107
|
-
export
|
|
109
|
+
export type PlanListPriceAdjustmentsResponsesCursorPage = CursorPage<PlanListPriceAdjustmentsResponse>;
|
|
108
110
|
|
|
109
111
|
export interface PlanListResponse {
|
|
110
112
|
/**
|
|
@@ -112,6 +114,9 @@ export interface PlanListResponse {
|
|
|
112
114
|
*/
|
|
113
115
|
id: string;
|
|
114
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
119
|
+
*/
|
|
115
120
|
custom_fields: { [key: string]: string };
|
|
116
121
|
|
|
117
122
|
plan_description: string;
|
|
@@ -358,17 +363,14 @@ export interface PlanListPriceAdjustmentsParams extends CursorPageParams {
|
|
|
358
363
|
customer_plan_id: string;
|
|
359
364
|
}
|
|
360
365
|
|
|
361
|
-
Plans.PlanListResponsesCursorPage = PlanListResponsesCursorPage;
|
|
362
|
-
Plans.PlanListPriceAdjustmentsResponsesCursorPage = PlanListPriceAdjustmentsResponsesCursorPage;
|
|
363
|
-
|
|
364
366
|
export declare namespace Plans {
|
|
365
367
|
export {
|
|
366
368
|
type PlanListResponse as PlanListResponse,
|
|
367
369
|
type PlanAddResponse as PlanAddResponse,
|
|
368
370
|
type PlanEndResponse as PlanEndResponse,
|
|
369
371
|
type PlanListPriceAdjustmentsResponse as PlanListPriceAdjustmentsResponse,
|
|
370
|
-
PlanListResponsesCursorPage as PlanListResponsesCursorPage,
|
|
371
|
-
PlanListPriceAdjustmentsResponsesCursorPage as PlanListPriceAdjustmentsResponsesCursorPage,
|
|
372
|
+
type PlanListResponsesCursorPage as PlanListResponsesCursorPage,
|
|
373
|
+
type PlanListPriceAdjustmentsResponsesCursorPage as PlanListPriceAdjustmentsResponsesCursorPage,
|
|
372
374
|
type PlanListParams as PlanListParams,
|
|
373
375
|
type PlanAddParams as PlanAddParams,
|
|
374
376
|
type PlanEndParams as PlanEndParams,
|