@metronome/sdk 3.7.0 → 3.9.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 (94) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +9 -1
  5. package/client.js.map +1 -1
  6. package/client.mjs +9 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/shared.d.mts +354 -20
  10. package/resources/shared.d.mts.map +1 -1
  11. package/resources/shared.d.ts +354 -20
  12. package/resources/shared.d.ts.map +1 -1
  13. package/resources/v1/alerts.d.mts +39 -0
  14. package/resources/v1/alerts.d.mts.map +1 -1
  15. package/resources/v1/alerts.d.ts +39 -0
  16. package/resources/v1/alerts.d.ts.map +1 -1
  17. package/resources/v1/contracts/contracts.d.mts +303 -20
  18. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  19. package/resources/v1/contracts/contracts.d.ts +303 -20
  20. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  21. package/resources/v1/contracts/contracts.js +43 -0
  22. package/resources/v1/contracts/contracts.js.map +1 -1
  23. package/resources/v1/contracts/contracts.mjs +43 -0
  24. package/resources/v1/contracts/contracts.mjs.map +1 -1
  25. package/resources/v1/contracts/index.d.mts +1 -1
  26. package/resources/v1/contracts/index.d.mts.map +1 -1
  27. package/resources/v1/contracts/index.d.ts +1 -1
  28. package/resources/v1/contracts/index.d.ts.map +1 -1
  29. package/resources/v1/contracts/index.js.map +1 -1
  30. package/resources/v1/contracts/index.mjs.map +1 -1
  31. package/resources/v1/contracts/rate-cards/rates.d.mts +4 -0
  32. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  33. package/resources/v1/contracts/rate-cards/rates.d.ts +4 -0
  34. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  35. package/resources/v1/contracts/rate-cards/rates.js +4 -0
  36. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  37. package/resources/v1/contracts/rate-cards/rates.mjs +4 -0
  38. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  39. package/resources/v1/customers/alerts.d.mts +79 -2
  40. package/resources/v1/customers/alerts.d.mts.map +1 -1
  41. package/resources/v1/customers/alerts.d.ts +79 -2
  42. package/resources/v1/customers/alerts.d.ts.map +1 -1
  43. package/resources/v1/customers/alerts.js +1 -1
  44. package/resources/v1/customers/alerts.mjs +1 -1
  45. package/resources/v1/customers/invoices.d.mts +5 -0
  46. package/resources/v1/customers/invoices.d.mts.map +1 -1
  47. package/resources/v1/customers/invoices.d.ts +5 -0
  48. package/resources/v1/customers/invoices.d.ts.map +1 -1
  49. package/resources/v1/dashboards.d.mts +8 -3
  50. package/resources/v1/dashboards.d.mts.map +1 -1
  51. package/resources/v1/dashboards.d.ts +8 -3
  52. package/resources/v1/dashboards.d.ts.map +1 -1
  53. package/resources/v1/dashboards.js +7 -2
  54. package/resources/v1/dashboards.js.map +1 -1
  55. package/resources/v1/dashboards.mjs +7 -2
  56. package/resources/v1/dashboards.mjs.map +1 -1
  57. package/resources/v1/index.d.mts +1 -1
  58. package/resources/v1/index.d.mts.map +1 -1
  59. package/resources/v1/index.d.ts +1 -1
  60. package/resources/v1/index.d.ts.map +1 -1
  61. package/resources/v1/index.js.map +1 -1
  62. package/resources/v1/index.mjs.map +1 -1
  63. package/resources/v1/packages.d.mts +240 -9
  64. package/resources/v1/packages.d.mts.map +1 -1
  65. package/resources/v1/packages.d.ts +240 -9
  66. package/resources/v1/packages.d.ts.map +1 -1
  67. package/resources/v1/v1.d.mts +2 -2
  68. package/resources/v1/v1.d.mts.map +1 -1
  69. package/resources/v1/v1.d.ts +2 -2
  70. package/resources/v1/v1.d.ts.map +1 -1
  71. package/resources/v1/v1.js.map +1 -1
  72. package/resources/v1/v1.mjs.map +1 -1
  73. package/resources/v2/contracts.d.mts +429 -8
  74. package/resources/v2/contracts.d.mts.map +1 -1
  75. package/resources/v2/contracts.d.ts +429 -8
  76. package/resources/v2/contracts.d.ts.map +1 -1
  77. package/src/client.ts +9 -1
  78. package/src/resources/shared.ts +422 -21
  79. package/src/resources/v1/alerts.ts +49 -0
  80. package/src/resources/v1/contracts/contracts.ts +356 -19
  81. package/src/resources/v1/contracts/index.ts +2 -0
  82. package/src/resources/v1/contracts/rate-cards/rates.ts +4 -0
  83. package/src/resources/v1/customers/alerts.ts +99 -2
  84. package/src/resources/v1/customers/invoices.ts +6 -0
  85. package/src/resources/v1/dashboards.ts +10 -3
  86. package/src/resources/v1/index.ts +2 -0
  87. package/src/resources/v1/packages.ts +291 -9
  88. package/src/resources/v1/v1.ts +4 -0
  89. package/src/resources/v2/contracts.ts +519 -8
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
@@ -50,11 +50,11 @@ export class Alerts extends APIResource {
50
50
  * - `null` - Notification has been archived
51
51
  * - `triggered_by`: Additional context about what caused the notification to
52
52
  * trigger (when applicable)
53
+ * - `updated_at`: Timestamp of when the `customer_status` was last updated
53
54
  * - alert: Complete threshold notification configuration including:
54
55
  * - Notification ID, name, and type
55
56
  * - Current threshold values and credit type information
56
57
  * - Notification status (enabled, disabled, or archived)
57
- * - Last update timestamp
58
58
  * - Any applied filters (credit grant types, custom fields, group values)
59
59
  *
60
60
  * ### Usage guidelines:
@@ -248,10 +248,17 @@ export namespace CustomerAlert {
248
248
  | 'invoice_total_reached';
249
249
 
250
250
  /**
251
- * Timestamp for when the threshold notification was last updated
251
+ * Timestamp for when the threshold notification's customer status was last updated
252
252
  */
253
253
  updated_at: string;
254
254
 
255
+ /**
256
+ * Present for `low_remaining_contract_credit_and_commit_balance_reached`
257
+ * notifications. The filters that define the balances that are considered when
258
+ * evaluating the alert.
259
+ */
260
+ alert_specifiers?: Array<Alert.AlertSpecifier>;
261
+
255
262
  /**
256
263
  * An array of strings, representing a way to filter the credit grant this
257
264
  * threshold notification applies to, by looking at the credit_grant_type field on
@@ -301,6 +308,48 @@ export namespace CustomerAlert {
301
308
  }
302
309
 
303
310
  export namespace Alert {
311
+ export interface AlertSpecifier {
312
+ /**
313
+ * A list of custom field filters for notification types that support advanced
314
+ * filtering
315
+ */
316
+ custom_field_filters?: Array<AlertSpecifier.CustomFieldFilter>;
317
+
318
+ /**
319
+ * If provided, the specifier will not apply to balances that matches the inclusion
320
+ * criteria and any of the excluding values.
321
+ */
322
+ exclude?: Array<AlertSpecifier.Exclude>;
323
+ }
324
+
325
+ export namespace AlertSpecifier {
326
+ export interface CustomFieldFilter {
327
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
328
+
329
+ key: string;
330
+
331
+ value?: string;
332
+ }
333
+
334
+ export interface Exclude {
335
+ /**
336
+ * A list of custom field filters for notification types that support advanced
337
+ * filtering
338
+ */
339
+ custom_field_filters?: Array<Exclude.CustomFieldFilter>;
340
+ }
341
+
342
+ export namespace Exclude {
343
+ export interface CustomFieldFilter {
344
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
345
+
346
+ key: string;
347
+
348
+ value: string;
349
+ }
350
+ }
351
+ }
352
+
304
353
  export interface CustomFieldFilter {
305
354
  entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
306
355
 
@@ -358,6 +407,12 @@ export interface AlertRetrieveParams {
358
407
  */
359
408
  customer_id: string;
360
409
 
410
+ /**
411
+ * Can be used with only `low_remaining_contract_credit_and_commit_balance_reached`
412
+ * notifications. Used to filter the alert by the custom field key-value pair.
413
+ */
414
+ alert_specifiers?: Array<AlertRetrieveParams.AlertSpecifier>;
415
+
361
416
  /**
362
417
  * Only present for `spend_threshold_reached` notifications. Retrieve the
363
418
  * notification for a specific group key-value pair.
@@ -378,6 +433,48 @@ export interface AlertRetrieveParams {
378
433
  }
379
434
 
380
435
  export namespace AlertRetrieveParams {
436
+ export interface AlertSpecifier {
437
+ /**
438
+ * A list of custom field filters for notification types that support advanced
439
+ * filtering
440
+ */
441
+ custom_field_filters: Array<AlertSpecifier.CustomFieldFilter>;
442
+
443
+ /**
444
+ * If provided, the specifier will not apply to balances that matches the inclusion
445
+ * criteria and any of the excluding values.
446
+ */
447
+ exclude?: Array<AlertSpecifier.Exclude>;
448
+ }
449
+
450
+ export namespace AlertSpecifier {
451
+ export interface CustomFieldFilter {
452
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
453
+
454
+ key: string;
455
+
456
+ value: string;
457
+ }
458
+
459
+ export interface Exclude {
460
+ /**
461
+ * A list of custom field filters for notification types that support advanced
462
+ * filtering
463
+ */
464
+ custom_field_filters?: Array<Exclude.CustomFieldFilter>;
465
+ }
466
+
467
+ export namespace Exclude {
468
+ export interface CustomFieldFilter {
469
+ entity: 'Contract' | 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
470
+
471
+ key: string;
472
+
473
+ value: string;
474
+ }
475
+ }
476
+ }
477
+
381
478
  /**
382
479
  * Scopes threshold notification evaluation to a specific presentation group key on
383
480
  * individual line items. Only present for spend notifications.
@@ -1052,6 +1052,12 @@ export interface InvoiceListParams extends CursorPageParams {
1052
1052
  * Query param: Filter invoices by type. Defaults to returning all invoice types.
1053
1053
  */
1054
1054
  type?: 'USAGE' | 'USAGE_CONSOLIDATED' | 'SCHEDULED';
1055
+
1056
+ /**
1057
+ * Query param: Indicates that this API request was triggered by a webhook
1058
+ * notification with the provided ID.
1059
+ */
1060
+ webhook_notification_id?: string;
1055
1061
  }
1056
1062
 
1057
1063
  export interface InvoiceAddChargeParams {
@@ -31,8 +31,13 @@ export class Dashboards extends APIResource {
31
31
  *
32
32
  * - Dashboard types: Choose from `invoices`, `usage`, or `commits_and_credits`
33
33
  * - Customization options:
34
- * - `dashboard_options`: Configure whether you want invoices to show zero usage
35
- * line items
34
+ * - `dashboard_options`: Configure dashboard behavior. For the invoices
35
+ * dashboard, supported keys include: `show_zero_usage_line_items`
36
+ * ("true"/"false"), `hide_voided_invoices` ("true"/"false"), `contract_id`
37
+ * (UUID, filters invoices by contract), `invoice_type` ("USAGE" or
38
+ * "SCHEDULED", filters by invoice type), `invoice_status_filter` ("VOID",
39
+ * "FINALIZED", "DRAFT", "FINALIZED_AND_DRAFT", or "ALL"), and
40
+ * `billable_status_filter` ("BILLABLE", "UNBILLABLE", or "ALL")
36
41
  * - `color_overrides`: Match your brand's color palette
37
42
  * - `bm_group_key_overrides`: Customize how dimensions are displayed (for the
38
43
  * usage embeddable dashboard)
@@ -151,7 +156,9 @@ export namespace DashboardGetEmbeddableURLParams {
151
156
  | 'Primary_green'
152
157
  | 'Primary_red'
153
158
  | 'Progress_bar'
154
- | 'Progress_bar_background';
159
+ | 'Progress_bar_background'
160
+ | 'Action'
161
+ | 'Action_hover';
155
162
 
156
163
  /**
157
164
  * Hex value representation of the color
@@ -34,6 +34,7 @@ export {
34
34
  type ContractArchiveResponse,
35
35
  type ContractCreateHistoricalInvoicesResponse,
36
36
  type ContractGetNetBalanceResponse,
37
+ type ContractGetSubscriptionSeatsHistoryResponse,
37
38
  type ContractListBalancesResponse,
38
39
  type ContractListSeatBalancesResponse,
39
40
  type ContractRetrieveRateScheduleResponse,
@@ -48,6 +49,7 @@ export {
48
49
  type ContractArchiveParams,
49
50
  type ContractCreateHistoricalInvoicesParams,
50
51
  type ContractGetNetBalanceParams,
52
+ type ContractGetSubscriptionSeatsHistoryParams,
51
53
  type ContractListBalancesParams,
52
54
  type ContractListSeatBalancesParams,
53
55
  type ContractRetrieveRateScheduleParams,