@metronome/sdk 3.4.1 → 3.6.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 +118 -0
- package/README.md +2 -2
- 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/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- 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/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/package.json +1 -1
- package/resources/shared.d.mts +176 -7
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +176 -7
- 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/contracts/contracts.d.mts +240 -166
- package/resources/v1/contracts/contracts.d.mts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +240 -166
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +54 -2
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +54 -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/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/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/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/index.d.mts +1 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/packages.d.mts +10 -10
- package/resources/v1/packages.d.mts.map +1 -1
- package/resources/v1/packages.d.ts +10 -10
- package/resources/v1/packages.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.mts +163 -13
- package/resources/v2/contracts.d.mts.map +1 -1
- package/resources/v2/contracts.d.ts +163 -13
- package/resources/v2/contracts.d.ts.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 +12 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/shared.ts +236 -7
- package/src/resources/v1/alerts.ts +1 -1
- package/src/resources/v1/contracts/contracts.ts +302 -183
- 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 -0
- package/src/resources/v1/packages.ts +14 -14
- package/src/resources/v1/v1.ts +4 -0
- package/src/resources/v2/contracts.ts +209 -15
- 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
|
@@ -217,6 +217,11 @@ export namespace PackageRetrieveResponse {
|
|
|
217
217
|
| 'gcp_marketplace'
|
|
218
218
|
| 'metronome';
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* The name to use for contracts created from this package.
|
|
222
|
+
*/
|
|
223
|
+
contract_name?: string;
|
|
224
|
+
|
|
220
225
|
credits?: Array<Data.Credit>;
|
|
221
226
|
|
|
222
227
|
delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
@@ -437,8 +442,6 @@ export namespace PackageRetrieveResponse {
|
|
|
437
442
|
product_tags?: Array<string>;
|
|
438
443
|
|
|
439
444
|
recurring_commit_template_ids?: Array<string>;
|
|
440
|
-
|
|
441
|
-
recurring_credit_template_ids?: Array<string>;
|
|
442
445
|
}
|
|
443
446
|
|
|
444
447
|
export interface StartingAtOffset {
|
|
@@ -513,6 +516,8 @@ export namespace PackageRetrieveResponse {
|
|
|
513
516
|
|
|
514
517
|
export interface UsageStatementSchedule {
|
|
515
518
|
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
519
|
+
|
|
520
|
+
day?: 'FIRST_OF_MONTH' | 'CONTRACT_START';
|
|
516
521
|
}
|
|
517
522
|
|
|
518
523
|
export interface Alias {
|
|
@@ -1039,6 +1044,11 @@ export interface PackageListResponse {
|
|
|
1039
1044
|
| 'gcp_marketplace'
|
|
1040
1045
|
| 'metronome';
|
|
1041
1046
|
|
|
1047
|
+
/**
|
|
1048
|
+
* The name to use for contracts created from this package.
|
|
1049
|
+
*/
|
|
1050
|
+
contract_name?: string;
|
|
1051
|
+
|
|
1042
1052
|
credits?: Array<PackageListResponse.Credit>;
|
|
1043
1053
|
|
|
1044
1054
|
delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
|
|
@@ -1259,8 +1269,6 @@ export namespace PackageListResponse {
|
|
|
1259
1269
|
product_tags?: Array<string>;
|
|
1260
1270
|
|
|
1261
1271
|
recurring_commit_template_ids?: Array<string>;
|
|
1262
|
-
|
|
1263
|
-
recurring_credit_template_ids?: Array<string>;
|
|
1264
1272
|
}
|
|
1265
1273
|
|
|
1266
1274
|
export interface StartingAtOffset {
|
|
@@ -1335,6 +1343,8 @@ export namespace PackageListResponse {
|
|
|
1335
1343
|
|
|
1336
1344
|
export interface UsageStatementSchedule {
|
|
1337
1345
|
frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1346
|
+
|
|
1347
|
+
day?: 'FIRST_OF_MONTH' | 'CONTRACT_START';
|
|
1338
1348
|
}
|
|
1339
1349
|
|
|
1340
1350
|
export interface Alias {
|
|
@@ -1856,8 +1866,6 @@ export interface PackageCreateParams {
|
|
|
1856
1866
|
*/
|
|
1857
1867
|
aliases?: Array<PackageCreateParams.Alias>;
|
|
1858
1868
|
|
|
1859
|
-
billing_anchor_date?: 'contract_start_date' | 'first_billing_period';
|
|
1860
|
-
|
|
1861
1869
|
billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite';
|
|
1862
1870
|
|
|
1863
1871
|
commits?: Array<PackageCreateParams.Commit>;
|
|
@@ -2332,14 +2340,6 @@ export namespace PackageCreateParams {
|
|
|
2332
2340
|
* commits created by the specified recurring commit ids.
|
|
2333
2341
|
*/
|
|
2334
2342
|
recurring_commit_ids?: Array<string>;
|
|
2335
|
-
|
|
2336
|
-
/**
|
|
2337
|
-
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2338
|
-
* one of `product_id`, `product_tags`, `pricing_group_values`, or
|
|
2339
|
-
* `presentation_group_values`. If provided, the override will only apply to
|
|
2340
|
-
* credits created by the specified recurring credit ids.
|
|
2341
|
-
*/
|
|
2342
|
-
recurring_credit_ids?: Array<string>;
|
|
2343
2343
|
}
|
|
2344
2344
|
|
|
2345
2345
|
/**
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -153,6 +153,8 @@ import {
|
|
|
153
153
|
ContractListBalancesResponsesBodyCursorPage,
|
|
154
154
|
ContractListParams,
|
|
155
155
|
ContractListResponse,
|
|
156
|
+
ContractListSeatBalancesParams,
|
|
157
|
+
ContractListSeatBalancesResponse,
|
|
156
158
|
ContractRetrieveParams,
|
|
157
159
|
ContractRetrieveRateScheduleParams,
|
|
158
160
|
ContractRetrieveRateScheduleResponse,
|
|
@@ -394,6 +396,7 @@ export declare namespace V1 {
|
|
|
394
396
|
type ContractCreateHistoricalInvoicesResponse as ContractCreateHistoricalInvoicesResponse,
|
|
395
397
|
type ContractGetNetBalanceResponse as ContractGetNetBalanceResponse,
|
|
396
398
|
type ContractListBalancesResponse as ContractListBalancesResponse,
|
|
399
|
+
type ContractListSeatBalancesResponse as ContractListSeatBalancesResponse,
|
|
397
400
|
type ContractRetrieveRateScheduleResponse as ContractRetrieveRateScheduleResponse,
|
|
398
401
|
type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
399
402
|
type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse,
|
|
@@ -408,6 +411,7 @@ export declare namespace V1 {
|
|
|
408
411
|
type ContractCreateHistoricalInvoicesParams as ContractCreateHistoricalInvoicesParams,
|
|
409
412
|
type ContractGetNetBalanceParams as ContractGetNetBalanceParams,
|
|
410
413
|
type ContractListBalancesParams as ContractListBalancesParams,
|
|
414
|
+
type ContractListSeatBalancesParams as ContractListSeatBalancesParams,
|
|
411
415
|
type ContractRetrieveRateScheduleParams as ContractRetrieveRateScheduleParams,
|
|
412
416
|
type ContractRetrieveSubscriptionQuantityHistoryParams as ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
413
417
|
type ContractScheduleProServicesInvoiceParams as ContractScheduleProServicesInvoiceParams,
|
|
@@ -289,7 +289,7 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
289
289
|
/**
|
|
290
290
|
* List of subscriptions on the contract.
|
|
291
291
|
*/
|
|
292
|
-
add_subscriptions?: Array<
|
|
292
|
+
add_subscriptions?: Array<Data.AddSubscription>;
|
|
293
293
|
|
|
294
294
|
add_usage_filters?: Array<Data.AddUsageFilter>;
|
|
295
295
|
|
|
@@ -479,6 +479,10 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
479
479
|
*/
|
|
480
480
|
priority?: number;
|
|
481
481
|
|
|
482
|
+
rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
|
|
483
|
+
|
|
484
|
+
rollover_fraction?: number;
|
|
485
|
+
|
|
482
486
|
/**
|
|
483
487
|
* This field's availability is dependent on your client's configuration.
|
|
484
488
|
*/
|
|
@@ -506,6 +510,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
506
510
|
export interface AddOverride {
|
|
507
511
|
id: string;
|
|
508
512
|
|
|
513
|
+
created_at: string;
|
|
514
|
+
|
|
509
515
|
starting_at: string;
|
|
510
516
|
|
|
511
517
|
applicable_product_tags?: Array<string>;
|
|
@@ -548,8 +554,6 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
548
554
|
product_tags?: Array<string>;
|
|
549
555
|
|
|
550
556
|
recurring_commit_ids?: Array<string>;
|
|
551
|
-
|
|
552
|
-
recurring_credit_ids?: Array<string>;
|
|
553
557
|
}
|
|
554
558
|
|
|
555
559
|
export interface OverwriteRate {
|
|
@@ -931,6 +935,130 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
931
935
|
}
|
|
932
936
|
}
|
|
933
937
|
|
|
938
|
+
export interface AddSubscription {
|
|
939
|
+
/**
|
|
940
|
+
* Previous, current, and next billing periods for the subscription.
|
|
941
|
+
*/
|
|
942
|
+
billing_periods: AddSubscription.BillingPeriods;
|
|
943
|
+
|
|
944
|
+
collection_schedule: 'ADVANCE' | 'ARREARS';
|
|
945
|
+
|
|
946
|
+
proration: AddSubscription.Proration;
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Determines how the subscription's quantity is controlled. Defaults to
|
|
950
|
+
* QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
|
|
951
|
+
* directly on the subscription. `initial_quantity` must be provided with this
|
|
952
|
+
* option. Compatible with recurring commits/credits that use POOLED allocation.
|
|
953
|
+
* **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
|
|
954
|
+
* user_123) to increment and decrement a subscription quantity, rather than
|
|
955
|
+
* directly providing the quantity. You must use a **SEAT_BASED** subscription to
|
|
956
|
+
* use a linked recurring credit with an allocation per seat. `seat_config` must be
|
|
957
|
+
* provided with this option.
|
|
958
|
+
*/
|
|
959
|
+
quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* List of quantity schedule items for the subscription. Only includes the current
|
|
963
|
+
* quantity and future quantity changes.
|
|
964
|
+
*/
|
|
965
|
+
quantity_schedule: Array<AddSubscription.QuantitySchedule>;
|
|
966
|
+
|
|
967
|
+
starting_at: string;
|
|
968
|
+
|
|
969
|
+
subscription_rate: AddSubscription.SubscriptionRate;
|
|
970
|
+
|
|
971
|
+
id?: string;
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
975
|
+
*/
|
|
976
|
+
custom_fields?: { [key: string]: string };
|
|
977
|
+
|
|
978
|
+
description?: string;
|
|
979
|
+
|
|
980
|
+
ending_before?: string;
|
|
981
|
+
|
|
982
|
+
fiat_credit_type_id?: string;
|
|
983
|
+
|
|
984
|
+
name?: string;
|
|
985
|
+
|
|
986
|
+
seat_config?: AddSubscription.SeatConfig;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export namespace AddSubscription {
|
|
990
|
+
/**
|
|
991
|
+
* Previous, current, and next billing periods for the subscription.
|
|
992
|
+
*/
|
|
993
|
+
export interface BillingPeriods {
|
|
994
|
+
current?: BillingPeriods.Current;
|
|
995
|
+
|
|
996
|
+
next?: BillingPeriods.Next;
|
|
997
|
+
|
|
998
|
+
previous?: BillingPeriods.Previous;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
export namespace BillingPeriods {
|
|
1002
|
+
export interface Current {
|
|
1003
|
+
ending_before: string;
|
|
1004
|
+
|
|
1005
|
+
starting_at: string;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export interface Next {
|
|
1009
|
+
ending_before: string;
|
|
1010
|
+
|
|
1011
|
+
starting_at: string;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
export interface Previous {
|
|
1015
|
+
ending_before: string;
|
|
1016
|
+
|
|
1017
|
+
starting_at: string;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
export interface Proration {
|
|
1022
|
+
invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
1023
|
+
|
|
1024
|
+
is_prorated: boolean;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
export interface QuantitySchedule {
|
|
1028
|
+
quantity: number;
|
|
1029
|
+
|
|
1030
|
+
starting_at: string;
|
|
1031
|
+
|
|
1032
|
+
ending_before?: string;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export interface SubscriptionRate {
|
|
1036
|
+
billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
|
|
1037
|
+
|
|
1038
|
+
product: SubscriptionRate.Product;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
export namespace SubscriptionRate {
|
|
1042
|
+
export interface Product {
|
|
1043
|
+
id: string;
|
|
1044
|
+
|
|
1045
|
+
name: string;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
export interface SeatConfig {
|
|
1050
|
+
/**
|
|
1051
|
+
* The property name, sent on usage events, that identifies the seat ID associated
|
|
1052
|
+
* with the usage event. For example, the property name might be seat_id or
|
|
1053
|
+
* user_id. The property must be set as a group key on billable metrics and a
|
|
1054
|
+
* presentation/pricing group key on contract products. This allows linked
|
|
1055
|
+
* recurring credits with an allocation per seat to be consumed by only one seat's
|
|
1056
|
+
* usage.
|
|
1057
|
+
*/
|
|
1058
|
+
seat_group_key: string;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
934
1062
|
export interface AddUsageFilter {
|
|
935
1063
|
group_key: string;
|
|
936
1064
|
|
|
@@ -1110,6 +1238,20 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1110
1238
|
|
|
1111
1239
|
access_schedule?: UpdateCredit.AccessSchedule;
|
|
1112
1240
|
|
|
1241
|
+
/**
|
|
1242
|
+
* Which products the credit applies to. If applicable_product_ids,
|
|
1243
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
1244
|
+
* all products.
|
|
1245
|
+
*/
|
|
1246
|
+
applicable_product_ids?: Array<string> | null;
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* Which tags the credit applies to. If applicable_product_ids,
|
|
1250
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
1251
|
+
* all products.
|
|
1252
|
+
*/
|
|
1253
|
+
applicable_product_tags?: Array<string> | null;
|
|
1254
|
+
|
|
1113
1255
|
description?: string;
|
|
1114
1256
|
|
|
1115
1257
|
/**
|
|
@@ -1127,12 +1269,24 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1127
1269
|
*/
|
|
1128
1270
|
priority?: number | null;
|
|
1129
1271
|
|
|
1272
|
+
product_id?: string;
|
|
1273
|
+
|
|
1130
1274
|
/**
|
|
1131
1275
|
* If set, the credit's rate type was updated to the specified value.
|
|
1132
1276
|
*/
|
|
1133
1277
|
rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
|
|
1134
1278
|
|
|
1135
1279
|
rollover_fraction?: number | null;
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* List of filters that determine what kind of customer usage draws down a commit
|
|
1283
|
+
* or credit. A customer's usage needs to meet the condition of at least one of the
|
|
1284
|
+
* specifiers to contribute to a commit's or credit's drawdown. This field cannot
|
|
1285
|
+
* be used together with `applicable_product_ids` or `applicable_product_tags`.
|
|
1286
|
+
* Instead, to target usage by product or product tag, pass those values in the
|
|
1287
|
+
* body of `specifiers`.
|
|
1288
|
+
*/
|
|
1289
|
+
specifiers?: Array<Shared.CommitSpecifierInput> | null;
|
|
1136
1290
|
}
|
|
1137
1291
|
|
|
1138
1292
|
export namespace UpdateCredit {
|
|
@@ -1310,6 +1464,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1310
1464
|
*/
|
|
1311
1465
|
custom_credit_type_id?: string | null;
|
|
1312
1466
|
|
|
1467
|
+
discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
|
|
1468
|
+
|
|
1313
1469
|
/**
|
|
1314
1470
|
* When set to false, the contract will not be evaluated against the
|
|
1315
1471
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -1356,6 +1512,15 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1356
1512
|
*/
|
|
1357
1513
|
specifiers?: Array<Shared.CommitSpecifierInput> | null;
|
|
1358
1514
|
}
|
|
1515
|
+
|
|
1516
|
+
export interface DiscountConfiguration {
|
|
1517
|
+
/**
|
|
1518
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
1519
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
1520
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
1521
|
+
*/
|
|
1522
|
+
payment_fraction?: number | null;
|
|
1523
|
+
}
|
|
1359
1524
|
}
|
|
1360
1525
|
|
|
1361
1526
|
export interface UpdateRecurringCommit {
|
|
@@ -1459,6 +1624,8 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1459
1624
|
export interface UpdateSpendThresholdConfiguration {
|
|
1460
1625
|
commit?: Shared.UpdateBaseThresholdCommit;
|
|
1461
1626
|
|
|
1627
|
+
discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
|
|
1628
|
+
|
|
1462
1629
|
/**
|
|
1463
1630
|
* When set to false, the contract will not be evaluated against the
|
|
1464
1631
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -1475,6 +1642,17 @@ export namespace ContractGetEditHistoryResponse {
|
|
|
1475
1642
|
threshold_amount?: number;
|
|
1476
1643
|
}
|
|
1477
1644
|
|
|
1645
|
+
export namespace UpdateSpendThresholdConfiguration {
|
|
1646
|
+
export interface DiscountConfiguration {
|
|
1647
|
+
/**
|
|
1648
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
1649
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
1650
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
1651
|
+
*/
|
|
1652
|
+
payment_fraction?: number | null;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1478
1656
|
export interface UpdateSubscription {
|
|
1479
1657
|
id: string;
|
|
1480
1658
|
|
|
@@ -2462,14 +2640,6 @@ export namespace ContractEditParams {
|
|
|
2462
2640
|
* created by the specified recurring commit ids.
|
|
2463
2641
|
*/
|
|
2464
2642
|
recurring_commit_ids?: Array<string>;
|
|
2465
|
-
|
|
2466
|
-
/**
|
|
2467
|
-
* Can only be used for commit specific overrides. Must be used in conjunction with
|
|
2468
|
-
* one of product_id, product_tags, pricing_group_values, or
|
|
2469
|
-
* presentation_group_values. If provided, the override will only apply to commits
|
|
2470
|
-
* created by the specified recurring credit ids.
|
|
2471
|
-
*/
|
|
2472
|
-
recurring_credit_ids?: Array<string>;
|
|
2473
2643
|
}
|
|
2474
2644
|
|
|
2475
2645
|
/**
|
|
@@ -3344,15 +3514,15 @@ export namespace ContractEditParams {
|
|
|
3344
3514
|
access_schedule?: UpdateCredit.AccessSchedule;
|
|
3345
3515
|
|
|
3346
3516
|
/**
|
|
3347
|
-
* Which products the
|
|
3348
|
-
* applicable_product_tags or specifiers are not provided, the
|
|
3517
|
+
* Which products the credit applies to. If applicable_product_ids,
|
|
3518
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
3349
3519
|
* all products.
|
|
3350
3520
|
*/
|
|
3351
3521
|
applicable_product_ids?: Array<string> | null;
|
|
3352
3522
|
|
|
3353
3523
|
/**
|
|
3354
|
-
* Which tags the
|
|
3355
|
-
* applicable_product_tags or specifiers are not provided, the
|
|
3524
|
+
* Which tags the credit applies to. If applicable_product_ids,
|
|
3525
|
+
* applicable_product_tags or specifiers are not provided, the credit applies to
|
|
3356
3526
|
* all products.
|
|
3357
3527
|
*/
|
|
3358
3528
|
applicable_product_tags?: Array<string> | null;
|
|
@@ -3425,6 +3595,8 @@ export namespace ContractEditParams {
|
|
|
3425
3595
|
*/
|
|
3426
3596
|
custom_credit_type_id?: string | null;
|
|
3427
3597
|
|
|
3598
|
+
discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
|
|
3599
|
+
|
|
3428
3600
|
/**
|
|
3429
3601
|
* When set to false, the contract will not be evaluated against the
|
|
3430
3602
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -3471,6 +3643,15 @@ export namespace ContractEditParams {
|
|
|
3471
3643
|
*/
|
|
3472
3644
|
specifiers?: Array<Shared.CommitSpecifierInput> | null;
|
|
3473
3645
|
}
|
|
3646
|
+
|
|
3647
|
+
export interface DiscountConfiguration {
|
|
3648
|
+
/**
|
|
3649
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
3650
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
3651
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
3652
|
+
*/
|
|
3653
|
+
payment_fraction?: number | null;
|
|
3654
|
+
}
|
|
3474
3655
|
}
|
|
3475
3656
|
|
|
3476
3657
|
export interface UpdateRecurringCommit {
|
|
@@ -3574,6 +3755,8 @@ export namespace ContractEditParams {
|
|
|
3574
3755
|
export interface UpdateSpendThresholdConfiguration {
|
|
3575
3756
|
commit?: Shared.UpdateBaseThresholdCommit;
|
|
3576
3757
|
|
|
3758
|
+
discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
|
|
3759
|
+
|
|
3577
3760
|
/**
|
|
3578
3761
|
* When set to false, the contract will not be evaluated against the
|
|
3579
3762
|
* threshold_amount. Toggling to true will result an immediate evaluation,
|
|
@@ -3590,6 +3773,17 @@ export namespace ContractEditParams {
|
|
|
3590
3773
|
threshold_amount?: number;
|
|
3591
3774
|
}
|
|
3592
3775
|
|
|
3776
|
+
export namespace UpdateSpendThresholdConfiguration {
|
|
3777
|
+
export interface DiscountConfiguration {
|
|
3778
|
+
/**
|
|
3779
|
+
* The fraction of the original amount that the customer pays after applying the
|
|
3780
|
+
* discount. Set to null to remove the discount fraction. For example, 0.85 means
|
|
3781
|
+
* the customer pays 85% of the original amount (a 15% discount).
|
|
3782
|
+
*/
|
|
3783
|
+
payment_fraction?: number | null;
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3593
3787
|
export interface UpdateSubscription {
|
|
3594
3788
|
subscription_id: string;
|
|
3595
3789
|
|
|
@@ -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.6.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.6.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.6.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '3.
|
|
1
|
+
export const VERSION = '3.6.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|