@metronome/sdk 2.2.0 → 3.0.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE +1 -1
  3. package/README.md +26 -4
  4. package/package.json +1 -1
  5. package/resources/shared.d.mts +62 -6
  6. package/resources/shared.d.mts.map +1 -1
  7. package/resources/shared.d.ts +62 -6
  8. package/resources/shared.d.ts.map +1 -1
  9. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +1 -1
  10. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +1 -1
  11. package/resources/v1/contracts/rate-cards/rates.d.mts +0 -18
  12. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  13. package/resources/v1/contracts/rate-cards/rates.d.ts +0 -18
  14. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  15. package/resources/v1/custom-fields.d.mts +6 -6
  16. package/resources/v1/custom-fields.d.mts.map +1 -1
  17. package/resources/v1/custom-fields.d.ts +6 -6
  18. package/resources/v1/custom-fields.d.ts.map +1 -1
  19. package/resources/v1/customers/billing-config.d.mts +5 -5
  20. package/resources/v1/customers/billing-config.d.ts +5 -5
  21. package/resources/v1/customers/customers.d.mts +7 -7
  22. package/resources/v1/customers/customers.d.ts +7 -7
  23. package/resources/v1/customers/invoices.d.mts +18 -7
  24. package/resources/v1/customers/invoices.d.mts.map +1 -1
  25. package/resources/v1/customers/invoices.d.ts +18 -7
  26. package/resources/v1/customers/invoices.d.ts.map +1 -1
  27. package/resources/v1/customers/plans.d.mts +5 -5
  28. package/resources/v1/customers/plans.d.ts +5 -5
  29. package/resources/v1/payments.d.mts +10 -0
  30. package/resources/v1/payments.d.mts.map +1 -1
  31. package/resources/v1/payments.d.ts +10 -0
  32. package/resources/v1/payments.d.ts.map +1 -1
  33. package/resources/v1/plans.d.mts +2 -2
  34. package/resources/v1/plans.d.ts +2 -2
  35. package/resources/v1/usage.d.mts +7 -7
  36. package/resources/v1/usage.d.ts +7 -7
  37. package/src/resources/shared.ts +76 -7
  38. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +1 -1
  39. package/src/resources/v1/contracts/rate-cards/rates.ts +0 -21
  40. package/src/resources/v1/custom-fields.ts +29 -5
  41. package/src/resources/v1/customers/billing-config.ts +5 -5
  42. package/src/resources/v1/customers/customers.ts +7 -7
  43. package/src/resources/v1/customers/invoices.ts +24 -7
  44. package/src/resources/v1/customers/plans.ts +5 -5
  45. package/src/resources/v1/payments.ts +15 -0
  46. package/src/resources/v1/plans.ts +2 -2
  47. package/src/resources/v1/usage.ts +7 -7
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -138,6 +138,12 @@ export interface Commit {
138
138
 
139
139
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
140
140
 
141
+ /**
142
+ * The ID of the recurring commit that this commit was generated from, if
143
+ * applicable.
144
+ */
145
+ recurring_commit_id?: string;
146
+
141
147
  rolled_over_from?: Commit.RolledOverFrom;
142
148
 
143
149
  rollover_fraction?: number;
@@ -154,6 +160,12 @@ export interface Commit {
154
160
  */
155
161
  specifiers?: Array<CommitSpecifier>;
156
162
 
163
+ /**
164
+ * The subscription configuration for this commit, if it was generated from a
165
+ * recurring commit with a subscription attached.
166
+ */
167
+ subscription_config?: Commit.SubscriptionConfig;
168
+
157
169
  /**
158
170
  * Prevents the creation of duplicates. If a request to create a commit or credit
159
171
  * is made with a uniqueness key that was previously used to create a commit or
@@ -344,6 +356,27 @@ export namespace Commit {
344
356
 
345
357
  contract_id: string;
346
358
  }
359
+
360
+ /**
361
+ * The subscription configuration for this commit, if it was generated from a
362
+ * recurring commit with a subscription attached.
363
+ */
364
+ export interface SubscriptionConfig {
365
+ allocation?: 'INDIVIDUAL' | 'POOLED';
366
+
367
+ apply_seat_increase_config?: SubscriptionConfig.ApplySeatIncreaseConfig;
368
+
369
+ subscription_id?: string;
370
+ }
371
+
372
+ export namespace SubscriptionConfig {
373
+ export interface ApplySeatIncreaseConfig {
374
+ /**
375
+ * Indicates whether a mid-period seat increase should be prorated.
376
+ */
377
+ is_prorated: boolean;
378
+ }
379
+ }
347
380
  }
348
381
 
349
382
  export interface CommitHierarchyConfiguration {
@@ -808,6 +841,11 @@ export namespace ContractV2 {
808
841
 
809
842
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
810
843
 
844
+ /**
845
+ * The ID of the recurring commit that created this commit
846
+ */
847
+ recurring_commit_id?: string;
848
+
811
849
  rolled_over_from?: Commit.RolledOverFrom;
812
850
 
813
851
  rollover_fraction?: number;
@@ -1217,6 +1255,11 @@ export namespace ContractV2 {
1217
1255
  */
1218
1256
  priority?: number;
1219
1257
 
1258
+ /**
1259
+ * The ID of the recurring credit that created this credit
1260
+ */
1261
+ recurring_credit_id?: string;
1262
+
1220
1263
  /**
1221
1264
  * This field's availability is dependent on your client's configuration.
1222
1265
  */
@@ -2265,6 +2308,12 @@ export interface Credit {
2265
2308
 
2266
2309
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
2267
2310
 
2311
+ /**
2312
+ * The ID of the recurring credit that this credit was generated from, if
2313
+ * applicable.
2314
+ */
2315
+ recurring_credit_id?: string;
2316
+
2268
2317
  /**
2269
2318
  * This field's availability is dependent on your client's configuration.
2270
2319
  */
@@ -2277,6 +2326,12 @@ export interface Credit {
2277
2326
  */
2278
2327
  specifiers?: Array<CommitSpecifier>;
2279
2328
 
2329
+ /**
2330
+ * The subscription configuration for this credit, if it was generated from a
2331
+ * recurring credit with a subscription attached.
2332
+ */
2333
+ subscription_config?: Credit.SubscriptionConfig;
2334
+
2280
2335
  /**
2281
2336
  * Prevents the creation of duplicates. If a request to create a commit or credit
2282
2337
  * is made with a uniqueness key that was previously used to create a commit or
@@ -2378,6 +2433,27 @@ export namespace Credit {
2378
2433
 
2379
2434
  type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
2380
2435
  }
2436
+
2437
+ /**
2438
+ * The subscription configuration for this credit, if it was generated from a
2439
+ * recurring credit with a subscription attached.
2440
+ */
2441
+ export interface SubscriptionConfig {
2442
+ allocation?: 'INDIVIDUAL' | 'POOLED';
2443
+
2444
+ apply_seat_increase_config?: SubscriptionConfig.ApplySeatIncreaseConfig;
2445
+
2446
+ subscription_id?: string;
2447
+ }
2448
+
2449
+ export namespace SubscriptionConfig {
2450
+ export interface ApplySeatIncreaseConfig {
2451
+ /**
2452
+ * Indicates whether a mid-period seat increase should be prorated.
2453
+ */
2454
+ is_prorated: boolean;
2455
+ }
2456
+ }
2381
2457
  }
2382
2458
 
2383
2459
  export interface CreditTypeData {
@@ -2987,13 +3063,6 @@ export interface Rate {
2987
3063
  * Only set for TIERED rate_type.
2988
3064
  */
2989
3065
  tiers?: Array<Tier>;
2990
-
2991
- /**
2992
- * Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
2993
- * using list prices rather than the standard rates for this product on the
2994
- * contract.
2995
- */
2996
- use_list_prices?: boolean;
2997
3066
  }
2998
3067
 
2999
3068
  export interface RecurringCommitSubscriptionConfig {
@@ -494,7 +494,7 @@ export namespace RateCardUpdateParams {
494
494
 
495
495
  export interface RateCardListParams extends CursorPageParams {
496
496
  /**
497
- * Body param:
497
+ * Body param
498
498
  */
499
499
  body?: unknown;
500
500
  }
@@ -196,13 +196,6 @@ export namespace RateAddResponse {
196
196
  * Only set for TIERED rate_type.
197
197
  */
198
198
  tiers?: Array<Shared.Tier>;
199
-
200
- /**
201
- * Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
202
- * using list prices rather than the standard rates for this product on the
203
- * contract.
204
- */
205
- use_list_prices?: boolean;
206
199
  }
207
200
  }
208
201
 
@@ -343,13 +336,6 @@ export interface RateAddParams {
343
336
  * Only set for TIERED rate_type.
344
337
  */
345
338
  tiers?: Array<Shared.Tier>;
346
-
347
- /**
348
- * Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
349
- * using list prices rather than the standard rates for this product on the
350
- * contract.
351
- */
352
- use_list_prices?: boolean;
353
339
  }
354
340
 
355
341
  export interface RateAddManyParams {
@@ -432,13 +418,6 @@ export namespace RateAddManyParams {
432
418
  * Only set for TIERED rate_type.
433
419
  */
434
420
  tiers?: Array<Shared.Tier>;
435
-
436
- /**
437
- * Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
438
- * using list prices rather than the standard rates for this product on the
439
- * contract.
440
- */
441
- use_list_prices?: boolean;
442
421
  }
443
422
  }
444
423
 
@@ -180,7 +180,11 @@ export interface CustomFieldListKeysResponse {
180
180
  | 'product'
181
181
  | 'rate_card'
182
182
  | 'scheduled_charge'
183
- | 'subscription';
183
+ | 'subscription'
184
+ | 'package_commit'
185
+ | 'package_credit'
186
+ | 'package_subscription'
187
+ | 'package_scheduled_charge';
184
188
 
185
189
  key: string;
186
190
  }
@@ -206,7 +210,11 @@ export interface CustomFieldAddKeyParams {
206
210
  | 'product'
207
211
  | 'rate_card'
208
212
  | 'scheduled_charge'
209
- | 'subscription';
213
+ | 'subscription'
214
+ | 'package_commit'
215
+ | 'package_credit'
216
+ | 'package_subscription'
217
+ | 'package_scheduled_charge';
210
218
 
211
219
  key: string;
212
220
  }
@@ -230,7 +238,11 @@ export interface CustomFieldDeleteValuesParams {
230
238
  | 'product'
231
239
  | 'rate_card'
232
240
  | 'scheduled_charge'
233
- | 'subscription';
241
+ | 'subscription'
242
+ | 'package_commit'
243
+ | 'package_credit'
244
+ | 'package_subscription'
245
+ | 'package_scheduled_charge';
234
246
 
235
247
  entity_id: string;
236
248
 
@@ -260,6 +272,10 @@ export interface CustomFieldListKeysParams extends CursorPageWithoutLimitParams
260
272
  | 'rate_card'
261
273
  | 'scheduled_charge'
262
274
  | 'subscription'
275
+ | 'package_commit'
276
+ | 'package_credit'
277
+ | 'package_subscription'
278
+ | 'package_scheduled_charge'
263
279
  >;
264
280
  }
265
281
 
@@ -282,7 +298,11 @@ export interface CustomFieldRemoveKeyParams {
282
298
  | 'product'
283
299
  | 'rate_card'
284
300
  | 'scheduled_charge'
285
- | 'subscription';
301
+ | 'subscription'
302
+ | 'package_commit'
303
+ | 'package_credit'
304
+ | 'package_subscription'
305
+ | 'package_scheduled_charge';
286
306
 
287
307
  key: string;
288
308
  }
@@ -311,7 +331,11 @@ export interface CustomFieldSetValuesParams {
311
331
  | 'product'
312
332
  | 'rate_card'
313
333
  | 'scheduled_charge'
314
- | 'subscription';
334
+ | 'subscription'
335
+ | 'package_commit'
336
+ | 'package_credit'
337
+ | 'package_subscription'
338
+ | 'package_scheduled_charge';
315
339
 
316
340
  entity_id: string;
317
341
  }
@@ -161,7 +161,7 @@ export namespace BillingConfigRetrieveResponse {
161
161
 
162
162
  export interface BillingConfigCreateParams {
163
163
  /**
164
- * Path param:
164
+ * Path param
165
165
  */
166
166
  customer_id: string;
167
167
 
@@ -186,22 +186,22 @@ export interface BillingConfigCreateParams {
186
186
  billing_provider_customer_id: string;
187
187
 
188
188
  /**
189
- * Body param:
189
+ * Body param
190
190
  */
191
191
  aws_customer_account_id?: string;
192
192
 
193
193
  /**
194
- * Body param:
194
+ * Body param
195
195
  */
196
196
  aws_customer_id?: string;
197
197
 
198
198
  /**
199
- * Body param:
199
+ * Body param
200
200
  */
201
201
  aws_product_code?: string;
202
202
 
203
203
  /**
204
- * Body param:
204
+ * Body param
205
205
  */
206
206
  aws_region?:
207
207
  | 'af-south-1'
@@ -1003,7 +1003,7 @@ export interface CustomerArchiveParams {
1003
1003
 
1004
1004
  export interface CustomerListBillableMetricsParams extends CursorPageParams {
1005
1005
  /**
1006
- * Path param:
1006
+ * Path param
1007
1007
  */
1008
1008
  customer_id: string;
1009
1009
 
@@ -1021,7 +1021,7 @@ export interface CustomerListBillableMetricsParams extends CursorPageParams {
1021
1021
 
1022
1022
  export interface CustomerListCostsParams extends CursorPageParams {
1023
1023
  /**
1024
- * Path param:
1024
+ * Path param
1025
1025
  */
1026
1026
  customer_id: string;
1027
1027
 
@@ -1038,7 +1038,7 @@ export interface CustomerListCostsParams extends CursorPageParams {
1038
1038
 
1039
1039
  export interface CustomerPreviewEventsParams {
1040
1040
  /**
1041
- * Path param:
1041
+ * Path param
1042
1042
  */
1043
1043
  customer_id: string;
1044
1044
 
@@ -1146,19 +1146,19 @@ export namespace CustomerSetBillingConfigurationsParams {
1146
1146
 
1147
1147
  export interface CustomerSetIngestAliasesParams {
1148
1148
  /**
1149
- * Path param:
1149
+ * Path param
1150
1150
  */
1151
1151
  customer_id: string;
1152
1152
 
1153
1153
  /**
1154
- * Body param:
1154
+ * Body param
1155
1155
  */
1156
1156
  ingest_aliases: Array<string>;
1157
1157
  }
1158
1158
 
1159
1159
  export interface CustomerSetNameParams {
1160
1160
  /**
1161
- * Path param:
1161
+ * Path param
1162
1162
  */
1163
1163
  customer_id: string;
1164
1164
 
@@ -1171,7 +1171,7 @@ export interface CustomerSetNameParams {
1171
1171
 
1172
1172
  export interface CustomerUpdateConfigParams {
1173
1173
  /**
1174
- * Path param:
1174
+ * Path param
1175
1175
  */
1176
1176
  customer_id: string;
1177
1177
 
@@ -367,6 +367,8 @@ export interface Invoice {
367
367
  */
368
368
  reseller_royalty?: Invoice.ResellerRoyalty;
369
369
 
370
+ revenue_system_invoices?: Array<Invoice.RevenueSystemInvoice> | null;
371
+
370
372
  /**
371
373
  * This field's availability is dependent on your client's configuration.
372
374
  */
@@ -943,6 +945,21 @@ export namespace Invoice {
943
945
  gcp_offer_id?: string;
944
946
  }
945
947
  }
948
+
949
+ export interface RevenueSystemInvoice {
950
+ revenue_system_external_entity_type: string;
951
+
952
+ revenue_system_provider: string;
953
+
954
+ sync_status: string;
955
+
956
+ /**
957
+ * The error message from the revenue system, if available.
958
+ */
959
+ error_message?: string;
960
+
961
+ revenue_system_external_entity_id?: string;
962
+ }
946
963
  }
947
964
 
948
965
  export interface InvoiceRetrieveResponse {
@@ -959,12 +976,12 @@ export interface InvoiceListBreakdownsResponse extends Invoice {
959
976
 
960
977
  export interface InvoiceRetrieveParams {
961
978
  /**
962
- * Path param:
979
+ * Path param
963
980
  */
964
981
  customer_id: string;
965
982
 
966
983
  /**
967
- * Path param:
984
+ * Path param
968
985
  */
969
986
  invoice_id: string;
970
987
 
@@ -977,7 +994,7 @@ export interface InvoiceRetrieveParams {
977
994
 
978
995
  export interface InvoiceListParams extends CursorPageParams {
979
996
  /**
980
- * Path param:
997
+ * Path param
981
998
  */
982
999
  customer_id: string;
983
1000
 
@@ -1018,7 +1035,7 @@ export interface InvoiceListParams extends CursorPageParams {
1018
1035
 
1019
1036
  export interface InvoiceAddChargeParams {
1020
1037
  /**
1021
- * Path param:
1038
+ * Path param
1022
1039
  */
1023
1040
  customer_id: string;
1024
1041
 
@@ -1035,7 +1052,7 @@ export interface InvoiceAddChargeParams {
1035
1052
  customer_plan_id: string;
1036
1053
 
1037
1054
  /**
1038
- * Body param:
1055
+ * Body param
1039
1056
  */
1040
1057
  description: string;
1041
1058
 
@@ -1051,14 +1068,14 @@ export interface InvoiceAddChargeParams {
1051
1068
  price: number;
1052
1069
 
1053
1070
  /**
1054
- * Body param:
1071
+ * Body param
1055
1072
  */
1056
1073
  quantity: number;
1057
1074
  }
1058
1075
 
1059
1076
  export interface InvoiceListBreakdownsParams extends CursorPageParams {
1060
1077
  /**
1061
- * Path param:
1078
+ * Path param
1062
1079
  */
1063
1080
  customer_id: string;
1064
1081
 
@@ -197,19 +197,19 @@ export namespace PlanListPriceAdjustmentsResponse {
197
197
 
198
198
  export interface PlanListParams extends CursorPageParams {
199
199
  /**
200
- * Path param:
200
+ * Path param
201
201
  */
202
202
  customer_id: string;
203
203
  }
204
204
 
205
205
  export interface PlanAddParams {
206
206
  /**
207
- * Path param:
207
+ * Path param
208
208
  */
209
209
  customer_id: string;
210
210
 
211
211
  /**
212
- * Body param:
212
+ * Body param
213
213
  */
214
214
  plan_id: string;
215
215
 
@@ -326,7 +326,7 @@ export namespace PlanAddParams {
326
326
 
327
327
  export interface PlanEndParams {
328
328
  /**
329
- * Path param:
329
+ * Path param
330
330
  */
331
331
  customer_id: string;
332
332
 
@@ -359,7 +359,7 @@ export interface PlanEndParams {
359
359
 
360
360
  export interface PlanListPriceAdjustmentsParams extends CursorPageParams {
361
361
  /**
362
- * Path param:
362
+ * Path param
363
363
  */
364
364
  customer_id: string;
365
365
 
@@ -95,6 +95,8 @@ export interface Payment {
95
95
 
96
96
  payment_gateway?: Payment.PaymentGateway;
97
97
 
98
+ revenue_system_payments?: Array<Payment.RevenueSystemPayment>;
99
+
98
100
  status?: PaymentStatus;
99
101
 
100
102
  updated_at?: string;
@@ -126,6 +128,19 @@ export namespace Payment {
126
128
  }
127
129
  }
128
130
  }
131
+
132
+ export interface RevenueSystemPayment {
133
+ revenue_system_provider: string;
134
+
135
+ sync_status: string;
136
+
137
+ /**
138
+ * The error message from the revenue system, if available.
139
+ */
140
+ error_message?: string;
141
+
142
+ revenue_system_external_payment_id?: string;
143
+ }
129
144
  }
130
145
 
131
146
  export type PaymentStatus = 'pending' | 'requires_intervention' | 'paid' | 'canceled';
@@ -306,14 +306,14 @@ export interface PlanGetDetailsParams {
306
306
 
307
307
  export interface PlanListChargesParams extends CursorPageParams {
308
308
  /**
309
- * Path param:
309
+ * Path param
310
310
  */
311
311
  plan_id: string;
312
312
  }
313
313
 
314
314
  export interface PlanListCustomersParams extends CursorPageParams {
315
315
  /**
316
- * Path param:
316
+ * Path param
317
317
  */
318
318
  plan_id: string;
319
319
 
@@ -451,12 +451,12 @@ export namespace UsageSearchResponse {
451
451
 
452
452
  export interface UsageListParams extends CursorPageWithoutLimitParams {
453
453
  /**
454
- * Body param:
454
+ * Body param
455
455
  */
456
456
  ending_before: string;
457
457
 
458
458
  /**
459
- * Body param:
459
+ * Body param
460
460
  */
461
461
  starting_on: string;
462
462
 
@@ -527,12 +527,12 @@ export namespace UsageIngestParams {
527
527
 
528
528
  export interface UsageListWithGroupsParams extends CursorPageParams {
529
529
  /**
530
- * Body param:
530
+ * Body param
531
531
  */
532
532
  billable_metric_id: string;
533
533
 
534
534
  /**
535
- * Body param:
535
+ * Body param
536
536
  */
537
537
  customer_id: string;
538
538
 
@@ -552,17 +552,17 @@ export interface UsageListWithGroupsParams extends CursorPageParams {
552
552
  current_period?: boolean;
553
553
 
554
554
  /**
555
- * Body param:
555
+ * Body param
556
556
  */
557
557
  ending_before?: string;
558
558
 
559
559
  /**
560
- * Body param:
560
+ * Body param
561
561
  */
562
562
  group_by?: UsageListWithGroupsParams.GroupBy;
563
563
 
564
564
  /**
565
- * Body param:
565
+ * Body param
566
566
  */
567
567
  starting_on?: string;
568
568
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.2.0'; // x-release-please-version
1
+ export const VERSION = '3.0.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.0";
1
+ export declare const VERSION = "3.0.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.0";
1
+ export declare const VERSION = "3.0.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.2.0'; // x-release-please-version
4
+ exports.VERSION = '3.0.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.2.0'; // x-release-please-version
1
+ export const VERSION = '3.0.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map