@metronome/sdk 1.0.0 → 2.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 (111) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/bin/cli +5 -12
  3. package/internal/to-file.d.mts +1 -1
  4. package/internal/to-file.d.ts +1 -1
  5. package/internal/to-file.js +1 -1
  6. package/internal/to-file.mjs +1 -1
  7. package/package.json +1 -1
  8. package/resources/shared.d.mts +129 -5
  9. package/resources/shared.d.mts.map +1 -1
  10. package/resources/shared.d.ts +129 -5
  11. package/resources/shared.d.ts.map +1 -1
  12. package/resources/v1/alerts.d.mts +68 -64
  13. package/resources/v1/alerts.d.mts.map +1 -1
  14. package/resources/v1/alerts.d.ts +68 -64
  15. package/resources/v1/alerts.d.ts.map +1 -1
  16. package/resources/v1/alerts.js +40 -39
  17. package/resources/v1/alerts.js.map +1 -1
  18. package/resources/v1/alerts.mjs +40 -39
  19. package/resources/v1/alerts.mjs.map +1 -1
  20. package/resources/v1/contracts/contracts.d.mts +28 -6
  21. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  22. package/resources/v1/contracts/contracts.d.ts +28 -6
  23. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  24. package/resources/v1/contracts/contracts.js +4 -3
  25. package/resources/v1/contracts/contracts.js.map +1 -1
  26. package/resources/v1/contracts/contracts.mjs +4 -3
  27. package/resources/v1/contracts/contracts.mjs.map +1 -1
  28. package/resources/v1/customers/alerts.d.mts +98 -77
  29. package/resources/v1/customers/alerts.d.mts.map +1 -1
  30. package/resources/v1/customers/alerts.d.ts +98 -77
  31. package/resources/v1/customers/alerts.d.ts.map +1 -1
  32. package/resources/v1/customers/alerts.js +65 -46
  33. package/resources/v1/customers/alerts.js.map +1 -1
  34. package/resources/v1/customers/alerts.mjs +65 -46
  35. package/resources/v1/customers/alerts.mjs.map +1 -1
  36. package/resources/v1/customers/customers.d.mts +17 -16
  37. package/resources/v1/customers/customers.d.mts.map +1 -1
  38. package/resources/v1/customers/customers.d.ts +17 -16
  39. package/resources/v1/customers/customers.d.ts.map +1 -1
  40. package/resources/v1/customers/customers.js +7 -4
  41. package/resources/v1/customers/customers.js.map +1 -1
  42. package/resources/v1/customers/customers.mjs +7 -4
  43. package/resources/v1/customers/customers.mjs.map +1 -1
  44. package/resources/v1/customers/index.d.mts +1 -1
  45. package/resources/v1/customers/index.d.mts.map +1 -1
  46. package/resources/v1/customers/index.d.ts +1 -1
  47. package/resources/v1/customers/index.d.ts.map +1 -1
  48. package/resources/v1/customers/index.js.map +1 -1
  49. package/resources/v1/customers/index.mjs.map +1 -1
  50. package/resources/v1/customers/invoices.d.mts +117 -2
  51. package/resources/v1/customers/invoices.d.mts.map +1 -1
  52. package/resources/v1/customers/invoices.d.ts +117 -2
  53. package/resources/v1/customers/invoices.d.ts.map +1 -1
  54. package/resources/v1/customers/invoices.js +49 -0
  55. package/resources/v1/customers/invoices.js.map +1 -1
  56. package/resources/v1/customers/invoices.mjs +49 -0
  57. package/resources/v1/customers/invoices.mjs.map +1 -1
  58. package/resources/v1/index.d.mts +1 -0
  59. package/resources/v1/index.d.mts.map +1 -1
  60. package/resources/v1/index.d.ts +1 -0
  61. package/resources/v1/index.d.ts.map +1 -1
  62. package/resources/v1/index.js +3 -1
  63. package/resources/v1/index.js.map +1 -1
  64. package/resources/v1/index.mjs +1 -0
  65. package/resources/v1/index.mjs.map +1 -1
  66. package/resources/v1/payments.d.mts +116 -0
  67. package/resources/v1/payments.d.mts.map +1 -0
  68. package/resources/v1/payments.d.ts +116 -0
  69. package/resources/v1/payments.d.ts.map +1 -0
  70. package/resources/v1/payments.js +71 -0
  71. package/resources/v1/payments.js.map +1 -0
  72. package/resources/v1/payments.mjs +67 -0
  73. package/resources/v1/payments.mjs.map +1 -0
  74. package/resources/v1/usage.d.mts +4 -2
  75. package/resources/v1/usage.d.mts.map +1 -1
  76. package/resources/v1/usage.d.ts +4 -2
  77. package/resources/v1/usage.d.ts.map +1 -1
  78. package/resources/v1/usage.js +4 -2
  79. package/resources/v1/usage.js.map +1 -1
  80. package/resources/v1/usage.mjs +4 -2
  81. package/resources/v1/usage.mjs.map +1 -1
  82. package/resources/v1/v1.d.mts +4 -0
  83. package/resources/v1/v1.d.mts.map +1 -1
  84. package/resources/v1/v1.d.ts +4 -0
  85. package/resources/v1/v1.d.ts.map +1 -1
  86. package/resources/v1/v1.js +4 -0
  87. package/resources/v1/v1.js.map +1 -1
  88. package/resources/v1/v1.mjs +4 -0
  89. package/resources/v1/v1.mjs.map +1 -1
  90. package/resources/v2/contracts.d.mts +109 -3
  91. package/resources/v2/contracts.d.mts.map +1 -1
  92. package/resources/v2/contracts.d.ts +109 -3
  93. package/resources/v2/contracts.d.ts.map +1 -1
  94. package/src/internal/to-file.ts +1 -1
  95. package/src/resources/shared.ts +160 -5
  96. package/src/resources/v1/alerts.ts +68 -64
  97. package/src/resources/v1/contracts/contracts.ts +32 -6
  98. package/src/resources/v1/customers/alerts.ts +98 -77
  99. package/src/resources/v1/customers/customers.ts +18 -15
  100. package/src/resources/v1/customers/index.ts +1 -0
  101. package/src/resources/v1/customers/invoices.ts +142 -1
  102. package/src/resources/v1/index.ts +11 -0
  103. package/src/resources/v1/payments.ts +170 -0
  104. package/src/resources/v1/usage.ts +4 -2
  105. package/src/resources/v1/v1.ts +26 -0
  106. package/src/resources/v2/contracts.ts +144 -3
  107. package/src/version.ts +1 -1
  108. package/version.d.mts +1 -1
  109. package/version.d.ts +1 -1
  110. package/version.js +1 -1
  111. package/version.mjs +1 -1
@@ -373,7 +373,7 @@ export namespace ContractGetEditHistoryResponse {
373
373
  /**
374
374
  * The schedule that the customer will be invoiced for this commit.
375
375
  */
376
- invoice_schedule?: Shared.SchedulePointInTime;
376
+ invoice_schedule?: AddCommit.InvoiceSchedule;
377
377
 
378
378
  name?: string;
379
379
 
@@ -414,6 +414,36 @@ export namespace ContractGetEditHistoryResponse {
414
414
 
415
415
  name: string;
416
416
  }
417
+
418
+ /**
419
+ * The schedule that the customer will be invoiced for this commit.
420
+ */
421
+ export interface InvoiceSchedule {
422
+ credit_type?: Shared.CreditTypeData;
423
+
424
+ /**
425
+ * If true, this schedule will not generate an invoice.
426
+ */
427
+ do_not_invoice?: boolean;
428
+
429
+ schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
430
+ }
431
+
432
+ export namespace InvoiceSchedule {
433
+ export interface ScheduleItem {
434
+ id: string;
435
+
436
+ timestamp: string;
437
+
438
+ amount?: number;
439
+
440
+ invoice_id?: string | null;
441
+
442
+ quantity?: number;
443
+
444
+ unit_price?: number;
445
+ }
446
+ }
417
447
  }
418
448
 
419
449
  export interface AddCredit {
@@ -495,7 +525,7 @@ export namespace ContractGetEditHistoryResponse {
495
525
 
496
526
  override_tiers?: Array<Shared.OverrideTier>;
497
527
 
498
- overwrite_rate?: Shared.OverwriteRate;
528
+ overwrite_rate?: AddOverride.OverwriteRate;
499
529
 
500
530
  priority?: number;
501
531
 
@@ -525,6 +555,40 @@ export namespace ContractGetEditHistoryResponse {
525
555
  recurring_credit_ids?: Array<string>;
526
556
  }
527
557
 
558
+ export interface OverwriteRate {
559
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
560
+
561
+ credit_type?: Shared.CreditTypeData;
562
+
563
+ /**
564
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
565
+ * processors.
566
+ */
567
+ custom_rate?: { [key: string]: unknown };
568
+
569
+ /**
570
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
571
+ * set to true.
572
+ */
573
+ is_prorated?: boolean;
574
+
575
+ /**
576
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
577
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
578
+ */
579
+ price?: number;
580
+
581
+ /**
582
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
583
+ */
584
+ quantity?: number;
585
+
586
+ /**
587
+ * Only set for TIERED rate_type.
588
+ */
589
+ tiers?: Array<Shared.Tier>;
590
+ }
591
+
528
592
  export interface Product {
529
593
  id: string;
530
594
 
@@ -1301,6 +1365,8 @@ export namespace ContractGetEditHistoryResponse {
1301
1365
  ending_before?: string;
1302
1366
 
1303
1367
  invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
1368
+
1369
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1304
1370
  }
1305
1371
 
1306
1372
  export namespace UpdateRecurringCommit {
@@ -1323,6 +1389,8 @@ export namespace ContractGetEditHistoryResponse {
1323
1389
  access_amount?: UpdateRecurringCredit.AccessAmount;
1324
1390
 
1325
1391
  ending_before?: string;
1392
+
1393
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1326
1394
  }
1327
1395
 
1328
1396
  export namespace UpdateRecurringCredit {
@@ -1494,6 +1562,13 @@ export interface ContractEditParams {
1494
1562
  */
1495
1563
  customer_id: string;
1496
1564
 
1565
+ /**
1566
+ * Update the billing provider configuration on the contract. Currently only
1567
+ * supports adding a billing provider configuration to a contract that does not
1568
+ * already have one.
1569
+ */
1570
+ add_billing_provider_configuration_update?: ContractEditParams.AddBillingProviderConfigurationUpdate;
1571
+
1497
1572
  add_commits?: Array<ContractEditParams.AddCommit>;
1498
1573
 
1499
1574
  add_credits?: Array<ContractEditParams.AddCredit>;
@@ -1601,6 +1676,50 @@ export interface ContractEditParams {
1601
1676
  }
1602
1677
 
1603
1678
  export namespace ContractEditParams {
1679
+ /**
1680
+ * Update the billing provider configuration on the contract. Currently only
1681
+ * supports adding a billing provider configuration to a contract that does not
1682
+ * already have one.
1683
+ */
1684
+ export interface AddBillingProviderConfigurationUpdate {
1685
+ billing_provider_configuration: AddBillingProviderConfigurationUpdate.BillingProviderConfiguration;
1686
+
1687
+ /**
1688
+ * Indicates when the billing provider will be active on the contract. Any charges
1689
+ * accrued during the schedule will be billed to the indicated billing provider.
1690
+ */
1691
+ schedule: AddBillingProviderConfigurationUpdate.Schedule;
1692
+ }
1693
+
1694
+ export namespace AddBillingProviderConfigurationUpdate {
1695
+ export interface BillingProviderConfiguration {
1696
+ billing_provider?:
1697
+ | 'aws_marketplace'
1698
+ | 'stripe'
1699
+ | 'netsuite'
1700
+ | 'custom'
1701
+ | 'azure_marketplace'
1702
+ | 'quickbooks_online'
1703
+ | 'workday'
1704
+ | 'gcp_marketplace';
1705
+
1706
+ billing_provider_configuration_id?: string;
1707
+
1708
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
1709
+ }
1710
+
1711
+ /**
1712
+ * Indicates when the billing provider will be active on the contract. Any charges
1713
+ * accrued during the schedule will be billed to the indicated billing provider.
1714
+ */
1715
+ export interface Schedule {
1716
+ /**
1717
+ * When the billing provider update will take effect.
1718
+ */
1719
+ effective_at: 'START_OF_CURRENT_PERIOD';
1720
+ }
1721
+ }
1722
+
1604
1723
  export interface AddCommit {
1605
1724
  product_id: string;
1606
1725
 
@@ -1858,7 +1977,7 @@ export namespace ContractEditParams {
1858
1977
  * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1859
1978
  * will default to NONE.
1860
1979
  */
1861
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1980
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
1862
1981
  }
1863
1982
 
1864
1983
  export namespace PaymentGateConfig {
@@ -3187,6 +3306,12 @@ export namespace ContractEditParams {
3187
3306
  ending_before?: string | null;
3188
3307
 
3189
3308
  invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
3309
+
3310
+ /**
3311
+ * If provided, updates the recurring commit to use the specified rate type when
3312
+ * generating future commits.
3313
+ */
3314
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
3190
3315
  }
3191
3316
 
3192
3317
  export namespace UpdateRecurringCommit {
@@ -3209,6 +3334,12 @@ export namespace ContractEditParams {
3209
3334
  access_amount?: UpdateRecurringCredit.AccessAmount;
3210
3335
 
3211
3336
  ending_before?: string | null;
3337
+
3338
+ /**
3339
+ * If provided, updates the recurring credit to use the specified rate type when
3340
+ * generating future credits.
3341
+ */
3342
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
3212
3343
  }
3213
3344
 
3214
3345
  export namespace UpdateRecurringCredit {
@@ -3344,6 +3475,11 @@ export interface ContractEditCommitParams {
3344
3475
  */
3345
3476
  applicable_product_tags?: Array<string> | null;
3346
3477
 
3478
+ /**
3479
+ * Optional configuration for commit hierarchy access control
3480
+ */
3481
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3482
+
3347
3483
  /**
3348
3484
  * ID of contract to use for invoicing
3349
3485
  */
@@ -3472,6 +3608,11 @@ export interface ContractEditCreditParams {
3472
3608
  */
3473
3609
  applicable_product_tags?: Array<string> | null;
3474
3610
 
3611
+ /**
3612
+ * Optional configuration for credit hierarchy access control
3613
+ */
3614
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3615
+
3475
3616
  /**
3476
3617
  * If multiple commits are applicable, the one with the lower priority will apply
3477
3618
  * first.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.0.0'; // x-release-please-version
1
+ export const VERSION = '2.0.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0";
1
+ export declare const VERSION = "2.0.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0";
1
+ export declare const VERSION = "2.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 = '1.0.0'; // x-release-please-version
4
+ exports.VERSION = '2.0.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.0.0'; // x-release-please-version
1
+ export const VERSION = '2.0.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map