@metronome/sdk 0.1.0-beta.8 → 0.1.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 +227 -0
- package/README.md +37 -52
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +25 -15
- package/core.js.map +1 -1
- package/core.mjs +26 -16
- package/core.mjs.map +1 -1
- package/index.d.mts +10 -42
- package/index.d.ts +10 -42
- package/index.d.ts.map +1 -1
- package/index.js +14 -55
- package/index.js.map +1 -1
- package/index.mjs +14 -55
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/index.d.ts +2 -13
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -38
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -13
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.ts +512 -24
- package/resources/shared.d.ts.map +1 -1
- package/resources/{alerts.d.ts → v1/alerts.d.ts} +29 -5
- package/resources/v1/alerts.d.ts.map +1 -0
- package/resources/v1/alerts.js +40 -0
- package/resources/v1/alerts.js.map +1 -0
- package/resources/v1/alerts.mjs +36 -0
- package/resources/v1/alerts.mjs.map +1 -0
- package/resources/{audit-logs.d.ts → v1/audit-logs.d.ts} +11 -3
- package/resources/v1/audit-logs.d.ts.map +1 -0
- package/resources/{audit-logs.js → v1/audit-logs.js} +4 -4
- package/resources/v1/audit-logs.js.map +1 -0
- package/resources/{audit-logs.mjs → v1/audit-logs.mjs} +4 -4
- package/resources/v1/audit-logs.mjs.map +1 -0
- package/resources/{billable-metrics.d.ts → v1/billable-metrics.d.ts} +62 -7
- package/resources/v1/billable-metrics.d.ts.map +1 -0
- package/resources/v1/billable-metrics.js +84 -0
- package/resources/v1/billable-metrics.js.map +1 -0
- package/resources/v1/billable-metrics.mjs +79 -0
- package/resources/v1/billable-metrics.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/contracts.d.ts +1618 -62
- package/resources/v1/contracts/contracts.d.ts.map +1 -0
- package/resources/v1/contracts/contracts.js +312 -0
- package/resources/v1/contracts/contracts.js.map +1 -0
- package/resources/v1/contracts/contracts.mjs +285 -0
- package/resources/v1/contracts/contracts.mjs.map +1 -0
- package/resources/v1/contracts/index.d.ts +5 -0
- package/resources/v1/contracts/index.d.ts.map +1 -0
- package/resources/v1/contracts/index.js.map +1 -0
- package/resources/v1/contracts/index.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/named-schedules.d.ts +23 -2
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -0
- package/resources/v1/contracts/named-schedules.js +48 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -0
- package/resources/v1/contracts/named-schedules.mjs +44 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/products.d.ts +55 -7
- package/resources/v1/contracts/products.d.ts.map +1 -0
- package/resources/v1/contracts/products.js +84 -0
- package/resources/v1/contracts/products.js.map +1 -0
- package/resources/v1/contracts/products.mjs +79 -0
- package/resources/v1/contracts/products.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/rate-cards/index.d.ts +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -0
- package/resources/v1/contracts/rate-cards/index.js.map +1 -0
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/rate-cards/named-schedules.d.ts +27 -2
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js +52 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +48 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/rate-cards/product-orders.d.ts +33 -3
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -0
- package/resources/v1/contracts/rate-cards/product-orders.js +54 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs +50 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/rate-cards/rate-cards.d.ts +118 -14
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -0
- package/resources/{contracts → v1/contracts}/rate-cards/rate-cards.js +83 -12
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +140 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -0
- package/resources/{contracts → v1/contracts}/rate-cards/rates.d.ts +118 -14
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -0
- package/resources/v1/contracts/rate-cards/rates.js +106 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -0
- package/resources/v1/contracts/rate-cards/rates.mjs +101 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -0
- package/resources/v1/contracts/rate-cards.d.ts +2 -0
- package/resources/v1/contracts/rate-cards.d.ts.map +1 -0
- package/resources/v1/contracts/rate-cards.js +19 -0
- package/resources/v1/contracts/rate-cards.js.map +1 -0
- package/resources/v1/contracts/rate-cards.mjs +3 -0
- package/resources/v1/contracts/rate-cards.mjs.map +1 -0
- package/resources/v1/contracts.d.ts +2 -0
- package/resources/v1/contracts.d.ts.map +1 -0
- package/resources/v1/contracts.js +19 -0
- package/resources/v1/contracts.js.map +1 -0
- package/resources/v1/contracts.mjs +3 -0
- package/resources/v1/contracts.mjs.map +1 -0
- package/resources/{credit-grants.d.ts → v1/credit-grants.d.ts} +81 -6
- package/resources/v1/credit-grants.d.ts.map +1 -0
- package/resources/v1/credit-grants.js +89 -0
- package/resources/v1/credit-grants.js.map +1 -0
- package/resources/v1/credit-grants.mjs +84 -0
- package/resources/v1/credit-grants.mjs.map +1 -0
- package/resources/{custom-fields.d.ts → v1/custom-fields.d.ts} +53 -9
- package/resources/v1/custom-fields.d.ts.map +1 -0
- package/resources/{custom-fields.js → v1/custom-fields.js} +42 -7
- package/resources/v1/custom-fields.js.map +1 -0
- package/resources/{custom-fields.mjs → v1/custom-fields.mjs} +42 -7
- package/resources/v1/custom-fields.mjs.map +1 -0
- package/resources/{customers → v1/customers}/alerts.d.ts +31 -3
- package/resources/v1/customers/alerts.d.ts.map +1 -0
- package/resources/v1/customers/alerts.js +56 -0
- package/resources/v1/customers/alerts.js.map +1 -0
- package/resources/v1/customers/alerts.mjs +52 -0
- package/resources/v1/customers/alerts.mjs.map +1 -0
- package/resources/{customers → v1/customers}/billing-config.d.ts +33 -2
- package/resources/v1/customers/billing-config.d.ts.map +1 -0
- package/resources/v1/customers/billing-config.js +65 -0
- package/resources/v1/customers/billing-config.js.map +1 -0
- package/resources/v1/customers/billing-config.mjs +61 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -0
- package/resources/{customers → v1/customers}/commits.d.ts +97 -10
- package/resources/v1/customers/commits.d.ts.map +1 -0
- package/resources/v1/customers/commits.js +82 -0
- package/resources/v1/customers/commits.js.map +1 -0
- package/resources/v1/customers/commits.mjs +78 -0
- package/resources/v1/customers/commits.mjs.map +1 -0
- package/resources/{customers → v1/customers}/credits.d.ts +76 -6
- package/resources/v1/customers/credits.d.ts.map +1 -0
- package/resources/v1/customers/credits.js +67 -0
- package/resources/v1/customers/credits.js.map +1 -0
- package/resources/v1/customers/credits.mjs +63 -0
- package/resources/v1/customers/credits.mjs.map +1 -0
- package/resources/{customers → v1/customers}/customers.d.ts +197 -14
- package/resources/v1/customers/customers.d.ts.map +1 -0
- package/resources/{customers → v1/customers}/customers.js +118 -16
- package/resources/v1/customers/customers.js.map +1 -0
- package/resources/v1/customers/customers.mjs +228 -0
- package/resources/v1/customers/customers.mjs.map +1 -0
- package/resources/{customers → v1/customers}/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -0
- package/resources/v1/customers/index.js.map +1 -0
- package/resources/v1/customers/index.mjs.map +1 -0
- package/resources/{customers → v1/customers}/invoices.d.ts +152 -57
- package/resources/v1/customers/invoices.d.ts.map +1 -0
- package/resources/v1/customers/invoices.js +103 -0
- package/resources/v1/customers/invoices.js.map +1 -0
- package/resources/v1/customers/invoices.mjs +97 -0
- package/resources/v1/customers/invoices.mjs.map +1 -0
- package/resources/{customers → v1/customers}/named-schedules.d.ts +23 -2
- package/resources/v1/customers/named-schedules.d.ts.map +1 -0
- package/resources/v1/customers/named-schedules.js +48 -0
- package/resources/v1/customers/named-schedules.js.map +1 -0
- package/resources/v1/customers/named-schedules.mjs +44 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -0
- package/resources/{customers → v1/customers}/plans.d.ts +50 -5
- package/resources/v1/customers/plans.d.ts.map +1 -0
- package/resources/v1/customers/plans.js +99 -0
- package/resources/v1/customers/plans.js.map +1 -0
- package/resources/v1/customers/plans.mjs +93 -0
- package/resources/v1/customers/plans.mjs.map +1 -0
- package/resources/v1/customers.d.ts +2 -0
- package/resources/v1/customers.d.ts.map +1 -0
- package/resources/v1/customers.js +19 -0
- package/resources/v1/customers.js.map +1 -0
- package/resources/v1/customers.mjs +3 -0
- package/resources/v1/customers.mjs.map +1 -0
- package/resources/{dashboards.d.ts → v1/dashboards.d.ts} +32 -4
- package/resources/v1/dashboards.d.ts.map +1 -0
- package/resources/v1/dashboards.js +43 -0
- package/resources/v1/dashboards.js.map +1 -0
- package/resources/v1/dashboards.mjs +39 -0
- package/resources/v1/dashboards.mjs.map +1 -0
- package/resources/v1/index.d.ts +15 -0
- package/resources/v1/index.d.ts.map +1 -0
- package/resources/v1/index.js +44 -0
- package/resources/v1/index.js.map +1 -0
- package/resources/v1/index.mjs +16 -0
- package/resources/v1/index.mjs.map +1 -0
- package/resources/{invoices.d.ts → v1/invoices.d.ts} +16 -2
- package/resources/v1/invoices.d.ts.map +1 -0
- package/resources/v1/invoices.js +35 -0
- package/resources/v1/invoices.js.map +1 -0
- package/resources/v1/invoices.mjs +31 -0
- package/resources/v1/invoices.mjs.map +1 -0
- package/resources/{plans.d.ts → v1/plans.d.ts} +51 -8
- package/resources/v1/plans.d.ts.map +1 -0
- package/resources/{plans.js → v1/plans.js} +34 -7
- package/resources/v1/plans.js.map +1 -0
- package/resources/v1/plans.mjs +74 -0
- package/resources/v1/plans.mjs.map +1 -0
- package/resources/{pricing-units.d.ts → v1/pricing-units.d.ts} +11 -3
- package/resources/v1/pricing-units.d.ts.map +1 -0
- package/resources/{pricing-units.js → v1/pricing-units.js} +4 -4
- package/resources/v1/pricing-units.js.map +1 -0
- package/resources/{pricing-units.mjs → v1/pricing-units.mjs} +4 -4
- package/resources/v1/pricing-units.mjs.map +1 -0
- package/resources/{services.d.ts → v1/services.d.ts} +7 -2
- package/resources/v1/services.d.ts.map +1 -0
- package/resources/{services.js → v1/services.js} +7 -2
- package/resources/v1/services.js.map +1 -0
- package/resources/{services.mjs → v1/services.mjs} +7 -2
- package/resources/v1/services.mjs.map +1 -0
- package/resources/v1/usage.d.ts +325 -0
- package/resources/v1/usage.d.ts.map +1 -0
- package/resources/v1/usage.js +92 -0
- package/resources/v1/usage.js.map +1 -0
- package/resources/v1/usage.mjs +87 -0
- package/resources/v1/usage.mjs.map +1 -0
- package/resources/v1/v1.d.ts +58 -0
- package/resources/v1/v1.d.ts.map +1 -0
- package/resources/v1/v1.js +98 -0
- package/resources/v1/v1.js.map +1 -0
- package/resources/v1/v1.mjs +71 -0
- package/resources/v1/v1.mjs.map +1 -0
- package/resources/v1.d.ts +2 -0
- package/resources/v1.d.ts.map +1 -0
- package/resources/v1.js +19 -0
- package/resources/v1.js.map +1 -0
- package/resources/v1.mjs +3 -0
- package/resources/v1.mjs.map +1 -0
- package/resources/v2/contracts.d.ts +5955 -0
- package/resources/v2/contracts.d.ts.map +1 -0
- package/resources/v2/contracts.js +136 -0
- package/resources/v2/contracts.js.map +1 -0
- package/resources/v2/contracts.mjs +132 -0
- package/resources/v2/contracts.mjs.map +1 -0
- package/resources/v2/index.d.ts +3 -0
- package/resources/v2/index.d.ts.map +1 -0
- package/resources/v2/index.js +9 -0
- package/resources/v2/index.js.map +1 -0
- package/resources/v2/index.mjs +4 -0
- package/resources/v2/index.mjs.map +1 -0
- package/resources/v2/v2.d.ts +10 -0
- package/resources/v2/v2.d.ts.map +1 -0
- package/resources/v2/v2.js +39 -0
- package/resources/v2/v2.js.map +1 -0
- package/resources/v2/v2.mjs +12 -0
- package/resources/v2/v2.mjs.map +1 -0
- package/resources/v2.d.ts +2 -0
- package/resources/v2.d.ts.map +1 -0
- package/resources/v2.js +19 -0
- package/resources/v2.js.map +1 -0
- package/resources/v2.mjs +3 -0
- package/resources/v2.mjs.map +1 -0
- package/resources/webhooks.js +5 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -5
- package/resources/webhooks.mjs.map +1 -1
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +5 -3
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +6 -2
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +49 -21
- package/src/error.ts +1 -1
- package/src/index.ts +31 -349
- package/src/internal/qs/formats.ts +1 -1
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +3 -3
- package/src/internal/qs/utils.ts +2 -2
- package/src/pagination.ts +5 -1
- package/src/resource.ts +2 -2
- package/src/resources/index.ts +4 -144
- package/src/resources/shared.ts +587 -26
- package/src/resources/{alerts.ts → v1/alerts.ts} +31 -7
- package/src/resources/{audit-logs.ts → v1/audit-logs.ts} +13 -5
- package/src/resources/{billable-metrics.ts → v1/billable-metrics.ts} +61 -12
- package/src/resources/{contracts → v1/contracts}/contracts.ts +1848 -83
- package/src/resources/{contracts → v1/contracts}/index.ts +8 -4
- package/src/resources/{contracts → v1/contracts}/named-schedules.ts +25 -4
- package/src/resources/{contracts → v1/contracts}/products.ts +58 -14
- package/src/resources/{contracts → v1/contracts}/rate-cards/index.ts +6 -4
- package/src/resources/{contracts → v1/contracts}/rate-cards/named-schedules.ts +29 -4
- package/src/resources/{contracts → v1/contracts}/rate-cards/product-orders.ts +38 -5
- package/src/resources/{contracts → v1/contracts}/rate-cards/rate-cards.ts +137 -25
- package/src/resources/{contracts → v1/contracts}/rate-cards/rates.ts +105 -17
- package/src/resources/v1/contracts/rate-cards.ts +3 -0
- package/src/resources/v1/contracts.ts +3 -0
- package/src/resources/{credit-grants.ts → v1/credit-grants.ts} +86 -14
- package/src/resources/{custom-fields.ts → v1/custom-fields.ts} +62 -14
- package/src/resources/{customers → v1/customers}/alerts.ts +35 -6
- package/src/resources/{customers → v1/customers}/billing-config.ts +37 -5
- package/src/resources/{customers → v1/customers}/commits.ts +100 -13
- package/src/resources/{customers → v1/customers}/credits.ts +79 -9
- package/src/resources/{customers → v1/customers}/customers.ts +229 -40
- package/src/resources/{customers → v1/customers}/index.ts +10 -8
- package/src/resources/{customers → v1/customers}/invoices.ts +131 -62
- package/src/resources/{customers → v1/customers}/named-schedules.ts +25 -4
- package/src/resources/{customers → v1/customers}/plans.ts +55 -9
- package/src/resources/v1/customers.ts +3 -0
- package/src/resources/{dashboards.ts → v1/dashboards.ts} +31 -5
- package/src/resources/v1/index.ts +151 -0
- package/src/resources/{invoices.ts → v1/invoices.ts} +18 -4
- package/src/resources/{plans.ts → v1/plans.ts} +49 -14
- package/src/resources/{pricing-units.ts → v1/pricing-units.ts} +13 -5
- package/src/resources/{services.ts → v1/services.ts} +8 -3
- package/src/resources/v1/usage.ts +429 -0
- package/src/resources/v1/v1.ts +364 -0
- package/src/resources/v1.ts +3 -0
- package/src/resources/v2/contracts.ts +7677 -0
- package/src/resources/v2/index.ts +18 -0
- package/src/resources/v2/v2.ts +43 -0
- package/src/resources/v2.ts +3 -0
- package/src/resources/webhooks.ts +7 -7
- package/src/resources.ts +1 -0
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/alerts.d.ts.map +0 -1
- package/resources/alerts.js +0 -21
- package/resources/alerts.js.map +0 -1
- package/resources/alerts.mjs +0 -17
- package/resources/alerts.mjs.map +0 -1
- package/resources/audit-logs.d.ts.map +0 -1
- package/resources/audit-logs.js.map +0 -1
- package/resources/audit-logs.mjs.map +0 -1
- package/resources/billable-metrics.d.ts.map +0 -1
- package/resources/billable-metrics.js +0 -43
- package/resources/billable-metrics.js.map +0 -1
- package/resources/billable-metrics.mjs +0 -38
- package/resources/billable-metrics.mjs.map +0 -1
- package/resources/contracts/contracts.d.ts.map +0 -1
- package/resources/contracts/contracts.js +0 -135
- package/resources/contracts/contracts.js.map +0 -1
- package/resources/contracts/contracts.mjs +0 -108
- package/resources/contracts/contracts.mjs.map +0 -1
- package/resources/contracts/index.d.ts +0 -5
- package/resources/contracts/index.d.ts.map +0 -1
- package/resources/contracts/index.js.map +0 -1
- package/resources/contracts/index.mjs.map +0 -1
- package/resources/contracts/named-schedules.d.ts.map +0 -1
- package/resources/contracts/named-schedules.js +0 -27
- package/resources/contracts/named-schedules.js.map +0 -1
- package/resources/contracts/named-schedules.mjs +0 -23
- package/resources/contracts/named-schedules.mjs.map +0 -1
- package/resources/contracts/products.d.ts.map +0 -1
- package/resources/contracts/products.js +0 -51
- package/resources/contracts/products.js.map +0 -1
- package/resources/contracts/products.mjs +0 -46
- package/resources/contracts/products.mjs.map +0 -1
- package/resources/contracts/rate-cards/index.d.ts.map +0 -1
- package/resources/contracts/rate-cards/index.js.map +0 -1
- package/resources/contracts/rate-cards/index.mjs.map +0 -1
- package/resources/contracts/rate-cards/named-schedules.d.ts.map +0 -1
- package/resources/contracts/rate-cards/named-schedules.js +0 -27
- package/resources/contracts/rate-cards/named-schedules.js.map +0 -1
- package/resources/contracts/rate-cards/named-schedules.mjs +0 -23
- package/resources/contracts/rate-cards/named-schedules.mjs.map +0 -1
- package/resources/contracts/rate-cards/product-orders.d.ts.map +0 -1
- package/resources/contracts/rate-cards/product-orders.js +0 -21
- package/resources/contracts/rate-cards/product-orders.js.map +0 -1
- package/resources/contracts/rate-cards/product-orders.mjs +0 -17
- package/resources/contracts/rate-cards/product-orders.mjs.map +0 -1
- package/resources/contracts/rate-cards/rate-cards.d.ts.map +0 -1
- package/resources/contracts/rate-cards/rate-cards.js.map +0 -1
- package/resources/contracts/rate-cards/rate-cards.mjs +0 -69
- package/resources/contracts/rate-cards/rate-cards.mjs.map +0 -1
- package/resources/contracts/rate-cards/rates.d.ts.map +0 -1
- package/resources/contracts/rate-cards/rates.js +0 -38
- package/resources/contracts/rate-cards/rates.js.map +0 -1
- package/resources/contracts/rate-cards/rates.mjs +0 -33
- package/resources/contracts/rate-cards/rates.mjs.map +0 -1
- package/resources/credit-grants.d.ts.map +0 -1
- package/resources/credit-grants.js +0 -52
- package/resources/credit-grants.js.map +0 -1
- package/resources/credit-grants.mjs +0 -47
- package/resources/credit-grants.mjs.map +0 -1
- package/resources/custom-fields.d.ts.map +0 -1
- package/resources/custom-fields.js.map +0 -1
- package/resources/custom-fields.mjs.map +0 -1
- package/resources/customers/alerts.d.ts.map +0 -1
- package/resources/customers/alerts.js +0 -33
- package/resources/customers/alerts.js.map +0 -1
- package/resources/customers/alerts.mjs +0 -29
- package/resources/customers/alerts.mjs.map +0 -1
- package/resources/customers/billing-config.d.ts.map +0 -1
- package/resources/customers/billing-config.js +0 -38
- package/resources/customers/billing-config.js.map +0 -1
- package/resources/customers/billing-config.mjs +0 -34
- package/resources/customers/billing-config.mjs.map +0 -1
- package/resources/customers/commits.d.ts.map +0 -1
- package/resources/customers/commits.js +0 -27
- package/resources/customers/commits.js.map +0 -1
- package/resources/customers/commits.mjs +0 -23
- package/resources/customers/commits.mjs.map +0 -1
- package/resources/customers/credits.d.ts.map +0 -1
- package/resources/customers/credits.js +0 -27
- package/resources/customers/credits.js.map +0 -1
- package/resources/customers/credits.mjs +0 -23
- package/resources/customers/credits.mjs.map +0 -1
- package/resources/customers/customers.d.ts.map +0 -1
- package/resources/customers/customers.js.map +0 -1
- package/resources/customers/customers.mjs +0 -126
- package/resources/customers/customers.mjs.map +0 -1
- package/resources/customers/index.d.ts.map +0 -1
- package/resources/customers/index.js.map +0 -1
- package/resources/customers/index.mjs.map +0 -1
- package/resources/customers/invoices.d.ts.map +0 -1
- package/resources/customers/invoices.js +0 -51
- package/resources/customers/invoices.js.map +0 -1
- package/resources/customers/invoices.mjs +0 -45
- package/resources/customers/invoices.mjs.map +0 -1
- package/resources/customers/named-schedules.d.ts.map +0 -1
- package/resources/customers/named-schedules.js +0 -27
- package/resources/customers/named-schedules.js.map +0 -1
- package/resources/customers/named-schedules.mjs +0 -23
- package/resources/customers/named-schedules.mjs.map +0 -1
- package/resources/customers/plans.d.ts.map +0 -1
- package/resources/customers/plans.js +0 -53
- package/resources/customers/plans.js.map +0 -1
- package/resources/customers/plans.mjs +0 -47
- package/resources/customers/plans.mjs.map +0 -1
- package/resources/dashboards.d.ts.map +0 -1
- package/resources/dashboards.js +0 -17
- package/resources/dashboards.js.map +0 -1
- package/resources/dashboards.mjs +0 -13
- package/resources/dashboards.mjs.map +0 -1
- package/resources/invoices.d.ts.map +0 -1
- package/resources/invoices.js +0 -21
- package/resources/invoices.js.map +0 -1
- package/resources/invoices.mjs +0 -17
- package/resources/invoices.mjs.map +0 -1
- package/resources/plans.d.ts.map +0 -1
- package/resources/plans.js.map +0 -1
- package/resources/plans.mjs +0 -47
- package/resources/plans.mjs.map +0 -1
- package/resources/pricing-units.d.ts.map +0 -1
- package/resources/pricing-units.js.map +0 -1
- package/resources/pricing-units.mjs.map +0 -1
- package/resources/services.d.ts.map +0 -1
- package/resources/services.js.map +0 -1
- package/resources/services.mjs.map +0 -1
- package/resources/usage.d.ts +0 -166
- package/resources/usage.d.ts.map +0 -1
- package/resources/usage.js +0 -49
- package/resources/usage.js.map +0 -1
- package/resources/usage.mjs +0 -44
- package/resources/usage.mjs.map +0 -1
- package/src/resources/usage.ts +0 -239
- /package/resources/{contracts → v1/contracts}/index.js +0 -0
- /package/resources/{contracts → v1/contracts}/index.mjs +0 -0
- /package/resources/{contracts → v1/contracts}/rate-cards/index.js +0 -0
- /package/resources/{contracts → v1/contracts}/rate-cards/index.mjs +0 -0
- /package/resources/{customers → v1/customers}/index.js +0 -0
- /package/resources/{customers → v1/customers}/index.mjs +0 -0
|
@@ -1,32 +1,72 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
5
|
-
import * as Shared from
|
|
3
|
+
import { APIResource } from "../../../resource.js";
|
|
4
|
+
import * as Core from "../../../core.js";
|
|
5
|
+
import * as Shared from "../../shared.js";
|
|
6
6
|
|
|
7
7
|
export class Credits extends APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new credit at the customer level.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const credit = await client.v1.customers.credits.create({
|
|
14
|
+
* access_schedule: {
|
|
15
|
+
* credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
|
|
16
|
+
* schedule_items: [
|
|
17
|
+
* {
|
|
18
|
+
* amount: 1000,
|
|
19
|
+
* starting_at: '2020-01-01T00:00:00.000Z',
|
|
20
|
+
* ending_before: '2020-02-01T00:00:00.000Z',
|
|
21
|
+
* },
|
|
22
|
+
* ],
|
|
23
|
+
* },
|
|
24
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
25
|
+
* priority: 100,
|
|
26
|
+
* product_id: 'f14d6729-6a44-4b13-9908-9387f1918790',
|
|
27
|
+
* name: 'My Credit',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
10
30
|
*/
|
|
11
31
|
create(body: CreditCreateParams, options?: Core.RequestOptions): Core.APIPromise<CreditCreateResponse> {
|
|
12
|
-
return this._client.post('/contracts/customerCredits/create', { body, ...options });
|
|
32
|
+
return this._client.post('/v1/contracts/customerCredits/create', { body, ...options });
|
|
13
33
|
}
|
|
14
34
|
|
|
15
35
|
/**
|
|
16
36
|
* List credits.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const credits = await client.v1.customers.credits.list({
|
|
41
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
42
|
+
* credit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
43
|
+
* include_ledgers: true,
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
17
46
|
*/
|
|
18
47
|
list(body: CreditListParams, options?: Core.RequestOptions): Core.APIPromise<CreditListResponse> {
|
|
19
|
-
return this._client.post('/contracts/customerCredits/list', { body, ...options });
|
|
48
|
+
return this._client.post('/v1/contracts/customerCredits/list', { body, ...options });
|
|
20
49
|
}
|
|
21
50
|
|
|
22
51
|
/**
|
|
23
|
-
*
|
|
52
|
+
* Pull forward the end date of a credit. Use the "edit a credit" endpoint to
|
|
53
|
+
* extend the end date of a credit, or to make other edits to the credit.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const response =
|
|
58
|
+
* await client.v1.customers.credits.updateEndDate({
|
|
59
|
+
* access_ending_before: '2020-01-01T00:00:00.000Z',
|
|
60
|
+
* credit_id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
|
|
61
|
+
* customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
24
64
|
*/
|
|
25
65
|
updateEndDate(
|
|
26
66
|
body: CreditUpdateEndDateParams,
|
|
27
67
|
options?: Core.RequestOptions,
|
|
28
68
|
): Core.APIPromise<CreditUpdateEndDateResponse> {
|
|
29
|
-
return this._client.post('/contracts/customerCredits/updateEndDate', { body, ...options });
|
|
69
|
+
return this._client.post('/v1/contracts/customerCredits/updateEndDate', { body, ...options });
|
|
30
70
|
}
|
|
31
71
|
}
|
|
32
72
|
|
|
@@ -78,7 +118,7 @@ export interface CreditCreateParams {
|
|
|
78
118
|
*/
|
|
79
119
|
applicable_product_tags?: Array<string>;
|
|
80
120
|
|
|
81
|
-
custom_fields?:
|
|
121
|
+
custom_fields?: { [key: string]: string };
|
|
82
122
|
|
|
83
123
|
/**
|
|
84
124
|
* Used only in UI/API. It is not exposed to end customers.
|
|
@@ -102,6 +142,14 @@ export interface CreditCreateParams {
|
|
|
102
142
|
*/
|
|
103
143
|
salesforce_opportunity_id?: string;
|
|
104
144
|
|
|
145
|
+
/**
|
|
146
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
147
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
148
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
149
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
150
|
+
*/
|
|
151
|
+
specifiers?: Array<CreditCreateParams.Specifier>;
|
|
152
|
+
|
|
105
153
|
/**
|
|
106
154
|
* Prevents the creation of duplicates. If a request to create a commit or credit
|
|
107
155
|
* is made with a uniqueness key that was previously used to create a commit or
|
|
@@ -139,6 +187,23 @@ export namespace CreditCreateParams {
|
|
|
139
187
|
starting_at: string;
|
|
140
188
|
}
|
|
141
189
|
}
|
|
190
|
+
|
|
191
|
+
export interface Specifier {
|
|
192
|
+
presentation_group_values?: { [key: string]: string };
|
|
193
|
+
|
|
194
|
+
pricing_group_values?: { [key: string]: string };
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* If provided, the specifier will only apply to the product with the specified ID.
|
|
198
|
+
*/
|
|
199
|
+
product_id?: string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* If provided, the specifier will only apply to products with all the specified
|
|
203
|
+
* tags.
|
|
204
|
+
*/
|
|
205
|
+
product_tags?: Array<string>;
|
|
206
|
+
}
|
|
142
207
|
}
|
|
143
208
|
|
|
144
209
|
export interface CreditListParams {
|
|
@@ -157,7 +222,7 @@ export interface CreditListParams {
|
|
|
157
222
|
effective_before?: string;
|
|
158
223
|
|
|
159
224
|
/**
|
|
160
|
-
* Include credits from archived contracts.
|
|
225
|
+
* Include archived credits and credits from archived contracts.
|
|
161
226
|
*/
|
|
162
227
|
include_archived?: boolean;
|
|
163
228
|
|
|
@@ -178,6 +243,11 @@ export interface CreditListParams {
|
|
|
178
243
|
*/
|
|
179
244
|
include_ledgers?: boolean;
|
|
180
245
|
|
|
246
|
+
/**
|
|
247
|
+
* The maximum number of commits to return. Defaults to 25.
|
|
248
|
+
*/
|
|
249
|
+
limit?: number;
|
|
250
|
+
|
|
181
251
|
/**
|
|
182
252
|
* The next page token from a previous response.
|
|
183
253
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import { isRequestOptions } from
|
|
5
|
-
import * as Core from
|
|
6
|
-
import * as Shared from
|
|
7
|
-
import * as AlertsAPI from
|
|
3
|
+
import { APIResource } from "../../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../../core.js";
|
|
5
|
+
import * as Core from "../../../core.js";
|
|
6
|
+
import * as Shared from "../../shared.js";
|
|
7
|
+
import * as AlertsAPI from "./alerts.js";
|
|
8
8
|
import {
|
|
9
9
|
AlertListParams,
|
|
10
10
|
AlertListResponse,
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
AlertRetrieveResponse,
|
|
14
14
|
Alerts,
|
|
15
15
|
CustomerAlert,
|
|
16
|
-
} from
|
|
17
|
-
import * as BillingConfigAPI from
|
|
16
|
+
} from "./alerts.js";
|
|
17
|
+
import * as BillingConfigAPI from "./billing-config.js";
|
|
18
18
|
import {
|
|
19
19
|
BillingConfig as BillingConfigAPIBillingConfig,
|
|
20
20
|
BillingConfigCreateParams,
|
|
21
21
|
BillingConfigDeleteParams,
|
|
22
22
|
BillingConfigRetrieveParams,
|
|
23
23
|
BillingConfigRetrieveResponse,
|
|
24
|
-
} from
|
|
25
|
-
import * as CommitsAPI from
|
|
24
|
+
} from "./billing-config.js";
|
|
25
|
+
import * as CommitsAPI from "./commits.js";
|
|
26
26
|
import {
|
|
27
27
|
CommitCreateParams,
|
|
28
28
|
CommitCreateResponse,
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
CommitUpdateEndDateParams,
|
|
32
32
|
CommitUpdateEndDateResponse,
|
|
33
33
|
Commits,
|
|
34
|
-
} from
|
|
35
|
-
import * as CreditsAPI from
|
|
34
|
+
} from "./commits.js";
|
|
35
|
+
import * as CreditsAPI from "./credits.js";
|
|
36
36
|
import {
|
|
37
37
|
CreditCreateParams,
|
|
38
38
|
CreditCreateResponse,
|
|
@@ -41,8 +41,8 @@ import {
|
|
|
41
41
|
CreditUpdateEndDateParams,
|
|
42
42
|
CreditUpdateEndDateResponse,
|
|
43
43
|
Credits,
|
|
44
|
-
} from
|
|
45
|
-
import * as InvoicesAPI from
|
|
44
|
+
} from "./credits.js";
|
|
45
|
+
import * as InvoicesAPI from "./invoices.js";
|
|
46
46
|
import {
|
|
47
47
|
Invoice,
|
|
48
48
|
InvoiceAddChargeParams,
|
|
@@ -55,15 +55,15 @@ import {
|
|
|
55
55
|
InvoiceRetrieveResponse,
|
|
56
56
|
Invoices,
|
|
57
57
|
InvoicesCursorPage,
|
|
58
|
-
} from
|
|
59
|
-
import * as NamedSchedulesAPI from
|
|
58
|
+
} from "./invoices.js";
|
|
59
|
+
import * as NamedSchedulesAPI from "./named-schedules.js";
|
|
60
60
|
import {
|
|
61
61
|
NamedScheduleRetrieveParams,
|
|
62
62
|
NamedScheduleRetrieveResponse,
|
|
63
63
|
NamedScheduleUpdateParams,
|
|
64
64
|
NamedSchedules,
|
|
65
|
-
} from
|
|
66
|
-
import * as PlansAPI from
|
|
65
|
+
} from "./named-schedules.js";
|
|
66
|
+
import * as PlansAPI from "./plans.js";
|
|
67
67
|
import {
|
|
68
68
|
PlanAddParams,
|
|
69
69
|
PlanAddResponse,
|
|
@@ -76,8 +76,8 @@ import {
|
|
|
76
76
|
PlanListResponse,
|
|
77
77
|
PlanListResponsesCursorPage,
|
|
78
78
|
Plans,
|
|
79
|
-
} from
|
|
80
|
-
import { CursorPage, type CursorPageParams } from
|
|
79
|
+
} from "./plans.js";
|
|
80
|
+
import { CursorPage, type CursorPageParams } from "../../../pagination.js";
|
|
81
81
|
|
|
82
82
|
export class Customers extends APIResource {
|
|
83
83
|
alerts: AlertsAPI.Alerts = new AlertsAPI.Alerts(this._client);
|
|
@@ -90,24 +90,57 @@ export class Customers extends APIResource {
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Create a new customer
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* const customer = await client.v1.customers.create({
|
|
97
|
+
* name: 'Example, Inc.',
|
|
98
|
+
* customer_billing_provider_configurations: [
|
|
99
|
+
* {
|
|
100
|
+
* billing_provider: 'stripe',
|
|
101
|
+
* delivery_method: 'direct_to_billing_provider',
|
|
102
|
+
* configuration: {
|
|
103
|
+
* stripe_customer_id: 'cus_123',
|
|
104
|
+
* stripe_collection_method: 'charge_automatically',
|
|
105
|
+
* },
|
|
106
|
+
* },
|
|
107
|
+
* ],
|
|
108
|
+
* ingest_aliases: ['team@example.com'],
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
93
111
|
*/
|
|
94
112
|
create(body: CustomerCreateParams, options?: Core.RequestOptions): Core.APIPromise<CustomerCreateResponse> {
|
|
95
|
-
return this._client.post('/customers', { body, ...options });
|
|
113
|
+
return this._client.post('/v1/customers', { body, ...options });
|
|
96
114
|
}
|
|
97
115
|
|
|
98
116
|
/**
|
|
99
117
|
* Get a customer by Metronome ID.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const customer = await client.v1.customers.retrieve({
|
|
122
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
100
125
|
*/
|
|
101
126
|
retrieve(
|
|
102
127
|
params: CustomerRetrieveParams,
|
|
103
128
|
options?: Core.RequestOptions,
|
|
104
129
|
): Core.APIPromise<CustomerRetrieveResponse> {
|
|
105
130
|
const { customer_id } = params;
|
|
106
|
-
return this._client.get(`/customers/${customer_id}`, options);
|
|
131
|
+
return this._client.get(`/v1/customers/${customer_id}`, options);
|
|
107
132
|
}
|
|
108
133
|
|
|
109
134
|
/**
|
|
110
135
|
* List all customers.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* // Automatically fetches more pages as needed.
|
|
140
|
+
* for await (const customerDetail of client.v1.customers.list()) {
|
|
141
|
+
* // ...
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
111
144
|
*/
|
|
112
145
|
list(
|
|
113
146
|
query?: CustomerListParams,
|
|
@@ -121,21 +154,39 @@ export class Customers extends APIResource {
|
|
|
121
154
|
if (isRequestOptions(query)) {
|
|
122
155
|
return this.list({}, query);
|
|
123
156
|
}
|
|
124
|
-
return this._client.getAPIList('/customers', CustomerDetailsCursorPage, { query, ...options });
|
|
157
|
+
return this._client.getAPIList('/v1/customers', CustomerDetailsCursorPage, { query, ...options });
|
|
125
158
|
}
|
|
126
159
|
|
|
127
160
|
/**
|
|
128
|
-
* Archive a customer
|
|
161
|
+
* Archive a customer Note: any alerts associated with the customer will not be
|
|
162
|
+
* triggered.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* const response = await client.v1.customers.archive({
|
|
167
|
+
* id: '8deed800-1b7a-495d-a207-6c52bac54dc9',
|
|
168
|
+
* });
|
|
169
|
+
* ```
|
|
129
170
|
*/
|
|
130
171
|
archive(
|
|
131
172
|
body: CustomerArchiveParams,
|
|
132
173
|
options?: Core.RequestOptions,
|
|
133
174
|
): Core.APIPromise<CustomerArchiveResponse> {
|
|
134
|
-
return this._client.post('/customers/archive', { body, ...options });
|
|
175
|
+
return this._client.post('/v1/customers/archive', { body, ...options });
|
|
135
176
|
}
|
|
136
177
|
|
|
137
178
|
/**
|
|
138
179
|
* Get all billable metrics for a given customer.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* // Automatically fetches more pages as needed.
|
|
184
|
+
* for await (const customerListBillableMetricsResponse of client.v1.customers.listBillableMetrics(
|
|
185
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
186
|
+
* )) {
|
|
187
|
+
* // ...
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
139
190
|
*/
|
|
140
191
|
listBillableMetrics(
|
|
141
192
|
params: CustomerListBillableMetricsParams,
|
|
@@ -143,7 +194,7 @@ export class Customers extends APIResource {
|
|
|
143
194
|
): Core.PagePromise<CustomerListBillableMetricsResponsesCursorPage, CustomerListBillableMetricsResponse> {
|
|
144
195
|
const { customer_id, ...query } = params;
|
|
145
196
|
return this._client.getAPIList(
|
|
146
|
-
`/customers/${customer_id}/billable-metrics`,
|
|
197
|
+
`/v1/customers/${customer_id}/billable-metrics`,
|
|
147
198
|
CustomerListBillableMetricsResponsesCursorPage,
|
|
148
199
|
{ query, ...options },
|
|
149
200
|
);
|
|
@@ -153,29 +204,80 @@ export class Customers extends APIResource {
|
|
|
153
204
|
* Fetch daily pending costs for the specified customer, broken down by credit type
|
|
154
205
|
* and line items. Note: this is not supported for customers whose plan includes a
|
|
155
206
|
* UNIQUE-type billable metric.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* // Automatically fetches more pages as needed.
|
|
211
|
+
* for await (const customerListCostsResponse of client.v1.customers.listCosts(
|
|
212
|
+
* {
|
|
213
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
214
|
+
* ending_before: '2019-12-27T18:11:19.117Z',
|
|
215
|
+
* starting_on: '2019-12-27T18:11:19.117Z',
|
|
216
|
+
* },
|
|
217
|
+
* )) {
|
|
218
|
+
* // ...
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
156
221
|
*/
|
|
157
222
|
listCosts(
|
|
158
223
|
params: CustomerListCostsParams,
|
|
159
224
|
options?: Core.RequestOptions,
|
|
160
225
|
): Core.PagePromise<CustomerListCostsResponsesCursorPage, CustomerListCostsResponse> {
|
|
161
226
|
const { customer_id, ...query } = params;
|
|
162
|
-
return this._client.getAPIList(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
227
|
+
return this._client.getAPIList(
|
|
228
|
+
`/v1/customers/${customer_id}/costs`,
|
|
229
|
+
CustomerListCostsResponsesCursorPage,
|
|
230
|
+
{ query, ...options },
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Preview how a set of events will affect a customer's invoice. Generates a draft
|
|
236
|
+
* invoice for a customer using their current contract configuration and the
|
|
237
|
+
* provided events. This is useful for testing how new events will affect the
|
|
238
|
+
* customer's invoice before they are actually processed.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```ts
|
|
242
|
+
* const response = await client.v1.customers.previewEvents({
|
|
243
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
244
|
+
* events: [
|
|
245
|
+
* {
|
|
246
|
+
* event_type: 'heartbeat',
|
|
247
|
+
* timestamp: '2021-01-01T00:00:00Z',
|
|
248
|
+
* properties: { cpu_hours: 100, memory_gb_hours: 200 },
|
|
249
|
+
* },
|
|
250
|
+
* ],
|
|
251
|
+
* });
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
previewEvents(
|
|
255
|
+
params: CustomerPreviewEventsParams,
|
|
256
|
+
options?: Core.RequestOptions,
|
|
257
|
+
): Core.APIPromise<CustomerPreviewEventsResponse> {
|
|
258
|
+
const { customer_id, ...body } = params;
|
|
259
|
+
return this._client.post(`/v1/customers/${customer_id}/previewEvents`, { body, ...options });
|
|
166
260
|
}
|
|
167
261
|
|
|
168
262
|
/**
|
|
169
263
|
* Sets the ingest aliases for a customer. Ingest aliases can be used in the
|
|
170
264
|
* `customer_id` field when sending usage events to Metronome. This call is
|
|
171
265
|
* idempotent. It fully replaces the set of ingest aliases for the given customer.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```ts
|
|
269
|
+
* await client.v1.customers.setIngestAliases({
|
|
270
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
271
|
+
* ingest_aliases: ['team@example.com'],
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
172
274
|
*/
|
|
173
275
|
setIngestAliases(
|
|
174
276
|
params: CustomerSetIngestAliasesParams,
|
|
175
277
|
options?: Core.RequestOptions,
|
|
176
278
|
): Core.APIPromise<void> {
|
|
177
279
|
const { customer_id, ...body } = params;
|
|
178
|
-
return this._client.post(`/customers/${customer_id}/setIngestAliases`, {
|
|
280
|
+
return this._client.post(`/v1/customers/${customer_id}/setIngestAliases`, {
|
|
179
281
|
body,
|
|
180
282
|
...options,
|
|
181
283
|
headers: { Accept: '*/*', ...options?.headers },
|
|
@@ -184,21 +286,37 @@ export class Customers extends APIResource {
|
|
|
184
286
|
|
|
185
287
|
/**
|
|
186
288
|
* Updates the specified customer's name.
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```ts
|
|
292
|
+
* const response = await client.v1.customers.setName({
|
|
293
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
294
|
+
* name: 'Example, Inc.',
|
|
295
|
+
* });
|
|
296
|
+
* ```
|
|
187
297
|
*/
|
|
188
298
|
setName(
|
|
189
299
|
params: CustomerSetNameParams,
|
|
190
300
|
options?: Core.RequestOptions,
|
|
191
301
|
): Core.APIPromise<CustomerSetNameResponse> {
|
|
192
302
|
const { customer_id, ...body } = params;
|
|
193
|
-
return this._client.post(`/customers/${customer_id}/setName`, { body, ...options });
|
|
303
|
+
return this._client.post(`/v1/customers/${customer_id}/setName`, { body, ...options });
|
|
194
304
|
}
|
|
195
305
|
|
|
196
306
|
/**
|
|
197
307
|
* Updates the specified customer's config.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```ts
|
|
311
|
+
* await client.v1.customers.updateConfig({
|
|
312
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
313
|
+
* salesforce_account_id: '0015500001WO1ZiABL',
|
|
314
|
+
* });
|
|
315
|
+
* ```
|
|
198
316
|
*/
|
|
199
317
|
updateConfig(params: CustomerUpdateConfigParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
200
318
|
const { customer_id, ...body } = params;
|
|
201
|
-
return this._client.post(`/customers/${customer_id}/updateConfig`, {
|
|
319
|
+
return this._client.post(`/v1/customers/${customer_id}/updateConfig`, {
|
|
202
320
|
body,
|
|
203
321
|
...options,
|
|
204
322
|
headers: { Accept: '*/*', ...options?.headers },
|
|
@@ -232,7 +350,7 @@ export interface Customer {
|
|
|
232
350
|
|
|
233
351
|
name: string;
|
|
234
352
|
|
|
235
|
-
custom_fields?:
|
|
353
|
+
custom_fields?: { [key: string]: string };
|
|
236
354
|
}
|
|
237
355
|
|
|
238
356
|
export interface CustomerDetail {
|
|
@@ -241,7 +359,12 @@ export interface CustomerDetail {
|
|
|
241
359
|
*/
|
|
242
360
|
id: string;
|
|
243
361
|
|
|
244
|
-
|
|
362
|
+
/**
|
|
363
|
+
* RFC 3339 timestamp indicating when the customer was created.
|
|
364
|
+
*/
|
|
365
|
+
created_at: string;
|
|
366
|
+
|
|
367
|
+
custom_fields: { [key: string]: string };
|
|
245
368
|
|
|
246
369
|
customer_config: CustomerDetail.CustomerConfig;
|
|
247
370
|
|
|
@@ -259,6 +382,12 @@ export interface CustomerDetail {
|
|
|
259
382
|
|
|
260
383
|
name: string;
|
|
261
384
|
|
|
385
|
+
/**
|
|
386
|
+
* RFC 3339 timestamp indicating when the customer was archived. Null if the
|
|
387
|
+
* customer is active.
|
|
388
|
+
*/
|
|
389
|
+
archived_at?: string | null;
|
|
390
|
+
|
|
262
391
|
/**
|
|
263
392
|
* This field's availability is dependent on your client's configuration.
|
|
264
393
|
*/
|
|
@@ -328,7 +457,7 @@ export interface CustomerListBillableMetricsResponse {
|
|
|
328
457
|
*/
|
|
329
458
|
archived_at?: string;
|
|
330
459
|
|
|
331
|
-
custom_fields?:
|
|
460
|
+
custom_fields?: { [key: string]: string };
|
|
332
461
|
|
|
333
462
|
/**
|
|
334
463
|
* An optional filtering rule to match the 'event_type' property of an event.
|
|
@@ -338,7 +467,7 @@ export interface CustomerListBillableMetricsResponse {
|
|
|
338
467
|
/**
|
|
339
468
|
* (DEPRECATED) use property_filters & event_type_filter instead
|
|
340
469
|
*/
|
|
341
|
-
filter?:
|
|
470
|
+
filter?: { [key: string]: unknown };
|
|
342
471
|
|
|
343
472
|
/**
|
|
344
473
|
* (DEPRECATED) use group_keys instead
|
|
@@ -365,7 +494,7 @@ export interface CustomerListBillableMetricsResponse {
|
|
|
365
494
|
}
|
|
366
495
|
|
|
367
496
|
export interface CustomerListCostsResponse {
|
|
368
|
-
credit_types:
|
|
497
|
+
credit_types: { [key: string]: CustomerListCostsResponse.CreditTypes };
|
|
369
498
|
|
|
370
499
|
end_timestamp: string;
|
|
371
500
|
|
|
@@ -394,6 +523,10 @@ export namespace CustomerListCostsResponse {
|
|
|
394
523
|
}
|
|
395
524
|
}
|
|
396
525
|
|
|
526
|
+
export interface CustomerPreviewEventsResponse {
|
|
527
|
+
data: InvoicesAPI.Invoice;
|
|
528
|
+
}
|
|
529
|
+
|
|
397
530
|
export interface CustomerSetNameResponse {
|
|
398
531
|
data: Customer;
|
|
399
532
|
}
|
|
@@ -406,7 +539,7 @@ export interface CustomerCreateParams {
|
|
|
406
539
|
|
|
407
540
|
billing_config?: CustomerCreateParams.BillingConfig;
|
|
408
541
|
|
|
409
|
-
custom_fields?:
|
|
542
|
+
custom_fields?: { [key: string]: string };
|
|
410
543
|
|
|
411
544
|
customer_billing_provider_configurations?: Array<CustomerCreateParams.CustomerBillingProviderConfiguration>;
|
|
412
545
|
|
|
@@ -485,7 +618,7 @@ export namespace CustomerCreateParams {
|
|
|
485
618
|
* object, however, for most billing provider + delivery method combinations, it
|
|
486
619
|
* will not be a valid configuration.
|
|
487
620
|
*/
|
|
488
|
-
configuration?:
|
|
621
|
+
configuration?: { [key: string]: unknown };
|
|
489
622
|
|
|
490
623
|
/**
|
|
491
624
|
* The method to use for delivering invoices to this customer. If not provided, the
|
|
@@ -517,7 +650,8 @@ export interface CustomerListParams extends CursorPageParams {
|
|
|
517
650
|
ingest_alias?: string;
|
|
518
651
|
|
|
519
652
|
/**
|
|
520
|
-
* Filter the customer list
|
|
653
|
+
* Filter the customer list to only return archived customers. By default, only
|
|
654
|
+
* active customers are returned.
|
|
521
655
|
*/
|
|
522
656
|
only_archived?: boolean;
|
|
523
657
|
|
|
@@ -567,6 +701,59 @@ export interface CustomerListCostsParams extends CursorPageParams {
|
|
|
567
701
|
starting_on: string;
|
|
568
702
|
}
|
|
569
703
|
|
|
704
|
+
export interface CustomerPreviewEventsParams {
|
|
705
|
+
/**
|
|
706
|
+
* Path param:
|
|
707
|
+
*/
|
|
708
|
+
customer_id: string;
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Body param:
|
|
712
|
+
*/
|
|
713
|
+
events: Array<CustomerPreviewEventsParams.Event>;
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Body param: If set to "replace", the preview will be generated as if those were
|
|
717
|
+
* the only events for the specified customer. If set to "merge", the events will
|
|
718
|
+
* be merged with any existing events for the specified customer. Defaults to
|
|
719
|
+
* "replace".
|
|
720
|
+
*/
|
|
721
|
+
mode?: 'replace' | 'merge';
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Body param: If set, all zero quantity line items will be filtered out of the
|
|
725
|
+
* response.
|
|
726
|
+
*/
|
|
727
|
+
skip_zero_qty_line_items?: boolean;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export namespace CustomerPreviewEventsParams {
|
|
731
|
+
export interface Event {
|
|
732
|
+
event_type: string;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* This has no effect for preview events, but may be set for consistency with Event
|
|
736
|
+
* objects. They will be processed even if they do not match the customer's ID or
|
|
737
|
+
* ingest aliases.
|
|
738
|
+
*/
|
|
739
|
+
customer_id?: string;
|
|
740
|
+
|
|
741
|
+
properties?: { [key: string]: unknown };
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* RFC 3339 formatted. If not provided, the current time will be used.
|
|
745
|
+
*/
|
|
746
|
+
timestamp?: string;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* This has no effect for preview events, but may be set for consistency with Event
|
|
750
|
+
* objects. Duplicate transaction_ids are NOT filtered out, even within the same
|
|
751
|
+
* request.
|
|
752
|
+
*/
|
|
753
|
+
transaction_id?: string;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
570
757
|
export interface CustomerSetIngestAliasesParams {
|
|
571
758
|
/**
|
|
572
759
|
* Path param:
|
|
@@ -634,6 +821,7 @@ export declare namespace Customers {
|
|
|
634
821
|
type CustomerArchiveResponse as CustomerArchiveResponse,
|
|
635
822
|
type CustomerListBillableMetricsResponse as CustomerListBillableMetricsResponse,
|
|
636
823
|
type CustomerListCostsResponse as CustomerListCostsResponse,
|
|
824
|
+
type CustomerPreviewEventsResponse as CustomerPreviewEventsResponse,
|
|
637
825
|
type CustomerSetNameResponse as CustomerSetNameResponse,
|
|
638
826
|
CustomerDetailsCursorPage as CustomerDetailsCursorPage,
|
|
639
827
|
CustomerListBillableMetricsResponsesCursorPage as CustomerListBillableMetricsResponsesCursorPage,
|
|
@@ -644,6 +832,7 @@ export declare namespace Customers {
|
|
|
644
832
|
type CustomerArchiveParams as CustomerArchiveParams,
|
|
645
833
|
type CustomerListBillableMetricsParams as CustomerListBillableMetricsParams,
|
|
646
834
|
type CustomerListCostsParams as CustomerListCostsParams,
|
|
835
|
+
type CustomerPreviewEventsParams as CustomerPreviewEventsParams,
|
|
647
836
|
type CustomerSetIngestAliasesParams as CustomerSetIngestAliasesParams,
|
|
648
837
|
type CustomerSetNameParams as CustomerSetNameParams,
|
|
649
838
|
type CustomerUpdateConfigParams as CustomerUpdateConfigParams,
|