@metronome/sdk 3.6.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 +22 -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/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- 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 +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- 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.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 +226 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +226 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.mts.map +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 +406 -1
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +406 -1
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.mts.map +1 -1
- package/resources/v1/contracts/index.d.ts.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.map +1 -1
- 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.map +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.map +1 -1
- 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 +0 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +0 -1
- 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 -4
- package/resources/v1/packages.d.mts.map +1 -1
- package/resources/v1/packages.d.ts +57 -4
- 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 +0 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +0 -4
- 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 +1337 -1
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +1337 -1
- 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/resources/shared.ts +290 -0
- package/src/resources/v1/contracts/contracts.ts +530 -1
- package/src/resources/v1/index.ts +0 -11
- package/src/resources/v1/packages.ts +81 -4
- package/src/resources/v1/v1.ts +0 -26
- package/src/resources/v2/contracts.ts +1756 -1
- 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,6 +812,11 @@ 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
|
*/
|
|
@@ -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 {
|
|
@@ -1858,6 +1933,39 @@ export namespace ContractV2 {
|
|
|
1858
1933
|
}
|
|
1859
1934
|
}
|
|
1860
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
|
+
|
|
1861
1969
|
export interface Subscription {
|
|
1862
1970
|
/**
|
|
1863
1971
|
* Previous, current, and next billing periods for the subscription.
|
|
@@ -2058,6 +2166,11 @@ export interface ContractWithoutAmendments {
|
|
|
2058
2166
|
|
|
2059
2167
|
spend_threshold_configuration?: SpendThresholdConfiguration;
|
|
2060
2168
|
|
|
2169
|
+
/**
|
|
2170
|
+
* Spend trackers attached to this contract.
|
|
2171
|
+
*/
|
|
2172
|
+
spend_trackers?: Array<ContractWithoutAmendments.SpendTracker>;
|
|
2173
|
+
|
|
2061
2174
|
/**
|
|
2062
2175
|
* This field's availability is dependent on your client's configuration.
|
|
2063
2176
|
*/
|
|
@@ -2396,6 +2509,39 @@ export namespace ContractWithoutAmendments {
|
|
|
2396
2509
|
reseller_contract_value?: number;
|
|
2397
2510
|
}
|
|
2398
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
|
+
|
|
2399
2545
|
export interface UsageFilter {
|
|
2400
2546
|
current: Shared.BaseUsageFilter | null;
|
|
2401
2547
|
|
|
@@ -3075,6 +3221,8 @@ export interface PrepaidBalanceThresholdConfiguration {
|
|
|
3075
3221
|
custom_credit_type_id?: string;
|
|
3076
3222
|
|
|
3077
3223
|
discount_configuration?: PrepaidBalanceThresholdConfiguration.DiscountConfiguration;
|
|
3224
|
+
|
|
3225
|
+
threshold_balance_specifiers?: Array<PrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier>;
|
|
3078
3226
|
}
|
|
3079
3227
|
|
|
3080
3228
|
export namespace PrepaidBalanceThresholdConfiguration {
|
|
@@ -3109,6 +3257,54 @@ export namespace PrepaidBalanceThresholdConfiguration {
|
|
|
3109
3257
|
* (a 15% discount).
|
|
3110
3258
|
*/
|
|
3111
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
|
+
}
|
|
3112
3308
|
}
|
|
3113
3309
|
}
|
|
3114
3310
|
|
|
@@ -3142,6 +3338,8 @@ export interface PrepaidBalanceThresholdConfigurationV2 {
|
|
|
3142
3338
|
custom_credit_type_id?: string;
|
|
3143
3339
|
|
|
3144
3340
|
discount_configuration?: PrepaidBalanceThresholdConfigurationV2.DiscountConfiguration;
|
|
3341
|
+
|
|
3342
|
+
threshold_balance_specifiers?: Array<PrepaidBalanceThresholdConfigurationV2.ThresholdBalanceSpecifier>;
|
|
3145
3343
|
}
|
|
3146
3344
|
|
|
3147
3345
|
export namespace PrepaidBalanceThresholdConfigurationV2 {
|
|
@@ -3178,6 +3376,50 @@ export namespace PrepaidBalanceThresholdConfigurationV2 {
|
|
|
3178
3376
|
* (a 15% discount).
|
|
3179
3377
|
*/
|
|
3180
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
|
+
}
|
|
3181
3423
|
}
|
|
3182
3424
|
}
|
|
3183
3425
|
|
|
@@ -3412,6 +3654,30 @@ export namespace SpendThresholdConfiguration {
|
|
|
3412
3654
|
* (a 15% discount).
|
|
3413
3655
|
*/
|
|
3414
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
|
+
}
|
|
3415
3681
|
}
|
|
3416
3682
|
}
|
|
3417
3683
|
|
|
@@ -3444,6 +3710,30 @@ export namespace SpendThresholdConfigurationV2 {
|
|
|
3444
3710
|
* (a 15% discount).
|
|
3445
3711
|
*/
|
|
3446
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
|
+
}
|
|
3447
3737
|
}
|
|
3448
3738
|
}
|
|
3449
3739
|
|