@metronome/sdk 0.2.0 → 0.3.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 (38) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/index.d.ts.map +1 -1
  3. package/index.js.map +1 -1
  4. package/index.mjs.map +1 -1
  5. package/package.json +4 -1
  6. package/resources/shared.d.ts +5 -0
  7. package/resources/shared.d.ts.map +1 -1
  8. package/resources/v1/contracts/contracts.d.ts +62 -4
  9. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  10. package/resources/v1/contracts/contracts.js.map +1 -1
  11. package/resources/v1/contracts/contracts.mjs.map +1 -1
  12. package/resources/v1/contracts/products.d.ts +3 -0
  13. package/resources/v1/contracts/products.d.ts.map +1 -1
  14. package/resources/v1/contracts/products.js.map +1 -1
  15. package/resources/v1/contracts/products.mjs.map +1 -1
  16. package/resources/v1/customers/commits.d.ts +6 -0
  17. package/resources/v1/customers/commits.d.ts.map +1 -1
  18. package/resources/v1/customers/commits.js +1 -0
  19. package/resources/v1/customers/commits.js.map +1 -1
  20. package/resources/v1/customers/commits.mjs +1 -0
  21. package/resources/v1/customers/commits.mjs.map +1 -1
  22. package/resources/v1/customers/invoices.d.ts +8 -0
  23. package/resources/v1/customers/invoices.d.ts.map +1 -1
  24. package/resources/v1/customers/invoices.js.map +1 -1
  25. package/resources/v1/customers/invoices.mjs.map +1 -1
  26. package/resources/v2/contracts.d.ts +60 -4
  27. package/resources/v2/contracts.d.ts.map +1 -1
  28. package/src/index.ts +1 -0
  29. package/src/resources/shared.ts +6 -0
  30. package/src/resources/v1/contracts/contracts.ts +68 -4
  31. package/src/resources/v1/contracts/products.ts +2 -0
  32. package/src/resources/v1/customers/commits.ts +7 -0
  33. package/src/resources/v1/customers/invoices.ts +9 -0
  34. package/src/resources/v2/contracts.ts +70 -4
  35. package/src/version.ts +1 -1
  36. package/version.d.ts +1 -1
  37. package/version.js +1 -1
  38. package/version.mjs +1 -1
package/src/index.ts CHANGED
@@ -190,6 +190,7 @@ export class Metronome extends Core.APIClient {
190
190
 
191
191
  Metronome.V2 = V2;
192
192
  Metronome.V1 = V1;
193
+
193
194
  export declare namespace Metronome {
194
195
  export type RequestOptions = Core.RequestOptions;
195
196
 
@@ -1774,6 +1774,12 @@ export namespace ScheduleDuration {
1774
1774
  export interface SchedulePointInTime {
1775
1775
  credit_type?: CreditTypeData;
1776
1776
 
1777
+ /**
1778
+ * This field is only applicable to commit invoice schedules. If true, this
1779
+ * schedule will not generate an invoice.
1780
+ */
1781
+ do_not_invoice?: boolean;
1782
+
1777
1783
  schedule_items?: Array<SchedulePointInTime.ScheduleItem>;
1778
1784
  }
1779
1785
 
@@ -1719,6 +1719,12 @@ export namespace ContractCreateParams {
1719
1719
  */
1720
1720
  credit_type_id?: string;
1721
1721
 
1722
+ /**
1723
+ * This field is only applicable to commit invoice schedules. If true, this
1724
+ * schedule will not generate an invoice.
1725
+ */
1726
+ do_not_invoice?: boolean;
1727
+
1722
1728
  /**
1723
1729
  * Enter the unit price and quantity for the charge or instead only send the
1724
1730
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -1866,6 +1872,18 @@ export namespace ContractCreateParams {
1866
1872
  * your payment type.
1867
1873
  */
1868
1874
  invoice_metadata?: { [key: string]: string };
1875
+
1876
+ /**
1877
+ * If true, the payment will be made assuming the customer is present (i.e. on
1878
+ * session).
1879
+ *
1880
+ * If false, the payment will be made assuming the customer is not present (i.e.
1881
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
1882
+ * India), the payment may be declined.
1883
+ *
1884
+ * If left blank, will default to false.
1885
+ */
1886
+ on_session_payment?: boolean;
1869
1887
  }
1870
1888
  }
1871
1889
 
@@ -2050,6 +2068,12 @@ export namespace ContractCreateParams {
2050
2068
  */
2051
2069
  credit_type_id?: string;
2052
2070
 
2071
+ /**
2072
+ * This field is only applicable to commit invoice schedules. If true, this
2073
+ * schedule will not generate an invoice.
2074
+ */
2075
+ do_not_invoice?: boolean;
2076
+
2053
2077
  /**
2054
2078
  * Enter the unit price and quantity for the charge or instead only send the
2055
2079
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -2622,8 +2646,8 @@ export namespace ContractCreateParams {
2622
2646
  unit_price: number;
2623
2647
 
2624
2648
  /**
2625
- * This field is currently required. Upcoming recurring commit/credit configuration
2626
- * options will allow it to be optional.
2649
+ * This field is required unless a subscription is attached via
2650
+ * `subscription_config`.
2627
2651
  */
2628
2652
  quantity?: number;
2629
2653
  }
@@ -2837,8 +2861,8 @@ export namespace ContractCreateParams {
2837
2861
  unit_price: number;
2838
2862
 
2839
2863
  /**
2840
- * This field is currently required. Upcoming recurring commit/credit configuration
2841
- * options will allow it to be optional.
2864
+ * This field is required unless a subscription is attached via
2865
+ * `subscription_config`.
2842
2866
  */
2843
2867
  quantity?: number;
2844
2868
  }
@@ -2976,6 +3000,8 @@ export namespace ContractCreateParams {
2976
3000
  */
2977
3001
  schedule: ScheduledCharge.Schedule;
2978
3002
 
3003
+ custom_fields?: { [key: string]: string };
3004
+
2979
3005
  /**
2980
3006
  * displayed on invoices
2981
3007
  */
@@ -2997,6 +3023,12 @@ export namespace ContractCreateParams {
2997
3023
  */
2998
3024
  credit_type_id?: string;
2999
3025
 
3026
+ /**
3027
+ * This field is only applicable to commit invoice schedules. If true, this
3028
+ * schedule will not generate an invoice.
3029
+ */
3030
+ do_not_invoice?: boolean;
3031
+
3000
3032
  /**
3001
3033
  * Enter the unit price and quantity for the charge or instead only send the
3002
3034
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -3610,6 +3642,12 @@ export namespace ContractAmendParams {
3610
3642
  */
3611
3643
  credit_type_id?: string;
3612
3644
 
3645
+ /**
3646
+ * This field is only applicable to commit invoice schedules. If true, this
3647
+ * schedule will not generate an invoice.
3648
+ */
3649
+ do_not_invoice?: boolean;
3650
+
3613
3651
  /**
3614
3652
  * Enter the unit price and quantity for the charge or instead only send the
3615
3653
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -3757,6 +3795,18 @@ export namespace ContractAmendParams {
3757
3795
  * your payment type.
3758
3796
  */
3759
3797
  invoice_metadata?: { [key: string]: string };
3798
+
3799
+ /**
3800
+ * If true, the payment will be made assuming the customer is present (i.e. on
3801
+ * session).
3802
+ *
3803
+ * If false, the payment will be made assuming the customer is not present (i.e.
3804
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
3805
+ * India), the payment may be declined.
3806
+ *
3807
+ * If left blank, will default to false.
3808
+ */
3809
+ on_session_payment?: boolean;
3760
3810
  }
3761
3811
  }
3762
3812
 
@@ -3941,6 +3991,12 @@ export namespace ContractAmendParams {
3941
3991
  */
3942
3992
  credit_type_id?: string;
3943
3993
 
3994
+ /**
3995
+ * This field is only applicable to commit invoice schedules. If true, this
3996
+ * schedule will not generate an invoice.
3997
+ */
3998
+ do_not_invoice?: boolean;
3999
+
3944
4000
  /**
3945
4001
  * Enter the unit price and quantity for the charge or instead only send the
3946
4002
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -4283,6 +4339,8 @@ export namespace ContractAmendParams {
4283
4339
  */
4284
4340
  schedule: ScheduledCharge.Schedule;
4285
4341
 
4342
+ custom_fields?: { [key: string]: string };
4343
+
4286
4344
  /**
4287
4345
  * displayed on invoices
4288
4346
  */
@@ -4304,6 +4362,12 @@ export namespace ContractAmendParams {
4304
4362
  */
4305
4363
  credit_type_id?: string;
4306
4364
 
4365
+ /**
4366
+ * This field is only applicable to commit invoice schedules. If true, this
4367
+ * schedule will not generate an invoice.
4368
+ */
4369
+ do_not_invoice?: boolean;
4370
+
4307
4371
  /**
4308
4372
  * Enter the unit price and quantity for the charge or instead only send the
4309
4373
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -428,6 +428,8 @@ export interface ProductCreateParams {
428
428
  */
429
429
  composite_tags?: Array<string>;
430
430
 
431
+ custom_fields?: { [key: string]: string };
432
+
431
433
  /**
432
434
  * Beta feature only available for composite products. If true, products with $0
433
435
  * will not be included when computing composite usage. Defaults to false
@@ -36,6 +36,7 @@ export class Commits extends APIResource {
36
36
  * timestamp: '2020-03-01T00:00:00.000Z',
37
37
  * },
38
38
  * ],
39
+ * do_not_invoice: false,
39
40
  * },
40
41
  * name: 'My Commit',
41
42
  * });
@@ -240,6 +241,12 @@ export namespace CommitCreateParams {
240
241
  */
241
242
  credit_type_id?: string;
242
243
 
244
+ /**
245
+ * This field is only applicable to commit invoice schedules. If true, this
246
+ * schedule will not generate an invoice.
247
+ */
248
+ do_not_invoice?: boolean;
249
+
243
250
  /**
244
251
  * Enter the unit price and quantity for the charge or instead only send the
245
252
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -207,6 +207,15 @@ export namespace Invoice {
207
207
 
208
208
  total: number;
209
209
 
210
+ /**
211
+ * The type of line item. Possible values are 'aws_royalty',
212
+ * 'applied_commit_or_credit', 'scheduled', 'commit_purchase', 'cpu_conversion',
213
+ * 'discount', 'gcp_royalty', 'postpaid_trueup', 'professional_services',
214
+ * 'subscription', 'usage', 'legacy', 'minimum', 'product_charge',
215
+ * 'trial_discount', 'rollover', 'seat', 'grouped_charge'.
216
+ */
217
+ type: string;
218
+
210
219
  /**
211
220
  * Details about the credit or commit that was applied to this line item. Only
212
221
  * present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE`
@@ -4683,6 +4683,12 @@ export namespace ContractGetEditHistoryResponse {
4683
4683
 
4684
4684
  netsuite_sales_order_id?: string | null;
4685
4685
 
4686
+ /**
4687
+ * If multiple commits are applicable, the one with the lower priority will apply
4688
+ * first.
4689
+ */
4690
+ priority?: number | null;
4691
+
4686
4692
  product_id?: string;
4687
4693
 
4688
4694
  rollover_fraction?: number | null;
@@ -4837,6 +4843,12 @@ export namespace ContractGetEditHistoryResponse {
4837
4843
 
4838
4844
  netsuite_sales_order_id?: string | null;
4839
4845
 
4846
+ /**
4847
+ * If multiple credits are applicable, the one with the lower priority will apply
4848
+ * first.
4849
+ */
4850
+ priority?: number | null;
4851
+
4840
4852
  rollover_fraction?: number | null;
4841
4853
  }
4842
4854
 
@@ -4937,6 +4949,12 @@ export namespace ContractGetEditHistoryResponse {
4937
4949
  */
4938
4950
  credit_type_id?: string;
4939
4951
 
4952
+ /**
4953
+ * This field is only applicable to commit invoice schedules. If true, this
4954
+ * schedule will not generate an invoice.
4955
+ */
4956
+ do_not_invoice?: boolean;
4957
+
4940
4958
  /**
4941
4959
  * Enter the unit price and quantity for the charge or instead only send the
4942
4960
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -5720,6 +5738,12 @@ export namespace ContractEditParams {
5720
5738
  */
5721
5739
  credit_type_id?: string;
5722
5740
 
5741
+ /**
5742
+ * This field is only applicable to commit invoice schedules. If true, this
5743
+ * schedule will not generate an invoice.
5744
+ */
5745
+ do_not_invoice?: boolean;
5746
+
5723
5747
  /**
5724
5748
  * Enter the unit price and quantity for the charge or instead only send the
5725
5749
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -5867,6 +5891,18 @@ export namespace ContractEditParams {
5867
5891
  * your payment type.
5868
5892
  */
5869
5893
  invoice_metadata?: { [key: string]: string };
5894
+
5895
+ /**
5896
+ * If true, the payment will be made assuming the customer is present (i.e. on
5897
+ * session).
5898
+ *
5899
+ * If false, the payment will be made assuming the customer is not present (i.e.
5900
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
5901
+ * India), the payment may be declined.
5902
+ *
5903
+ * If left blank, will default to false.
5904
+ */
5905
+ on_session_payment?: boolean;
5870
5906
  }
5871
5907
  }
5872
5908
 
@@ -6050,6 +6086,12 @@ export namespace ContractEditParams {
6050
6086
  */
6051
6087
  credit_type_id?: string;
6052
6088
 
6089
+ /**
6090
+ * This field is only applicable to commit invoice schedules. If true, this
6091
+ * schedule will not generate an invoice.
6092
+ */
6093
+ do_not_invoice?: boolean;
6094
+
6053
6095
  /**
6054
6096
  * Enter the unit price and quantity for the charge or instead only send the
6055
6097
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -6611,8 +6653,8 @@ export namespace ContractEditParams {
6611
6653
  unit_price: number;
6612
6654
 
6613
6655
  /**
6614
- * This field is currently required. Upcoming recurring commit/credit configuration
6615
- * options will allow it to be optional.
6656
+ * This field is required unless a subscription is attached via
6657
+ * `subscription_config`.
6616
6658
  */
6617
6659
  quantity?: number;
6618
6660
  }
@@ -6828,8 +6870,8 @@ export namespace ContractEditParams {
6828
6870
  unit_price: number;
6829
6871
 
6830
6872
  /**
6831
- * This field is currently required. Upcoming recurring commit/credit configuration
6832
- * options will allow it to be optional.
6873
+ * This field is required unless a subscription is attached via
6874
+ * `subscription_config`.
6833
6875
  */
6834
6876
  quantity?: number;
6835
6877
  }
@@ -6970,6 +7012,8 @@ export namespace ContractEditParams {
6970
7012
  */
6971
7013
  schedule: AddScheduledCharge.Schedule;
6972
7014
 
7015
+ custom_fields?: { [key: string]: string };
7016
+
6973
7017
  /**
6974
7018
  * displayed on invoices
6975
7019
  */
@@ -6991,6 +7035,12 @@ export namespace ContractEditParams {
6991
7035
  */
6992
7036
  credit_type_id?: string;
6993
7037
 
7038
+ /**
7039
+ * This field is only applicable to commit invoice schedules. If true, this
7040
+ * schedule will not generate an invoice.
7041
+ */
7042
+ do_not_invoice?: boolean;
7043
+
6994
7044
  /**
6995
7045
  * Enter the unit price and quantity for the charge or instead only send the
6996
7046
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -7285,6 +7335,8 @@ export namespace ContractEditParams {
7285
7335
 
7286
7336
  netsuite_sales_order_id?: string | null;
7287
7337
 
7338
+ priority?: number | null;
7339
+
7288
7340
  product_id?: string;
7289
7341
 
7290
7342
  rollover_fraction?: number | null;
@@ -7412,6 +7464,8 @@ export namespace ContractEditParams {
7412
7464
 
7413
7465
  netsuite_sales_order_id?: string | null;
7414
7466
 
7467
+ priority?: number | null;
7468
+
7415
7469
  product_id?: string;
7416
7470
  }
7417
7471
 
@@ -7879,6 +7933,12 @@ export interface ContractEditCommitParams {
7879
7933
 
7880
7934
  invoice_schedule?: ContractEditCommitParams.InvoiceSchedule;
7881
7935
 
7936
+ /**
7937
+ * If multiple commits are applicable, the one with the lower priority will apply
7938
+ * first.
7939
+ */
7940
+ priority?: number | null;
7941
+
7882
7942
  product_id?: string;
7883
7943
 
7884
7944
  /**
@@ -8004,6 +8064,12 @@ export interface ContractEditCreditParams {
8004
8064
  */
8005
8065
  applicable_product_tags?: Array<string> | null;
8006
8066
 
8067
+ /**
8068
+ * If multiple commits are applicable, the one with the lower priority will apply
8069
+ * first.
8070
+ */
8071
+ priority?: number | null;
8072
+
8007
8073
  product_id?: string;
8008
8074
 
8009
8075
  /**
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.3.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.3.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 = '0.2.0'; // x-release-please-version
4
+ exports.VERSION = '0.3.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.3.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map