@metronome/sdk 0.2.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 +62 -0
- 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 +116 -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 +1409 -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 +450 -1285
- 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 +47 -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 +145 -47
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +132 -12
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +132 -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 +196 -19
- 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 +381 -3862
- 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 -220
- 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 +1786 -520
- 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 +518 -1622
- 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 +52 -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 +153 -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 +206 -37
- 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 +431 -4967
- 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
|
@@ -1,9 +1,73 @@
|
|
|
1
|
-
import { APIResource } from "../../../resource.js";
|
|
2
|
-
import * as Core from "../../../core.js";
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
3
2
|
import * as Shared from "../../shared.js";
|
|
3
|
+
import { CommitsBodyCursorPage } from "../../shared.js";
|
|
4
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
5
|
+
import { type BodyCursorPageParams, PagePromise } from "../../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
4
7
|
export declare class Commits extends APIResource {
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
9
|
+
* Creates customer-level commits that establish spending commitments for customers
|
|
10
|
+
* across their Metronome usage. Commits represent contracted spending obligations
|
|
11
|
+
* that can be either prepaid (paid upfront) or postpaid (billed later).
|
|
12
|
+
*
|
|
13
|
+
* Note: In most cases, you should add commitments directly to customer contracts
|
|
14
|
+
* using the contract/create or contract/edit APIs.
|
|
15
|
+
*
|
|
16
|
+
* ### Use this endpoint to:
|
|
17
|
+
*
|
|
18
|
+
* Use this endpoint when you need to establish customer-level spending commitments
|
|
19
|
+
* that can be applied across multiple contracts or scoped to specific contracts.
|
|
20
|
+
* Customer-level commits are ideal for:
|
|
21
|
+
*
|
|
22
|
+
* - Enterprise-wide minimum spending agreements that span multiple contracts
|
|
23
|
+
* - Multi-contract volume commitments with shared spending pools
|
|
24
|
+
* - Cross-contract discount tiers based on aggregate usage
|
|
25
|
+
*
|
|
26
|
+
* #### Commit type Requirements:
|
|
27
|
+
*
|
|
28
|
+
* - You must specify either "prepaid" or "postpaid" as the commit type:
|
|
29
|
+
* - Prepaid commits: Customer pays upfront; invoice_schedule is optional (if
|
|
30
|
+
* omitted, creates a commit without an invoice)
|
|
31
|
+
* - Postpaid commits: Customer pays when the commitment expires (the end of the
|
|
32
|
+
* access_schedule); invoice_schedule is required and must match access_schedule
|
|
33
|
+
* totals.
|
|
34
|
+
*
|
|
35
|
+
* #### Billing configuration:
|
|
36
|
+
*
|
|
37
|
+
* - invoice_contract_id is required for postpaid commits and for prepaid commits
|
|
38
|
+
* with billing (only optional for free prepaid commits)
|
|
39
|
+
* - For postpaid commits: access_schedule and invoice_schedule must have matching
|
|
40
|
+
* amounts
|
|
41
|
+
* - For postpaid commits: only one schedule item is allowed in both schedules.
|
|
42
|
+
*
|
|
43
|
+
* #### Scoping flexibility:
|
|
44
|
+
*
|
|
45
|
+
* Customer-level commits can be configured in a few ways:
|
|
46
|
+
*
|
|
47
|
+
* - Contract-specific: Use the `applicable_contract_ids` field to limit the commit
|
|
48
|
+
* to specific contracts
|
|
49
|
+
* - Cross-contract: Leave `applicable_contract_ids` empty to allow the commit to
|
|
50
|
+
* be used across all of the customer's contracts
|
|
51
|
+
*
|
|
52
|
+
* #### Product targeting:
|
|
53
|
+
*
|
|
54
|
+
* Commits can be scoped to specific products using applicable_product_ids,
|
|
55
|
+
* applicable_product_tags, or specifiers, or left unrestricted to apply to all
|
|
56
|
+
* products.
|
|
57
|
+
*
|
|
58
|
+
* #### Priority considerations:
|
|
59
|
+
*
|
|
60
|
+
* When multiple commits are applicable, the one with the lower priority value will
|
|
61
|
+
* be consumed first. If there is a tie, contract level commits and credits will be
|
|
62
|
+
* applied before customer level commits and credits. Plan your priority scheme
|
|
63
|
+
* carefully to ensure commits are applied in the desired order.
|
|
64
|
+
*
|
|
65
|
+
* ### Usage guidelines:
|
|
66
|
+
*
|
|
67
|
+
* ⚠️ Preferred Alternative: In most cases, you should add commits directly to
|
|
68
|
+
* contracts using the create contract or edit contract APIs instead of creating
|
|
69
|
+
* customer-level commits. Contract-level commits provide better organization and
|
|
70
|
+
* are the recommended approach for standard use cases.
|
|
7
71
|
*
|
|
8
72
|
* @example
|
|
9
73
|
* ```ts
|
|
@@ -33,29 +97,83 @@ export declare class Commits extends APIResource {
|
|
|
33
97
|
* timestamp: '2020-03-01T00:00:00.000Z',
|
|
34
98
|
* },
|
|
35
99
|
* ],
|
|
100
|
+
* do_not_invoice: false,
|
|
36
101
|
* },
|
|
37
102
|
* name: 'My Commit',
|
|
38
103
|
* });
|
|
39
104
|
* ```
|
|
40
105
|
*/
|
|
41
|
-
create(body: CommitCreateParams, options?:
|
|
106
|
+
create(body: CommitCreateParams, options?: RequestOptions): APIPromise<CommitCreateResponse>;
|
|
42
107
|
/**
|
|
43
|
-
*
|
|
108
|
+
* Retrieve all commit agreements for a customer, including both prepaid and
|
|
109
|
+
* postpaid commitments. This endpoint provides comprehensive visibility into
|
|
110
|
+
* contractual spending obligations, enabling you to track commitment utilization
|
|
111
|
+
* and manage customer contracts effectively.
|
|
112
|
+
*
|
|
113
|
+
* ### Use this endpoint to:
|
|
114
|
+
*
|
|
115
|
+
* - Display commitment balances and utilization in customer dashboards
|
|
116
|
+
* - Track prepaid commitment drawdown and remaining balances
|
|
117
|
+
* - Monitor postpaid commitment progress toward minimum thresholds
|
|
118
|
+
* - Build commitment tracking and forecasting tools
|
|
119
|
+
* - Show commitment history with optional ledger details
|
|
120
|
+
* - Manage rollover balances between contract periods
|
|
121
|
+
*
|
|
122
|
+
* ### Key response fields:
|
|
123
|
+
*
|
|
124
|
+
* An array of Commit objects containing:
|
|
125
|
+
*
|
|
126
|
+
* - Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)
|
|
127
|
+
* - Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)
|
|
128
|
+
* - Access schedule: When commitment funds become available
|
|
129
|
+
* - Invoice schedule: When the customer is billed
|
|
130
|
+
* - Product targeting: Which product(s) usage is eligible to draw from this commit
|
|
131
|
+
* - Optional ledger entries: Transaction history (if `include_ledgers=true`)
|
|
132
|
+
* - Balance information: Current available amount (if `include_balance=true`)
|
|
133
|
+
* - Rollover settings: Fraction of unused amount that carries forward
|
|
134
|
+
*
|
|
135
|
+
* ### Usage guidelines:
|
|
136
|
+
*
|
|
137
|
+
* - Pagination: Results limited to 25 commits per page; use 'next_page' for more
|
|
138
|
+
* - Date filtering options:
|
|
139
|
+
* - `covering_date`: Commits active on a specific date
|
|
140
|
+
* - `starting_at`: Commits with access on/after a date
|
|
141
|
+
* - `effective_before`: Commits with access before a date (exclusive)
|
|
142
|
+
* - Scope options:
|
|
143
|
+
* - `include_contract_commits`: Include contract-level commits (not just
|
|
144
|
+
* customer-level)
|
|
145
|
+
* - `include_archived`: Include archived commits and commits from archived
|
|
146
|
+
* contracts
|
|
147
|
+
* - Performance considerations:
|
|
148
|
+
* - include_ledgers: Adds detailed transaction history (slower)
|
|
149
|
+
* - include_balance: Adds current balance calculation (slower)
|
|
150
|
+
* - Optional filtering: Use commit_id to retrieve a specific commit
|
|
44
151
|
*
|
|
45
152
|
* @example
|
|
46
153
|
* ```ts
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
154
|
+
* // Automatically fetches more pages as needed.
|
|
155
|
+
* for await (const commit of client.v1.customers.commits.list(
|
|
156
|
+
* {
|
|
157
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
158
|
+
* commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
159
|
+
* include_ledgers: true,
|
|
160
|
+
* },
|
|
161
|
+
* )) {
|
|
162
|
+
* // ...
|
|
163
|
+
* }
|
|
52
164
|
* ```
|
|
53
165
|
*/
|
|
54
|
-
list(body: CommitListParams, options?:
|
|
166
|
+
list(body: CommitListParams, options?: RequestOptions): PagePromise<CommitsBodyCursorPage, Shared.Commit>;
|
|
55
167
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* commit.
|
|
168
|
+
* Shortens the end date of a prepaid commit to terminate it earlier than
|
|
169
|
+
* originally scheduled. Use this endpoint when you need to cancel or reduce the
|
|
170
|
+
* duration of an existing prepaid commit. Only works with prepaid commit types and
|
|
171
|
+
* can only move the end date forward (earlier), not extend it.
|
|
172
|
+
*
|
|
173
|
+
* ### Usage guidelines:
|
|
174
|
+
*
|
|
175
|
+
* To extend commit end dates or make other comprehensive edits, use the 'edit
|
|
176
|
+
* commit' endpoint instead.
|
|
59
177
|
*
|
|
60
178
|
* @example
|
|
61
179
|
* ```ts
|
|
@@ -68,15 +186,11 @@ export declare class Commits extends APIResource {
|
|
|
68
186
|
* });
|
|
69
187
|
* ```
|
|
70
188
|
*/
|
|
71
|
-
updateEndDate(body: CommitUpdateEndDateParams, options?:
|
|
189
|
+
updateEndDate(body: CommitUpdateEndDateParams, options?: RequestOptions): APIPromise<CommitUpdateEndDateResponse>;
|
|
72
190
|
}
|
|
73
191
|
export interface CommitCreateResponse {
|
|
74
192
|
data: Shared.ID;
|
|
75
193
|
}
|
|
76
|
-
export interface CommitListResponse {
|
|
77
|
-
data: Array<Shared.Commit>;
|
|
78
|
-
next_page: string | null;
|
|
79
|
-
}
|
|
80
194
|
export interface CommitUpdateEndDateResponse {
|
|
81
195
|
data: Shared.ID;
|
|
82
196
|
}
|
|
@@ -115,6 +229,9 @@ export interface CommitCreateParams {
|
|
|
115
229
|
* all products.
|
|
116
230
|
*/
|
|
117
231
|
applicable_product_tags?: Array<string>;
|
|
232
|
+
/**
|
|
233
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
234
|
+
*/
|
|
118
235
|
custom_fields?: {
|
|
119
236
|
[key: string]: string;
|
|
120
237
|
};
|
|
@@ -154,7 +271,7 @@ export interface CommitCreateParams {
|
|
|
154
271
|
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
155
272
|
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
156
273
|
*/
|
|
157
|
-
specifiers?: Array<
|
|
274
|
+
specifiers?: Array<Shared.CommitSpecifierInput>;
|
|
158
275
|
/**
|
|
159
276
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
160
277
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -199,6 +316,11 @@ export declare namespace CommitCreateParams {
|
|
|
199
316
|
* Defaults to USD (cents) if not passed.
|
|
200
317
|
*/
|
|
201
318
|
credit_type_id?: string;
|
|
319
|
+
/**
|
|
320
|
+
* This field is only applicable to commit invoice schedules. If true, this
|
|
321
|
+
* schedule will not generate an invoice.
|
|
322
|
+
*/
|
|
323
|
+
do_not_invoice?: boolean;
|
|
202
324
|
/**
|
|
203
325
|
* Enter the unit price and quantity for the charge or instead only send the
|
|
204
326
|
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
@@ -271,25 +393,8 @@ export declare namespace CommitCreateParams {
|
|
|
271
393
|
unit_price?: number;
|
|
272
394
|
}
|
|
273
395
|
}
|
|
274
|
-
interface Specifier {
|
|
275
|
-
presentation_group_values?: {
|
|
276
|
-
[key: string]: string;
|
|
277
|
-
};
|
|
278
|
-
pricing_group_values?: {
|
|
279
|
-
[key: string]: string;
|
|
280
|
-
};
|
|
281
|
-
/**
|
|
282
|
-
* If provided, the specifier will only apply to the product with the specified ID.
|
|
283
|
-
*/
|
|
284
|
-
product_id?: string;
|
|
285
|
-
/**
|
|
286
|
-
* If provided, the specifier will only apply to products with all the specified
|
|
287
|
-
* tags.
|
|
288
|
-
*/
|
|
289
|
-
product_tags?: Array<string>;
|
|
290
|
-
}
|
|
291
396
|
}
|
|
292
|
-
export interface CommitListParams {
|
|
397
|
+
export interface CommitListParams extends BodyCursorPageParams {
|
|
293
398
|
customer_id: string;
|
|
294
399
|
commit_id?: string;
|
|
295
400
|
/**
|
|
@@ -318,14 +423,6 @@ export interface CommitListParams {
|
|
|
318
423
|
* be slower.
|
|
319
424
|
*/
|
|
320
425
|
include_ledgers?: boolean;
|
|
321
|
-
/**
|
|
322
|
-
* The maximum number of commits to return. Defaults to 25.
|
|
323
|
-
*/
|
|
324
|
-
limit?: number;
|
|
325
|
-
/**
|
|
326
|
-
* The next page token from a previous response.
|
|
327
|
-
*/
|
|
328
|
-
next_page?: string;
|
|
329
426
|
/**
|
|
330
427
|
* Include only commits that have any access on or after the provided date
|
|
331
428
|
*/
|
|
@@ -353,6 +450,7 @@ export interface CommitUpdateEndDateParams {
|
|
|
353
450
|
invoices_ending_before?: string;
|
|
354
451
|
}
|
|
355
452
|
export declare namespace Commits {
|
|
356
|
-
export { type CommitCreateResponse as CommitCreateResponse, type
|
|
453
|
+
export { type CommitCreateResponse as CommitCreateResponse, type CommitUpdateEndDateResponse as CommitUpdateEndDateResponse, type CommitCreateParams as CommitCreateParams, type CommitListParams as CommitListParams, type CommitUpdateEndDateParams as CommitUpdateEndDateParams, };
|
|
357
454
|
}
|
|
455
|
+
export { type CommitsBodyCursorPage };
|
|
358
456
|
//# sourceMappingURL=commits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commits.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commits.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,10 +2,72 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Commits = void 0;
|
|
5
|
-
const resource_1 = require("../../../resource.js");
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
6
7
|
class Commits extends resource_1.APIResource {
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Creates customer-level commits that establish spending commitments for customers
|
|
10
|
+
* across their Metronome usage. Commits represent contracted spending obligations
|
|
11
|
+
* that can be either prepaid (paid upfront) or postpaid (billed later).
|
|
12
|
+
*
|
|
13
|
+
* Note: In most cases, you should add commitments directly to customer contracts
|
|
14
|
+
* using the contract/create or contract/edit APIs.
|
|
15
|
+
*
|
|
16
|
+
* ### Use this endpoint to:
|
|
17
|
+
*
|
|
18
|
+
* Use this endpoint when you need to establish customer-level spending commitments
|
|
19
|
+
* that can be applied across multiple contracts or scoped to specific contracts.
|
|
20
|
+
* Customer-level commits are ideal for:
|
|
21
|
+
*
|
|
22
|
+
* - Enterprise-wide minimum spending agreements that span multiple contracts
|
|
23
|
+
* - Multi-contract volume commitments with shared spending pools
|
|
24
|
+
* - Cross-contract discount tiers based on aggregate usage
|
|
25
|
+
*
|
|
26
|
+
* #### Commit type Requirements:
|
|
27
|
+
*
|
|
28
|
+
* - You must specify either "prepaid" or "postpaid" as the commit type:
|
|
29
|
+
* - Prepaid commits: Customer pays upfront; invoice_schedule is optional (if
|
|
30
|
+
* omitted, creates a commit without an invoice)
|
|
31
|
+
* - Postpaid commits: Customer pays when the commitment expires (the end of the
|
|
32
|
+
* access_schedule); invoice_schedule is required and must match access_schedule
|
|
33
|
+
* totals.
|
|
34
|
+
*
|
|
35
|
+
* #### Billing configuration:
|
|
36
|
+
*
|
|
37
|
+
* - invoice_contract_id is required for postpaid commits and for prepaid commits
|
|
38
|
+
* with billing (only optional for free prepaid commits)
|
|
39
|
+
* - For postpaid commits: access_schedule and invoice_schedule must have matching
|
|
40
|
+
* amounts
|
|
41
|
+
* - For postpaid commits: only one schedule item is allowed in both schedules.
|
|
42
|
+
*
|
|
43
|
+
* #### Scoping flexibility:
|
|
44
|
+
*
|
|
45
|
+
* Customer-level commits can be configured in a few ways:
|
|
46
|
+
*
|
|
47
|
+
* - Contract-specific: Use the `applicable_contract_ids` field to limit the commit
|
|
48
|
+
* to specific contracts
|
|
49
|
+
* - Cross-contract: Leave `applicable_contract_ids` empty to allow the commit to
|
|
50
|
+
* be used across all of the customer's contracts
|
|
51
|
+
*
|
|
52
|
+
* #### Product targeting:
|
|
53
|
+
*
|
|
54
|
+
* Commits can be scoped to specific products using applicable_product_ids,
|
|
55
|
+
* applicable_product_tags, or specifiers, or left unrestricted to apply to all
|
|
56
|
+
* products.
|
|
57
|
+
*
|
|
58
|
+
* #### Priority considerations:
|
|
59
|
+
*
|
|
60
|
+
* When multiple commits are applicable, the one with the lower priority value will
|
|
61
|
+
* be consumed first. If there is a tie, contract level commits and credits will be
|
|
62
|
+
* applied before customer level commits and credits. Plan your priority scheme
|
|
63
|
+
* carefully to ensure commits are applied in the desired order.
|
|
64
|
+
*
|
|
65
|
+
* ### Usage guidelines:
|
|
66
|
+
*
|
|
67
|
+
* ⚠️ Preferred Alternative: In most cases, you should add commits directly to
|
|
68
|
+
* contracts using the create contract or edit contract APIs instead of creating
|
|
69
|
+
* customer-level commits. Contract-level commits provide better organization and
|
|
70
|
+
* are the recommended approach for standard use cases.
|
|
9
71
|
*
|
|
10
72
|
* @example
|
|
11
73
|
* ```ts
|
|
@@ -35,6 +97,7 @@ class Commits extends resource_1.APIResource {
|
|
|
35
97
|
* timestamp: '2020-03-01T00:00:00.000Z',
|
|
36
98
|
* },
|
|
37
99
|
* ],
|
|
100
|
+
* do_not_invoice: false,
|
|
38
101
|
* },
|
|
39
102
|
* name: 'My Commit',
|
|
40
103
|
* });
|
|
@@ -44,24 +107,81 @@ class Commits extends resource_1.APIResource {
|
|
|
44
107
|
return this._client.post('/v1/contracts/customerCommits/create', { body, ...options });
|
|
45
108
|
}
|
|
46
109
|
/**
|
|
47
|
-
*
|
|
110
|
+
* Retrieve all commit agreements for a customer, including both prepaid and
|
|
111
|
+
* postpaid commitments. This endpoint provides comprehensive visibility into
|
|
112
|
+
* contractual spending obligations, enabling you to track commitment utilization
|
|
113
|
+
* and manage customer contracts effectively.
|
|
114
|
+
*
|
|
115
|
+
* ### Use this endpoint to:
|
|
116
|
+
*
|
|
117
|
+
* - Display commitment balances and utilization in customer dashboards
|
|
118
|
+
* - Track prepaid commitment drawdown and remaining balances
|
|
119
|
+
* - Monitor postpaid commitment progress toward minimum thresholds
|
|
120
|
+
* - Build commitment tracking and forecasting tools
|
|
121
|
+
* - Show commitment history with optional ledger details
|
|
122
|
+
* - Manage rollover balances between contract periods
|
|
123
|
+
*
|
|
124
|
+
* ### Key response fields:
|
|
125
|
+
*
|
|
126
|
+
* An array of Commit objects containing:
|
|
127
|
+
*
|
|
128
|
+
* - Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)
|
|
129
|
+
* - Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)
|
|
130
|
+
* - Access schedule: When commitment funds become available
|
|
131
|
+
* - Invoice schedule: When the customer is billed
|
|
132
|
+
* - Product targeting: Which product(s) usage is eligible to draw from this commit
|
|
133
|
+
* - Optional ledger entries: Transaction history (if `include_ledgers=true`)
|
|
134
|
+
* - Balance information: Current available amount (if `include_balance=true`)
|
|
135
|
+
* - Rollover settings: Fraction of unused amount that carries forward
|
|
136
|
+
*
|
|
137
|
+
* ### Usage guidelines:
|
|
138
|
+
*
|
|
139
|
+
* - Pagination: Results limited to 25 commits per page; use 'next_page' for more
|
|
140
|
+
* - Date filtering options:
|
|
141
|
+
* - `covering_date`: Commits active on a specific date
|
|
142
|
+
* - `starting_at`: Commits with access on/after a date
|
|
143
|
+
* - `effective_before`: Commits with access before a date (exclusive)
|
|
144
|
+
* - Scope options:
|
|
145
|
+
* - `include_contract_commits`: Include contract-level commits (not just
|
|
146
|
+
* customer-level)
|
|
147
|
+
* - `include_archived`: Include archived commits and commits from archived
|
|
148
|
+
* contracts
|
|
149
|
+
* - Performance considerations:
|
|
150
|
+
* - include_ledgers: Adds detailed transaction history (slower)
|
|
151
|
+
* - include_balance: Adds current balance calculation (slower)
|
|
152
|
+
* - Optional filtering: Use commit_id to retrieve a specific commit
|
|
48
153
|
*
|
|
49
154
|
* @example
|
|
50
155
|
* ```ts
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
156
|
+
* // Automatically fetches more pages as needed.
|
|
157
|
+
* for await (const commit of client.v1.customers.commits.list(
|
|
158
|
+
* {
|
|
159
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
160
|
+
* commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
161
|
+
* include_ledgers: true,
|
|
162
|
+
* },
|
|
163
|
+
* )) {
|
|
164
|
+
* // ...
|
|
165
|
+
* }
|
|
56
166
|
* ```
|
|
57
167
|
*/
|
|
58
168
|
list(body, options) {
|
|
59
|
-
return this._client.
|
|
169
|
+
return this._client.getAPIList('/v1/contracts/customerCommits/list', (pagination_1.BodyCursorPage), {
|
|
170
|
+
body,
|
|
171
|
+
method: 'post',
|
|
172
|
+
...options,
|
|
173
|
+
});
|
|
60
174
|
}
|
|
61
175
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* commit.
|
|
176
|
+
* Shortens the end date of a prepaid commit to terminate it earlier than
|
|
177
|
+
* originally scheduled. Use this endpoint when you need to cancel or reduce the
|
|
178
|
+
* duration of an existing prepaid commit. Only works with prepaid commit types and
|
|
179
|
+
* can only move the end date forward (earlier), not extend it.
|
|
180
|
+
*
|
|
181
|
+
* ### Usage guidelines:
|
|
182
|
+
*
|
|
183
|
+
* To extend commit end dates or make other comprehensive edits, use the 'edit
|
|
184
|
+
* commit' endpoint instead.
|
|
65
185
|
*
|
|
66
186
|
* @example
|
|
67
187
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commits.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"commits.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,4DAAkG;AAGlG,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiGG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0DG;IACH,IAAI,CAAC,IAAsB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,oCAAoC,EAAE,CAAA,2BAA6B,CAAA,EAAE;YAClG,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;CACF;AAtMD,0BAsMC"}
|
|
@@ -1,8 +1,70 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../../resource.mjs";
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { BodyCursorPage } from "../../../core/pagination.mjs";
|
|
3
4
|
export class Commits extends APIResource {
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Creates customer-level commits that establish spending commitments for customers
|
|
7
|
+
* across their Metronome usage. Commits represent contracted spending obligations
|
|
8
|
+
* that can be either prepaid (paid upfront) or postpaid (billed later).
|
|
9
|
+
*
|
|
10
|
+
* Note: In most cases, you should add commitments directly to customer contracts
|
|
11
|
+
* using the contract/create or contract/edit APIs.
|
|
12
|
+
*
|
|
13
|
+
* ### Use this endpoint to:
|
|
14
|
+
*
|
|
15
|
+
* Use this endpoint when you need to establish customer-level spending commitments
|
|
16
|
+
* that can be applied across multiple contracts or scoped to specific contracts.
|
|
17
|
+
* Customer-level commits are ideal for:
|
|
18
|
+
*
|
|
19
|
+
* - Enterprise-wide minimum spending agreements that span multiple contracts
|
|
20
|
+
* - Multi-contract volume commitments with shared spending pools
|
|
21
|
+
* - Cross-contract discount tiers based on aggregate usage
|
|
22
|
+
*
|
|
23
|
+
* #### Commit type Requirements:
|
|
24
|
+
*
|
|
25
|
+
* - You must specify either "prepaid" or "postpaid" as the commit type:
|
|
26
|
+
* - Prepaid commits: Customer pays upfront; invoice_schedule is optional (if
|
|
27
|
+
* omitted, creates a commit without an invoice)
|
|
28
|
+
* - Postpaid commits: Customer pays when the commitment expires (the end of the
|
|
29
|
+
* access_schedule); invoice_schedule is required and must match access_schedule
|
|
30
|
+
* totals.
|
|
31
|
+
*
|
|
32
|
+
* #### Billing configuration:
|
|
33
|
+
*
|
|
34
|
+
* - invoice_contract_id is required for postpaid commits and for prepaid commits
|
|
35
|
+
* with billing (only optional for free prepaid commits)
|
|
36
|
+
* - For postpaid commits: access_schedule and invoice_schedule must have matching
|
|
37
|
+
* amounts
|
|
38
|
+
* - For postpaid commits: only one schedule item is allowed in both schedules.
|
|
39
|
+
*
|
|
40
|
+
* #### Scoping flexibility:
|
|
41
|
+
*
|
|
42
|
+
* Customer-level commits can be configured in a few ways:
|
|
43
|
+
*
|
|
44
|
+
* - Contract-specific: Use the `applicable_contract_ids` field to limit the commit
|
|
45
|
+
* to specific contracts
|
|
46
|
+
* - Cross-contract: Leave `applicable_contract_ids` empty to allow the commit to
|
|
47
|
+
* be used across all of the customer's contracts
|
|
48
|
+
*
|
|
49
|
+
* #### Product targeting:
|
|
50
|
+
*
|
|
51
|
+
* Commits can be scoped to specific products using applicable_product_ids,
|
|
52
|
+
* applicable_product_tags, or specifiers, or left unrestricted to apply to all
|
|
53
|
+
* products.
|
|
54
|
+
*
|
|
55
|
+
* #### Priority considerations:
|
|
56
|
+
*
|
|
57
|
+
* When multiple commits are applicable, the one with the lower priority value will
|
|
58
|
+
* be consumed first. If there is a tie, contract level commits and credits will be
|
|
59
|
+
* applied before customer level commits and credits. Plan your priority scheme
|
|
60
|
+
* carefully to ensure commits are applied in the desired order.
|
|
61
|
+
*
|
|
62
|
+
* ### Usage guidelines:
|
|
63
|
+
*
|
|
64
|
+
* ⚠️ Preferred Alternative: In most cases, you should add commits directly to
|
|
65
|
+
* contracts using the create contract or edit contract APIs instead of creating
|
|
66
|
+
* customer-level commits. Contract-level commits provide better organization and
|
|
67
|
+
* are the recommended approach for standard use cases.
|
|
6
68
|
*
|
|
7
69
|
* @example
|
|
8
70
|
* ```ts
|
|
@@ -32,6 +94,7 @@ export class Commits extends APIResource {
|
|
|
32
94
|
* timestamp: '2020-03-01T00:00:00.000Z',
|
|
33
95
|
* },
|
|
34
96
|
* ],
|
|
97
|
+
* do_not_invoice: false,
|
|
35
98
|
* },
|
|
36
99
|
* name: 'My Commit',
|
|
37
100
|
* });
|
|
@@ -41,24 +104,81 @@ export class Commits extends APIResource {
|
|
|
41
104
|
return this._client.post('/v1/contracts/customerCommits/create', { body, ...options });
|
|
42
105
|
}
|
|
43
106
|
/**
|
|
44
|
-
*
|
|
107
|
+
* Retrieve all commit agreements for a customer, including both prepaid and
|
|
108
|
+
* postpaid commitments. This endpoint provides comprehensive visibility into
|
|
109
|
+
* contractual spending obligations, enabling you to track commitment utilization
|
|
110
|
+
* and manage customer contracts effectively.
|
|
111
|
+
*
|
|
112
|
+
* ### Use this endpoint to:
|
|
113
|
+
*
|
|
114
|
+
* - Display commitment balances and utilization in customer dashboards
|
|
115
|
+
* - Track prepaid commitment drawdown and remaining balances
|
|
116
|
+
* - Monitor postpaid commitment progress toward minimum thresholds
|
|
117
|
+
* - Build commitment tracking and forecasting tools
|
|
118
|
+
* - Show commitment history with optional ledger details
|
|
119
|
+
* - Manage rollover balances between contract periods
|
|
120
|
+
*
|
|
121
|
+
* ### Key response fields:
|
|
122
|
+
*
|
|
123
|
+
* An array of Commit objects containing:
|
|
124
|
+
*
|
|
125
|
+
* - Commit type: PREPAID (pay upfront) or POSTPAID (pay at true-up)
|
|
126
|
+
* - Rate type: COMMIT_RATE (discounted) or LIST_RATE (standard pricing)
|
|
127
|
+
* - Access schedule: When commitment funds become available
|
|
128
|
+
* - Invoice schedule: When the customer is billed
|
|
129
|
+
* - Product targeting: Which product(s) usage is eligible to draw from this commit
|
|
130
|
+
* - Optional ledger entries: Transaction history (if `include_ledgers=true`)
|
|
131
|
+
* - Balance information: Current available amount (if `include_balance=true`)
|
|
132
|
+
* - Rollover settings: Fraction of unused amount that carries forward
|
|
133
|
+
*
|
|
134
|
+
* ### Usage guidelines:
|
|
135
|
+
*
|
|
136
|
+
* - Pagination: Results limited to 25 commits per page; use 'next_page' for more
|
|
137
|
+
* - Date filtering options:
|
|
138
|
+
* - `covering_date`: Commits active on a specific date
|
|
139
|
+
* - `starting_at`: Commits with access on/after a date
|
|
140
|
+
* - `effective_before`: Commits with access before a date (exclusive)
|
|
141
|
+
* - Scope options:
|
|
142
|
+
* - `include_contract_commits`: Include contract-level commits (not just
|
|
143
|
+
* customer-level)
|
|
144
|
+
* - `include_archived`: Include archived commits and commits from archived
|
|
145
|
+
* contracts
|
|
146
|
+
* - Performance considerations:
|
|
147
|
+
* - include_ledgers: Adds detailed transaction history (slower)
|
|
148
|
+
* - include_balance: Adds current balance calculation (slower)
|
|
149
|
+
* - Optional filtering: Use commit_id to retrieve a specific commit
|
|
45
150
|
*
|
|
46
151
|
* @example
|
|
47
152
|
* ```ts
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
153
|
+
* // Automatically fetches more pages as needed.
|
|
154
|
+
* for await (const commit of client.v1.customers.commits.list(
|
|
155
|
+
* {
|
|
156
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
157
|
+
* commit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
158
|
+
* include_ledgers: true,
|
|
159
|
+
* },
|
|
160
|
+
* )) {
|
|
161
|
+
* // ...
|
|
162
|
+
* }
|
|
53
163
|
* ```
|
|
54
164
|
*/
|
|
55
165
|
list(body, options) {
|
|
56
|
-
return this._client.
|
|
166
|
+
return this._client.getAPIList('/v1/contracts/customerCommits/list', (BodyCursorPage), {
|
|
167
|
+
body,
|
|
168
|
+
method: 'post',
|
|
169
|
+
...options,
|
|
170
|
+
});
|
|
57
171
|
}
|
|
58
172
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* commit.
|
|
173
|
+
* Shortens the end date of a prepaid commit to terminate it earlier than
|
|
174
|
+
* originally scheduled. Use this endpoint when you need to cancel or reduce the
|
|
175
|
+
* duration of an existing prepaid commit. Only works with prepaid commit types and
|
|
176
|
+
* can only move the end date forward (earlier), not extend it.
|
|
177
|
+
*
|
|
178
|
+
* ### Usage guidelines:
|
|
179
|
+
*
|
|
180
|
+
* To extend commit end dates or make other comprehensive edits, use the 'edit
|
|
181
|
+
* commit' endpoint instead.
|
|
62
182
|
*
|
|
63
183
|
* @example
|
|
64
184
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commits.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"commits.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/commits.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,cAAc,EAA0C;AAGjE,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiGG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0DG;IACH,IAAI,CAAC,IAAsB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,oCAAoC,EAAE,CAAA,cAA6B,CAAA,EAAE;YAClG,IAAI;YACJ,MAAM,EAAE,MAAM;YACd,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,aAAa,CACX,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;CACF"}
|