orb-billing 1.27.0 → 1.28.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 +14 -0
- package/core.d.ts +0 -10
- package/core.d.ts.map +1 -1
- package/core.js +1 -13
- package/core.js.map +1 -1
- package/core.mjs +0 -11
- package/core.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.ts +1 -7
- package/resource.d.ts.map +1 -1
- package/resource.js +1 -7
- package/resource.js.map +1 -1
- package/resource.mjs +1 -7
- package/resource.mjs.map +1 -1
- package/resources/coupons/coupons.d.ts.map +1 -1
- package/resources/coupons/coupons.js +5 -5
- package/resources/coupons/coupons.js.map +1 -1
- package/resources/coupons/coupons.mjs +5 -5
- package/resources/coupons/coupons.mjs.map +1 -1
- package/resources/coupons/subscriptions.d.ts.map +1 -1
- package/resources/coupons/subscriptions.js +4 -1
- package/resources/coupons/subscriptions.js.map +1 -1
- package/resources/coupons/subscriptions.mjs +4 -1
- package/resources/coupons/subscriptions.mjs.map +1 -1
- package/resources/credit-notes.js +2 -2
- package/resources/credit-notes.js.map +1 -1
- package/resources/credit-notes.mjs +2 -2
- package/resources/credit-notes.mjs.map +1 -1
- package/resources/customers/balance-transactions.js +2 -2
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs +2 -2
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/costs.d.ts.map +1 -1
- package/resources/customers/costs.js +5 -2
- package/resources/customers/costs.js.map +1 -1
- package/resources/customers/costs.mjs +5 -2
- package/resources/customers/costs.mjs.map +1 -1
- package/resources/customers/credits/credits.d.ts.map +1 -1
- package/resources/customers/credits/credits.js +3 -3
- package/resources/customers/credits/credits.js.map +1 -1
- package/resources/customers/credits/credits.mjs +3 -3
- package/resources/customers/credits/credits.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +132 -20
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js +4 -4
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs +4 -4
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/customers.d.ts +11 -10
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js +12 -12
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs +12 -12
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/customers/usage.js +2 -2
- package/resources/customers/usage.js.map +1 -1
- package/resources/customers/usage.mjs +2 -2
- package/resources/customers/usage.mjs.map +1 -1
- package/resources/events/backfills.js +5 -5
- package/resources/events/backfills.js.map +1 -1
- package/resources/events/backfills.mjs +5 -5
- package/resources/events/backfills.mjs.map +1 -1
- package/resources/events/events.d.ts.map +1 -1
- package/resources/events/events.js +5 -5
- package/resources/events/events.js.map +1 -1
- package/resources/events/events.mjs +5 -5
- package/resources/events/events.mjs.map +1 -1
- package/resources/invoice-line-items.js +1 -1
- package/resources/invoice-line-items.js.map +1 -1
- package/resources/invoice-line-items.mjs +1 -1
- package/resources/invoice-line-items.mjs.map +1 -1
- package/resources/invoices.d.ts +10 -2
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +7 -7
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +7 -7
- package/resources/invoices.mjs.map +1 -1
- package/resources/items.js +3 -3
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +3 -3
- package/resources/items.mjs.map +1 -1
- package/resources/metrics.d.ts +14 -3
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js +3 -3
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs +3 -3
- package/resources/metrics.mjs.map +1 -1
- package/resources/plans/external-plan-id.d.ts +4 -1
- package/resources/plans/external-plan-id.d.ts.map +1 -1
- package/resources/plans/external-plan-id.js +2 -2
- package/resources/plans/external-plan-id.js.map +1 -1
- package/resources/plans/external-plan-id.mjs +2 -2
- package/resources/plans/external-plan-id.mjs.map +1 -1
- package/resources/plans/plans.d.ts +13 -3
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js +5 -5
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs +5 -5
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/external-price-id.js +1 -1
- package/resources/prices/external-price-id.js.map +1 -1
- package/resources/prices/external-price-id.mjs +1 -1
- package/resources/prices/external-price-id.mjs.map +1 -1
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js +4 -4
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs +4 -4
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/subscriptions.d.ts +7 -4
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +17 -14
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +17 -14
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/top-level.js +1 -1
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +1 -1
- package/resources/top-level.mjs.map +1 -1
- package/src/core.ts +0 -21
- package/src/resource.ts +3 -16
- package/src/resources/coupons/coupons.ts +5 -5
- package/src/resources/coupons/subscriptions.ts +4 -1
- package/src/resources/credit-notes.ts +2 -2
- package/src/resources/customers/balance-transactions.ts +2 -2
- package/src/resources/customers/costs.ts +5 -2
- package/src/resources/customers/credits/credits.ts +3 -3
- package/src/resources/customers/credits/ledger.ts +136 -24
- package/src/resources/customers/customers.ts +22 -21
- package/src/resources/customers/usage.ts +2 -2
- package/src/resources/events/backfills.ts +5 -5
- package/src/resources/events/events.ts +5 -5
- package/src/resources/invoice-line-items.ts +1 -1
- package/src/resources/invoices.ts +17 -9
- package/src/resources/items.ts +3 -3
- package/src/resources/metrics.ts +17 -6
- package/src/resources/plans/external-plan-id.ts +6 -3
- package/src/resources/plans/plans.ts +18 -8
- package/src/resources/prices/external-price-id.ts +1 -1
- package/src/resources/prices/prices.ts +4 -4
- package/src/resources/subscriptions.ts +24 -18
- package/src/resources/top-level.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -11,11 +11,11 @@ import * as CreditsAPI from "./credits/credits";
|
|
|
11
11
|
import { Page, type PageParams } from "../../pagination";
|
|
12
12
|
|
|
13
13
|
export class Customers extends APIResource {
|
|
14
|
-
costs: CostsAPI.Costs = new CostsAPI.Costs(this.
|
|
15
|
-
usage: UsageAPI.Usage = new UsageAPI.Usage(this.
|
|
16
|
-
credits: CreditsAPI.Credits = new CreditsAPI.Credits(this.
|
|
14
|
+
costs: CostsAPI.Costs = new CostsAPI.Costs(this._client);
|
|
15
|
+
usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
|
|
16
|
+
credits: CreditsAPI.Credits = new CreditsAPI.Credits(this._client);
|
|
17
17
|
balanceTransactions: BalanceTransactionsAPI.BalanceTransactions =
|
|
18
|
-
new BalanceTransactionsAPI.BalanceTransactions(this.
|
|
18
|
+
new BalanceTransactionsAPI.BalanceTransactions(this._client);
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* This operation is used to create an Orb customer, who is party to the core
|
|
@@ -32,7 +32,7 @@ export class Customers extends APIResource {
|
|
|
32
32
|
* configured on a per-customer basis by setting the `timezone` parameter
|
|
33
33
|
*/
|
|
34
34
|
create(body: CustomerCreateParams, options?: Core.RequestOptions): Core.APIPromise<Customer> {
|
|
35
|
-
return this.post('/customers', { body, ...options });
|
|
35
|
+
return this._client.post('/customers', { body, ...options });
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -56,7 +56,7 @@ export class Customers extends APIResource {
|
|
|
56
56
|
if (isRequestOptions(body)) {
|
|
57
57
|
return this.update(customerId, {}, body);
|
|
58
58
|
}
|
|
59
|
-
return this.put(`/customers/${customerId}`, { body, ...options });
|
|
59
|
+
return this._client.put(`/customers/${customerId}`, { body, ...options });
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -77,7 +77,7 @@ export class Customers extends APIResource {
|
|
|
77
77
|
if (isRequestOptions(query)) {
|
|
78
78
|
return this.list({}, query);
|
|
79
79
|
}
|
|
80
|
-
return this.getAPIList('/customers', CustomersPage, { query, ...options });
|
|
80
|
+
return this._client.getAPIList('/customers', CustomersPage, { query, ...options });
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
@@ -94,8 +94,8 @@ export class Customers extends APIResource {
|
|
|
94
94
|
*
|
|
95
95
|
* On successful processing, this returns an empty dictionary (`{}`) in the API.
|
|
96
96
|
*/
|
|
97
|
-
|
|
98
|
-
return this.delete(`/customers/${customerId}`, {
|
|
97
|
+
delete(customerId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
98
|
+
return this._client.delete(`/customers/${customerId}`, {
|
|
99
99
|
...options,
|
|
100
100
|
headers: { Accept: '', ...options?.headers },
|
|
101
101
|
});
|
|
@@ -110,7 +110,7 @@ export class Customers extends APIResource {
|
|
|
110
110
|
* discussion of the Customer model.
|
|
111
111
|
*/
|
|
112
112
|
fetch(customerId: string, options?: Core.RequestOptions): Core.APIPromise<Customer> {
|
|
113
|
-
return this.get(`/customers/${customerId}`, options);
|
|
113
|
+
return this._client.get(`/customers/${customerId}`, options);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
@@ -121,7 +121,7 @@ export class Customers extends APIResource {
|
|
|
121
121
|
* [Get Customer](fetch-customer).
|
|
122
122
|
*/
|
|
123
123
|
fetchByExternalId(externalCustomerId: string, options?: Core.RequestOptions): Core.APIPromise<Customer> {
|
|
124
|
-
return this.get(`/customers/external_customer_id/${externalCustomerId}`, options);
|
|
124
|
+
return this._client.get(`/customers/external_customer_id/${externalCustomerId}`, options);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
/**
|
|
@@ -144,7 +144,7 @@ export class Customers extends APIResource {
|
|
|
144
144
|
if (isRequestOptions(body)) {
|
|
145
145
|
return this.updateByExternalId(id, {}, body);
|
|
146
146
|
}
|
|
147
|
-
return this.put(`/customers/external_customer_id/${id}`, { body, ...options });
|
|
147
|
+
return this._client.put(`/customers/external_customer_id/${id}`, { body, ...options });
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -205,6 +205,10 @@ export interface Customer {
|
|
|
205
205
|
*/
|
|
206
206
|
external_customer_id: string | null;
|
|
207
207
|
|
|
208
|
+
/**
|
|
209
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
210
|
+
* dictionary.
|
|
211
|
+
*/
|
|
208
212
|
metadata: Record<string, string>;
|
|
209
213
|
|
|
210
214
|
/**
|
|
@@ -628,10 +632,9 @@ export interface CustomerCreateParams {
|
|
|
628
632
|
external_customer_id?: string | null;
|
|
629
633
|
|
|
630
634
|
/**
|
|
631
|
-
* User-specified key
|
|
632
|
-
* or IDs. Returned as-is in the customer resource.
|
|
635
|
+
* User-specified key/value pairs for the resource.
|
|
633
636
|
*/
|
|
634
|
-
metadata?:
|
|
637
|
+
metadata?: Record<string, string | null> | null;
|
|
635
638
|
|
|
636
639
|
/**
|
|
637
640
|
* This is used for creating charges or invoices in an external system via Orb.
|
|
@@ -1031,10 +1034,9 @@ export interface CustomerUpdateParams {
|
|
|
1031
1034
|
email_delivery?: boolean | null;
|
|
1032
1035
|
|
|
1033
1036
|
/**
|
|
1034
|
-
* User-specified key
|
|
1035
|
-
* or IDs. Returned as-is in the customer resource.
|
|
1037
|
+
* User-specified key/value pairs for the resource.
|
|
1036
1038
|
*/
|
|
1037
|
-
metadata?:
|
|
1039
|
+
metadata?: Record<string, string | null> | null;
|
|
1038
1040
|
|
|
1039
1041
|
/**
|
|
1040
1042
|
* The full name of the customer
|
|
@@ -1446,10 +1448,9 @@ export interface CustomerUpdateByExternalIDParams {
|
|
|
1446
1448
|
email_delivery?: boolean | null;
|
|
1447
1449
|
|
|
1448
1450
|
/**
|
|
1449
|
-
* User-specified key
|
|
1450
|
-
* or IDs. Returned as-is in the customer resource.
|
|
1451
|
+
* User-specified key/value pairs for the resource.
|
|
1451
1452
|
*/
|
|
1452
|
-
metadata?:
|
|
1453
|
+
metadata?: Record<string, string | null> | null;
|
|
1453
1454
|
|
|
1454
1455
|
/**
|
|
1455
1456
|
* The full name of the customer
|
|
@@ -109,7 +109,7 @@ export class Usage extends APIResource {
|
|
|
109
109
|
options?: Core.RequestOptions,
|
|
110
110
|
): Core.APIPromise<UsageUpdateResponse> {
|
|
111
111
|
const { timeframe_end, timeframe_start, ...body } = params;
|
|
112
|
-
return this.patch(`/customers/${id}/usage`, {
|
|
112
|
+
return this._client.patch(`/customers/${id}/usage`, {
|
|
113
113
|
query: { timeframe_end, timeframe_start },
|
|
114
114
|
body,
|
|
115
115
|
...options,
|
|
@@ -220,7 +220,7 @@ export class Usage extends APIResource {
|
|
|
220
220
|
options?: Core.RequestOptions,
|
|
221
221
|
): Core.APIPromise<UsageUpdateByExternalIDResponse> {
|
|
222
222
|
const { timeframe_end, timeframe_start, ...body } = params;
|
|
223
|
-
return this.patch(`/customers/external_customer_id/${id}/usage`, {
|
|
223
|
+
return this._client.patch(`/customers/external_customer_id/${id}/usage`, {
|
|
224
224
|
query: { timeframe_end, timeframe_start },
|
|
225
225
|
body,
|
|
226
226
|
...options,
|
|
@@ -35,7 +35,7 @@ export class Backfills extends APIResource {
|
|
|
35
35
|
* events.
|
|
36
36
|
*/
|
|
37
37
|
create(body: BackfillCreateParams, options?: Core.RequestOptions): Core.APIPromise<BackfillCreateResponse> {
|
|
38
|
-
return this.post('/events/backfills', { body, ...options });
|
|
38
|
+
return this._client.post('/events/backfills', { body, ...options });
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -59,7 +59,7 @@ export class Backfills extends APIResource {
|
|
|
59
59
|
if (isRequestOptions(query)) {
|
|
60
60
|
return this.list({}, query);
|
|
61
61
|
}
|
|
62
|
-
return this.getAPIList('/events/backfills', BackfillListResponsesPage, { query, ...options });
|
|
62
|
+
return this._client.getAPIList('/events/backfills', BackfillListResponsesPage, { query, ...options });
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -69,14 +69,14 @@ export class Backfills extends APIResource {
|
|
|
69
69
|
* will transition to `reflected`.
|
|
70
70
|
*/
|
|
71
71
|
close(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillCloseResponse> {
|
|
72
|
-
return this.post(`/events/backfills/${backfillId}/close`, options);
|
|
72
|
+
return this._client.post(`/events/backfills/${backfillId}/close`, options);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* This endpoint is used to fetch a backfill given an identifier.
|
|
77
77
|
*/
|
|
78
78
|
fetch(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillFetchResponse> {
|
|
79
|
-
return this.get(`/events/backfills/${backfillId}`, options);
|
|
79
|
+
return this._client.get(`/events/backfills/${backfillId}`, options);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -89,7 +89,7 @@ export class Backfills extends APIResource {
|
|
|
89
89
|
* result of the backfill and it will immediately transition to `reverted`.
|
|
90
90
|
*/
|
|
91
91
|
revert(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillRevertResponse> {
|
|
92
|
-
return this.post(`/events/backfills/${backfillId}/revert`, options);
|
|
92
|
+
return this._client.post(`/events/backfills/${backfillId}/revert`, options);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -6,7 +6,7 @@ import * as EventsAPI from "./events";
|
|
|
6
6
|
import * as BackfillsAPI from "./backfills";
|
|
7
7
|
|
|
8
8
|
export class Events extends APIResource {
|
|
9
|
-
backfills: BackfillsAPI.Backfills = new BackfillsAPI.Backfills(this.
|
|
9
|
+
backfills: BackfillsAPI.Backfills = new BackfillsAPI.Backfills(this._client);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* This endpoint is used to amend a single usage event with a given `event_id`.
|
|
@@ -58,7 +58,7 @@ export class Events extends APIResource {
|
|
|
58
58
|
body: EventUpdateParams,
|
|
59
59
|
options?: Core.RequestOptions,
|
|
60
60
|
): Core.APIPromise<EventUpdateResponse> {
|
|
61
|
-
return this.put(`/events/${eventId}`, { body, ...options });
|
|
61
|
+
return this._client.put(`/events/${eventId}`, { body, ...options });
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -101,7 +101,7 @@ export class Events extends APIResource {
|
|
|
101
101
|
* deprecating events for customers not in the Orb system.
|
|
102
102
|
*/
|
|
103
103
|
deprecate(eventId: string, options?: Core.RequestOptions): Core.APIPromise<EventDeprecateResponse> {
|
|
104
|
-
return this.put(`/events/${eventId}/deprecate`, options);
|
|
104
|
+
return this._client.put(`/events/${eventId}/deprecate`, options);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
@@ -306,7 +306,7 @@ export class Events extends APIResource {
|
|
|
306
306
|
*/
|
|
307
307
|
ingest(params: EventIngestParams, options?: Core.RequestOptions): Core.APIPromise<EventIngestResponse> {
|
|
308
308
|
const { backfill_id, debug, ...body } = params;
|
|
309
|
-
return this.post('/ingest', { query: { backfill_id, debug }, body, ...options });
|
|
309
|
+
return this._client.post('/ingest', { query: { backfill_id, debug }, body, ...options });
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
/**
|
|
@@ -329,7 +329,7 @@ export class Events extends APIResource {
|
|
|
329
329
|
* empty array for `data` instead.
|
|
330
330
|
*/
|
|
331
331
|
search(body: EventSearchParams, options?: Core.RequestOptions): Core.APIPromise<EventSearchResponse> {
|
|
332
|
-
return this.post('/events/search', { body, ...options });
|
|
332
|
+
return this._client.post('/events/search', { body, ...options });
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
@@ -15,7 +15,7 @@ export class InvoiceLineItems extends APIResource {
|
|
|
15
15
|
body: InvoiceLineItemCreateParams,
|
|
16
16
|
options?: Core.RequestOptions,
|
|
17
17
|
): Core.APIPromise<InvoiceLineItemCreateResponse> {
|
|
18
|
-
return this.post('/invoice_line_items', { body, ...options });
|
|
18
|
+
return this._client.post('/invoice_line_items', { body, ...options });
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -13,7 +13,7 @@ export class Invoices extends APIResource {
|
|
|
13
13
|
* This endpoint is used to create a one-off invoice for a customer.
|
|
14
14
|
*/
|
|
15
15
|
create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
16
|
-
return this.post('/invoices', { body, ...options });
|
|
16
|
+
return this._client.post('/invoices', { body, ...options });
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -36,7 +36,7 @@ export class Invoices extends APIResource {
|
|
|
36
36
|
if (isRequestOptions(query)) {
|
|
37
37
|
return this.list({}, query);
|
|
38
38
|
}
|
|
39
|
-
return this.getAPIList('/invoices', InvoicesPage, { query, ...options });
|
|
39
|
+
return this._client.getAPIList('/invoices', InvoicesPage, { query, ...options });
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -44,7 +44,7 @@ export class Invoices extends APIResource {
|
|
|
44
44
|
* an identifier.
|
|
45
45
|
*/
|
|
46
46
|
fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
47
|
-
return this.get(`/invoices/${invoiceId}`, options);
|
|
47
|
+
return this._client.get(`/invoices/${invoiceId}`, options);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -64,7 +64,7 @@ export class Invoices extends APIResource {
|
|
|
64
64
|
if (isRequestOptions(query)) {
|
|
65
65
|
return this.fetchUpcoming({}, query);
|
|
66
66
|
}
|
|
67
|
-
return this.get('/invoices/upcoming', { query, ...options });
|
|
67
|
+
return this._client.get('/invoices/upcoming', { query, ...options });
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -76,7 +76,7 @@ export class Invoices extends APIResource {
|
|
|
76
76
|
* providers, etc).
|
|
77
77
|
*/
|
|
78
78
|
issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
79
|
-
return this.post(`/invoices/${invoiceId}/issue`, options);
|
|
79
|
+
return this._client.post(`/invoices/${invoiceId}/issue`, options);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -88,7 +88,7 @@ export class Invoices extends APIResource {
|
|
|
88
88
|
body: InvoiceMarkPaidParams,
|
|
89
89
|
options?: Core.RequestOptions,
|
|
90
90
|
): Core.APIPromise<Invoice> {
|
|
91
|
-
return this.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
|
|
91
|
+
return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/**
|
|
@@ -101,7 +101,7 @@ export class Invoices extends APIResource {
|
|
|
101
101
|
* customer balance upon voiding.
|
|
102
102
|
*/
|
|
103
103
|
void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
|
|
104
|
-
return this.post(`/invoices/${invoiceId}/void`, options);
|
|
104
|
+
return this._client.post(`/invoices/${invoiceId}/void`, options);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -298,7 +298,11 @@ export interface Invoice {
|
|
|
298
298
|
*/
|
|
299
299
|
memo: string | null;
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
/**
|
|
302
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
303
|
+
* dictionary.
|
|
304
|
+
*/
|
|
305
|
+
metadata: Record<string, string>;
|
|
302
306
|
|
|
303
307
|
minimum: Invoice.Minimum | null;
|
|
304
308
|
|
|
@@ -1363,7 +1367,11 @@ export interface InvoiceFetchUpcomingResponse {
|
|
|
1363
1367
|
*/
|
|
1364
1368
|
memo: string | null;
|
|
1365
1369
|
|
|
1366
|
-
|
|
1370
|
+
/**
|
|
1371
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
1372
|
+
* dictionary.
|
|
1373
|
+
*/
|
|
1374
|
+
metadata: Record<string, string>;
|
|
1367
1375
|
|
|
1368
1376
|
minimum: InvoiceFetchUpcomingResponse.Minimum | null;
|
|
1369
1377
|
|
package/src/resources/items.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Items extends APIResource {
|
|
|
11
11
|
* This endpoint is used to create an [Item](../guides/concepts#item).
|
|
12
12
|
*/
|
|
13
13
|
create(body: ItemCreateParams, options?: Core.RequestOptions): Core.APIPromise<Item> {
|
|
14
|
-
return this.post('/items', { body, ...options });
|
|
14
|
+
return this._client.post('/items', { body, ...options });
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -27,14 +27,14 @@ export class Items extends APIResource {
|
|
|
27
27
|
if (isRequestOptions(query)) {
|
|
28
28
|
return this.list({}, query);
|
|
29
29
|
}
|
|
30
|
-
return this.getAPIList('/items', ItemsPage, { query, ...options });
|
|
30
|
+
return this._client.getAPIList('/items', ItemsPage, { query, ...options });
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* This endpoint returns an item identified by its item_id.
|
|
35
35
|
*/
|
|
36
36
|
fetch(itemId: string, options?: Core.RequestOptions): Core.APIPromise<Item> {
|
|
37
|
-
return this.get(`/items/${itemId}`, options);
|
|
37
|
+
return this._client.get(`/items/${itemId}`, options);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
package/src/resources/metrics.ts
CHANGED
|
@@ -15,7 +15,7 @@ export class Metrics extends APIResource {
|
|
|
15
15
|
* description of constructing SQL queries with examples.
|
|
16
16
|
*/
|
|
17
17
|
create(body: MetricCreateParams, options?: Core.RequestOptions): Core.APIPromise<MetricCreateResponse> {
|
|
18
|
-
return this.post('/metrics', { body, ...options });
|
|
18
|
+
return this._client.post('/metrics', { body, ...options });
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -35,7 +35,7 @@ export class Metrics extends APIResource {
|
|
|
35
35
|
if (isRequestOptions(query)) {
|
|
36
36
|
return this.list({}, query);
|
|
37
37
|
}
|
|
38
|
-
return this.getAPIList('/metrics', MetricListResponsesPage, { query, ...options });
|
|
38
|
+
return this._client.getAPIList('/metrics', MetricListResponsesPage, { query, ...options });
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -43,7 +43,7 @@ export class Metrics extends APIResource {
|
|
|
43
43
|
* information about the metrics including its name, description, and item.
|
|
44
44
|
*/
|
|
45
45
|
fetch(metricId: string, options?: Core.RequestOptions): Core.APIPromise<MetricFetchResponse> {
|
|
46
|
-
return this.get(`/metrics/${metricId}`, options);
|
|
46
|
+
return this._client.get(`/metrics/${metricId}`, options);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -66,6 +66,10 @@ export interface MetricCreateResponse {
|
|
|
66
66
|
*/
|
|
67
67
|
item: ItemsAPI.Item;
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
71
|
+
* dictionary.
|
|
72
|
+
*/
|
|
69
73
|
metadata: Record<string, string>;
|
|
70
74
|
|
|
71
75
|
name: string;
|
|
@@ -90,6 +94,10 @@ export interface MetricListResponse {
|
|
|
90
94
|
*/
|
|
91
95
|
item: ItemsAPI.Item;
|
|
92
96
|
|
|
97
|
+
/**
|
|
98
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
99
|
+
* dictionary.
|
|
100
|
+
*/
|
|
93
101
|
metadata: Record<string, string>;
|
|
94
102
|
|
|
95
103
|
name: string;
|
|
@@ -114,6 +122,10 @@ export interface MetricFetchResponse {
|
|
|
114
122
|
*/
|
|
115
123
|
item: ItemsAPI.Item;
|
|
116
124
|
|
|
125
|
+
/**
|
|
126
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
127
|
+
* dictionary.
|
|
128
|
+
*/
|
|
117
129
|
metadata: Record<string, string>;
|
|
118
130
|
|
|
119
131
|
name: string;
|
|
@@ -143,10 +155,9 @@ export interface MetricCreateParams {
|
|
|
143
155
|
sql: string;
|
|
144
156
|
|
|
145
157
|
/**
|
|
146
|
-
* User-specified key
|
|
147
|
-
* or IDs. Returned as-is in the metric resource.
|
|
158
|
+
* User-specified key/value pairs for the resource.
|
|
148
159
|
*/
|
|
149
|
-
metadata?:
|
|
160
|
+
metadata?: Record<string, string | null> | null;
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
export interface MetricListParams extends PageParams {
|
|
@@ -35,7 +35,7 @@ export class ExternalPlanID extends APIResource {
|
|
|
35
35
|
if (isRequestOptions(body)) {
|
|
36
36
|
return this.update(otherExternalPlanId, {}, body);
|
|
37
37
|
}
|
|
38
|
-
return this.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
|
|
38
|
+
return this._client.put(`/plans/external_plan_id/${otherExternalPlanId}`, { body, ...options });
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -53,7 +53,7 @@ export class ExternalPlanID extends APIResource {
|
|
|
53
53
|
* [Price schema](../guides/concepts#plan-and-price). "
|
|
54
54
|
*/
|
|
55
55
|
fetch(externalPlanId: string, options?: Core.RequestOptions): Core.APIPromise<PlansAPI.Plan> {
|
|
56
|
-
return this.get(`/plans/external_plan_id/${externalPlanId}`, options);
|
|
56
|
+
return this._client.get(`/plans/external_plan_id/${externalPlanId}`, options);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -65,7 +65,10 @@ export interface ExternalPlanIDUpdateParams {
|
|
|
65
65
|
*/
|
|
66
66
|
external_plan_id?: string | null;
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
/**
|
|
69
|
+
* User-specified key/value pairs for the resource.
|
|
70
|
+
*/
|
|
71
|
+
metadata?: Record<string, string | null> | null;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
export namespace ExternalPlanID {
|
|
@@ -10,13 +10,13 @@ import * as PricesAPI from "../prices/prices";
|
|
|
10
10
|
import { Page, type PageParams } from "../../pagination";
|
|
11
11
|
|
|
12
12
|
export class Plans extends APIResource {
|
|
13
|
-
externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this.
|
|
13
|
+
externalPlanId: ExternalPlanIDAPI.ExternalPlanID = new ExternalPlanIDAPI.ExternalPlanID(this._client);
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* This endpoint allows creation of plans including their prices.
|
|
17
17
|
*/
|
|
18
18
|
create(body: PlanCreateParams, options?: Core.RequestOptions): Core.APIPromise<Plan> {
|
|
19
|
-
return this.post('/plans', { body, ...options });
|
|
19
|
+
return this._client.post('/plans', { body, ...options });
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -35,7 +35,7 @@ export class Plans extends APIResource {
|
|
|
35
35
|
if (isRequestOptions(body)) {
|
|
36
36
|
return this.update(planId, {}, body);
|
|
37
37
|
}
|
|
38
|
-
return this.put(`/plans/${planId}`, { body, ...options });
|
|
38
|
+
return this._client.put(`/plans/${planId}`, { body, ...options });
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -54,7 +54,7 @@ export class Plans extends APIResource {
|
|
|
54
54
|
if (isRequestOptions(query)) {
|
|
55
55
|
return this.list({}, query);
|
|
56
56
|
}
|
|
57
|
-
return this.getAPIList('/plans', PlansPage, { query, ...options });
|
|
57
|
+
return this._client.getAPIList('/plans', PlansPage, { query, ...options });
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
@@ -77,7 +77,7 @@ export class Plans extends APIResource {
|
|
|
77
77
|
* the serialized prices refer to all prices across all phases.
|
|
78
78
|
*/
|
|
79
79
|
fetch(planId: string, options?: Core.RequestOptions): Core.APIPromise<Plan> {
|
|
80
|
-
return this.get(`/plans/${planId}`, options);
|
|
80
|
+
return this._client.get(`/plans/${planId}`, options);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -135,7 +135,11 @@ export interface Plan {
|
|
|
135
135
|
|
|
136
136
|
maximum_amount: string | null;
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
/**
|
|
139
|
+
* User specified key-value pairs. If not provided, this defaults to an empty
|
|
140
|
+
* dictionary.
|
|
141
|
+
*/
|
|
142
|
+
metadata: Record<string, string>;
|
|
139
143
|
|
|
140
144
|
minimum: Plan.Minimum | null;
|
|
141
145
|
|
|
@@ -316,7 +320,10 @@ export interface PlanCreateParams {
|
|
|
316
320
|
|
|
317
321
|
external_plan_id?: string | null;
|
|
318
322
|
|
|
319
|
-
|
|
323
|
+
/**
|
|
324
|
+
* User-specified key/value pairs for the resource.
|
|
325
|
+
*/
|
|
326
|
+
metadata?: Record<string, string | null> | null;
|
|
320
327
|
|
|
321
328
|
/**
|
|
322
329
|
* The net terms determines the difference between the invoice date and the issue
|
|
@@ -1127,7 +1134,10 @@ export interface PlanUpdateParams {
|
|
|
1127
1134
|
*/
|
|
1128
1135
|
external_plan_id?: string | null;
|
|
1129
1136
|
|
|
1130
|
-
|
|
1137
|
+
/**
|
|
1138
|
+
* User-specified key/value pairs for the resource.
|
|
1139
|
+
*/
|
|
1140
|
+
metadata?: Record<string, string | null> | null;
|
|
1131
1141
|
}
|
|
1132
1142
|
|
|
1133
1143
|
export interface PlanListParams extends PageParams {
|
|
@@ -11,6 +11,6 @@ export class ExternalPriceID extends APIResource {
|
|
|
11
11
|
* external price aliases.
|
|
12
12
|
*/
|
|
13
13
|
fetch(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise<PricesAPI.Price> {
|
|
14
|
-
return this.get(`/prices/external_price_id/${externalPriceId}`, options);
|
|
14
|
+
return this._client.get(`/prices/external_price_id/${externalPriceId}`, options);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -9,7 +9,7 @@ import * as ExternalPriceIDAPI from "./external-price-id";
|
|
|
9
9
|
import { Page, type PageParams } from "../../pagination";
|
|
10
10
|
|
|
11
11
|
export class Prices extends APIResource {
|
|
12
|
-
externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this.
|
|
12
|
+
externalPriceId: ExternalPriceIDAPI.ExternalPriceID = new ExternalPriceIDAPI.ExternalPriceID(this._client);
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* This endpoint is used to create a [price](../reference/price). A price created
|
|
@@ -24,7 +24,7 @@ export class Prices extends APIResource {
|
|
|
24
24
|
* price model configurations possible in this endpoint.
|
|
25
25
|
*/
|
|
26
26
|
create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Price> {
|
|
27
|
-
return this.post('/prices', { body, ...options });
|
|
27
|
+
return this._client.post('/prices', { body, ...options });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -40,14 +40,14 @@ export class Prices extends APIResource {
|
|
|
40
40
|
if (isRequestOptions(query)) {
|
|
41
41
|
return this.list({}, query);
|
|
42
42
|
}
|
|
43
|
-
return this.getAPIList('/prices', PricesPage, { query, ...options });
|
|
43
|
+
return this._client.getAPIList('/prices', PricesPage, { query, ...options });
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* This endpoint returns a price given an identifier.
|
|
48
48
|
*/
|
|
49
49
|
fetch(priceId: string, options?: Core.RequestOptions): Core.APIPromise<Price> {
|
|
50
|
-
return this.get(`/prices/${priceId}`, options);
|
|
50
|
+
return this._client.get(`/prices/${priceId}`, options);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|