@metronome/sdk 0.1.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.
- package/CHANGELOG.md +57 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +4 -5
- package/resources/shared.d.ts +53 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.ts +4 -8
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +124 -8
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/products.d.ts +3 -0
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.ts +9 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/commits.d.ts +6 -0
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +1 -0
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +1 -0
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.ts +8 -0
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/dashboards.d.ts +1 -1
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v2/contracts.d.ts +404 -28
- package/resources/v2/contracts.d.ts.map +1 -1
- package/src/index.ts +1 -0
- package/src/resources/shared.ts +72 -0
- package/src/resources/v1/alerts.ts +4 -8
- package/src/resources/v1/contracts/contracts.ts +141 -8
- package/src/resources/v1/contracts/products.ts +2 -0
- package/src/resources/v1/customers/alerts.ts +12 -0
- package/src/resources/v1/customers/commits.ts +7 -0
- package/src/resources/v1/customers/invoices.ts +9 -0
- package/src/resources/v1/dashboards.ts +3 -1
- package/src/resources/v2/contracts.ts +509 -28
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -118,10 +118,10 @@ export interface AlertCreateParams {
|
|
|
118
118
|
evaluate_on_create?: boolean;
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
121
|
+
* Only present for `spend_threshold_reached` alerts. Scope alert to a specific
|
|
122
|
+
* group key on individual line items.
|
|
123
123
|
*/
|
|
124
|
-
|
|
124
|
+
group_values?: Array<AlertCreateParams.GroupValue>;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* Only supported for invoice_total_reached alerts. A list of invoice types to
|
|
@@ -152,11 +152,7 @@ export namespace AlertCreateParams {
|
|
|
152
152
|
value: string;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
* Scopes alert evaluation to a specific presentation group key on individual line
|
|
157
|
-
* items. Only present for spend alerts.
|
|
158
|
-
*/
|
|
159
|
-
export interface GroupKeyFilter {
|
|
155
|
+
export interface GroupValue {
|
|
160
156
|
key: string;
|
|
161
157
|
|
|
162
158
|
value: string;
|
|
@@ -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
|
|
@@ -2600,6 +2624,11 @@ export namespace ContractCreateParams {
|
|
|
2600
2624
|
*/
|
|
2601
2625
|
specifiers?: Array<RecurringCommit.Specifier>;
|
|
2602
2626
|
|
|
2627
|
+
/**
|
|
2628
|
+
* Attach a subscription to the recurring commit/credit.
|
|
2629
|
+
*/
|
|
2630
|
+
subscription_config?: RecurringCommit.SubscriptionConfig;
|
|
2631
|
+
|
|
2603
2632
|
/**
|
|
2604
2633
|
* A temporary ID that can be used to reference the recurring commit for commit
|
|
2605
2634
|
* specific overrides.
|
|
@@ -2617,8 +2646,8 @@ export namespace ContractCreateParams {
|
|
|
2617
2646
|
unit_price: number;
|
|
2618
2647
|
|
|
2619
2648
|
/**
|
|
2620
|
-
* This field is
|
|
2621
|
-
*
|
|
2649
|
+
* This field is required unless a subscription is attached via
|
|
2650
|
+
* `subscription_config`.
|
|
2622
2651
|
*/
|
|
2623
2652
|
quantity?: number;
|
|
2624
2653
|
}
|
|
@@ -2687,6 +2716,32 @@ export namespace ContractCreateParams {
|
|
|
2687
2716
|
*/
|
|
2688
2717
|
product_tags?: Array<string>;
|
|
2689
2718
|
}
|
|
2719
|
+
|
|
2720
|
+
/**
|
|
2721
|
+
* Attach a subscription to the recurring commit/credit.
|
|
2722
|
+
*/
|
|
2723
|
+
export interface SubscriptionConfig {
|
|
2724
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
2725
|
+
|
|
2726
|
+
/**
|
|
2727
|
+
* ID of the subscription to configure on the recurring commit/credit.
|
|
2728
|
+
*/
|
|
2729
|
+
subscription_id: string;
|
|
2730
|
+
|
|
2731
|
+
/**
|
|
2732
|
+
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
2733
|
+
*/
|
|
2734
|
+
allocation?: 'POOLED';
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
export namespace SubscriptionConfig {
|
|
2738
|
+
export interface ApplySeatIncreaseConfig {
|
|
2739
|
+
/**
|
|
2740
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
2741
|
+
*/
|
|
2742
|
+
is_prorated: boolean;
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2690
2745
|
}
|
|
2691
2746
|
|
|
2692
2747
|
export interface RecurringCredit {
|
|
@@ -2784,6 +2839,11 @@ export namespace ContractCreateParams {
|
|
|
2784
2839
|
*/
|
|
2785
2840
|
specifiers?: Array<RecurringCredit.Specifier>;
|
|
2786
2841
|
|
|
2842
|
+
/**
|
|
2843
|
+
* Attach a subscription to the recurring commit/credit.
|
|
2844
|
+
*/
|
|
2845
|
+
subscription_config?: RecurringCredit.SubscriptionConfig;
|
|
2846
|
+
|
|
2787
2847
|
/**
|
|
2788
2848
|
* A temporary ID that can be used to reference the recurring commit for commit
|
|
2789
2849
|
* specific overrides.
|
|
@@ -2801,8 +2861,8 @@ export namespace ContractCreateParams {
|
|
|
2801
2861
|
unit_price: number;
|
|
2802
2862
|
|
|
2803
2863
|
/**
|
|
2804
|
-
* This field is
|
|
2805
|
-
*
|
|
2864
|
+
* This field is required unless a subscription is attached via
|
|
2865
|
+
* `subscription_config`.
|
|
2806
2866
|
*/
|
|
2807
2867
|
quantity?: number;
|
|
2808
2868
|
}
|
|
@@ -2860,6 +2920,32 @@ export namespace ContractCreateParams {
|
|
|
2860
2920
|
*/
|
|
2861
2921
|
product_tags?: Array<string>;
|
|
2862
2922
|
}
|
|
2923
|
+
|
|
2924
|
+
/**
|
|
2925
|
+
* Attach a subscription to the recurring commit/credit.
|
|
2926
|
+
*/
|
|
2927
|
+
export interface SubscriptionConfig {
|
|
2928
|
+
apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* ID of the subscription to configure on the recurring commit/credit.
|
|
2932
|
+
*/
|
|
2933
|
+
subscription_id: string;
|
|
2934
|
+
|
|
2935
|
+
/**
|
|
2936
|
+
* If set to POOLED, allocation added per seat is pooled across the account.
|
|
2937
|
+
*/
|
|
2938
|
+
allocation?: 'POOLED';
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
export namespace SubscriptionConfig {
|
|
2942
|
+
export interface ApplySeatIncreaseConfig {
|
|
2943
|
+
/**
|
|
2944
|
+
* Indicates whether a mid-period seat increase should be prorated.
|
|
2945
|
+
*/
|
|
2946
|
+
is_prorated: boolean;
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2863
2949
|
}
|
|
2864
2950
|
|
|
2865
2951
|
export interface ResellerRoyalty {
|
|
@@ -2914,6 +3000,8 @@ export namespace ContractCreateParams {
|
|
|
2914
3000
|
*/
|
|
2915
3001
|
schedule: ScheduledCharge.Schedule;
|
|
2916
3002
|
|
|
3003
|
+
custom_fields?: { [key: string]: string };
|
|
3004
|
+
|
|
2917
3005
|
/**
|
|
2918
3006
|
* displayed on invoices
|
|
2919
3007
|
*/
|
|
@@ -2935,6 +3023,12 @@ export namespace ContractCreateParams {
|
|
|
2935
3023
|
*/
|
|
2936
3024
|
credit_type_id?: string;
|
|
2937
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
|
+
|
|
2938
3032
|
/**
|
|
2939
3033
|
* Enter the unit price and quantity for the charge or instead only send the
|
|
2940
3034
|
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
@@ -3149,15 +3243,22 @@ export namespace ContractCreateParams {
|
|
|
3149
3243
|
* start date
|
|
3150
3244
|
*/
|
|
3151
3245
|
starting_at?: string;
|
|
3246
|
+
|
|
3247
|
+
/**
|
|
3248
|
+
* A temporary ID used to reference the subscription in recurring commit/credit
|
|
3249
|
+
* subscription configs created within the same payload.
|
|
3250
|
+
*/
|
|
3251
|
+
temporary_id?: string;
|
|
3152
3252
|
}
|
|
3153
3253
|
|
|
3154
3254
|
export namespace Subscription {
|
|
3155
3255
|
export interface Proration {
|
|
3156
3256
|
/**
|
|
3157
|
-
* Indicates how mid-period quantity adjustments are invoiced.
|
|
3158
|
-
*
|
|
3159
|
-
*
|
|
3160
|
-
*
|
|
3257
|
+
* Indicates how mid-period quantity adjustments are invoiced.
|
|
3258
|
+
* **BILL_IMMEDIATELY**: Only available when collection schedule is `ADVANCE`. The
|
|
3259
|
+
* quantity increase will be billed immediately on the scheduled date.
|
|
3260
|
+
* **BILL_ON_NEXT_COLLECTION_DATE**: The quantity increase will be billed for
|
|
3261
|
+
* in-arrears at the end of the period.
|
|
3161
3262
|
*/
|
|
3162
3263
|
invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
|
|
3163
3264
|
|
|
@@ -3541,6 +3642,12 @@ export namespace ContractAmendParams {
|
|
|
3541
3642
|
*/
|
|
3542
3643
|
credit_type_id?: string;
|
|
3543
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
|
+
|
|
3544
3651
|
/**
|
|
3545
3652
|
* Enter the unit price and quantity for the charge or instead only send the
|
|
3546
3653
|
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
@@ -3688,6 +3795,18 @@ export namespace ContractAmendParams {
|
|
|
3688
3795
|
* your payment type.
|
|
3689
3796
|
*/
|
|
3690
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;
|
|
3691
3810
|
}
|
|
3692
3811
|
}
|
|
3693
3812
|
|
|
@@ -3872,6 +3991,12 @@ export namespace ContractAmendParams {
|
|
|
3872
3991
|
*/
|
|
3873
3992
|
credit_type_id?: string;
|
|
3874
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
|
+
|
|
3875
4000
|
/**
|
|
3876
4001
|
* Enter the unit price and quantity for the charge or instead only send the
|
|
3877
4002
|
* amount. If amount is sent, the unit price is assumed to be the amount and
|
|
@@ -4214,6 +4339,8 @@ export namespace ContractAmendParams {
|
|
|
4214
4339
|
*/
|
|
4215
4340
|
schedule: ScheduledCharge.Schedule;
|
|
4216
4341
|
|
|
4342
|
+
custom_fields?: { [key: string]: string };
|
|
4343
|
+
|
|
4217
4344
|
/**
|
|
4218
4345
|
* displayed on invoices
|
|
4219
4346
|
*/
|
|
@@ -4235,6 +4362,12 @@ export namespace ContractAmendParams {
|
|
|
4235
4362
|
*/
|
|
4236
4363
|
credit_type_id?: string;
|
|
4237
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
|
+
|
|
4238
4371
|
/**
|
|
4239
4372
|
* Enter the unit price and quantity for the charge or instead only send the
|
|
4240
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
|
|
@@ -137,6 +137,12 @@ export namespace CustomerAlert {
|
|
|
137
137
|
*/
|
|
138
138
|
group_key_filter?: Alert.GroupKeyFilter;
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Only present for `spend_threshold_reached` alerts. Scope alert to a specific
|
|
142
|
+
* group key on individual line items.
|
|
143
|
+
*/
|
|
144
|
+
group_values?: Array<Alert.GroupValue>;
|
|
145
|
+
|
|
140
146
|
/**
|
|
141
147
|
* Only supported for invoice_total_reached alerts. A list of invoice types to
|
|
142
148
|
* evaluate.
|
|
@@ -169,6 +175,12 @@ export namespace CustomerAlert {
|
|
|
169
175
|
|
|
170
176
|
value: string;
|
|
171
177
|
}
|
|
178
|
+
|
|
179
|
+
export interface GroupValue {
|
|
180
|
+
key: string;
|
|
181
|
+
|
|
182
|
+
value: string;
|
|
183
|
+
}
|
|
172
184
|
}
|
|
173
185
|
}
|
|
174
186
|
|
|
@@ -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`
|
|
@@ -119,7 +119,9 @@ export namespace DashboardGetEmbeddableURLParams {
|
|
|
119
119
|
| 'UsageLine_8'
|
|
120
120
|
| 'UsageLine_9'
|
|
121
121
|
| 'Primary_green'
|
|
122
|
-
| 'Primary_red'
|
|
122
|
+
| 'Primary_red'
|
|
123
|
+
| 'Progress_bar'
|
|
124
|
+
| 'Progress_bar_background';
|
|
123
125
|
|
|
124
126
|
/**
|
|
125
127
|
* Hex value representation of the color
|