@metronome/sdk 0.1.0-beta.9 → 0.1.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 +179 -0
- package/README.md +30 -46
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +23 -14
- package/core.js.map +1 -1
- package/core.mjs +24 -15
- package/core.mjs.map +1 -1
- package/index.d.mts +3 -2
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/shared.d.ts +473 -37
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.ts +26 -2
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +19 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +19 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.ts +8 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.ts +58 -3
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +41 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +41 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +1478 -102
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +180 -3
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +180 -3
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.ts +2 -2
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts +21 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +21 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +21 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.ts +51 -3
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +33 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +33 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +68 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.ts +77 -2
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +39 -2
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +39 -2
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.ts +51 -7
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +35 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +35 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.ts +28 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +23 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +23 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +31 -0
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +27 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +27 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.ts +94 -7
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +56 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +56 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.ts +73 -3
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +41 -1
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +41 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.ts +186 -9
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -1
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -1
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.ts +144 -52
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +49 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +49 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +21 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +21 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +21 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.ts +46 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +43 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +43 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.ts +30 -2
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +26 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +26 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.ts +14 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +14 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +14 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/plans.d.ts +47 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +27 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +27 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.ts +8 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.ts +5 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +5 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +5 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.ts +161 -3
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +46 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +46 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.ts +2923 -207
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +90 -2
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +90 -2
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/webhooks.js +5 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -5
- package/resources/webhooks.mjs.map +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +5 -3
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +6 -2
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +46 -18
- package/src/error.ts +1 -1
- package/src/index.ts +22 -16
- package/src/internal/qs/formats.ts +1 -1
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +3 -3
- package/src/internal/qs/utils.ts +2 -2
- package/src/pagination.ts +5 -1
- package/src/resource.ts +2 -2
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +539 -40
- package/src/resources/v1/alerts.ts +29 -5
- package/src/resources/v1/audit-logs.ts +12 -4
- package/src/resources/v1/billable-metrics.ts +57 -8
- package/src/resources/v1/contracts/contracts.ts +1643 -124
- package/src/resources/v1/contracts/index.ts +8 -4
- package/src/resources/v1/contracts/named-schedules.ts +23 -2
- package/src/resources/v1/contracts/products.ts +53 -9
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
- package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +82 -10
- package/src/resources/v1/custom-fields.ts +57 -9
- package/src/resources/v1/customers/alerts.ts +32 -3
- package/src/resources/v1/customers/billing-config.ts +34 -2
- package/src/resources/v1/customers/commits.ts +97 -10
- package/src/resources/v1/customers/credits.ts +76 -6
- package/src/resources/v1/customers/customers.ts +208 -27
- package/src/resources/v1/customers/index.ts +10 -8
- package/src/resources/v1/customers/invoices.ts +123 -57
- package/src/resources/v1/customers/named-schedules.ts +23 -2
- package/src/resources/v1/customers/plans.ts +48 -5
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +30 -4
- package/src/resources/v1/index.ts +20 -14
- package/src/resources/v1/invoices.ts +16 -2
- package/src/resources/v1/plans.ts +45 -10
- package/src/resources/v1/pricing-units.ts +12 -4
- package/src/resources/v1/services.ts +7 -2
- package/src/resources/v1/usage.ts +187 -6
- package/src/resources/v1/v1.ts +39 -27
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +3397 -235
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +7 -7
- package/src/resources.ts +1 -1
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/resources/v1/plans.d.ts
CHANGED
|
@@ -6,20 +6,55 @@ import { CursorPage, type CursorPageParams } from "../../pagination.js";
|
|
|
6
6
|
export declare class Plans extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* List all available plans.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // Automatically fetches more pages as needed.
|
|
13
|
+
* for await (const planListResponse of client.v1.plans.list()) {
|
|
14
|
+
* // ...
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
9
17
|
*/
|
|
10
18
|
list(query?: PlanListParams, options?: Core.RequestOptions): Core.PagePromise<PlanListResponsesCursorPage, PlanListResponse>;
|
|
11
19
|
list(options?: Core.RequestOptions): Core.PagePromise<PlanListResponsesCursorPage, PlanListResponse>;
|
|
12
20
|
/**
|
|
13
21
|
* Fetch high level details of a specific plan.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const response = await client.v1.plans.getDetails({
|
|
26
|
+
* plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
14
29
|
*/
|
|
15
30
|
getDetails(params: PlanGetDetailsParams, options?: Core.RequestOptions): Core.APIPromise<PlanGetDetailsResponse>;
|
|
16
31
|
/**
|
|
17
32
|
* Fetches a list of charges of a specific plan.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // Automatically fetches more pages as needed.
|
|
37
|
+
* for await (const planListChargesResponse of client.v1.plans.listCharges(
|
|
38
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
39
|
+
* )) {
|
|
40
|
+
* // ...
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
18
43
|
*/
|
|
19
44
|
listCharges(params: PlanListChargesParams, options?: Core.RequestOptions): Core.PagePromise<PlanListChargesResponsesCursorPage, PlanListChargesResponse>;
|
|
20
45
|
/**
|
|
21
46
|
* Fetches a list of customers on a specific plan (by default, only currently
|
|
22
47
|
* active plans are included)
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const planListCustomersResponse of client.v1.plans.listCustomers(
|
|
53
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
54
|
+
* )) {
|
|
55
|
+
* // ...
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
23
58
|
*/
|
|
24
59
|
listCustomers(params: PlanListCustomersParams, options?: Core.RequestOptions): Core.PagePromise<PlanListCustomersResponsesCursorPage, PlanListCustomersResponse>;
|
|
25
60
|
}
|
|
@@ -31,7 +66,9 @@ export declare class PlanListCustomersResponsesCursorPage extends CursorPage<Pla
|
|
|
31
66
|
}
|
|
32
67
|
export interface PlanDetail {
|
|
33
68
|
id: string;
|
|
34
|
-
custom_fields:
|
|
69
|
+
custom_fields: {
|
|
70
|
+
[key: string]: string;
|
|
71
|
+
};
|
|
35
72
|
name: string;
|
|
36
73
|
credit_grants?: Array<PlanDetail.CreditGrant>;
|
|
37
74
|
description?: string;
|
|
@@ -77,7 +114,9 @@ export interface PlanListResponse {
|
|
|
77
114
|
id: string;
|
|
78
115
|
description: string;
|
|
79
116
|
name: string;
|
|
80
|
-
custom_fields?:
|
|
117
|
+
custom_fields?: {
|
|
118
|
+
[key: string]: string;
|
|
119
|
+
};
|
|
81
120
|
}
|
|
82
121
|
export interface PlanGetDetailsResponse {
|
|
83
122
|
data: PlanDetail;
|
|
@@ -86,7 +125,9 @@ export interface PlanListChargesResponse {
|
|
|
86
125
|
id: string;
|
|
87
126
|
charge_type: 'usage' | 'fixed' | 'composite' | 'minimum' | 'seat';
|
|
88
127
|
credit_type: Shared.CreditTypeData;
|
|
89
|
-
custom_fields:
|
|
128
|
+
custom_fields: {
|
|
129
|
+
[key: string]: string;
|
|
130
|
+
};
|
|
90
131
|
name: string;
|
|
91
132
|
prices: Array<PlanListChargesResponse.Price>;
|
|
92
133
|
product_id: string;
|
|
@@ -140,7 +181,9 @@ export interface PlanListCustomersResponse {
|
|
|
140
181
|
export declare namespace PlanListCustomersResponse {
|
|
141
182
|
interface PlanDetails {
|
|
142
183
|
id: string;
|
|
143
|
-
custom_fields:
|
|
184
|
+
custom_fields: {
|
|
185
|
+
[key: string]: string;
|
|
186
|
+
};
|
|
144
187
|
customer_plan_id: string;
|
|
145
188
|
name: string;
|
|
146
189
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/resources/v1/plans.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErE,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/resources/v1/plans.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErE,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,CAAC,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,2BAA2B,EAAE,gBAAgB,CAAC;IAClE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,2BAA2B,EAAE,gBAAgB,CAAC;IAWpG;;;;;;;;;OASG;IACH,UAAU,CACR,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAK1C;;;;;;;;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SAAQ,gBAAgB;IAC/D;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;CAClD;AAMD,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,2BAA2B,IAAI,2BAA2B,EAC1D,kCAAkC,IAAI,kCAAkC,EACxE,oCAAoC,IAAI,oCAAoC,EAC5E,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
package/resources/v1/plans.js
CHANGED
|
@@ -14,6 +14,13 @@ class Plans extends resource_1.APIResource {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Fetch high level details of a specific plan.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const response = await client.v1.plans.getDetails({
|
|
21
|
+
* plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
17
24
|
*/
|
|
18
25
|
getDetails(params, options) {
|
|
19
26
|
const { plan_id } = params;
|
|
@@ -21,6 +28,16 @@ class Plans extends resource_1.APIResource {
|
|
|
21
28
|
}
|
|
22
29
|
/**
|
|
23
30
|
* Fetches a list of charges of a specific plan.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* // Automatically fetches more pages as needed.
|
|
35
|
+
* for await (const planListChargesResponse of client.v1.plans.listCharges(
|
|
36
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
37
|
+
* )) {
|
|
38
|
+
* // ...
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
24
41
|
*/
|
|
25
42
|
listCharges(params, options) {
|
|
26
43
|
const { plan_id, ...query } = params;
|
|
@@ -32,6 +49,16 @@ class Plans extends resource_1.APIResource {
|
|
|
32
49
|
/**
|
|
33
50
|
* Fetches a list of customers on a specific plan (by default, only currently
|
|
34
51
|
* active plans are included)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* // Automatically fetches more pages as needed.
|
|
56
|
+
* for await (const planListCustomersResponse of client.v1.plans.listCustomers(
|
|
57
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
58
|
+
* )) {
|
|
59
|
+
* // ...
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
35
62
|
*/
|
|
36
63
|
listCustomers(params, options) {
|
|
37
64
|
const { plan_id, ...query } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/resources/v1/plans.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAI9C,oDAAqE;AAErE,MAAa,KAAM,SAAQ,sBAAW;
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/resources/v1/plans.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAI9C,oDAAqE;AAErE,MAAa,KAAM,SAAQ,sBAAW;IAiBpC,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,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
package/resources/v1/plans.mjs
CHANGED
|
@@ -11,6 +11,13 @@ export class Plans extends APIResource {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Fetch high level details of a specific plan.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response = await client.v1.plans.getDetails({
|
|
18
|
+
* plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
22
|
getDetails(params, options) {
|
|
16
23
|
const { plan_id } = params;
|
|
@@ -18,6 +25,16 @@ export class Plans extends APIResource {
|
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
27
|
* Fetches a list of charges of a specific plan.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // Automatically fetches more pages as needed.
|
|
32
|
+
* for await (const planListChargesResponse of client.v1.plans.listCharges(
|
|
33
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
34
|
+
* )) {
|
|
35
|
+
* // ...
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
21
38
|
*/
|
|
22
39
|
listCharges(params, options) {
|
|
23
40
|
const { plan_id, ...query } = params;
|
|
@@ -29,6 +46,16 @@ export class Plans extends APIResource {
|
|
|
29
46
|
/**
|
|
30
47
|
* Fetches a list of customers on a specific plan (by default, only currently
|
|
31
48
|
* active plans are included)
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* // Automatically fetches more pages as needed.
|
|
53
|
+
* for await (const planListCustomersResponse of client.v1.plans.listCustomers(
|
|
54
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
55
|
+
* )) {
|
|
56
|
+
* // ...
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
32
59
|
*/
|
|
33
60
|
listCustomers(params, options) {
|
|
34
61
|
const { plan_id, ...query } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.mjs","sourceRoot":"","sources":["../../src/resources/v1/plans.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,KAAM,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"plans.mjs","sourceRoot":"","sources":["../../src/resources/v1/plans.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,KAAM,SAAQ,WAAW;IAiBpC,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,2BAA2B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CACR,MAA4B,EAC5B,OAA6B;QAE7B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,WAAW,CACT,MAA6B,EAC7B,OAA6B;QAE7B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,OAAO,UAAU,EAAE,kCAAkC,EAAE;YACvG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,aAAa,CACX,MAA+B,EAC/B,OAA6B;QAE7B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,mBAAmB,OAAO,YAAY,EACtC,oCAAoC,EACpC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,UAA4B;CAAG;AAEhF,MAAM,OAAO,kCAAmC,SAAQ,UAAmC;CAAG;AAE9F,MAAM,OAAO,oCAAqC,SAAQ,UAAqC;CAAG;AAyNlG,KAAK,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;AAChE,KAAK,CAAC,kCAAkC,GAAG,kCAAkC,CAAC;AAC9E,KAAK,CAAC,oCAAoC,GAAG,oCAAoC,CAAC"}
|
|
@@ -4,6 +4,14 @@ import { CursorPage, type CursorPageParams } from "../../pagination.js";
|
|
|
4
4
|
export declare class PricingUnits extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* List all pricing units (known in the API by the legacy term "credit types").
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // Automatically fetches more pages as needed.
|
|
11
|
+
* for await (const pricingUnitListResponse of client.v1.pricingUnits.list()) {
|
|
12
|
+
* // ...
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
7
15
|
*/
|
|
8
16
|
list(query?: PricingUnitListParams, options?: Core.RequestOptions): Core.PagePromise<PricingUnitListResponsesCursorPage, PricingUnitListResponse>;
|
|
9
17
|
list(options?: Core.RequestOptions): Core.PagePromise<PricingUnitListResponsesCursorPage, PricingUnitListResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-units.d.ts","sourceRoot":"","sources":["../../src/resources/v1/pricing-units.ts"],"names":[],"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
|
1
|
-
{"version":3,"file":"pricing-units.js","sourceRoot":"","sources":["../../src/resources/v1/pricing-units.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,oDAAqE;AAErE,MAAa,YAAa,SAAQ,sBAAW;
|
|
1
|
+
{"version":3,"file":"pricing-units.js","sourceRoot":"","sources":["../../src/resources/v1/pricing-units.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,oDAAqE;AAErE,MAAa,YAAa,SAAQ,sBAAW;IAmB3C,IAAI,CACF,QAAqD,EAAE,EACvD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,kCAAkC,EAAE;YAC1F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,oCA+BC;AAED,MAAa,kCAAmC,SAAQ,uBAAmC;CAAG;AAA9F,gFAA8F;AAY9F,YAAY,CAAC,kCAAkC,GAAG,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-units.mjs","sourceRoot":"","sources":["../../src/resources/v1/pricing-units.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,YAAa,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"pricing-units.mjs","sourceRoot":"","sources":["../../src/resources/v1/pricing-units.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,UAAU,EAAyB;AAE5C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAmB3C,IAAI,CACF,QAAqD,EAAE,EACvD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,kCAAkC,EAAE;YAC1F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,OAAO,kCAAmC,SAAQ,UAAmC;CAAG;AAY9F,YAAY,CAAC,kCAAkC,GAAG,kCAAkC,CAAC"}
|
|
@@ -6,6 +6,11 @@ export declare class Services extends APIResource {
|
|
|
6
6
|
* addresses are not necessarily unique between services. In most cases, IP
|
|
7
7
|
* addresses will appear in the list at least 30 days before they are used for the
|
|
8
8
|
* first time.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const services = await client.v1.services.list();
|
|
13
|
+
* ```
|
|
9
14
|
*/
|
|
10
15
|
list(options?: Core.RequestOptions): Core.APIPromise<ServiceListResponse>;
|
|
11
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/resources/v1/services.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/resources/v1/services.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAG1E;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;CAC9C;AAED,yBAAiB,mBAAmB,CAAC;IACnC,UAAiB,OAAO;QACtB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEnB,IAAI,EAAE,MAAM,CAAC;QAEb,KAAK,EAAE,wBAAwB,GAAG,wBAAwB,CAAC;KAC5D;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC5D"}
|
package/resources/v1/services.js
CHANGED
|
@@ -9,6 +9,11 @@ class Services extends resource_1.APIResource {
|
|
|
9
9
|
* addresses are not necessarily unique between services. In most cases, IP
|
|
10
10
|
* addresses will appear in the list at least 30 days before they are used for the
|
|
11
11
|
* first time.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const services = await client.v1.services.list();
|
|
16
|
+
* ```
|
|
12
17
|
*/
|
|
13
18
|
list(options) {
|
|
14
19
|
return this._client.get('/v1/services', options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/resources/v1/services.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,QAAS,SAAQ,sBAAW;IACvC
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/resources/v1/services.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF;AAfD,4BAeC"}
|
|
@@ -6,6 +6,11 @@ export class Services extends APIResource {
|
|
|
6
6
|
* addresses are not necessarily unique between services. In most cases, IP
|
|
7
7
|
* addresses will appear in the list at least 30 days before they are used for the
|
|
8
8
|
* first time.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const services = await client.v1.services.list();
|
|
13
|
+
* ```
|
|
9
14
|
*/
|
|
10
15
|
list(options) {
|
|
11
16
|
return this._client.get('/v1/services', options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.mjs","sourceRoot":"","sources":["../../src/resources/v1/services.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"services.mjs","sourceRoot":"","sources":["../../src/resources/v1/services.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF"}
|
package/resources/v1/usage.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { APIResource } from "../../resource.js";
|
|
2
2
|
import * as Core from "../../core.js";
|
|
3
|
+
import * as Shared from "../shared.js";
|
|
3
4
|
import { CursorPage, type CursorPageParams } from "../../pagination.js";
|
|
4
5
|
export declare class Usage extends APIResource {
|
|
5
6
|
/**
|
|
6
7
|
* Fetch aggregated usage data for multiple customers and billable-metrics, broken
|
|
7
8
|
* into intervals of the specified length.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const usages = await client.v1.usage.list({
|
|
13
|
+
* ending_before: '2021-01-03T00:00:00Z',
|
|
14
|
+
* starting_on: '2021-01-01T00:00:00Z',
|
|
15
|
+
* window_size: 'day',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
8
18
|
*/
|
|
9
19
|
list(params: UsageListParams, options?: Core.RequestOptions): Core.APIPromise<UsageListResponse>;
|
|
10
20
|
/**
|
|
@@ -13,14 +23,61 @@ export declare class Usage extends APIResource {
|
|
|
13
23
|
* supported with a `Content-Encoding: gzip` header. See
|
|
14
24
|
* [Getting usage into Metronome](https://docs.metronome.com/connect-metronome/) to
|
|
15
25
|
* learn more about usage events.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* await client.v1.usage.ingest([
|
|
30
|
+
* {
|
|
31
|
+
* customer_id: 'team@example.com',
|
|
32
|
+
* event_type: 'heartbeat',
|
|
33
|
+
* timestamp: '2021-01-01T00:00:00Z',
|
|
34
|
+
* transaction_id: '2021-01-01T00:00:00Z_cluster42',
|
|
35
|
+
* },
|
|
36
|
+
* ]);
|
|
37
|
+
* ```
|
|
16
38
|
*/
|
|
17
39
|
ingest(body?: UsageIngestParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
18
40
|
ingest(options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
19
41
|
/**
|
|
20
42
|
* Fetch aggregated usage data for the specified customer, billable-metric, and
|
|
21
43
|
* optional group, broken into intervals of the specified length.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Automatically fetches more pages as needed.
|
|
48
|
+
* for await (const usageListWithGroupsResponse of client.v1.usage.listWithGroups(
|
|
49
|
+
* {
|
|
50
|
+
* billable_metric_id:
|
|
51
|
+
* '222796fd-d29c-429e-89b2-549fabda4ed6',
|
|
52
|
+
* customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb',
|
|
53
|
+
* window_size: 'day',
|
|
54
|
+
* ending_before: '2021-01-03T00:00:00Z',
|
|
55
|
+
* group_by: {
|
|
56
|
+
* key: 'region',
|
|
57
|
+
* values: ['US-East', 'US-West', 'EU-Central'],
|
|
58
|
+
* },
|
|
59
|
+
* starting_on: '2021-01-01T00:00:00Z',
|
|
60
|
+
* },
|
|
61
|
+
* )) {
|
|
62
|
+
* // ...
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
22
65
|
*/
|
|
23
66
|
listWithGroups(params: UsageListWithGroupsParams, options?: Core.RequestOptions): Core.PagePromise<UsageListWithGroupsResponsesCursorPage, UsageListWithGroupsResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* For a set of events, look up matched billable metrics and customers by
|
|
69
|
+
* transaction id. This endpoint looks at transactions that occurred in the last 34
|
|
70
|
+
* days, and is intended for sampling-based testing workflows. It is heavily rate
|
|
71
|
+
* limited.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const response = await client.v1.usage.search({
|
|
76
|
+
* transactionIds: ['2021-01-01T00:00:00Z_cluster42'],
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
search(body: UsageSearchParams, options?: Core.RequestOptions): Core.APIPromise<UsageSearchResponse>;
|
|
24
81
|
}
|
|
25
82
|
export declare class UsageListWithGroupsResponsesCursorPage extends CursorPage<UsageListWithGroupsResponse> {
|
|
26
83
|
}
|
|
@@ -40,7 +97,9 @@ export declare namespace UsageListResponse {
|
|
|
40
97
|
* Values will be either a number or null. Null indicates that there were no
|
|
41
98
|
* matches for the group_by value.
|
|
42
99
|
*/
|
|
43
|
-
groups?:
|
|
100
|
+
groups?: {
|
|
101
|
+
[key: string]: number | null;
|
|
102
|
+
};
|
|
44
103
|
}
|
|
45
104
|
}
|
|
46
105
|
export interface UsageListWithGroupsResponse {
|
|
@@ -50,6 +109,97 @@ export interface UsageListWithGroupsResponse {
|
|
|
50
109
|
starting_on: string;
|
|
51
110
|
value: number | null;
|
|
52
111
|
}
|
|
112
|
+
export type UsageSearchResponse = Array<UsageSearchResponse.UsageSearchResponseItem>;
|
|
113
|
+
export declare namespace UsageSearchResponse {
|
|
114
|
+
interface UsageSearchResponseItem {
|
|
115
|
+
id: string;
|
|
116
|
+
/**
|
|
117
|
+
* The ID of the customer in the ingest event body
|
|
118
|
+
*/
|
|
119
|
+
customer_id: string;
|
|
120
|
+
event_type: string;
|
|
121
|
+
timestamp: string;
|
|
122
|
+
transaction_id: string;
|
|
123
|
+
is_duplicate?: boolean;
|
|
124
|
+
matched_billable_metrics?: Array<UsageSearchResponseItem.MatchedBillableMetric>;
|
|
125
|
+
/**
|
|
126
|
+
* The customer the event was matched to if a match was found
|
|
127
|
+
*/
|
|
128
|
+
matched_customer?: UsageSearchResponseItem.MatchedCustomer;
|
|
129
|
+
processed_at?: string;
|
|
130
|
+
properties?: {
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
namespace UsageSearchResponseItem {
|
|
135
|
+
interface MatchedBillableMetric {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
/**
|
|
139
|
+
* (DEPRECATED) use aggregation_type instead
|
|
140
|
+
*/
|
|
141
|
+
aggregate?: string;
|
|
142
|
+
/**
|
|
143
|
+
* (DEPRECATED) use aggregation_key instead
|
|
144
|
+
*/
|
|
145
|
+
aggregate_keys?: Array<string>;
|
|
146
|
+
/**
|
|
147
|
+
* A key that specifies which property of the event is used to aggregate data. This
|
|
148
|
+
* key must be one of the property filter names and is not applicable when the
|
|
149
|
+
* aggregation type is 'count'.
|
|
150
|
+
*/
|
|
151
|
+
aggregation_key?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Specifies the type of aggregation performed on matching events.
|
|
154
|
+
*/
|
|
155
|
+
aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE';
|
|
156
|
+
/**
|
|
157
|
+
* RFC 3339 timestamp indicating when the billable metric was archived. If not
|
|
158
|
+
* provided, the billable metric is not archived.
|
|
159
|
+
*/
|
|
160
|
+
archived_at?: string;
|
|
161
|
+
custom_fields?: {
|
|
162
|
+
[key: string]: string;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* An optional filtering rule to match the 'event_type' property of an event.
|
|
166
|
+
*/
|
|
167
|
+
event_type_filter?: Shared.EventTypeFilter;
|
|
168
|
+
/**
|
|
169
|
+
* (DEPRECATED) use property_filters & event_type_filter instead
|
|
170
|
+
*/
|
|
171
|
+
filter?: {
|
|
172
|
+
[key: string]: unknown;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* (DEPRECATED) use group_keys instead
|
|
176
|
+
*/
|
|
177
|
+
group_by?: Array<string>;
|
|
178
|
+
/**
|
|
179
|
+
* Property names that are used to group usage costs on an invoice. Each entry
|
|
180
|
+
* represents a set of properties used to slice events into distinct buckets.
|
|
181
|
+
*/
|
|
182
|
+
group_keys?: Array<Array<string>>;
|
|
183
|
+
/**
|
|
184
|
+
* A list of filters to match events to this billable metric. Each filter defines a
|
|
185
|
+
* rule on an event property. All rules must pass for the event to match the
|
|
186
|
+
* billable metric.
|
|
187
|
+
*/
|
|
188
|
+
property_filters?: Array<Shared.PropertyFilter>;
|
|
189
|
+
/**
|
|
190
|
+
* The SQL query associated with the billable metric
|
|
191
|
+
*/
|
|
192
|
+
sql?: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The customer the event was matched to if a match was found
|
|
196
|
+
*/
|
|
197
|
+
interface MatchedCustomer {
|
|
198
|
+
id?: string;
|
|
199
|
+
name?: string;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
53
203
|
export interface UsageListParams {
|
|
54
204
|
/**
|
|
55
205
|
* Body param:
|
|
@@ -110,7 +260,9 @@ export declare namespace UsageIngestParams {
|
|
|
110
260
|
*/
|
|
111
261
|
timestamp: string;
|
|
112
262
|
transaction_id: string;
|
|
113
|
-
properties?:
|
|
263
|
+
properties?: {
|
|
264
|
+
[key: string]: unknown;
|
|
265
|
+
};
|
|
114
266
|
}
|
|
115
267
|
}
|
|
116
268
|
export interface UsageListWithGroupsParams extends CursorPageParams {
|
|
@@ -161,7 +313,13 @@ export declare namespace UsageListWithGroupsParams {
|
|
|
161
313
|
values?: Array<string>;
|
|
162
314
|
}
|
|
163
315
|
}
|
|
316
|
+
export interface UsageSearchParams {
|
|
317
|
+
/**
|
|
318
|
+
* The transaction IDs of the events to retrieve
|
|
319
|
+
*/
|
|
320
|
+
transactionIds: Array<string>;
|
|
321
|
+
}
|
|
164
322
|
export declare namespace Usage {
|
|
165
|
-
export { type UsageListResponse as UsageListResponse, type UsageListWithGroupsResponse as UsageListWithGroupsResponse, UsageListWithGroupsResponsesCursorPage as UsageListWithGroupsResponsesCursorPage, type UsageListParams as UsageListParams, type UsageIngestParams as UsageIngestParams, type UsageListWithGroupsParams as UsageListWithGroupsParams, };
|
|
323
|
+
export { type UsageListResponse as UsageListResponse, type UsageListWithGroupsResponse as UsageListWithGroupsResponse, type UsageSearchResponse as UsageSearchResponse, UsageListWithGroupsResponsesCursorPage as UsageListWithGroupsResponsesCursorPage, type UsageListParams as UsageListParams, type UsageIngestParams as UsageIngestParams, type UsageListWithGroupsParams as UsageListWithGroupsParams, type UsageSearchParams as UsageSearchParams, };
|
|
166
324
|
}
|
|
167
325
|
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErE,qBAAa,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/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AAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,yBAAyB,CAAC;IACzC,UAAiB,OAAO;QACtB;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;;WAGG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACxB;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC/B;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,sCAAsC,IAAI,sCAAsC,EAChF,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/v1/usage.js
CHANGED
|
@@ -9,6 +9,15 @@ class Usage extends resource_1.APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* Fetch aggregated usage data for multiple customers and billable-metrics, broken
|
|
11
11
|
* into intervals of the specified length.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const usages = await client.v1.usage.list({
|
|
16
|
+
* ending_before: '2021-01-03T00:00:00Z',
|
|
17
|
+
* starting_on: '2021-01-01T00:00:00Z',
|
|
18
|
+
* window_size: 'day',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
12
21
|
*/
|
|
13
22
|
list(params, options) {
|
|
14
23
|
const { next_page, ...body } = params;
|
|
@@ -27,6 +36,27 @@ class Usage extends resource_1.APIResource {
|
|
|
27
36
|
/**
|
|
28
37
|
* Fetch aggregated usage data for the specified customer, billable-metric, and
|
|
29
38
|
* optional group, broken into intervals of the specified length.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* // Automatically fetches more pages as needed.
|
|
43
|
+
* for await (const usageListWithGroupsResponse of client.v1.usage.listWithGroups(
|
|
44
|
+
* {
|
|
45
|
+
* billable_metric_id:
|
|
46
|
+
* '222796fd-d29c-429e-89b2-549fabda4ed6',
|
|
47
|
+
* customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb',
|
|
48
|
+
* window_size: 'day',
|
|
49
|
+
* ending_before: '2021-01-03T00:00:00Z',
|
|
50
|
+
* group_by: {
|
|
51
|
+
* key: 'region',
|
|
52
|
+
* values: ['US-East', 'US-West', 'EU-Central'],
|
|
53
|
+
* },
|
|
54
|
+
* starting_on: '2021-01-01T00:00:00Z',
|
|
55
|
+
* },
|
|
56
|
+
* )) {
|
|
57
|
+
* // ...
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
30
60
|
*/
|
|
31
61
|
listWithGroups(params, options) {
|
|
32
62
|
const { limit, next_page, ...body } = params;
|
|
@@ -37,6 +67,22 @@ class Usage extends resource_1.APIResource {
|
|
|
37
67
|
...options,
|
|
38
68
|
});
|
|
39
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* For a set of events, look up matched billable metrics and customers by
|
|
72
|
+
* transaction id. This endpoint looks at transactions that occurred in the last 34
|
|
73
|
+
* days, and is intended for sampling-based testing workflows. It is heavily rate
|
|
74
|
+
* limited.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const response = await client.v1.usage.search({
|
|
79
|
+
* transactionIds: ['2021-01-01T00:00:00Z_cluster42'],
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
search(body, options) {
|
|
84
|
+
return this._client.post('/v1/events/search', { body, ...options });
|
|
85
|
+
}
|
|
40
86
|
}
|
|
41
87
|
exports.Usage = Usage;
|
|
42
88
|
class UsageListWithGroupsResponsesCursorPage extends pagination_1.CursorPage {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/resources/v1/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,oDAAqE;AAErE,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,MAAuB,EAAE,OAA6B;QACzD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAuBD,MAAM,CACJ,IAA8C,EAC9C,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cAAc,CACZ,MAAiC,EACjC,OAA6B;QAE7B,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,sCAAsC,EAAE;YACzF,KAAK,EAAE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