@metronome/sdk 0.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +113 -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 +46 -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 +2363 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +1470 -465
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +207 -0
- package/resources/v1/alerts.d.mts.map +1 -0
- package/resources/v1/alerts.d.ts +107 -32
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +74 -3
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +74 -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 +3006 -0
- package/resources/v1/contracts/contracts.d.mts.map +1 -0
- package/resources/v1/contracts/contracts.d.ts +428 -1299
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +269 -50
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +267 -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 +309 -0
- package/resources/v1/customers/alerts.d.mts.map +1 -0
- package/resources/v1/customers/alerts.d.ts +176 -50
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +131 -10
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +131 -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 +819 -0
- package/resources/v1/customers/customers.d.mts.map +1 -0
- package/resources/v1/customers/customers.d.ts +319 -55
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +220 -76
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +213 -44
- 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 +825 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -0
- package/resources/v1/customers/invoices.d.ts +309 -25
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +180 -22
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +179 -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 +16 -0
- package/resources/v1/index.d.mts.map +1 -0
- package/resources/v1/index.d.ts +10 -9
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -12
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +8 -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/payments.d.mts +116 -0
- package/resources/v1/payments.d.mts.map +1 -0
- package/resources/v1/payments.d.ts +116 -0
- package/resources/v1/payments.d.ts.map +1 -0
- package/resources/v1/payments.js +71 -0
- package/resources/v1/payments.js.map +1 -0
- package/resources/v1/payments.mjs +67 -0
- package/resources/v1/payments.mjs.map +1 -0
- 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 +490 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +223 -58
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +214 -26
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +213 -24
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +62 -0
- package/resources/v1/v1.d.mts.map +1 -0
- package/resources/v1/v1.d.ts +19 -15
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +19 -48
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +12 -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 +2900 -0
- package/resources/v2/contracts.d.mts.map +1 -0
- package/resources/v2/contracts.d.ts +399 -3830
- 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 +1921 -506
- package/src/resources/v1/alerts.ts +108 -33
- 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 +490 -1632
- 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 +195 -55
- 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 +407 -115
- package/src/resources/v1/customers/index.ts +20 -18
- package/src/resources/v1/customers/invoices.ts +343 -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 +43 -25
- package/src/resources/v1/invoices.ts +28 -9
- package/src/resources/v1/payments.ts +170 -0
- 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 +247 -73
- package/src/resources/v1/v1.ts +78 -49
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +469 -4930
- 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
package/resources/v1/alerts.js
CHANGED
|
@@ -2,10 +2,54 @@
|
|
|
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.Alerts = void 0;
|
|
5
|
-
const resource_1 = require("../../resource.js");
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
6
|
class Alerts extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Create a new
|
|
8
|
+
* Create a new threshold notification to monitor customer spending, balances, and
|
|
9
|
+
* billing metrics in real-time. Metronome's notification system provides
|
|
10
|
+
* industry-leading speed with immediate evaluation capabilities, enabling you to
|
|
11
|
+
* proactively manage customer accounts and prevent revenue leakage.
|
|
12
|
+
*
|
|
13
|
+
* This endpoint creates configurable threshold notifications that continuously
|
|
14
|
+
* monitor various billing thresholds including spend limits, credit balances,
|
|
15
|
+
* commitment utilization, and invoice totals. Threshold notifications can be
|
|
16
|
+
* configured globally for all customers or targeted to specific customer accounts.
|
|
17
|
+
*
|
|
18
|
+
* ### Use this endpoint to:
|
|
19
|
+
*
|
|
20
|
+
* - Proactively monitor customer spending patterns to prevent unexpected overages
|
|
21
|
+
* or credit exhaustion
|
|
22
|
+
* - Automate notifications when customers approach commitment limits or credit
|
|
23
|
+
* thresholds
|
|
24
|
+
* - Enable real-time intervention for accounts at risk of churn or payment issues
|
|
25
|
+
* - Scale billing operations by automating threshold-based workflows and
|
|
26
|
+
* notifications
|
|
27
|
+
*
|
|
28
|
+
* ### Key response fields:
|
|
29
|
+
*
|
|
30
|
+
* A successful response returns a CustomerAlert object containing:
|
|
31
|
+
*
|
|
32
|
+
* - The threshold notification configuration with its unique ID and current status
|
|
33
|
+
* - The customer's evaluation status (ok, in_alarm, or evaluating)
|
|
34
|
+
* - Threshold notification metadata including type, threshold values, and update
|
|
35
|
+
* timestamps
|
|
36
|
+
*
|
|
37
|
+
* ### Usage guidelines:
|
|
38
|
+
*
|
|
39
|
+
* - Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant
|
|
40
|
+
* evaluation against existing customers
|
|
41
|
+
* - Uniqueness constraints: Each threshold notification must have a unique
|
|
42
|
+
* `uniqueness_key` within your organization. Use `release_uniqueness_key` :
|
|
43
|
+
* `true` when archiving to reuse keys
|
|
44
|
+
* - Notification type requirements: Different threshold notification types require
|
|
45
|
+
* specific fields (e.g., `billable_metric_id` for usage notifications,
|
|
46
|
+
* `credit_type_id` for credit-based threshold notifications)
|
|
47
|
+
* - Webhook delivery: Threshold notifications trigger webhook notifications for
|
|
48
|
+
* real-time integration with your systems. Configure webhook endpoints before
|
|
49
|
+
* creating threshold notifications
|
|
50
|
+
* - Performance at scale: Metronome's event-driven architecture processes
|
|
51
|
+
* threshold notification evaluations in real-time as usage events stream in,
|
|
52
|
+
* unlike competitors who rely on periodic polling or batch evaluation cycles
|
|
9
53
|
*
|
|
10
54
|
* @example
|
|
11
55
|
* ```ts
|
|
@@ -23,7 +67,34 @@ class Alerts extends resource_1.APIResource {
|
|
|
23
67
|
return this._client.post('/v1/alerts/create', { body, ...options });
|
|
24
68
|
}
|
|
25
69
|
/**
|
|
26
|
-
*
|
|
70
|
+
* Permanently disable a threshold notification and remove it from active
|
|
71
|
+
* monitoring across all customers. Archived threshold notifications stop
|
|
72
|
+
* evaluating immediately and can optionally release their uniqueness key for reuse
|
|
73
|
+
* in future threshold notification configurations.
|
|
74
|
+
*
|
|
75
|
+
* ### Use this endpoint to:
|
|
76
|
+
*
|
|
77
|
+
* - Decommission threshold notifications that are no longer needed
|
|
78
|
+
* - Clean up test or deprecated threshold notification configurations
|
|
79
|
+
* - Free up uniqueness keys for reuse with new threshold notifications
|
|
80
|
+
* - Stop threshold notification evaluations without losing historical
|
|
81
|
+
* configuration data
|
|
82
|
+
* - Disable outdated monitoring rules during pricing model transitions
|
|
83
|
+
*
|
|
84
|
+
* ### Key response fields:
|
|
85
|
+
*
|
|
86
|
+
* - data: Object containing the archived threshold notification's ID
|
|
87
|
+
*
|
|
88
|
+
* ### Usage guidelines:
|
|
89
|
+
*
|
|
90
|
+
* - Irreversible for evaluation: Archived threshold notifications cannot be
|
|
91
|
+
* re-enabled; create a new threshold notification to resume monitoring
|
|
92
|
+
* - Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the
|
|
93
|
+
* key in future threshold notifications
|
|
94
|
+
* - Immediate effect: Threshold notification evaluation stops instantly across all
|
|
95
|
+
* customers
|
|
96
|
+
* - Historical preservation: Archive operation maintains threshold notification
|
|
97
|
+
* history and configuration for compliance and auditing
|
|
27
98
|
*
|
|
28
99
|
* @example
|
|
29
100
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../src/resources/v1/alerts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../src/resources/v1/alerts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0DG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAxGD,wBAwGC"}
|
package/resources/v1/alerts.mjs
CHANGED
|
@@ -1,8 +1,52 @@
|
|
|
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
3
|
export class Alerts extends APIResource {
|
|
4
4
|
/**
|
|
5
|
-
* Create a new
|
|
5
|
+
* Create a new threshold notification to monitor customer spending, balances, and
|
|
6
|
+
* billing metrics in real-time. Metronome's notification system provides
|
|
7
|
+
* industry-leading speed with immediate evaluation capabilities, enabling you to
|
|
8
|
+
* proactively manage customer accounts and prevent revenue leakage.
|
|
9
|
+
*
|
|
10
|
+
* This endpoint creates configurable threshold notifications that continuously
|
|
11
|
+
* monitor various billing thresholds including spend limits, credit balances,
|
|
12
|
+
* commitment utilization, and invoice totals. Threshold notifications can be
|
|
13
|
+
* configured globally for all customers or targeted to specific customer accounts.
|
|
14
|
+
*
|
|
15
|
+
* ### Use this endpoint to:
|
|
16
|
+
*
|
|
17
|
+
* - Proactively monitor customer spending patterns to prevent unexpected overages
|
|
18
|
+
* or credit exhaustion
|
|
19
|
+
* - Automate notifications when customers approach commitment limits or credit
|
|
20
|
+
* thresholds
|
|
21
|
+
* - Enable real-time intervention for accounts at risk of churn or payment issues
|
|
22
|
+
* - Scale billing operations by automating threshold-based workflows and
|
|
23
|
+
* notifications
|
|
24
|
+
*
|
|
25
|
+
* ### Key response fields:
|
|
26
|
+
*
|
|
27
|
+
* A successful response returns a CustomerAlert object containing:
|
|
28
|
+
*
|
|
29
|
+
* - The threshold notification configuration with its unique ID and current status
|
|
30
|
+
* - The customer's evaluation status (ok, in_alarm, or evaluating)
|
|
31
|
+
* - Threshold notification metadata including type, threshold values, and update
|
|
32
|
+
* timestamps
|
|
33
|
+
*
|
|
34
|
+
* ### Usage guidelines:
|
|
35
|
+
*
|
|
36
|
+
* - Immediate evaluation: Set `evaluate_on_create` : `true` (default) for instant
|
|
37
|
+
* evaluation against existing customers
|
|
38
|
+
* - Uniqueness constraints: Each threshold notification must have a unique
|
|
39
|
+
* `uniqueness_key` within your organization. Use `release_uniqueness_key` :
|
|
40
|
+
* `true` when archiving to reuse keys
|
|
41
|
+
* - Notification type requirements: Different threshold notification types require
|
|
42
|
+
* specific fields (e.g., `billable_metric_id` for usage notifications,
|
|
43
|
+
* `credit_type_id` for credit-based threshold notifications)
|
|
44
|
+
* - Webhook delivery: Threshold notifications trigger webhook notifications for
|
|
45
|
+
* real-time integration with your systems. Configure webhook endpoints before
|
|
46
|
+
* creating threshold notifications
|
|
47
|
+
* - Performance at scale: Metronome's event-driven architecture processes
|
|
48
|
+
* threshold notification evaluations in real-time as usage events stream in,
|
|
49
|
+
* unlike competitors who rely on periodic polling or batch evaluation cycles
|
|
6
50
|
*
|
|
7
51
|
* @example
|
|
8
52
|
* ```ts
|
|
@@ -20,7 +64,34 @@ export class Alerts extends APIResource {
|
|
|
20
64
|
return this._client.post('/v1/alerts/create', { body, ...options });
|
|
21
65
|
}
|
|
22
66
|
/**
|
|
23
|
-
*
|
|
67
|
+
* Permanently disable a threshold notification and remove it from active
|
|
68
|
+
* monitoring across all customers. Archived threshold notifications stop
|
|
69
|
+
* evaluating immediately and can optionally release their uniqueness key for reuse
|
|
70
|
+
* in future threshold notification configurations.
|
|
71
|
+
*
|
|
72
|
+
* ### Use this endpoint to:
|
|
73
|
+
*
|
|
74
|
+
* - Decommission threshold notifications that are no longer needed
|
|
75
|
+
* - Clean up test or deprecated threshold notification configurations
|
|
76
|
+
* - Free up uniqueness keys for reuse with new threshold notifications
|
|
77
|
+
* - Stop threshold notification evaluations without losing historical
|
|
78
|
+
* configuration data
|
|
79
|
+
* - Disable outdated monitoring rules during pricing model transitions
|
|
80
|
+
*
|
|
81
|
+
* ### Key response fields:
|
|
82
|
+
*
|
|
83
|
+
* - data: Object containing the archived threshold notification's ID
|
|
84
|
+
*
|
|
85
|
+
* ### Usage guidelines:
|
|
86
|
+
*
|
|
87
|
+
* - Irreversible for evaluation: Archived threshold notifications cannot be
|
|
88
|
+
* re-enabled; create a new threshold notification to resume monitoring
|
|
89
|
+
* - Uniqueness key handling: Set `release_uniqueness_key` : `true` to reuse the
|
|
90
|
+
* key in future threshold notifications
|
|
91
|
+
* - Immediate effect: Threshold notification evaluation stops instantly across all
|
|
92
|
+
* customers
|
|
93
|
+
* - Historical preservation: Archive operation maintains threshold notification
|
|
94
|
+
* history and configuration for compliance and auditing
|
|
24
95
|
*
|
|
25
96
|
* @example
|
|
26
97
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.mjs","sourceRoot":"","sources":["../../src/resources/v1/alerts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"alerts.mjs","sourceRoot":"","sources":["../../src/resources/v1/alerts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0DG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
export declare class AuditLogs extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get a comprehensive audit trail of all operations performed in your Metronome
|
|
7
|
+
* account, whether initiated through the API, web interface, or automated
|
|
8
|
+
* processes. This endpoint provides detailed logs of who did what and when,
|
|
9
|
+
* enabling compliance reporting, security monitoring, and operational
|
|
10
|
+
* troubleshooting across all interaction channels.
|
|
11
|
+
*
|
|
12
|
+
* ### Use this endpoint to:
|
|
13
|
+
*
|
|
14
|
+
* - Monitor all account activity for security and compliance purposes
|
|
15
|
+
* - Track configuration changes regardless of source (API, UI, or system)
|
|
16
|
+
* - Investigate issues by reviewing historical operations
|
|
17
|
+
*
|
|
18
|
+
* ### Key response fields:
|
|
19
|
+
*
|
|
20
|
+
* An array of AuditLog objects containing:
|
|
21
|
+
*
|
|
22
|
+
* - id: Unique identifier for the audit log entry
|
|
23
|
+
* - timestamp: When the action occurred (RFC 3339 format)
|
|
24
|
+
* - actor: Information about who performed the action
|
|
25
|
+
* - request: Details including request ID, IP address, and user agent
|
|
26
|
+
* - `resource_type`: The type of resource affected (e.g., customer, contract,
|
|
27
|
+
* invoice)
|
|
28
|
+
* - `resource_id`: The specific resource identifier
|
|
29
|
+
* - `action`: The operation performed
|
|
30
|
+
* - `next_page`: Cursor for continuous log retrieval
|
|
31
|
+
*
|
|
32
|
+
* ### Usage guidelines:
|
|
33
|
+
*
|
|
34
|
+
* - Continuous retrieval: The next_page token enables uninterrupted log
|
|
35
|
+
* streaming—save it between requests to ensure no logs are missed
|
|
36
|
+
* - Empty responses: An empty data array means no new logs yet; continue polling
|
|
37
|
+
* with the same next_page token
|
|
38
|
+
* - Date filtering:
|
|
39
|
+
* - `starting_on`: Earliest logs to return (inclusive)
|
|
40
|
+
* - `ending_before`: Latest logs to return (exclusive)
|
|
41
|
+
* - Cannot be used with `next_page`
|
|
42
|
+
* - Resource filtering: Must specify both `resource_type` and `resource_id`
|
|
43
|
+
* together
|
|
44
|
+
* - Sort order: Default is `date_asc`; use `date_desc` for newest first
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Automatically fetches more pages as needed.
|
|
49
|
+
* for await (const auditLogListResponse of client.v1.auditLogs.list()) {
|
|
50
|
+
* // ...
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
list(query?: AuditLogListParams | null | undefined, options?: RequestOptions): PagePromise<AuditLogListResponsesCursorPage, AuditLogListResponse>;
|
|
55
|
+
}
|
|
56
|
+
export type AuditLogListResponsesCursorPage = CursorPage<AuditLogListResponse>;
|
|
57
|
+
export interface AuditLogListResponse {
|
|
58
|
+
id: string;
|
|
59
|
+
request: AuditLogListResponse.Request;
|
|
60
|
+
timestamp: string;
|
|
61
|
+
action?: string;
|
|
62
|
+
actor?: AuditLogListResponse.Actor;
|
|
63
|
+
description?: string;
|
|
64
|
+
resource_id?: string;
|
|
65
|
+
resource_type?: string;
|
|
66
|
+
status?: 'success' | 'failure' | 'pending';
|
|
67
|
+
}
|
|
68
|
+
export declare namespace AuditLogListResponse {
|
|
69
|
+
interface Request {
|
|
70
|
+
id: string;
|
|
71
|
+
ip?: string;
|
|
72
|
+
user_agent?: string;
|
|
73
|
+
}
|
|
74
|
+
interface Actor {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
email?: string;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export interface AuditLogListParams extends CursorPageParams {
|
|
81
|
+
/**
|
|
82
|
+
* RFC 3339 timestamp (exclusive). Cannot be used with 'next_page'.
|
|
83
|
+
*/
|
|
84
|
+
ending_before?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Optional parameter that can be used to filter which audit logs are returned. If
|
|
87
|
+
* you specify resource_id, you must also specify resource_type.
|
|
88
|
+
*/
|
|
89
|
+
resource_id?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Optional parameter that can be used to filter which audit logs are returned. If
|
|
92
|
+
* you specify resource_type, you must also specify resource_id.
|
|
93
|
+
*/
|
|
94
|
+
resource_type?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Sort order by timestamp, e.g. date_asc or date_desc. Defaults to date_asc.
|
|
97
|
+
*/
|
|
98
|
+
sort?: 'date_asc' | 'date_desc';
|
|
99
|
+
/**
|
|
100
|
+
* RFC 3339 timestamp of the earliest audit log to return. Cannot be used with
|
|
101
|
+
* 'next_page'.
|
|
102
|
+
*/
|
|
103
|
+
starting_on?: string;
|
|
104
|
+
}
|
|
105
|
+
export declare namespace AuditLogs {
|
|
106
|
+
export { type AuditLogListResponse as AuditLogListResponse, type AuditLogListResponsesCursorPage as AuditLogListResponsesCursorPage, type AuditLogListParams as AuditLogListParams, };
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=audit-logs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-logs.d.mts","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAEzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,oBAAoB,CAAC;CAGtE;AAED,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAE/E,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC;IAEtC,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC;IAEnC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;CAC5C;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,OAAO;QACtB,EAAE,EAAE,MAAM,CAAC;QAEX,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAED,UAAiB,KAAK;QACpB,EAAE,EAAE,MAAM,CAAC;QAEX,IAAI,EAAE,MAAM,CAAC;QAEb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;CACF;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
import { APIResource } from "../../resource.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
4
|
export declare class AuditLogs extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Get a comprehensive audit trail of all operations performed in your Metronome
|
|
7
|
+
* account, whether initiated through the API, web interface, or automated
|
|
8
|
+
* processes. This endpoint provides detailed logs of who did what and when,
|
|
9
|
+
* enabling compliance reporting, security monitoring, and operational
|
|
10
|
+
* troubleshooting across all interaction channels.
|
|
11
|
+
*
|
|
12
|
+
* ### Use this endpoint to:
|
|
13
|
+
*
|
|
14
|
+
* - Monitor all account activity for security and compliance purposes
|
|
15
|
+
* - Track configuration changes regardless of source (API, UI, or system)
|
|
16
|
+
* - Investigate issues by reviewing historical operations
|
|
17
|
+
*
|
|
18
|
+
* ### Key response fields:
|
|
19
|
+
*
|
|
20
|
+
* An array of AuditLog objects containing:
|
|
21
|
+
*
|
|
22
|
+
* - id: Unique identifier for the audit log entry
|
|
23
|
+
* - timestamp: When the action occurred (RFC 3339 format)
|
|
24
|
+
* - actor: Information about who performed the action
|
|
25
|
+
* - request: Details including request ID, IP address, and user agent
|
|
26
|
+
* - `resource_type`: The type of resource affected (e.g., customer, contract,
|
|
27
|
+
* invoice)
|
|
28
|
+
* - `resource_id`: The specific resource identifier
|
|
29
|
+
* - `action`: The operation performed
|
|
30
|
+
* - `next_page`: Cursor for continuous log retrieval
|
|
31
|
+
*
|
|
32
|
+
* ### Usage guidelines:
|
|
33
|
+
*
|
|
34
|
+
* - Continuous retrieval: The next_page token enables uninterrupted log
|
|
35
|
+
* streaming—save it between requests to ensure no logs are missed
|
|
36
|
+
* - Empty responses: An empty data array means no new logs yet; continue polling
|
|
37
|
+
* with the same next_page token
|
|
38
|
+
* - Date filtering:
|
|
39
|
+
* - `starting_on`: Earliest logs to return (inclusive)
|
|
40
|
+
* - `ending_before`: Latest logs to return (exclusive)
|
|
41
|
+
* - Cannot be used with `next_page`
|
|
42
|
+
* - Resource filtering: Must specify both `resource_type` and `resource_id`
|
|
43
|
+
* together
|
|
44
|
+
* - Sort order: Default is `date_asc`; use `date_desc` for newest first
|
|
10
45
|
*
|
|
11
46
|
* @example
|
|
12
47
|
* ```ts
|
|
@@ -16,11 +51,9 @@ export declare class AuditLogs extends APIResource {
|
|
|
16
51
|
* }
|
|
17
52
|
* ```
|
|
18
53
|
*/
|
|
19
|
-
list(query?: AuditLogListParams, options?:
|
|
20
|
-
list(options?: Core.RequestOptions): Core.PagePromise<AuditLogListResponsesCursorPage, AuditLogListResponse>;
|
|
21
|
-
}
|
|
22
|
-
export declare class AuditLogListResponsesCursorPage extends CursorPage<AuditLogListResponse> {
|
|
54
|
+
list(query?: AuditLogListParams | null | undefined, options?: RequestOptions): PagePromise<AuditLogListResponsesCursorPage, AuditLogListResponse>;
|
|
23
55
|
}
|
|
56
|
+
export type AuditLogListResponsesCursorPage = CursorPage<AuditLogListResponse>;
|
|
24
57
|
export interface AuditLogListResponse {
|
|
25
58
|
id: string;
|
|
26
59
|
request: AuditLogListResponse.Request;
|
|
@@ -70,6 +103,6 @@ export interface AuditLogListParams extends CursorPageParams {
|
|
|
70
103
|
starting_on?: string;
|
|
71
104
|
}
|
|
72
105
|
export declare namespace AuditLogs {
|
|
73
|
-
export { type AuditLogListResponse as AuditLogListResponse, AuditLogListResponsesCursorPage as AuditLogListResponsesCursorPage, type AuditLogListParams as AuditLogListParams, };
|
|
106
|
+
export { type AuditLogListResponse as AuditLogListResponse, type AuditLogListResponsesCursorPage as AuditLogListResponsesCursorPage, type AuditLogListParams as AuditLogListParams, };
|
|
74
107
|
}
|
|
75
108
|
//# sourceMappingURL=audit-logs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-logs.d.ts","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit-logs.d.ts","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAEzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,+BAA+B,EAAE,oBAAoB,CAAC;CAGtE;AAED,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAE/E,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC;IAEtC,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC;IAEnC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;CAC5C;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,OAAO;QACtB,EAAE,EAAE,MAAM,CAAC;QAEX,EAAE,CAAC,EAAE,MAAM,CAAC;QAEZ,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAED,UAAiB,KAAK;QACpB,EAAE,EAAE,MAAM,CAAC;QAEX,IAAI,EAAE,MAAM,CAAC;QAEb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;CACF;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -1,21 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
const resource_1 = require("../../resource.js");
|
|
6
|
-
const
|
|
7
|
-
const pagination_1 = require("../../pagination.js");
|
|
4
|
+
exports.AuditLogs = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
8
7
|
class AuditLogs extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get a comprehensive audit trail of all operations performed in your Metronome
|
|
10
|
+
* account, whether initiated through the API, web interface, or automated
|
|
11
|
+
* processes. This endpoint provides detailed logs of who did what and when,
|
|
12
|
+
* enabling compliance reporting, security monitoring, and operational
|
|
13
|
+
* troubleshooting across all interaction channels.
|
|
14
|
+
*
|
|
15
|
+
* ### Use this endpoint to:
|
|
16
|
+
*
|
|
17
|
+
* - Monitor all account activity for security and compliance purposes
|
|
18
|
+
* - Track configuration changes regardless of source (API, UI, or system)
|
|
19
|
+
* - Investigate issues by reviewing historical operations
|
|
20
|
+
*
|
|
21
|
+
* ### Key response fields:
|
|
22
|
+
*
|
|
23
|
+
* An array of AuditLog objects containing:
|
|
24
|
+
*
|
|
25
|
+
* - id: Unique identifier for the audit log entry
|
|
26
|
+
* - timestamp: When the action occurred (RFC 3339 format)
|
|
27
|
+
* - actor: Information about who performed the action
|
|
28
|
+
* - request: Details including request ID, IP address, and user agent
|
|
29
|
+
* - `resource_type`: The type of resource affected (e.g., customer, contract,
|
|
30
|
+
* invoice)
|
|
31
|
+
* - `resource_id`: The specific resource identifier
|
|
32
|
+
* - `action`: The operation performed
|
|
33
|
+
* - `next_page`: Cursor for continuous log retrieval
|
|
34
|
+
*
|
|
35
|
+
* ### Usage guidelines:
|
|
36
|
+
*
|
|
37
|
+
* - Continuous retrieval: The next_page token enables uninterrupted log
|
|
38
|
+
* streaming—save it between requests to ensure no logs are missed
|
|
39
|
+
* - Empty responses: An empty data array means no new logs yet; continue polling
|
|
40
|
+
* with the same next_page token
|
|
41
|
+
* - Date filtering:
|
|
42
|
+
* - `starting_on`: Earliest logs to return (inclusive)
|
|
43
|
+
* - `ending_before`: Latest logs to return (exclusive)
|
|
44
|
+
* - Cannot be used with `next_page`
|
|
45
|
+
* - Resource filtering: Must specify both `resource_type` and `resource_id`
|
|
46
|
+
* together
|
|
47
|
+
* - Sort order: Default is `date_asc`; use `date_desc` for newest first
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const auditLogListResponse of client.v1.auditLogs.list()) {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
9
57
|
list(query = {}, options) {
|
|
10
|
-
|
|
11
|
-
return this.list({}, query);
|
|
12
|
-
}
|
|
13
|
-
return this._client.getAPIList('/v1/auditLogs', AuditLogListResponsesCursorPage, { query, ...options });
|
|
58
|
+
return this._client.getAPIList('/v1/auditLogs', (pagination_1.CursorPage), { query, ...options });
|
|
14
59
|
}
|
|
15
60
|
}
|
|
16
61
|
exports.AuditLogs = AuditLogs;
|
|
17
|
-
class AuditLogListResponsesCursorPage extends pagination_1.CursorPage {
|
|
18
|
-
}
|
|
19
|
-
exports.AuditLogListResponsesCursorPage = AuditLogListResponsesCursorPage;
|
|
20
|
-
AuditLogs.AuditLogListResponsesCursorPage = AuditLogListResponsesCursorPage;
|
|
21
62
|
//# sourceMappingURL=audit-logs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-logs.js","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"audit-logs.js","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAClD,yDAAuF;AAGvF,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,uBAAgC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF;AAxDD,8BAwDC"}
|
|
@@ -1,16 +1,58 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../resource.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { CursorPage } from "../../pagination.mjs";
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { CursorPage } from "../../core/pagination.mjs";
|
|
5
4
|
export class AuditLogs extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get a comprehensive audit trail of all operations performed in your Metronome
|
|
7
|
+
* account, whether initiated through the API, web interface, or automated
|
|
8
|
+
* processes. This endpoint provides detailed logs of who did what and when,
|
|
9
|
+
* enabling compliance reporting, security monitoring, and operational
|
|
10
|
+
* troubleshooting across all interaction channels.
|
|
11
|
+
*
|
|
12
|
+
* ### Use this endpoint to:
|
|
13
|
+
*
|
|
14
|
+
* - Monitor all account activity for security and compliance purposes
|
|
15
|
+
* - Track configuration changes regardless of source (API, UI, or system)
|
|
16
|
+
* - Investigate issues by reviewing historical operations
|
|
17
|
+
*
|
|
18
|
+
* ### Key response fields:
|
|
19
|
+
*
|
|
20
|
+
* An array of AuditLog objects containing:
|
|
21
|
+
*
|
|
22
|
+
* - id: Unique identifier for the audit log entry
|
|
23
|
+
* - timestamp: When the action occurred (RFC 3339 format)
|
|
24
|
+
* - actor: Information about who performed the action
|
|
25
|
+
* - request: Details including request ID, IP address, and user agent
|
|
26
|
+
* - `resource_type`: The type of resource affected (e.g., customer, contract,
|
|
27
|
+
* invoice)
|
|
28
|
+
* - `resource_id`: The specific resource identifier
|
|
29
|
+
* - `action`: The operation performed
|
|
30
|
+
* - `next_page`: Cursor for continuous log retrieval
|
|
31
|
+
*
|
|
32
|
+
* ### Usage guidelines:
|
|
33
|
+
*
|
|
34
|
+
* - Continuous retrieval: The next_page token enables uninterrupted log
|
|
35
|
+
* streaming—save it between requests to ensure no logs are missed
|
|
36
|
+
* - Empty responses: An empty data array means no new logs yet; continue polling
|
|
37
|
+
* with the same next_page token
|
|
38
|
+
* - Date filtering:
|
|
39
|
+
* - `starting_on`: Earliest logs to return (inclusive)
|
|
40
|
+
* - `ending_before`: Latest logs to return (exclusive)
|
|
41
|
+
* - Cannot be used with `next_page`
|
|
42
|
+
* - Resource filtering: Must specify both `resource_type` and `resource_id`
|
|
43
|
+
* together
|
|
44
|
+
* - Sort order: Default is `date_asc`; use `date_desc` for newest first
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Automatically fetches more pages as needed.
|
|
49
|
+
* for await (const auditLogListResponse of client.v1.auditLogs.list()) {
|
|
50
|
+
* // ...
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
6
54
|
list(query = {}, options) {
|
|
7
|
-
|
|
8
|
-
return this.list({}, query);
|
|
9
|
-
}
|
|
10
|
-
return this._client.getAPIList('/v1/auditLogs', AuditLogListResponsesCursorPage, { query, ...options });
|
|
55
|
+
return this._client.getAPIList('/v1/auditLogs', (CursorPage), { query, ...options });
|
|
11
56
|
}
|
|
12
57
|
}
|
|
13
|
-
export class AuditLogListResponsesCursorPage extends CursorPage {
|
|
14
|
-
}
|
|
15
|
-
AuditLogs.AuditLogListResponsesCursorPage = AuditLogListResponsesCursorPage;
|
|
16
58
|
//# sourceMappingURL=audit-logs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-logs.mjs","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,
|
|
1
|
+
{"version":3,"file":"audit-logs.mjs","sourceRoot":"","sources":["../../src/resources/v1/audit-logs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAsC;AAGzD,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,UAAgC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF"}
|