@metronome/sdk 3.5.0 → 3.7.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 +78 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/bin/cli +12 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +11 -0
- package/client.js.map +1 -1
- package/client.mjs +11 -0
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts.map +1 -1
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +2 -2
- package/internal/qs/index.d.mts.map +1 -1
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts.map +1 -1
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +10 -10
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +10 -10
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.mts +1 -0
- package/pagination.d.mts.map +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.mjs +1 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.mts +321 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +321 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts +1 -1
- package/resources/v1/alerts.d.mts.map +1 -1
- package/resources/v1/alerts.d.ts +1 -1
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.mts.map +1 -1
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.mts.map +1 -1
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.mts +629 -143
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +629 -143
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +47 -2
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +47 -2
- 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.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.mts +18 -0
- package/resources/v1/contracts/products.d.mts.map +1 -1
- package/resources/v1/contracts/products.d.ts +18 -0
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
- package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts.d.mts.map +1 -1
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.mjs.map +1 -1
- package/resources/v1/credit-grants.d.mts.map +1 -1
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.mts.map +1 -1
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.mts +1 -1
- package/resources/v1/customers/alerts.d.mts.map +1 -1
- package/resources/v1/customers/alerts.d.ts +1 -1
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.mts.map +1 -1
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.mts.map +1 -1
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.mts.map +1 -1
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.mts +9 -0
- package/resources/v1/customers/invoices.d.mts.map +1 -1
- package/resources/v1/customers/invoices.d.ts +9 -0
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.mts.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.mts.map +1 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/customers.d.mts.map +1 -1
- package/resources/v1/customers.d.ts.map +1 -1
- package/resources/v1/customers.mjs.map +1 -1
- package/resources/v1/dashboards.d.mts.map +1 -1
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.mts +1 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +1 -3
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +0 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.mts.map +1 -1
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/packages.d.mts +57 -5
- package/resources/v1/packages.d.mts.map +1 -1
- package/resources/v1/packages.d.ts +57 -5
- package/resources/v1/packages.d.ts.map +1 -1
- package/resources/v1/packages.js +3 -4
- package/resources/v1/packages.js.map +1 -1
- package/resources/v1/packages.mjs +3 -4
- package/resources/v1/packages.mjs.map +1 -1
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.mts.map +1 -1
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.mts.map +1 -1
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/settings/billing-providers.d.mts.map +1 -1
- package/resources/v1/settings/billing-providers.d.ts.map +1 -1
- package/resources/v1/settings/billing-providers.mjs.map +1 -1
- package/resources/v1/settings/index.d.mts.map +1 -1
- package/resources/v1/settings/index.d.ts.map +1 -1
- package/resources/v1/settings/index.mjs.map +1 -1
- package/resources/v1/settings/settings.d.mts.map +1 -1
- package/resources/v1/settings/settings.d.ts.map +1 -1
- package/resources/v1/settings/settings.mjs.map +1 -1
- package/resources/v1/settings.d.mts.map +1 -1
- package/resources/v1/settings.d.ts.map +1 -1
- package/resources/v1/settings.mjs.map +1 -1
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +0 -4
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +0 -4
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1.d.mts.map +1 -1
- package/resources/v1.d.ts.map +1 -1
- package/resources/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +1431 -2
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +1431 -2
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/v2/index.d.mts.map +1 -1
- package/resources/v2/index.d.ts.map +1 -1
- package/resources/v2/index.mjs.map +1 -1
- package/resources/v2/v2.d.mts.map +1 -1
- package/resources/v2/v2.d.ts.map +1 -1
- package/resources/v2/v2.mjs.map +1 -1
- package/resources/v2.d.mts.map +1 -1
- package/resources/v2.d.ts.map +1 -1
- package/resources/v2.mjs.map +1 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +12 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/shared.ts +417 -1
- package/src/resources/v1/alerts.ts +1 -1
- package/src/resources/v1/contracts/contracts.ts +813 -156
- package/src/resources/v1/contracts/index.ts +2 -0
- package/src/resources/v1/contracts/products.ts +20 -0
- package/src/resources/v1/customers/alerts.ts +1 -1
- package/src/resources/v1/customers/invoices.ts +12 -0
- package/src/resources/v1/index.ts +2 -11
- package/src/resources/v1/packages.ts +81 -6
- package/src/resources/v1/v1.ts +4 -26
- package/src/resources/v2/contracts.ts +1881 -2
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/v1/payments.d.mts +0 -127
- package/resources/v1/payments.d.mts.map +0 -1
- package/resources/v1/payments.d.ts +0 -127
- package/resources/v1/payments.d.ts.map +0 -1
- package/resources/v1/payments.js +0 -71
- package/resources/v1/payments.js.map +0 -1
- package/resources/v1/payments.mjs +0 -67
- package/resources/v1/payments.mjs.map +0 -1
- package/src/resources/v1/payments.ts +0 -187
package/src/resources/shared.ts
CHANGED
|
@@ -183,6 +183,11 @@ export interface Commit {
|
|
|
183
183
|
*/
|
|
184
184
|
specifiers?: Array<CommitSpecifier>;
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Optional attributes controlling how this commit interacts with spend trackers.
|
|
188
|
+
*/
|
|
189
|
+
spend_tracker_attributes?: Commit.SpendTrackerAttributes;
|
|
190
|
+
|
|
186
191
|
/**
|
|
187
192
|
* The subscription configuration for this commit, if it was generated from a
|
|
188
193
|
* recurring commit with a subscription attached.
|
|
@@ -380,6 +385,17 @@ export namespace Commit {
|
|
|
380
385
|
contract_id: string;
|
|
381
386
|
}
|
|
382
387
|
|
|
388
|
+
/**
|
|
389
|
+
* Optional attributes controlling how this commit interacts with spend trackers.
|
|
390
|
+
*/
|
|
391
|
+
export interface SpendTrackerAttributes {
|
|
392
|
+
/**
|
|
393
|
+
* If true, this commit is included in spend trackers with discounted set to
|
|
394
|
+
* DISCOUNTED_ONLY
|
|
395
|
+
*/
|
|
396
|
+
counts_as_discounted: boolean;
|
|
397
|
+
}
|
|
398
|
+
|
|
383
399
|
/**
|
|
384
400
|
* The subscription configuration for this commit, if it was generated from a
|
|
385
401
|
* recurring commit with a subscription attached.
|
|
@@ -532,6 +548,11 @@ export interface Contract {
|
|
|
532
548
|
|
|
533
549
|
spend_threshold_configuration?: SpendThresholdConfiguration;
|
|
534
550
|
|
|
551
|
+
/**
|
|
552
|
+
* Spend trackers attached to this contract.
|
|
553
|
+
*/
|
|
554
|
+
spend_trackers?: Array<Contract.SpendTracker>;
|
|
555
|
+
|
|
535
556
|
/**
|
|
536
557
|
* List of subscriptions on the contract.
|
|
537
558
|
*/
|
|
@@ -642,6 +663,39 @@ export namespace Contract {
|
|
|
642
663
|
*/
|
|
643
664
|
configuration?: { [key: string]: unknown };
|
|
644
665
|
}
|
|
666
|
+
|
|
667
|
+
export interface SpendTracker {
|
|
668
|
+
/**
|
|
669
|
+
* Human-readable identifier, unique per contract.
|
|
670
|
+
*/
|
|
671
|
+
alias: string;
|
|
672
|
+
|
|
673
|
+
applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
|
|
674
|
+
|
|
675
|
+
credit_type_id: string;
|
|
676
|
+
|
|
677
|
+
reset_frequency: 'BILLING_PERIOD';
|
|
678
|
+
|
|
679
|
+
accumulated_spend?: SpendTracker.AccumulatedSpend;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export namespace SpendTracker {
|
|
683
|
+
export interface ApplicableSpendSpecifier {
|
|
684
|
+
sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
|
|
685
|
+
|
|
686
|
+
spend_type: 'COMMIT_PURCHASE';
|
|
687
|
+
|
|
688
|
+
discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
export interface AccumulatedSpend {
|
|
692
|
+
amount: number;
|
|
693
|
+
|
|
694
|
+
period_ending_before: string;
|
|
695
|
+
|
|
696
|
+
period_starting_at: string;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
645
699
|
}
|
|
646
700
|
|
|
647
701
|
export interface ContractV2 {
|
|
@@ -758,10 +812,15 @@ export interface ContractV2 {
|
|
|
758
812
|
|
|
759
813
|
spend_threshold_configuration?: SpendThresholdConfigurationV2;
|
|
760
814
|
|
|
815
|
+
/**
|
|
816
|
+
* Spend trackers attached to this contract.
|
|
817
|
+
*/
|
|
818
|
+
spend_trackers?: Array<ContractV2.SpendTracker>;
|
|
819
|
+
|
|
761
820
|
/**
|
|
762
821
|
* List of subscriptions on the contract.
|
|
763
822
|
*/
|
|
764
|
-
subscriptions?: Array<Subscription>;
|
|
823
|
+
subscriptions?: Array<ContractV2.Subscription>;
|
|
765
824
|
|
|
766
825
|
total_contract_value?: number;
|
|
767
826
|
|
|
@@ -895,6 +954,11 @@ export namespace ContractV2 {
|
|
|
895
954
|
*/
|
|
896
955
|
specifiers?: Array<Shared.CommitSpecifier>;
|
|
897
956
|
|
|
957
|
+
/**
|
|
958
|
+
* Optional attributes controlling how this commit interacts with spend trackers.
|
|
959
|
+
*/
|
|
960
|
+
spend_tracker_attributes?: Commit.SpendTrackerAttributes;
|
|
961
|
+
|
|
898
962
|
/**
|
|
899
963
|
* Attach a subscription to the recurring commit/credit.
|
|
900
964
|
*/
|
|
@@ -1082,6 +1146,17 @@ export namespace ContractV2 {
|
|
|
1082
1146
|
|
|
1083
1147
|
contract_id: string;
|
|
1084
1148
|
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* Optional attributes controlling how this commit interacts with spend trackers.
|
|
1152
|
+
*/
|
|
1153
|
+
export interface SpendTrackerAttributes {
|
|
1154
|
+
/**
|
|
1155
|
+
* If true, this commit is included in spend trackers with discounted set to
|
|
1156
|
+
* DISCOUNTED_ONLY
|
|
1157
|
+
*/
|
|
1158
|
+
counts_as_discounted: boolean;
|
|
1159
|
+
}
|
|
1085
1160
|
}
|
|
1086
1161
|
|
|
1087
1162
|
export interface Override {
|
|
@@ -1227,6 +1302,8 @@ export namespace ContractV2 {
|
|
|
1227
1302
|
|
|
1228
1303
|
applicable_product_tags?: Array<string>;
|
|
1229
1304
|
|
|
1305
|
+
archived_at?: string;
|
|
1306
|
+
|
|
1230
1307
|
/**
|
|
1231
1308
|
* The current balance of the credit or commit. This balance reflects the amount of
|
|
1232
1309
|
* credit or commit that the customer has access to use at this moment - thus,
|
|
@@ -1855,6 +1932,163 @@ export namespace ContractV2 {
|
|
|
1855
1932
|
reseller_contract_value?: number;
|
|
1856
1933
|
}
|
|
1857
1934
|
}
|
|
1935
|
+
|
|
1936
|
+
export interface SpendTracker {
|
|
1937
|
+
/**
|
|
1938
|
+
* Human-readable identifier, unique per contract.
|
|
1939
|
+
*/
|
|
1940
|
+
alias: string;
|
|
1941
|
+
|
|
1942
|
+
applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
|
|
1943
|
+
|
|
1944
|
+
credit_type_id: string;
|
|
1945
|
+
|
|
1946
|
+
reset_frequency: 'BILLING_PERIOD';
|
|
1947
|
+
|
|
1948
|
+
accumulated_spend?: SpendTracker.AccumulatedSpend;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
export namespace SpendTracker {
|
|
1952
|
+
export interface ApplicableSpendSpecifier {
|
|
1953
|
+
sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
|
|
1954
|
+
|
|
1955
|
+
spend_type: 'COMMIT_PURCHASE';
|
|
1956
|
+
|
|
1957
|
+
discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
export interface AccumulatedSpend {
|
|
1961
|
+
amount: number;
|
|
1962
|
+
|
|
1963
|
+
period_ending_before: string;
|
|
1964
|
+
|
|
1965
|
+
period_starting_at: string;
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
export interface Subscription {
|
|
1970
|
+
/**
|
|
1971
|
+
* Previous, current, and next billing periods for the subscription.
|
|
1972
|
+
*/
|
|
1973
|
+
billing_periods: Subscription.BillingPeriods;
|
|
1974
|
+
|
|
1975
|
+
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
1976
|
+
|
|
1977
|
+
proration: Subscription.Proration;
|
|
1978
|
+
|
|
1979
|
+
/**
|
|
1980
|
+
* Determines how the subscription's quantity is controlled. Defaults to
|
|
1981
|
+
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
1982
|
+
* directly on the subscription. `initial_quantity` must be provided with this
|
|
1983
|
+
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
1984
|
+
* **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
1985
|
+
* user_123) to increment and decrement a subscription quantity, rather than
|
|
1986
|
+
* directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
1987
|
+
* use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
1988
|
+
* provided with this option.
|
|
1989
|
+
*/
|
|
1990
|
+
quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
1991
|
+
|
|
1992
|
+
/**
|
|
1993
|
+
* List of quantity schedule items for the subscription. Only includes the current
|
|
1994
|
+
* quantity and future quantity changes.
|
|
1995
|
+
*/
|
|
1996
|
+
quantity_schedule: Array<Subscription.QuantitySchedule>;
|
|
1997
|
+
|
|
1998
|
+
starting_at: string;
|
|
1999
|
+
|
|
2000
|
+
subscription_rate: Subscription.SubscriptionRate;
|
|
2001
|
+
|
|
2002
|
+
id?: string;
|
|
2003
|
+
|
|
2004
|
+
/**
|
|
2005
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
2006
|
+
*/
|
|
2007
|
+
custom_fields?: { [key: string]: string };
|
|
2008
|
+
|
|
2009
|
+
description?: string;
|
|
2010
|
+
|
|
2011
|
+
ending_before?: string;
|
|
2012
|
+
|
|
2013
|
+
fiat_credit_type_id?: string;
|
|
2014
|
+
|
|
2015
|
+
name?: string;
|
|
2016
|
+
|
|
2017
|
+
seat_config?: Subscription.SeatConfig;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
export namespace Subscription {
|
|
2021
|
+
/**
|
|
2022
|
+
* Previous, current, and next billing periods for the subscription.
|
|
2023
|
+
*/
|
|
2024
|
+
export interface BillingPeriods {
|
|
2025
|
+
current?: BillingPeriods.Current;
|
|
2026
|
+
|
|
2027
|
+
next?: BillingPeriods.Next;
|
|
2028
|
+
|
|
2029
|
+
previous?: BillingPeriods.Previous;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
export namespace BillingPeriods {
|
|
2033
|
+
export interface Current {
|
|
2034
|
+
ending_before: string;
|
|
2035
|
+
|
|
2036
|
+
starting_at: string;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
export interface Next {
|
|
2040
|
+
ending_before: string;
|
|
2041
|
+
|
|
2042
|
+
starting_at: string;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
export interface Previous {
|
|
2046
|
+
ending_before: string;
|
|
2047
|
+
|
|
2048
|
+
starting_at: string;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
export interface Proration {
|
|
2053
|
+
invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
2054
|
+
|
|
2055
|
+
is_prorated: boolean;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
export interface QuantitySchedule {
|
|
2059
|
+
quantity: number;
|
|
2060
|
+
|
|
2061
|
+
starting_at: string;
|
|
2062
|
+
|
|
2063
|
+
ending_before?: string;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
export interface SubscriptionRate {
|
|
2067
|
+
billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
2068
|
+
|
|
2069
|
+
product: SubscriptionRate.Product;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
export namespace SubscriptionRate {
|
|
2073
|
+
export interface Product {
|
|
2074
|
+
id: string;
|
|
2075
|
+
|
|
2076
|
+
name: string;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
export interface SeatConfig {
|
|
2081
|
+
/**
|
|
2082
|
+
* The property name, sent on usage events, that identifies the seat ID associated
|
|
2083
|
+
* with the usage event. For example, the property name might be seat_id or
|
|
2084
|
+
* user_id. The property must be set as a group key on billable metrics and a
|
|
2085
|
+
* presentation/pricing group key on contract products. This allows linked
|
|
2086
|
+
* recurring credits with an allocation per seat to be consumed by only one seat's
|
|
2087
|
+
* usage.
|
|
2088
|
+
*/
|
|
2089
|
+
seat_group_key: string;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
1858
2092
|
}
|
|
1859
2093
|
|
|
1860
2094
|
export interface ContractWithoutAmendments {
|
|
@@ -1932,6 +2166,11 @@ export interface ContractWithoutAmendments {
|
|
|
1932
2166
|
|
|
1933
2167
|
spend_threshold_configuration?: SpendThresholdConfiguration;
|
|
1934
2168
|
|
|
2169
|
+
/**
|
|
2170
|
+
* Spend trackers attached to this contract.
|
|
2171
|
+
*/
|
|
2172
|
+
spend_trackers?: Array<ContractWithoutAmendments.SpendTracker>;
|
|
2173
|
+
|
|
1935
2174
|
/**
|
|
1936
2175
|
* This field's availability is dependent on your client's configuration.
|
|
1937
2176
|
*/
|
|
@@ -2270,6 +2509,39 @@ export namespace ContractWithoutAmendments {
|
|
|
2270
2509
|
reseller_contract_value?: number;
|
|
2271
2510
|
}
|
|
2272
2511
|
|
|
2512
|
+
export interface SpendTracker {
|
|
2513
|
+
/**
|
|
2514
|
+
* Human-readable identifier, unique per contract.
|
|
2515
|
+
*/
|
|
2516
|
+
alias: string;
|
|
2517
|
+
|
|
2518
|
+
applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
|
|
2519
|
+
|
|
2520
|
+
credit_type_id: string;
|
|
2521
|
+
|
|
2522
|
+
reset_frequency: 'BILLING_PERIOD';
|
|
2523
|
+
|
|
2524
|
+
accumulated_spend?: SpendTracker.AccumulatedSpend;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
export namespace SpendTracker {
|
|
2528
|
+
export interface ApplicableSpendSpecifier {
|
|
2529
|
+
sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
|
|
2530
|
+
|
|
2531
|
+
spend_type: 'COMMIT_PURCHASE';
|
|
2532
|
+
|
|
2533
|
+
discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
export interface AccumulatedSpend {
|
|
2537
|
+
amount: number;
|
|
2538
|
+
|
|
2539
|
+
period_ending_before: string;
|
|
2540
|
+
|
|
2541
|
+
period_starting_at: string;
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2273
2545
|
export interface UsageFilter {
|
|
2274
2546
|
current: Shared.BaseUsageFilter | null;
|
|
2275
2547
|
|
|
@@ -2949,6 +3221,8 @@ export interface PrepaidBalanceThresholdConfiguration {
|
|
|
2949
3221
|
custom_credit_type_id?: string;
|
|
2950
3222
|
|
|
2951
3223
|
discount_configuration?: PrepaidBalanceThresholdConfiguration.DiscountConfiguration;
|
|
3224
|
+
|
|
3225
|
+
threshold_balance_specifiers?: Array<PrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier>;
|
|
2952
3226
|
}
|
|
2953
3227
|
|
|
2954
3228
|
export namespace PrepaidBalanceThresholdConfiguration {
|
|
@@ -2983,6 +3257,54 @@ export namespace PrepaidBalanceThresholdConfiguration {
|
|
|
2983
3257
|
* (a 15% discount).
|
|
2984
3258
|
*/
|
|
2985
3259
|
payment_fraction: number;
|
|
3260
|
+
|
|
3261
|
+
/**
|
|
3262
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3263
|
+
* this much spend in the billing period.
|
|
3264
|
+
*/
|
|
3265
|
+
cap?: DiscountConfiguration.Cap;
|
|
3266
|
+
}
|
|
3267
|
+
|
|
3268
|
+
export namespace DiscountConfiguration {
|
|
3269
|
+
/**
|
|
3270
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3271
|
+
* this much spend in the billing period.
|
|
3272
|
+
*/
|
|
3273
|
+
export interface Cap {
|
|
3274
|
+
/**
|
|
3275
|
+
* Accumulated spend ceiling above which the discount stops applying.
|
|
3276
|
+
*/
|
|
3277
|
+
amount: number;
|
|
3278
|
+
|
|
3279
|
+
/**
|
|
3280
|
+
* Alias of the spend tracker this cap is measured against.
|
|
3281
|
+
*/
|
|
3282
|
+
spend_tracker_alias: string;
|
|
3283
|
+
}
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
export interface ThresholdBalanceSpecifier {
|
|
3287
|
+
exclude: Array<ThresholdBalanceSpecifier.Exclude>;
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
export namespace ThresholdBalanceSpecifier {
|
|
3291
|
+
export interface Exclude {
|
|
3292
|
+
/**
|
|
3293
|
+
* If provided, balances with all the custom fields will not be considered when
|
|
3294
|
+
* evaluating threshold billing
|
|
3295
|
+
*/
|
|
3296
|
+
custom_field_filters: Array<Exclude.CustomFieldFilter>;
|
|
3297
|
+
}
|
|
3298
|
+
|
|
3299
|
+
export namespace Exclude {
|
|
3300
|
+
export interface CustomFieldFilter {
|
|
3301
|
+
entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
3302
|
+
|
|
3303
|
+
key: string;
|
|
3304
|
+
|
|
3305
|
+
value: string;
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
2986
3308
|
}
|
|
2987
3309
|
}
|
|
2988
3310
|
|
|
@@ -3016,6 +3338,8 @@ export interface PrepaidBalanceThresholdConfigurationV2 {
|
|
|
3016
3338
|
custom_credit_type_id?: string;
|
|
3017
3339
|
|
|
3018
3340
|
discount_configuration?: PrepaidBalanceThresholdConfigurationV2.DiscountConfiguration;
|
|
3341
|
+
|
|
3342
|
+
threshold_balance_specifiers?: Array<PrepaidBalanceThresholdConfigurationV2.ThresholdBalanceSpecifier>;
|
|
3019
3343
|
}
|
|
3020
3344
|
|
|
3021
3345
|
export namespace PrepaidBalanceThresholdConfigurationV2 {
|
|
@@ -3052,6 +3376,50 @@ export namespace PrepaidBalanceThresholdConfigurationV2 {
|
|
|
3052
3376
|
* (a 15% discount).
|
|
3053
3377
|
*/
|
|
3054
3378
|
payment_fraction: number;
|
|
3379
|
+
|
|
3380
|
+
/**
|
|
3381
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3382
|
+
* this much spend in the billing period.
|
|
3383
|
+
*/
|
|
3384
|
+
cap?: DiscountConfiguration.Cap;
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
export namespace DiscountConfiguration {
|
|
3388
|
+
/**
|
|
3389
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3390
|
+
* this much spend in the billing period.
|
|
3391
|
+
*/
|
|
3392
|
+
export interface Cap {
|
|
3393
|
+
/**
|
|
3394
|
+
* Accumulated spend ceiling above which the discount stops applying.
|
|
3395
|
+
*/
|
|
3396
|
+
amount: number;
|
|
3397
|
+
|
|
3398
|
+
/**
|
|
3399
|
+
* Alias of the spend tracker this cap is measured against.
|
|
3400
|
+
*/
|
|
3401
|
+
spend_tracker_alias: string;
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
export interface ThresholdBalanceSpecifier {
|
|
3406
|
+
exclude: Array<ThresholdBalanceSpecifier.Exclude>;
|
|
3407
|
+
}
|
|
3408
|
+
|
|
3409
|
+
export namespace ThresholdBalanceSpecifier {
|
|
3410
|
+
export interface Exclude {
|
|
3411
|
+
custom_field_filters: Array<Exclude.CustomFieldFilter>;
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
export namespace Exclude {
|
|
3415
|
+
export interface CustomFieldFilter {
|
|
3416
|
+
entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
3417
|
+
|
|
3418
|
+
key: string;
|
|
3419
|
+
|
|
3420
|
+
value: string;
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3055
3423
|
}
|
|
3056
3424
|
}
|
|
3057
3425
|
|
|
@@ -3286,6 +3654,30 @@ export namespace SpendThresholdConfiguration {
|
|
|
3286
3654
|
* (a 15% discount).
|
|
3287
3655
|
*/
|
|
3288
3656
|
payment_fraction: number;
|
|
3657
|
+
|
|
3658
|
+
/**
|
|
3659
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3660
|
+
* this much spend in the billing period.
|
|
3661
|
+
*/
|
|
3662
|
+
cap?: DiscountConfiguration.Cap;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
export namespace DiscountConfiguration {
|
|
3666
|
+
/**
|
|
3667
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3668
|
+
* this much spend in the billing period.
|
|
3669
|
+
*/
|
|
3670
|
+
export interface Cap {
|
|
3671
|
+
/**
|
|
3672
|
+
* Accumulated spend ceiling above which the discount stops applying.
|
|
3673
|
+
*/
|
|
3674
|
+
amount: number;
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* Alias of the spend tracker this cap is measured against.
|
|
3678
|
+
*/
|
|
3679
|
+
spend_tracker_alias: string;
|
|
3680
|
+
}
|
|
3289
3681
|
}
|
|
3290
3682
|
}
|
|
3291
3683
|
|
|
@@ -3318,6 +3710,30 @@ export namespace SpendThresholdConfigurationV2 {
|
|
|
3318
3710
|
* (a 15% discount).
|
|
3319
3711
|
*/
|
|
3320
3712
|
payment_fraction: number;
|
|
3713
|
+
|
|
3714
|
+
/**
|
|
3715
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3716
|
+
* this much spend in the billing period.
|
|
3717
|
+
*/
|
|
3718
|
+
cap?: DiscountConfiguration.Cap;
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
export namespace DiscountConfiguration {
|
|
3722
|
+
/**
|
|
3723
|
+
* If provided, the discount stops applying once the spend tracker has accumulated
|
|
3724
|
+
* this much spend in the billing period.
|
|
3725
|
+
*/
|
|
3726
|
+
export interface Cap {
|
|
3727
|
+
/**
|
|
3728
|
+
* Accumulated spend ceiling above which the discount stops applying.
|
|
3729
|
+
*/
|
|
3730
|
+
amount: number;
|
|
3731
|
+
|
|
3732
|
+
/**
|
|
3733
|
+
* Alias of the spend tracker this cap is measured against.
|
|
3734
|
+
*/
|
|
3735
|
+
spend_tracker_alias: string;
|
|
3736
|
+
}
|
|
3321
3737
|
}
|
|
3322
3738
|
}
|
|
3323
3739
|
|
|
@@ -229,7 +229,7 @@ export interface AlertCreateParams {
|
|
|
229
229
|
|
|
230
230
|
export namespace AlertCreateParams {
|
|
231
231
|
export interface CustomFieldFilter {
|
|
232
|
-
entity: 'Contract' | 'Commit' | 'ContractCredit';
|
|
232
|
+
entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
|
|
233
233
|
|
|
234
234
|
key: string;
|
|
235
235
|
|