@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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.InvoiceListBreakdownsResponsesCursorPage = exports.InvoicesCursorPage = exports.Invoices = void 0;
|
|
5
|
+
const resource_1 = require("../../../resource.js");
|
|
6
|
+
const pagination_1 = require("../../../pagination.js");
|
|
7
|
+
class Invoices extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Fetch a specific invoice for a given customer.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const invoice = await client.v1.customers.invoices.retrieve(
|
|
14
|
+
* {
|
|
15
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
16
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
17
|
+
* },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(params, options) {
|
|
22
|
+
const { customer_id, invoice_id, ...query } = params;
|
|
23
|
+
return this._client.get(`/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* List all invoices for a given customer, optionally filtered by status, date
|
|
27
|
+
* range, and/or credit type.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Automatically fetches more pages as needed.
|
|
32
|
+
* for await (const invoice of client.v1.customers.invoices.list(
|
|
33
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
34
|
+
* )) {
|
|
35
|
+
* // ...
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
list(params, options) {
|
|
40
|
+
const { customer_id, ...query } = params;
|
|
41
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices`, InvoicesCursorPage, {
|
|
42
|
+
query,
|
|
43
|
+
...options,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Add a one time charge to the specified invoice
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const response =
|
|
52
|
+
* await client.v1.customers.invoices.addCharge({
|
|
53
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
54
|
+
* charge_id: '5ae4b726-1ebe-439c-9190-9831760ba195',
|
|
55
|
+
* customer_plan_id:
|
|
56
|
+
* 'a23b3cf4-47fb-4c3f-bb3d-9e64f7704015',
|
|
57
|
+
* description: 'One time charge',
|
|
58
|
+
* invoice_start_timestamp: '2024-01-01T00:00:00Z',
|
|
59
|
+
* price: 250,
|
|
60
|
+
* quantity: 1,
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
addCharge(params, options) {
|
|
65
|
+
const { customer_id, ...body } = params;
|
|
66
|
+
return this._client.post(`/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* List daily or hourly invoice breakdowns for a given customer, optionally
|
|
70
|
+
* filtered by status, date range, and/or credit type. Important considerations:
|
|
71
|
+
*
|
|
72
|
+
* - If we receive backdated usage after an invoice has been finalized, the
|
|
73
|
+
* backdated usage will be included in the response and usage numbers may differ.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* // Automatically fetches more pages as needed.
|
|
78
|
+
* for await (const invoiceListBreakdownsResponse of client.v1.customers.invoices.listBreakdowns(
|
|
79
|
+
* {
|
|
80
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
81
|
+
* ending_before: '2019-12-27T18:11:19.117Z',
|
|
82
|
+
* starting_on: '2019-12-27T18:11:19.117Z',
|
|
83
|
+
* },
|
|
84
|
+
* )) {
|
|
85
|
+
* // ...
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
listBreakdowns(params, options) {
|
|
90
|
+
const { customer_id, ...query } = params;
|
|
91
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices/breakdowns`, InvoiceListBreakdownsResponsesCursorPage, { query, ...options });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.Invoices = Invoices;
|
|
95
|
+
class InvoicesCursorPage extends pagination_1.CursorPage {
|
|
96
|
+
}
|
|
97
|
+
exports.InvoicesCursorPage = InvoicesCursorPage;
|
|
98
|
+
class InvoiceListBreakdownsResponsesCursorPage extends pagination_1.CursorPage {
|
|
99
|
+
}
|
|
100
|
+
exports.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
101
|
+
Invoices.InvoicesCursorPage = InvoicesCursorPage;
|
|
102
|
+
Invoices.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
103
|
+
//# sourceMappingURL=invoices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/invoices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAGhD,uDAAwE;AAExE,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,MAA6B,EAC7B,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,aAAa,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,MAAyB,EACzB,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,WAAW,WAAW,EAAE,kBAAkB,EAAE;YAC1F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CACP,MAA8B,EAC9B,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,cAAc,CACZ,MAAmC,EACnC,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,iBAAiB,WAAW,sBAAsB,EAClD,wCAAwC,EACxC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAzGD,4BAyGC;AAED,MAAa,kBAAmB,SAAQ,uBAAmB;CAAG;AAA9D,gDAA8D;AAE9D,MAAa,wCAAyC,SAAQ,uBAAyC;CAAG;AAA1G,4FAA0G;AA6lB1G,QAAQ,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACjD,QAAQ,CAAC,wCAAwC,GAAG,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../resource.mjs";
|
|
3
|
+
import { CursorPage } from "../../../pagination.mjs";
|
|
4
|
+
export class Invoices extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Fetch a specific invoice for a given customer.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const invoice = await client.v1.customers.invoices.retrieve(
|
|
11
|
+
* {
|
|
12
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
13
|
+
* invoice_id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
14
|
+
* },
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
retrieve(params, options) {
|
|
19
|
+
const { customer_id, invoice_id, ...query } = params;
|
|
20
|
+
return this._client.get(`/v1/customers/${customer_id}/invoices/${invoice_id}`, { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* List all invoices for a given customer, optionally filtered by status, date
|
|
24
|
+
* range, and/or credit type.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* // Automatically fetches more pages as needed.
|
|
29
|
+
* for await (const invoice of client.v1.customers.invoices.list(
|
|
30
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
31
|
+
* )) {
|
|
32
|
+
* // ...
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
list(params, options) {
|
|
37
|
+
const { customer_id, ...query } = params;
|
|
38
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices`, InvoicesCursorPage, {
|
|
39
|
+
query,
|
|
40
|
+
...options,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Add a one time charge to the specified invoice
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const response =
|
|
49
|
+
* await client.v1.customers.invoices.addCharge({
|
|
50
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
51
|
+
* charge_id: '5ae4b726-1ebe-439c-9190-9831760ba195',
|
|
52
|
+
* customer_plan_id:
|
|
53
|
+
* 'a23b3cf4-47fb-4c3f-bb3d-9e64f7704015',
|
|
54
|
+
* description: 'One time charge',
|
|
55
|
+
* invoice_start_timestamp: '2024-01-01T00:00:00Z',
|
|
56
|
+
* price: 250,
|
|
57
|
+
* quantity: 1,
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
addCharge(params, options) {
|
|
62
|
+
const { customer_id, ...body } = params;
|
|
63
|
+
return this._client.post(`/v1/customers/${customer_id}/addCharge`, { body, ...options });
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* List daily or hourly invoice breakdowns for a given customer, optionally
|
|
67
|
+
* filtered by status, date range, and/or credit type. Important considerations:
|
|
68
|
+
*
|
|
69
|
+
* - If we receive backdated usage after an invoice has been finalized, the
|
|
70
|
+
* backdated usage will be included in the response and usage numbers may differ.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const invoiceListBreakdownsResponse of client.v1.customers.invoices.listBreakdowns(
|
|
76
|
+
* {
|
|
77
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
78
|
+
* ending_before: '2019-12-27T18:11:19.117Z',
|
|
79
|
+
* starting_on: '2019-12-27T18:11:19.117Z',
|
|
80
|
+
* },
|
|
81
|
+
* )) {
|
|
82
|
+
* // ...
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
listBreakdowns(params, options) {
|
|
87
|
+
const { customer_id, ...query } = params;
|
|
88
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/invoices/breakdowns`, InvoiceListBreakdownsResponsesCursorPage, { query, ...options });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export class InvoicesCursorPage extends CursorPage {
|
|
92
|
+
}
|
|
93
|
+
export class InvoiceListBreakdownsResponsesCursorPage extends CursorPage {
|
|
94
|
+
}
|
|
95
|
+
Invoices.InvoicesCursorPage = InvoicesCursorPage;
|
|
96
|
+
Invoices.InvoiceListBreakdownsResponsesCursorPage = InvoiceListBreakdownsResponsesCursorPage;
|
|
97
|
+
//# sourceMappingURL=invoices.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/invoices.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;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,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACjD,QAAQ,CAAC,wCAAwC,GAAG,wCAAwC,CAAC"}
|
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
2
|
-
import * as Core from "
|
|
1
|
+
import { APIResource } from "../../../resource.js";
|
|
2
|
+
import * as Core from "../../../core.js";
|
|
3
3
|
export declare class NamedSchedules extends APIResource {
|
|
4
4
|
/**
|
|
5
5
|
* Get a named schedule for the given customer. This endpoint's availability is
|
|
6
6
|
* dependent on your client's configuration.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const namedSchedule =
|
|
11
|
+
* await client.v1.customers.namedSchedules.retrieve({
|
|
12
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
13
|
+
* schedule_name: 'my-schedule',
|
|
14
|
+
* covering_date: '2022-02-15T00:00:00Z',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
7
17
|
*/
|
|
8
18
|
retrieve(body: NamedScheduleRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<NamedScheduleRetrieveResponse>;
|
|
9
19
|
/**
|
|
10
20
|
* Update a named schedule for the given customer. This endpoint's availability is
|
|
11
21
|
* dependent on your client's configuration.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* await client.v1.customers.namedSchedules.update({
|
|
26
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
27
|
+
* schedule_name: 'my-schedule',
|
|
28
|
+
* starting_at: '2022-02-01T00:00:00Z',
|
|
29
|
+
* value: { my_key: 'my_value' },
|
|
30
|
+
* ending_before: '2022-02-15T00:00:00Z',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
12
33
|
*/
|
|
13
34
|
update(body: NamedScheduleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
14
35
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-schedules.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAIjD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAO9F;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,KAAK,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,yBAAiB,6BAA6B,CAAC;IAC7C,UAAiB,IAAI;QACnB,WAAW,EAAE,MAAM,CAAC;QAEpB,KAAK,EAAE,OAAO,CAAC;QAEf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NamedSchedules = void 0;
|
|
5
|
+
const resource_1 = require("../../../resource.js");
|
|
6
|
+
class NamedSchedules extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Get a named schedule for the given customer. This endpoint's availability is
|
|
9
|
+
* dependent on your client's configuration.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const namedSchedule =
|
|
14
|
+
* await client.v1.customers.namedSchedules.retrieve({
|
|
15
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
16
|
+
* schedule_name: 'my-schedule',
|
|
17
|
+
* covering_date: '2022-02-15T00:00:00Z',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
retrieve(body, options) {
|
|
22
|
+
return this._client.post('/v1/customers/getNamedSchedule', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a named schedule for the given customer. This endpoint's availability is
|
|
26
|
+
* dependent on your client's configuration.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* await client.v1.customers.namedSchedules.update({
|
|
31
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
32
|
+
* schedule_name: 'my-schedule',
|
|
33
|
+
* starting_at: '2022-02-01T00:00:00Z',
|
|
34
|
+
* value: { my_key: 'my_value' },
|
|
35
|
+
* ending_before: '2022-02-15T00:00:00Z',
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
update(body, options) {
|
|
40
|
+
return this._client.post('/v1/customers/updateNamedSchedule', {
|
|
41
|
+
body,
|
|
42
|
+
...options,
|
|
43
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.NamedSchedules = NamedSchedules;
|
|
48
|
+
//# sourceMappingURL=named-schedules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-schedules.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAGhD,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA+B,EAAE,OAA6B;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE;YAC5D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AA5CD,wCA4CC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../resource.mjs";
|
|
3
|
+
export class NamedSchedules extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Get a named schedule for the given customer. This endpoint's availability is
|
|
6
|
+
* dependent on your client's configuration.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const namedSchedule =
|
|
11
|
+
* await client.v1.customers.namedSchedules.retrieve({
|
|
12
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
13
|
+
* schedule_name: 'my-schedule',
|
|
14
|
+
* covering_date: '2022-02-15T00:00:00Z',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
retrieve(body, options) {
|
|
19
|
+
return this._client.post('/v1/customers/getNamedSchedule', { body, ...options });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Update a named schedule for the given customer. This endpoint's availability is
|
|
23
|
+
* dependent on your client's configuration.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* await client.v1.customers.namedSchedules.update({
|
|
28
|
+
* customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1',
|
|
29
|
+
* schedule_name: 'my-schedule',
|
|
30
|
+
* starting_at: '2022-02-01T00:00:00Z',
|
|
31
|
+
* value: { my_key: 'my_value' },
|
|
32
|
+
* ending_before: '2022-02-15T00:00:00Z',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
update(body, options) {
|
|
37
|
+
return this._client.post('/v1/customers/updateNamedSchedule', {
|
|
38
|
+
body,
|
|
39
|
+
...options,
|
|
40
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=named-schedules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-schedules.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/named-schedules.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA+B,EAAE,OAA6B;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE;YAC5D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,26 +1,69 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
2
|
-
import * as Core from "
|
|
3
|
-
import * as Shared from "
|
|
4
|
-
import { CursorPage, type CursorPageParams } from "
|
|
1
|
+
import { APIResource } from "../../../resource.js";
|
|
2
|
+
import * as Core from "../../../core.js";
|
|
3
|
+
import * as Shared from "../../shared.js";
|
|
4
|
+
import { CursorPage, type CursorPageParams } from "../../../pagination.js";
|
|
5
5
|
export declare class Plans extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* List the given customer's plans in reverse-chronological order.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const planListResponse of client.v1.customers.plans.list(
|
|
13
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
14
|
+
* )) {
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
8
18
|
*/
|
|
9
19
|
list(params: PlanListParams, options?: Core.RequestOptions): Core.PagePromise<PlanListResponsesCursorPage, PlanListResponse>;
|
|
10
20
|
/**
|
|
11
21
|
* Associate an existing customer with a plan for a specified date range. See the
|
|
12
22
|
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
13
23
|
* for details on the price adjustments.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const response = await client.v1.customers.plans.add({
|
|
28
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
29
|
+
* plan_id: 'd2c06dae-9549-4d7d-bc04-b78dd3d241b8',
|
|
30
|
+
* starting_on: '2021-02-01T00:00:00Z',
|
|
31
|
+
* ending_before: '2022-02-01T00:00:00Z',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
14
34
|
*/
|
|
15
35
|
add(params: PlanAddParams, options?: Core.RequestOptions): Core.APIPromise<PlanAddResponse>;
|
|
16
36
|
/**
|
|
17
37
|
* Change the end date of a customer's plan.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const response = await client.v1.customers.plans.end({
|
|
42
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
43
|
+
* customer_plan_id: '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
44
|
+
* ending_before: '2021-02-01T00:00:00Z',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
18
47
|
*/
|
|
19
48
|
end(params: PlanEndParams, options?: Core.RequestOptions): Core.APIPromise<PlanEndResponse>;
|
|
20
49
|
/**
|
|
21
50
|
* Lists a customer plans adjustments. See the
|
|
22
51
|
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
23
52
|
* for details.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Automatically fetches more pages as needed.
|
|
57
|
+
* for await (const planListPriceAdjustmentsResponse of client.v1.customers.plans.listPriceAdjustments(
|
|
58
|
+
* {
|
|
59
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
60
|
+
* customer_plan_id:
|
|
61
|
+
* '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
62
|
+
* },
|
|
63
|
+
* )) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
24
67
|
*/
|
|
25
68
|
listPriceAdjustments(params: PlanListPriceAdjustmentsParams, options?: Core.RequestOptions): Core.PagePromise<PlanListPriceAdjustmentsResponsesCursorPage, PlanListPriceAdjustmentsResponse>;
|
|
26
69
|
}
|
|
@@ -33,7 +76,9 @@ export interface PlanListResponse {
|
|
|
33
76
|
* the ID of the customer plan
|
|
34
77
|
*/
|
|
35
78
|
id: string;
|
|
36
|
-
custom_fields:
|
|
79
|
+
custom_fields: {
|
|
80
|
+
[key: string]: string;
|
|
81
|
+
};
|
|
37
82
|
plan_description: string;
|
|
38
83
|
/**
|
|
39
84
|
* the ID of the plan
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/customers/plans.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAExE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,2BAA2B,EAAE,gBAAgB,CAAC;IAQlE;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IAK3F;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CA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AK,aAAa,IAAI,aAAa,EACnC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PlanListPriceAdjustmentsResponsesCursorPage = exports.PlanListResponsesCursorPage = exports.Plans = void 0;
|
|
5
|
+
const resource_1 = require("../../../resource.js");
|
|
6
|
+
const pagination_1 = require("../../../pagination.js");
|
|
7
|
+
class Plans extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* List the given customer's plans in reverse-chronological order.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Automatically fetches more pages as needed.
|
|
14
|
+
* for await (const planListResponse of client.v1.customers.plans.list(
|
|
15
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
16
|
+
* )) {
|
|
17
|
+
* // ...
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(params, options) {
|
|
22
|
+
const { customer_id, ...query } = params;
|
|
23
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/plans`, PlanListResponsesCursorPage, {
|
|
24
|
+
query,
|
|
25
|
+
...options,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Associate an existing customer with a plan for a specified date range. See the
|
|
30
|
+
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
31
|
+
* for details on the price adjustments.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const response = await client.v1.customers.plans.add({
|
|
36
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
37
|
+
* plan_id: 'd2c06dae-9549-4d7d-bc04-b78dd3d241b8',
|
|
38
|
+
* starting_on: '2021-02-01T00:00:00Z',
|
|
39
|
+
* ending_before: '2022-02-01T00:00:00Z',
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
add(params, options) {
|
|
44
|
+
const { customer_id, ...body } = params;
|
|
45
|
+
return this._client.post(`/v1/customers/${customer_id}/plans/add`, { body, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Change the end date of a customer's plan.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const response = await client.v1.customers.plans.end({
|
|
53
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
54
|
+
* customer_plan_id: '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
55
|
+
* ending_before: '2021-02-01T00:00:00Z',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
end(params, options) {
|
|
60
|
+
const { customer_id, customer_plan_id, ...body } = params;
|
|
61
|
+
return this._client.post(`/v1/customers/${customer_id}/plans/${customer_plan_id}/end`, {
|
|
62
|
+
body,
|
|
63
|
+
...options,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Lists a customer plans adjustments. See the
|
|
68
|
+
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
69
|
+
* for details.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* // Automatically fetches more pages as needed.
|
|
74
|
+
* for await (const planListPriceAdjustmentsResponse of client.v1.customers.plans.listPriceAdjustments(
|
|
75
|
+
* {
|
|
76
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
77
|
+
* customer_plan_id:
|
|
78
|
+
* '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
79
|
+
* },
|
|
80
|
+
* )) {
|
|
81
|
+
* // ...
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
listPriceAdjustments(params, options) {
|
|
86
|
+
const { customer_id, customer_plan_id, ...query } = params;
|
|
87
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/plans/${customer_plan_id}/priceAdjustments`, PlanListPriceAdjustmentsResponsesCursorPage, { query, ...options });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.Plans = Plans;
|
|
91
|
+
class PlanListResponsesCursorPage extends pagination_1.CursorPage {
|
|
92
|
+
}
|
|
93
|
+
exports.PlanListResponsesCursorPage = PlanListResponsesCursorPage;
|
|
94
|
+
class PlanListPriceAdjustmentsResponsesCursorPage extends pagination_1.CursorPage {
|
|
95
|
+
}
|
|
96
|
+
exports.PlanListPriceAdjustmentsResponsesCursorPage = PlanListPriceAdjustmentsResponsesCursorPage;
|
|
97
|
+
Plans.PlanListResponsesCursorPage = PlanListResponsesCursorPage;
|
|
98
|
+
Plans.PlanListPriceAdjustmentsResponsesCursorPage = PlanListPriceAdjustmentsResponsesCursorPage;
|
|
99
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../src/resources/v1/customers/plans.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAGhD,uDAAwE;AAExE,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAsB,EACtB,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,WAAW,QAAQ,EAAE,2BAA2B,EAAE;YAChG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IA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
3
|
+
import { CursorPage } from "../../../pagination.mjs";
|
|
4
|
+
export class Plans extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* List the given customer's plans in reverse-chronological order.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Automatically fetches more pages as needed.
|
|
11
|
+
* for await (const planListResponse of client.v1.customers.plans.list(
|
|
12
|
+
* { customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
13
|
+
* )) {
|
|
14
|
+
* // ...
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
list(params, options) {
|
|
19
|
+
const { customer_id, ...query } = params;
|
|
20
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/plans`, PlanListResponsesCursorPage, {
|
|
21
|
+
query,
|
|
22
|
+
...options,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Associate an existing customer with a plan for a specified date range. See the
|
|
27
|
+
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
28
|
+
* for details on the price adjustments.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.v1.customers.plans.add({
|
|
33
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
34
|
+
* plan_id: 'd2c06dae-9549-4d7d-bc04-b78dd3d241b8',
|
|
35
|
+
* starting_on: '2021-02-01T00:00:00Z',
|
|
36
|
+
* ending_before: '2022-02-01T00:00:00Z',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
add(params, options) {
|
|
41
|
+
const { customer_id, ...body } = params;
|
|
42
|
+
return this._client.post(`/v1/customers/${customer_id}/plans/add`, { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Change the end date of a customer's plan.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response = await client.v1.customers.plans.end({
|
|
50
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
51
|
+
* customer_plan_id: '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
52
|
+
* ending_before: '2021-02-01T00:00:00Z',
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
end(params, options) {
|
|
57
|
+
const { customer_id, customer_plan_id, ...body } = params;
|
|
58
|
+
return this._client.post(`/v1/customers/${customer_id}/plans/${customer_plan_id}/end`, {
|
|
59
|
+
body,
|
|
60
|
+
...options,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Lists a customer plans adjustments. See the
|
|
65
|
+
* [price adjustments documentation](https://plans-docs.metronome.com/pricing/managing-plans/#price-adjustments)
|
|
66
|
+
* for details.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* // Automatically fetches more pages as needed.
|
|
71
|
+
* for await (const planListPriceAdjustmentsResponse of client.v1.customers.plans.listPriceAdjustments(
|
|
72
|
+
* {
|
|
73
|
+
* customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
74
|
+
* customer_plan_id:
|
|
75
|
+
* '7aa11640-0703-4600-8eb9-293f535a6b74',
|
|
76
|
+
* },
|
|
77
|
+
* )) {
|
|
78
|
+
* // ...
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
listPriceAdjustments(params, options) {
|
|
83
|
+
const { customer_id, customer_plan_id, ...query } = params;
|
|
84
|
+
return this._client.getAPIList(`/v1/customers/${customer_id}/plans/${customer_plan_id}/priceAdjustments`, PlanListPriceAdjustmentsResponsesCursorPage, { query, ...options });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export class PlanListResponsesCursorPage extends CursorPage {
|
|
88
|
+
}
|
|
89
|
+
export class PlanListPriceAdjustmentsResponsesCursorPage extends CursorPage {
|
|
90
|
+
}
|
|
91
|
+
Plans.PlanListResponsesCursorPage = PlanListResponsesCursorPage;
|
|
92
|
+
Plans.PlanListPriceAdjustmentsResponsesCursorPage = PlanListPriceAdjustmentsResponsesCursorPage;
|
|
93
|
+
//# sourceMappingURL=plans.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.mjs","sourceRoot":"","sources":["../../../src/resources/v1/customers/plans.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAsB,EACtB,OAA6B;QAE7B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,WAAW,QAAQ,EAAE,2BAA2B,EAAE;YAChG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,MAAqB,EAAE,OAA6B;QACtD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,MAAqB,EAAE,OAA6B;QACtD,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,WAAW,UAAU,gBAAgB,MAAM,EAAE;YACrF,IA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