@metronome/sdk 3.0.0 → 3.5.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 +204 -0
- package/README.md +2 -2
- package/client.d.mts +5 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -3
- package/client.d.ts.map +1 -1
- package/client.js +26 -10
- package/client.js.map +1 -1
- package/client.mjs +26 -10
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/shared.d.mts +130 -30
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +130 -30
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +3 -0
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +3 -0
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +3 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +3 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts +3 -0
- package/resources/v1/audit-logs.d.mts.map +1 -1
- package/resources/v1/audit-logs.d.ts +3 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js +3 -0
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs +3 -0
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts +3 -0
- package/resources/v1/billable-metrics.d.mts.map +1 -1
- package/resources/v1/billable-metrics.d.ts +3 -0
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +3 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +3 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +141 -28
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +141 -28
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +76 -0
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +76 -0
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts +1 -1
- package/resources/v1/contracts/index.d.mts.map +1 -1
- package/resources/v1/contracts/index.d.ts +1 -1
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.mts +3 -0
- package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts +3 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +3 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +3 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +3 -0
- package/resources/v1/contracts/products.d.mts.map +1 -1
- package/resources/v1/contracts/products.d.ts +3 -0
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +3 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +3 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +3 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts +3 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +3 -0
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +3 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +3 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts +6 -3
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +6 -3
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +3 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +3 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.mts +3 -0
- package/resources/v1/credit-grants.d.mts.map +1 -1
- package/resources/v1/credit-grants.d.ts +3 -0
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +3 -0
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +3 -0
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts +3 -0
- package/resources/v1/custom-fields.d.mts.map +1 -1
- package/resources/v1/custom-fields.d.ts +3 -0
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +3 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +3 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +3 -0
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +3 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +3 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +3 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts +3 -0
- package/resources/v1/customers/billing-config.d.mts.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +3 -0
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +3 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +3 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts +3 -0
- package/resources/v1/customers/commits.d.mts.map +1 -1
- package/resources/v1/customers/commits.d.ts +3 -0
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +3 -0
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +3 -0
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts +3 -0
- package/resources/v1/customers/credits.d.mts.map +1 -1
- package/resources/v1/customers/credits.d.ts +3 -0
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +3 -0
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +3 -0
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +77 -1
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +77 -1
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +53 -0
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +53 -0
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +20 -12
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +20 -12
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +3 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +3 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts +3 -0
- package/resources/v1/customers/named-schedules.d.mts.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +3 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +3 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +3 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts +3 -0
- package/resources/v1/customers/plans.d.mts.map +1 -1
- package/resources/v1/customers/plans.d.ts +3 -0
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +3 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +3 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.mts +3 -0
- package/resources/v1/dashboards.d.mts.map +1 -1
- package/resources/v1/dashboards.d.ts +3 -0
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +3 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +3 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +3 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts +3 -0
- package/resources/v1/invoices.d.mts.map +1 -1
- package/resources/v1/invoices.d.ts +3 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +3 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +3 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/packages.d.mts +2353 -0
- package/resources/v1/packages.d.mts.map +1 -0
- package/resources/v1/packages.d.ts +2353 -0
- package/resources/v1/packages.d.ts.map +1 -0
- package/resources/v1/packages.js +160 -0
- package/resources/v1/packages.js.map +1 -0
- package/resources/v1/packages.mjs +156 -0
- package/resources/v1/packages.mjs.map +1 -0
- package/resources/v1/plans.d.mts +3 -0
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts +3 -0
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +3 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +3 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts +3 -0
- package/resources/v1/pricing-units.d.mts.map +1 -1
- package/resources/v1/pricing-units.d.ts +3 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js +3 -0
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs +3 -0
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts +3 -0
- package/resources/v1/services.d.mts.map +1 -1
- package/resources/v1/services.d.ts +3 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +3 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +3 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/settings/billing-providers.d.mts +3 -0
- package/resources/v1/settings/billing-providers.d.mts.map +1 -1
- package/resources/v1/settings/billing-providers.d.ts +3 -0
- package/resources/v1/settings/billing-providers.d.ts.map +1 -1
- package/resources/v1/settings/billing-providers.js +3 -0
- package/resources/v1/settings/billing-providers.js.map +1 -1
- package/resources/v1/settings/billing-providers.mjs +3 -0
- package/resources/v1/settings/billing-providers.mjs.map +1 -1
- package/resources/v1/settings/settings.d.mts +3 -0
- package/resources/v1/settings/settings.d.mts.map +1 -1
- package/resources/v1/settings/settings.d.ts +3 -0
- package/resources/v1/settings/settings.d.ts.map +1 -1
- package/resources/v1/settings/settings.js +3 -0
- package/resources/v1/settings/settings.js.map +1 -1
- package/resources/v1/settings/settings.mjs +3 -0
- package/resources/v1/settings/settings.mjs.map +1 -1
- package/resources/v1/usage.d.mts +81 -12
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +81 -12
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +37 -11
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +37 -11
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +8 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +8 -4
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +114 -19
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +114 -19
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +1 -4
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +1 -4
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/webhooks.js +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +37 -15
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/shared.ts +160 -31
- package/src/resources/v1/alerts.ts +3 -0
- package/src/resources/v1/audit-logs.ts +3 -0
- package/src/resources/v1/billable-metrics.ts +3 -0
- package/src/resources/v1/contracts/contracts.ts +158 -29
- package/src/resources/v1/contracts/index.ts +2 -0
- package/src/resources/v1/contracts/named-schedules.ts +3 -0
- package/src/resources/v1/contracts/products.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +3 -0
- package/src/resources/v1/contracts/rate-cards/rates.ts +6 -3
- package/src/resources/v1/credit-grants.ts +3 -0
- package/src/resources/v1/custom-fields.ts +3 -0
- package/src/resources/v1/customers/alerts.ts +3 -0
- package/src/resources/v1/customers/billing-config.ts +3 -0
- package/src/resources/v1/customers/commits.ts +3 -0
- package/src/resources/v1/customers/credits.ts +3 -0
- package/src/resources/v1/customers/customers.ts +89 -0
- package/src/resources/v1/customers/index.ts +2 -0
- package/src/resources/v1/customers/invoices.ts +21 -12
- package/src/resources/v1/customers/named-schedules.ts +3 -0
- package/src/resources/v1/customers/plans.ts +3 -0
- package/src/resources/v1/dashboards.ts +3 -0
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/invoices.ts +3 -0
- package/src/resources/v1/packages.ts +3059 -0
- package/src/resources/v1/plans.ts +3 -0
- package/src/resources/v1/pricing-units.ts +3 -0
- package/src/resources/v1/services.ts +3 -0
- package/src/resources/v1/settings/billing-providers.ts +3 -0
- package/src/resources/v1/settings/settings.ts +3 -0
- package/src/resources/v1/usage.ts +80 -12
- package/src/resources/v1/v1.ts +42 -0
- package/src/resources/v2/contracts.ts +139 -21
- package/src/resources/webhooks.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -8,6 +8,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagin
|
|
|
8
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
9
9
|
import { path } from '../../internal/utils/path';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* [Plans](https://docs.metronome.com/pricing-and-packaging/create-plans/) determine the base pricing for a customer. Use these endpoints to add a plan to a customer, end a customer plan, retrieve plans, and retrieve plan details. Create plans in the [Metronome app](https://app.metronome.com/plans).
|
|
13
|
+
*/
|
|
11
14
|
export class Plans extends APIResource {
|
|
12
15
|
/**
|
|
13
16
|
* List all available plans. This is a Plans (deprecated) endpoint. New clients
|
|
@@ -4,6 +4,9 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
|
|
5
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.
|
|
9
|
+
*/
|
|
7
10
|
export class PricingUnits extends APIResource {
|
|
8
11
|
/**
|
|
9
12
|
* List all pricing units. All fiat currency types (for example, USD or GBP) will
|
|
@@ -4,6 +4,9 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* [Security](https://docs.metronome.com/developer-resources/security/) endpoints allow you to retrieve security-related data.
|
|
9
|
+
*/
|
|
7
10
|
export class Services extends APIResource {
|
|
8
11
|
/**
|
|
9
12
|
* Gets Metronome's service registry with associated IP addresses for security
|
|
@@ -4,6 +4,9 @@ import { APIResource } from '../../../core/resource';
|
|
|
4
4
|
import { APIPromise } from '../../../core/api-promise';
|
|
5
5
|
import { RequestOptions } from '../../../internal/request-options';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.
|
|
9
|
+
*/
|
|
7
10
|
export class BillingProviders extends APIResource {
|
|
8
11
|
/**
|
|
9
12
|
* Set up account-level configuration for a billing provider. Once configured,
|
|
@@ -12,6 +12,9 @@ import {
|
|
|
12
12
|
import { APIPromise } from '../../../core/api-promise';
|
|
13
13
|
import { RequestOptions } from '../../../internal/request-options';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Use these endpoints to configure a billing API key, a webhook secret, or invoice finalization behavior.
|
|
17
|
+
*/
|
|
15
18
|
export class Settings extends APIResource {
|
|
16
19
|
billingProviders: BillingProvidersAPI.BillingProviders = new BillingProvidersAPI.BillingProviders(
|
|
17
20
|
this._client,
|
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
import { buildHeaders } from '../../internal/headers';
|
|
14
14
|
import { RequestOptions } from '../../internal/request-options';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* [Usage events](https://docs.metronome.com/connecting-metronome/send-usage-data/) are the basis for billable metrics. Use these endpoints to send usage events to Metronome and retrieve aggregated event data.
|
|
18
|
+
*/
|
|
16
19
|
export class Usage extends APIResource {
|
|
17
20
|
/**
|
|
18
21
|
* Retrieve aggregated usage data across multiple customers and billable metrics in
|
|
@@ -192,13 +195,37 @@ export class Usage extends APIResource {
|
|
|
192
195
|
* - Build detailed usage dashboards with dimensional filtering
|
|
193
196
|
* - Identify high-usage segments for optimization opportunities
|
|
194
197
|
*
|
|
198
|
+
* ### Request parameters
|
|
199
|
+
*
|
|
200
|
+
* Use [`group_key`](#body-group-key) and [`group_filters`](#body-group-filters) to
|
|
201
|
+
* group by one or more dimensions. This is required for compound group keys and
|
|
202
|
+
* recommended for all new integrations:
|
|
203
|
+
*
|
|
204
|
+
* ```json
|
|
205
|
+
* {
|
|
206
|
+
* "group_key": ["region", "team"],
|
|
207
|
+
* "group_filters": {
|
|
208
|
+
* "region": ["US-East", "US-West"]
|
|
209
|
+
* }
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* Important: For compound group keys, you must pass the complete set of keys that
|
|
214
|
+
* make up the compound key. Partial key combinations are not supported. For
|
|
215
|
+
* example, if your billable metric has a compound group key [region, team,
|
|
216
|
+
* environment], you must pass all three keys in group_key—you cannot pass just
|
|
217
|
+
* `[region]` or `[region, team]`.
|
|
218
|
+
*
|
|
195
219
|
* ### Key response fields:
|
|
196
220
|
*
|
|
197
221
|
* An array of `PagedUsageAggregate` objects containing:
|
|
198
222
|
*
|
|
199
223
|
* - `starting_on` and `ending_before`: Time window boundaries
|
|
200
|
-
* - `
|
|
201
|
-
*
|
|
224
|
+
* - `group`: Object mapping group keys to their values
|
|
225
|
+
* - For simple groups, this will be a map with a single key-value pair (e.g.,
|
|
226
|
+
* `{"region": "US-East"}`)
|
|
227
|
+
* - For compound groups, this will be a map with multiple key-value pairs (e.g.,
|
|
228
|
+
* `{"region": "US-East", "team": "engineering"}`)
|
|
202
229
|
* - `value`: Aggregated usage for this group and time window
|
|
203
230
|
* - `next_page`: Pagination cursor for large datasets
|
|
204
231
|
*
|
|
@@ -208,12 +235,13 @@ export class Usage extends APIResource {
|
|
|
208
235
|
* `window_size`
|
|
209
236
|
* - Time windows: Set `window_size` to hour, day, or none for different
|
|
210
237
|
* granularities
|
|
211
|
-
* - Group filtering: Use `
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
238
|
+
* - Group filtering: Use `group_key` and `group_filters` to specify groups and
|
|
239
|
+
* group filters
|
|
240
|
+
* - Limits: When using compound group keys (2+ keys in `group_key`), the default
|
|
241
|
+
* and max limit is 100
|
|
215
242
|
* - Pagination: Use limit and `next_page` for large result sets
|
|
216
|
-
* - Null handling:
|
|
243
|
+
* - Null handling: Group values may be null for events missing the group key
|
|
244
|
+
* property
|
|
217
245
|
*
|
|
218
246
|
* @example
|
|
219
247
|
* ```ts
|
|
@@ -225,10 +253,8 @@ export class Usage extends APIResource {
|
|
|
225
253
|
* customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb',
|
|
226
254
|
* window_size: 'day',
|
|
227
255
|
* ending_before: '2021-01-03T00:00:00Z',
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* values: ['US-East', 'US-West', 'EU-Central'],
|
|
231
|
-
* },
|
|
256
|
+
* group_filters: { region: ['us-east1', 'us-west1'] },
|
|
257
|
+
* group_key: ['region'],
|
|
232
258
|
* starting_on: '2021-01-01T00:00:00Z',
|
|
233
259
|
* },
|
|
234
260
|
* )) {
|
|
@@ -324,13 +350,27 @@ export interface UsageListResponse {
|
|
|
324
350
|
export interface UsageListWithGroupsResponse {
|
|
325
351
|
ending_before: string;
|
|
326
352
|
|
|
353
|
+
/**
|
|
354
|
+
* @deprecated Use `group` instead. The group key for single-key grouping.
|
|
355
|
+
*/
|
|
327
356
|
group_key: string | null;
|
|
328
357
|
|
|
358
|
+
/**
|
|
359
|
+
* @deprecated Use `group` instead. The group value for single-key grouping.
|
|
360
|
+
*/
|
|
329
361
|
group_value: string | null;
|
|
330
362
|
|
|
331
363
|
starting_on: string;
|
|
332
364
|
|
|
333
365
|
value: number | null;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Map of group key to their value for this usage aggregate. For simple group keys,
|
|
369
|
+
* this should be a single key e.g. `{"region": "US-East"}` For compound group
|
|
370
|
+
* keys, this should contain the values of each group key that forms the compound
|
|
371
|
+
* e.g. `{"region": "US-East", "team": "engineering"}`
|
|
372
|
+
*/
|
|
373
|
+
group?: { [key: string]: string };
|
|
334
374
|
}
|
|
335
375
|
|
|
336
376
|
export type UsageSearchResponse = Array<UsageSearchResponse.UsageSearchResponseItem>;
|
|
@@ -557,10 +597,34 @@ export interface UsageListWithGroupsParams extends CursorPageParams {
|
|
|
557
597
|
ending_before?: string;
|
|
558
598
|
|
|
559
599
|
/**
|
|
560
|
-
* Body param
|
|
600
|
+
* @deprecated Body param: Use group_key and group_filters instead. Use a single
|
|
601
|
+
* group key to group by. Compound group keys are not supported.
|
|
561
602
|
*/
|
|
562
603
|
group_by?: UsageListWithGroupsParams.GroupBy;
|
|
563
604
|
|
|
605
|
+
/**
|
|
606
|
+
* Body param: Object mapping group keys to arrays of values to filter on. Only
|
|
607
|
+
* usage matching these filter values will be returned. Keys must be present in
|
|
608
|
+
* group_key. Omit a key or use an empty array to include all values for that
|
|
609
|
+
* dimension.
|
|
610
|
+
*/
|
|
611
|
+
group_filters?: { [key: string]: Array<string> };
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Body param: Group key to group usage by. Supports both simple (single key) and
|
|
615
|
+
* compound (multiple keys) group keys.
|
|
616
|
+
*
|
|
617
|
+
* For simple group keys, provide a single key e.g. `["region"]`. For compound
|
|
618
|
+
* group keys, provide multiple keys e.g. `["region", "team"]`.
|
|
619
|
+
*
|
|
620
|
+
* For streaming metrics, the keys must be defined as a simple or compound group
|
|
621
|
+
* key on the billable metric. For compound group keys, all keys must match an
|
|
622
|
+
* exact compound group key definition — partial matches are not allowed.
|
|
623
|
+
*
|
|
624
|
+
* Cannot be used together with `group_by`.
|
|
625
|
+
*/
|
|
626
|
+
group_key?: Array<string>;
|
|
627
|
+
|
|
564
628
|
/**
|
|
565
629
|
* Body param
|
|
566
630
|
*/
|
|
@@ -568,6 +632,10 @@ export interface UsageListWithGroupsParams extends CursorPageParams {
|
|
|
568
632
|
}
|
|
569
633
|
|
|
570
634
|
export namespace UsageListWithGroupsParams {
|
|
635
|
+
/**
|
|
636
|
+
* @deprecated Use group_key and group_filters instead. Use a single group key to
|
|
637
|
+
* group by. Compound group keys are not supported.
|
|
638
|
+
*/
|
|
571
639
|
export interface GroupBy {
|
|
572
640
|
/**
|
|
573
641
|
* The name of the group_by key to use
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -69,6 +69,22 @@ import {
|
|
|
69
69
|
InvoiceVoidResponse,
|
|
70
70
|
Invoices,
|
|
71
71
|
} from './invoices';
|
|
72
|
+
import * as PackagesAPI from './packages';
|
|
73
|
+
import {
|
|
74
|
+
PackageArchiveParams,
|
|
75
|
+
PackageArchiveResponse,
|
|
76
|
+
PackageCreateParams,
|
|
77
|
+
PackageCreateResponse,
|
|
78
|
+
PackageListContractsOnPackageParams,
|
|
79
|
+
PackageListContractsOnPackageResponse,
|
|
80
|
+
PackageListContractsOnPackageResponsesCursorPage,
|
|
81
|
+
PackageListParams,
|
|
82
|
+
PackageListResponse,
|
|
83
|
+
PackageListResponsesCursorPage,
|
|
84
|
+
PackageRetrieveParams,
|
|
85
|
+
PackageRetrieveResponse,
|
|
86
|
+
Packages,
|
|
87
|
+
} from './packages';
|
|
72
88
|
import * as PaymentsAPI from './payments';
|
|
73
89
|
import {
|
|
74
90
|
Payment,
|
|
@@ -130,6 +146,8 @@ import {
|
|
|
130
146
|
ContractCreateHistoricalInvoicesResponse,
|
|
131
147
|
ContractCreateParams,
|
|
132
148
|
ContractCreateResponse,
|
|
149
|
+
ContractGetNetBalanceParams,
|
|
150
|
+
ContractGetNetBalanceResponse,
|
|
133
151
|
ContractListBalancesParams,
|
|
134
152
|
ContractListBalancesResponse,
|
|
135
153
|
ContractListBalancesResponsesBodyCursorPage,
|
|
@@ -151,6 +169,8 @@ import {
|
|
|
151
169
|
import * as CustomersAPI from './customers/customers';
|
|
152
170
|
import {
|
|
153
171
|
Customer,
|
|
172
|
+
CustomerArchiveBillingConfigurationsParams,
|
|
173
|
+
CustomerArchiveBillingConfigurationsResponse,
|
|
154
174
|
CustomerArchiveParams,
|
|
155
175
|
CustomerArchiveResponse,
|
|
156
176
|
CustomerCreateParams,
|
|
@@ -199,6 +219,7 @@ export class V1 extends APIResource {
|
|
|
199
219
|
services: ServicesAPI.Services = new ServicesAPI.Services(this._client);
|
|
200
220
|
invoices: InvoicesAPI.Invoices = new InvoicesAPI.Invoices(this._client);
|
|
201
221
|
contracts: ContractsAPI.Contracts = new ContractsAPI.Contracts(this._client);
|
|
222
|
+
packages: PackagesAPI.Packages = new PackagesAPI.Packages(this._client);
|
|
202
223
|
payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this._client);
|
|
203
224
|
settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client);
|
|
204
225
|
}
|
|
@@ -216,6 +237,7 @@ V1.BillableMetrics = BillableMetrics;
|
|
|
216
237
|
V1.Services = Services;
|
|
217
238
|
V1.Invoices = Invoices;
|
|
218
239
|
V1.Contracts = Contracts;
|
|
240
|
+
V1.Packages = Packages;
|
|
219
241
|
V1.Payments = Payments;
|
|
220
242
|
V1.Settings = Settings;
|
|
221
243
|
|
|
@@ -277,6 +299,7 @@ export declare namespace V1 {
|
|
|
277
299
|
type CustomerCreateResponse as CustomerCreateResponse,
|
|
278
300
|
type CustomerRetrieveResponse as CustomerRetrieveResponse,
|
|
279
301
|
type CustomerArchiveResponse as CustomerArchiveResponse,
|
|
302
|
+
type CustomerArchiveBillingConfigurationsResponse as CustomerArchiveBillingConfigurationsResponse,
|
|
280
303
|
type CustomerListBillableMetricsResponse as CustomerListBillableMetricsResponse,
|
|
281
304
|
type CustomerListCostsResponse as CustomerListCostsResponse,
|
|
282
305
|
type CustomerPreviewEventsResponse as CustomerPreviewEventsResponse,
|
|
@@ -290,6 +313,7 @@ export declare namespace V1 {
|
|
|
290
313
|
type CustomerRetrieveParams as CustomerRetrieveParams,
|
|
291
314
|
type CustomerListParams as CustomerListParams,
|
|
292
315
|
type CustomerArchiveParams as CustomerArchiveParams,
|
|
316
|
+
type CustomerArchiveBillingConfigurationsParams as CustomerArchiveBillingConfigurationsParams,
|
|
293
317
|
type CustomerListBillableMetricsParams as CustomerListBillableMetricsParams,
|
|
294
318
|
type CustomerListCostsParams as CustomerListCostsParams,
|
|
295
319
|
type CustomerPreviewEventsParams as CustomerPreviewEventsParams,
|
|
@@ -368,6 +392,7 @@ export declare namespace V1 {
|
|
|
368
392
|
type ContractAmendResponse as ContractAmendResponse,
|
|
369
393
|
type ContractArchiveResponse as ContractArchiveResponse,
|
|
370
394
|
type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
|
|
395
|
+
type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
|
|
371
396
|
type ContractListBalancesResponse as ContractListBalancesResponse,
|
|
372
397
|
type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
|
|
373
398
|
type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
@@ -381,6 +406,7 @@ export declare namespace V1 {
|
|
|
381
406
|
type ContractAmendParams as ContractAmendParams,
|
|
382
407
|
type ContractArchiveParams as ContractArchiveParams,
|
|
383
408
|
type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
|
|
409
|
+
type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
|
|
384
410
|
type ContractListBalancesParams as ContractListBalancesParams,
|
|
385
411
|
type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
|
|
386
412
|
type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
@@ -389,6 +415,22 @@ export declare namespace V1 {
|
|
|
389
415
|
type ContractUpdateEndDateParams as ContractUpdateEndDateParams,
|
|
390
416
|
};
|
|
391
417
|
|
|
418
|
+
export {
|
|
419
|
+
Packages as Packages,
|
|
420
|
+
type PackageCreateResponse as PackageCreateResponse,
|
|
421
|
+
type PackageRetrieveResponse as PackageRetrieveResponse,
|
|
422
|
+
type PackageListResponse as PackageListResponse,
|
|
423
|
+
type PackageArchiveResponse as PackageArchiveResponse,
|
|
424
|
+
type PackageListContractsOnPackageResponse as PackageListContractsOnPackageResponse,
|
|
425
|
+
type PackageListResponsesCursorPage as PackageListResponsesCursorPage,
|
|
426
|
+
type PackageListContractsOnPackageResponsesCursorPage as PackageListContractsOnPackageResponsesCursorPage,
|
|
427
|
+
type PackageCreateParams as PackageCreateParams,
|
|
428
|
+
type PackageRetrieveParams as PackageRetrieveParams,
|
|
429
|
+
type PackageListParams as PackageListParams,
|
|
430
|
+
type PackageArchiveParams as PackageArchiveParams,
|
|
431
|
+
type PackageListContractsOnPackageParams as PackageListContractsOnPackageParams,
|
|
432
|
+
};
|
|
433
|
+
|
|
392
434
|
export {
|
|
393
435
|
Payments as Payments,
|
|
394
436
|
type Payment as Payment,
|
|
@@ -76,10 +76,7 @@ export class Contracts extends APIResource {
|
|
|
76
76
|
*
|
|
77
77
|
* ### Key response fields:
|
|
78
78
|
*
|
|
79
|
-
* - The `id` of the
|
|
80
|
-
* - Complete edit details. For example, if you edited the contract to add new
|
|
81
|
-
* overrides and credits, you will receive the IDs of those overrides and credits
|
|
82
|
-
* in the response.
|
|
79
|
+
* - The `id` of the contract that was edited
|
|
83
80
|
*
|
|
84
81
|
* ### Usage guidelines:
|
|
85
82
|
*
|
|
@@ -482,6 +479,10 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
482
479
|
*/
|
|
483
480
|
priority?: number;
|
|
484
481
|
|
|
482
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
483
|
+
|
|
484
|
+
rollover_fraction?: number;
|
|
485
|
+
|
|
485
486
|
/**
|
|
486
487
|
* This field's availability is dependent on your client's configuration.
|
|
487
488
|
*/
|
|
@@ -509,6 +510,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
509
510
|
export interface AddOverride {
|
|
510
511
|
id: string;
|
|
511
512
|
|
|
513
|
+
created_at: string;
|
|
514
|
+
|
|
512
515
|
starting_at: string;
|
|
513
516
|
|
|
514
517
|
applicable_product_tags?: Array<string>;
|
|
@@ -551,12 +554,10 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
551
554
|
product_tags?: Array<string>;
|
|
552
555
|
|
|
553
556
|
recurring_commit_ids?: Array<string>;
|
|
554
|
-
|
|
555
|
-
recurring_credit_ids?: Array<string>;
|
|
556
557
|
}
|
|
557
558
|
|
|
558
559
|
export interface OverwriteRate {
|
|
559
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
560
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
560
561
|
|
|
561
562
|
credit_type?: Shared.CreditTypeData;
|
|
562
563
|
|
|
@@ -1113,6 +1114,20 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1113
1114
|
|
|
1114
1115
|
access_schedule?: UpdateCredit.AccessSchedule;
|
|
1115
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Which products the credit applies to. If applicable_product_ids,
|
|
1119
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
1120
|
+
* all products.
|
|
1121
|
+
*/
|
|
1122
|
+
applicable_product_ids?: Array<string> | null;
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Which tags the credit applies to. If applicable_product_ids,
|
|
1126
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
1127
|
+
* all products.
|
|
1128
|
+
*/
|
|
1129
|
+
applicable_product_tags?: Array<string> | null;
|
|
1130
|
+
|
|
1116
1131
|
description?: string;
|
|
1117
1132
|
|
|
1118
1133
|
/**
|
|
@@ -1130,12 +1145,24 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1130
1145
|
*/
|
|
1131
1146
|
priority?: number | null;
|
|
1132
1147
|
|
|
1148
|
+
product_id?: string;
|
|
1149
|
+
|
|
1133
1150
|
/**
|
|
1134
1151
|
* If set, the credit's rate type was updated to the specified value.
|
|
1135
1152
|
*/
|
|
1136
1153
|
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
1137
1154
|
|
|
1138
1155
|
rollover_fraction?: number | null;
|
|
1156
|
+
|
|
1157
|
+
/**
|
|
1158
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1159
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1160
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1161
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1162
|
+
* Instead, to target usage by product or product tag, pass those values in the
|
|
1163
|
+
* body of `specifiers`.
|
|
1164
|
+
*/
|
|
1165
|
+
specifiers?: Array<Shared.CommitSpecifierInput> | null;
|
|
1139
1166
|
}
|
|
1140
1167
|
|
|
1141
1168
|
export namespace UpdateCredit {
|
|
@@ -1313,6 +1340,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1313
1340
|
*/
|
|
1314
1341
|
custom_credit_type_id?: string | null;
|
|
1315
1342
|
|
|
1343
|
+
discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
|
|
1344
|
+
|
|
1316
1345
|
/**
|
|
1317
1346
|
* When set to false, the contract will not be evaluated against the
|
|
1318
1347
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -1359,6 +1388,15 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1359
1388
|
*/
|
|
1360
1389
|
specifiers?: Array<Shared.CommitSpecifierInput> | null;
|
|
1361
1390
|
}
|
|
1391
|
+
|
|
1392
|
+
export interface DiscountConfiguration {
|
|
1393
|
+
/**
|
|
1394
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
1395
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
1396
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
1397
|
+
*/
|
|
1398
|
+
payment_fraction?: number | null;
|
|
1399
|
+
}
|
|
1362
1400
|
}
|
|
1363
1401
|
|
|
1364
1402
|
export interface UpdateRecurringCommit {
|
|
@@ -1462,6 +1500,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1462
1500
|
export interface UpdateSpendThresholdConfiguration {
|
|
1463
1501
|
commit?: Shared.UpdateBaseThresholdCommit;
|
|
1464
1502
|
|
|
1503
|
+
discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
|
|
1504
|
+
|
|
1465
1505
|
/**
|
|
1466
1506
|
* When set to false, the contract will not be evaluated against the
|
|
1467
1507
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -1478,6 +1518,17 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1478
1518
|
threshold_amount?: number;
|
|
1479
1519
|
}
|
|
1480
1520
|
|
|
1521
|
+
export namespace UpdateSpendThresholdConfiguration {
|
|
1522
|
+
export interface DiscountConfiguration {
|
|
1523
|
+
/**
|
|
1524
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
1525
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
1526
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
1527
|
+
*/
|
|
1528
|
+
payment_fraction?: number | null;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1481
1532
|
export interface UpdateSubscription {
|
|
1482
1533
|
id: string;
|
|
1483
1534
|
|
|
@@ -1677,6 +1728,13 @@ export interface ContractEditParams {
|
|
|
1677
1728
|
|
|
1678
1729
|
add_reseller_royalties?: Array<ContractEditParams.AddResellerRoyalty>;
|
|
1679
1730
|
|
|
1731
|
+
/**
|
|
1732
|
+
* Update the revenue system configuration on the contract. Currently only supports
|
|
1733
|
+
* adding a revenue system configuration to a contract that does not already have
|
|
1734
|
+
* one.
|
|
1735
|
+
*/
|
|
1736
|
+
add_revenue_system_configuration_update?: ContractEditParams.AddRevenueSystemConfigurationUpdate;
|
|
1737
|
+
|
|
1680
1738
|
add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
|
|
1681
1739
|
|
|
1682
1740
|
add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
|
|
@@ -1736,6 +1794,12 @@ export interface ContractEditParams {
|
|
|
1736
1794
|
|
|
1737
1795
|
update_credits?: Array<ContractEditParams.UpdateCredit>;
|
|
1738
1796
|
|
|
1797
|
+
/**
|
|
1798
|
+
* Number of days after issuance of invoice after which the invoice is due (e.g.
|
|
1799
|
+
* Net 30).
|
|
1800
|
+
*/
|
|
1801
|
+
update_net_payment_terms_days?: number | null;
|
|
1802
|
+
|
|
1739
1803
|
update_prepaid_balance_threshold_configuration?: ContractEditParams.UpdatePrepaidBalanceThresholdConfiguration;
|
|
1740
1804
|
|
|
1741
1805
|
/**
|
|
@@ -2065,7 +2129,7 @@ export namespace ContractEditParams {
|
|
|
2065
2129
|
* not wish Metronome to calculate tax on your behalf. Leaving this field blank
|
|
2066
2130
|
* will default to NONE.
|
|
2067
2131
|
*/
|
|
2068
|
-
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | '
|
|
2132
|
+
tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
|
|
2069
2133
|
}
|
|
2070
2134
|
|
|
2071
2135
|
export namespace PaymentGateConfig {
|
|
@@ -2169,6 +2233,11 @@ export namespace ContractEditParams {
|
|
|
2169
2233
|
|
|
2170
2234
|
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
2171
2235
|
|
|
2236
|
+
/**
|
|
2237
|
+
* Fraction of unused segments that will be rolled over. Must be between 0 and 1.
|
|
2238
|
+
*/
|
|
2239
|
+
rollover_fraction?: number;
|
|
2240
|
+
|
|
2172
2241
|
/**
|
|
2173
2242
|
* List of filters that determine what kind of customer usage draws down a commit
|
|
2174
2243
|
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
@@ -2447,21 +2516,13 @@ export namespace ContractEditParams {
|
|
|
2447
2516
|
* created by the specified recurring commit ids.
|
|
2448
2517
|
*/
|
|
2449
2518
|
recurring_commit_ids?: Array<string>;
|
|
2450
|
-
|
|
2451
|
-
/**
|
|
2452
|
-
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2453
|
-
* one of product_id, product_tags, pricing_group_values, or
|
|
2454
|
-
* presentation_group_values. If provided, the override will only apply to commits
|
|
2455
|
-
* created by the specified recurring credit ids.
|
|
2456
|
-
*/
|
|
2457
|
-
recurring_credit_ids?: Array<string>;
|
|
2458
2519
|
}
|
|
2459
2520
|
|
|
2460
2521
|
/**
|
|
2461
2522
|
* Required for OVERWRITE type.
|
|
2462
2523
|
*/
|
|
2463
2524
|
export interface OverwriteRate {
|
|
2464
|
-
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
|
|
2525
|
+
rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
|
|
2465
2526
|
|
|
2466
2527
|
credit_type_id?: string;
|
|
2467
2528
|
|
|
@@ -2925,6 +2986,37 @@ export namespace ContractEditParams {
|
|
|
2925
2986
|
}
|
|
2926
2987
|
}
|
|
2927
2988
|
|
|
2989
|
+
/**
|
|
2990
|
+
* Update the revenue system configuration on the contract. Currently only supports
|
|
2991
|
+
* adding a revenue system configuration to a contract that does not already have
|
|
2992
|
+
* one.
|
|
2993
|
+
*/
|
|
2994
|
+
export interface AddRevenueSystemConfigurationUpdate {
|
|
2995
|
+
revenue_system_configuration: AddRevenueSystemConfigurationUpdate.RevenueSystemConfiguration;
|
|
2996
|
+
|
|
2997
|
+
schedule: AddRevenueSystemConfigurationUpdate.Schedule;
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
export namespace AddRevenueSystemConfigurationUpdate {
|
|
3001
|
+
export interface RevenueSystemConfiguration {
|
|
3002
|
+
delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
3003
|
+
|
|
3004
|
+
/**
|
|
3005
|
+
* The revenue system provider type.
|
|
3006
|
+
*/
|
|
3007
|
+
provider?: 'netsuite';
|
|
3008
|
+
|
|
3009
|
+
revenue_system_configuration_id?: string;
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
export interface Schedule {
|
|
3013
|
+
/**
|
|
3014
|
+
* When the revenue system configuration update will take effect.
|
|
3015
|
+
*/
|
|
3016
|
+
effective_at: 'START_OF_CURRENT_PERIOD';
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
|
|
2928
3020
|
export interface AddScheduledCharge {
|
|
2929
3021
|
product_id: string;
|
|
2930
3022
|
|
|
@@ -3298,15 +3390,15 @@ export namespace ContractEditParams {
|
|
|
3298
3390
|
access_schedule?: UpdateCredit.AccessSchedule;
|
|
3299
3391
|
|
|
3300
3392
|
/**
|
|
3301
|
-
* Which products the
|
|
3302
|
-
* applicable_product_tags or specifiers are not provided, the
|
|
3393
|
+
* Which products the credit applies to. If applicable_product_ids,
|
|
3394
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
3303
3395
|
* all products.
|
|
3304
3396
|
*/
|
|
3305
3397
|
applicable_product_ids?: Array<string> | null;
|
|
3306
3398
|
|
|
3307
3399
|
/**
|
|
3308
|
-
* Which tags the
|
|
3309
|
-
* applicable_product_tags or specifiers are not provided, the
|
|
3400
|
+
* Which tags the credit applies to. If applicable_product_ids,
|
|
3401
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
3310
3402
|
* all products.
|
|
3311
3403
|
*/
|
|
3312
3404
|
applicable_product_tags?: Array<string> | null;
|
|
@@ -3332,6 +3424,8 @@ export namespace ContractEditParams {
|
|
|
3332
3424
|
* regenerated to reflect the rate type change.
|
|
3333
3425
|
*/
|
|
3334
3426
|
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
3427
|
+
|
|
3428
|
+
rollover_fraction?: number | null;
|
|
3335
3429
|
}
|
|
3336
3430
|
|
|
3337
3431
|
export namespace UpdateCredit {
|
|
@@ -3377,6 +3471,8 @@ export namespace ContractEditParams {
|
|
|
3377
3471
|
*/
|
|
3378
3472
|
custom_credit_type_id?: string | null;
|
|
3379
3473
|
|
|
3474
|
+
discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
|
|
3475
|
+
|
|
3380
3476
|
/**
|
|
3381
3477
|
* When set to false, the contract will not be evaluated against the
|
|
3382
3478
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -3423,6 +3519,15 @@ export namespace ContractEditParams {
|
|
|
3423
3519
|
*/
|
|
3424
3520
|
specifiers?: Array<Shared.CommitSpecifierInput> | null;
|
|
3425
3521
|
}
|
|
3522
|
+
|
|
3523
|
+
export interface DiscountConfiguration {
|
|
3524
|
+
/**
|
|
3525
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
3526
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
3527
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
3528
|
+
*/
|
|
3529
|
+
payment_fraction?: number | null;
|
|
3530
|
+
}
|
|
3426
3531
|
}
|
|
3427
3532
|
|
|
3428
3533
|
export interface UpdateRecurringCommit {
|
|
@@ -3526,6 +3631,8 @@ export namespace ContractEditParams {
|
|
|
3526
3631
|
export interface UpdateSpendThresholdConfiguration {
|
|
3527
3632
|
commit?: Shared.UpdateBaseThresholdCommit;
|
|
3528
3633
|
|
|
3634
|
+
discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
|
|
3635
|
+
|
|
3529
3636
|
/**
|
|
3530
3637
|
* When set to false, the contract will not be evaluated against the
|
|
3531
3638
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -3542,6 +3649,17 @@ export namespace ContractEditParams {
|
|
|
3542
3649
|
threshold_amount?: number;
|
|
3543
3650
|
}
|
|
3544
3651
|
|
|
3652
|
+
export namespace UpdateSpendThresholdConfiguration {
|
|
3653
|
+
export interface DiscountConfiguration {
|
|
3654
|
+
/**
|
|
3655
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
3656
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
3657
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
3658
|
+
*/
|
|
3659
|
+
payment_fraction?: number | null;
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
|
|
3545
3663
|
export interface UpdateSubscription {
|
|
3546
3664
|
subscription_id: string;
|
|
3547
3665
|
|
|
@@ -82,7 +82,7 @@ export class Webhooks extends APIResource {
|
|
|
82
82
|
): void {
|
|
83
83
|
this.validateSecret(secret);
|
|
84
84
|
|
|
85
|
-
const msgDate = getRequiredHeader(headers, 'Date');
|
|
85
|
+
const msgDate = getRequiredHeader(headers, 'X-Metronome-Date');
|
|
86
86
|
const msgSignature = getRequiredHeader(headers, 'Metronome-Webhook-Signature');
|
|
87
87
|
|
|
88
88
|
const now = Date.now();
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '3.
|
|
1
|
+
export const VERSION = '3.5.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.
|
|
1
|
+
export declare const VERSION = "3.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.
|
|
1
|
+
export declare const VERSION = "3.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED