@stigg/typescript 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +20 -0
- package/README.md +31 -0
- package/core/pagination.d.mts +11 -5
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +11 -5
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +9 -9
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +9 -9
- package/core/pagination.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/v1/coupons.d.mts +100 -86
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +100 -86
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +8 -4
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +8 -4
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +101 -96
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +101 -96
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +11 -7
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +11 -7
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +2 -2
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +2 -2
- 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/payment-method.d.mts +5 -2
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +5 -2
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +2 -2
- package/resources/v1/customers/payment-method.mjs +2 -2
- package/resources/v1/customers/usage.d.mts +0 -94
- package/resources/v1/customers/usage.d.mts.map +1 -1
- package/resources/v1/customers/usage.d.ts +0 -94
- package/resources/v1/customers/usage.d.ts.map +1 -1
- package/resources/v1/customers/usage.js +0 -11
- package/resources/v1/customers/usage.js.map +1 -1
- package/resources/v1/customers/usage.mjs +0 -11
- package/resources/v1/customers/usage.mjs.map +1 -1
- package/resources/v1/index.d.mts +3 -3
- package/resources/v1/index.d.mts.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/subscriptions/future-update.d.mts +8 -2
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +8 -2
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +2 -2
- package/resources/v1/subscriptions/future-update.mjs +2 -2
- package/resources/v1/subscriptions/index.d.mts +1 -1
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +1 -1
- package/resources/v1/subscriptions/index.d.ts.map +1 -1
- package/resources/v1/subscriptions/index.js.map +1 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +1092 -111
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +1092 -111
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +12 -8
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +12 -8
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/v1.d.mts +32 -9
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +32 -9
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +2 -2
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +2 -2
- package/resources/v1/v1.mjs.map +1 -1
- package/src/core/pagination.ts +24 -18
- package/src/resources/v1/coupons.ts +223 -212
- package/src/resources/v1/customers/customers.ts +121 -120
- package/src/resources/v1/customers/index.ts +2 -1
- package/src/resources/v1/customers/payment-method.ts +5 -2
- package/src/resources/v1/customers/usage.ts +1 -128
- package/src/resources/v1/index.ts +3 -0
- package/src/resources/v1/subscriptions/future-update.ts +8 -2
- package/src/resources/v1/subscriptions/index.ts +1 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +2201 -153
- package/src/resources/v1/v1.ts +32 -3
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -4,8 +4,9 @@ import { APIResource } from '../../../core/resource';
|
|
|
4
4
|
import * as PaymentMethodAPI from './payment-method';
|
|
5
5
|
import { PaymentMethod, PaymentMethodAttachParams } from './payment-method';
|
|
6
6
|
import * as UsageAPI from './usage';
|
|
7
|
-
import { Usage
|
|
7
|
+
import { Usage } from './usage';
|
|
8
8
|
import { APIPromise } from '../../../core/api-promise';
|
|
9
|
+
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
|
|
9
10
|
import { RequestOptions } from '../../../internal/request-options';
|
|
10
11
|
import { path } from '../../../internal/utils/path';
|
|
11
12
|
|
|
@@ -14,56 +15,70 @@ export class Customers extends APIResource {
|
|
|
14
15
|
usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Provision customer
|
|
18
19
|
*/
|
|
19
20
|
create(body: CustomerCreateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
20
21
|
return this._client.post('/api/v1/customers', { body, ...options });
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
* Get a single
|
|
25
|
+
* Get a single customer by ID
|
|
25
26
|
*/
|
|
26
27
|
retrieve(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
27
28
|
return this._client.get(path`/api/v1/customers/${id}`, options);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
* Update
|
|
32
|
+
* Update a customer
|
|
32
33
|
*/
|
|
33
34
|
update(id: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
34
35
|
return this._client.patch(path`/api/v1/customers/${id}`, { body, ...options });
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
|
-
* Get a list of
|
|
39
|
+
* Get a list of customers
|
|
39
40
|
*/
|
|
40
41
|
list(
|
|
41
42
|
query: CustomerListParams | null | undefined = {},
|
|
42
43
|
options?: RequestOptions,
|
|
43
|
-
):
|
|
44
|
-
return this._client.
|
|
44
|
+
): PagePromise<CustomerListResponsesMyCursorIDPage, CustomerListResponse> {
|
|
45
|
+
return this._client.getAPIList('/api/v1/customers', MyCursorIDPage<CustomerListResponse>, {
|
|
46
|
+
query,
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
/**
|
|
48
|
-
*
|
|
52
|
+
* Archive customer
|
|
49
53
|
*/
|
|
50
54
|
archive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
51
55
|
return this._client.post(path`/api/v1/customers/${id}/archive`, options);
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
/**
|
|
55
|
-
*
|
|
59
|
+
* Unarchive customer
|
|
56
60
|
*/
|
|
57
61
|
unarchive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
58
62
|
return this._client.post(path`/api/v1/customers/${id}/unarchive`, options);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
|
|
66
|
+
export type CustomerListResponsesMyCursorIDPage = MyCursorIDPage<CustomerListResponse>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Response object
|
|
70
|
+
*/
|
|
62
71
|
export interface CustomerResponse {
|
|
72
|
+
/**
|
|
73
|
+
* A customer can be either an organization or an individual
|
|
74
|
+
*/
|
|
63
75
|
data: CustomerResponse.Data;
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
export namespace CustomerResponse {
|
|
79
|
+
/**
|
|
80
|
+
* A customer can be either an organization or an individual
|
|
81
|
+
*/
|
|
67
82
|
export interface Data {
|
|
68
83
|
/**
|
|
69
84
|
* Customer slug
|
|
@@ -147,6 +162,9 @@ export namespace CustomerResponse {
|
|
|
147
162
|
type: 'CARD' | 'BANK' | 'CASH_APP';
|
|
148
163
|
}
|
|
149
164
|
|
|
165
|
+
/**
|
|
166
|
+
* External billing or CRM integration link
|
|
167
|
+
*/
|
|
150
168
|
export interface Integration {
|
|
151
169
|
/**
|
|
152
170
|
* Integration details
|
|
@@ -176,125 +194,120 @@ export namespace CustomerResponse {
|
|
|
176
194
|
}
|
|
177
195
|
}
|
|
178
196
|
|
|
197
|
+
/**
|
|
198
|
+
* A customer can be either an organization or an individual
|
|
199
|
+
*/
|
|
179
200
|
export interface CustomerListResponse {
|
|
180
|
-
|
|
181
|
-
|
|
201
|
+
/**
|
|
202
|
+
* Customer slug
|
|
203
|
+
*/
|
|
204
|
+
id: string;
|
|
182
205
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
*/
|
|
188
|
-
id: string;
|
|
206
|
+
/**
|
|
207
|
+
* Timestamp of when the record was deleted
|
|
208
|
+
*/
|
|
209
|
+
archivedAt: string | null;
|
|
189
210
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Timestamp of when the record was created
|
|
213
|
+
*/
|
|
214
|
+
createdAt: string;
|
|
194
215
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
216
|
+
/**
|
|
217
|
+
* Timestamp of when the record was last updated
|
|
218
|
+
*/
|
|
219
|
+
updatedAt: string;
|
|
199
220
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Customer level coupon
|
|
223
|
+
*/
|
|
224
|
+
couponId?: string | null;
|
|
204
225
|
|
|
226
|
+
/**
|
|
227
|
+
* The default payment method details
|
|
228
|
+
*/
|
|
229
|
+
defaultPaymentMethod?: CustomerListResponse.DefaultPaymentMethod | null;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The email of the customer
|
|
233
|
+
*/
|
|
234
|
+
email?: string | null;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* List of integrations
|
|
238
|
+
*/
|
|
239
|
+
integrations?: Array<CustomerListResponse.Integration>;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Additional metadata
|
|
243
|
+
*/
|
|
244
|
+
metadata?: { [key: string]: string };
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The name of the customer
|
|
248
|
+
*/
|
|
249
|
+
name?: string | null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export namespace CustomerListResponse {
|
|
253
|
+
/**
|
|
254
|
+
* The default payment method details
|
|
255
|
+
*/
|
|
256
|
+
export interface DefaultPaymentMethod {
|
|
205
257
|
/**
|
|
206
|
-
*
|
|
258
|
+
* The default payment method id
|
|
207
259
|
*/
|
|
208
|
-
|
|
260
|
+
billingId: string | null;
|
|
209
261
|
|
|
210
262
|
/**
|
|
211
|
-
*
|
|
263
|
+
* The expiration month of the default payment method
|
|
212
264
|
*/
|
|
213
|
-
|
|
265
|
+
cardExpiryMonth: number | null;
|
|
214
266
|
|
|
215
267
|
/**
|
|
216
|
-
* The default payment method
|
|
268
|
+
* The expiration year of the default payment method
|
|
217
269
|
*/
|
|
218
|
-
|
|
270
|
+
cardExpiryYear: number | null;
|
|
219
271
|
|
|
220
272
|
/**
|
|
221
|
-
* The
|
|
273
|
+
* The last 4 digits of the default payment method
|
|
222
274
|
*/
|
|
223
|
-
|
|
275
|
+
cardLast4Digits: string | null;
|
|
224
276
|
|
|
225
277
|
/**
|
|
226
|
-
*
|
|
278
|
+
* The default payment method type
|
|
227
279
|
*/
|
|
228
|
-
|
|
280
|
+
type: 'CARD' | 'BANK' | 'CASH_APP';
|
|
281
|
+
}
|
|
229
282
|
|
|
283
|
+
/**
|
|
284
|
+
* External billing or CRM integration link
|
|
285
|
+
*/
|
|
286
|
+
export interface Integration {
|
|
230
287
|
/**
|
|
231
|
-
*
|
|
288
|
+
* Integration details
|
|
232
289
|
*/
|
|
233
|
-
|
|
290
|
+
id: string;
|
|
234
291
|
|
|
235
292
|
/**
|
|
236
|
-
*
|
|
293
|
+
* Synced entity id
|
|
237
294
|
*/
|
|
238
|
-
|
|
239
|
-
}
|
|
295
|
+
syncedEntityId: string | null;
|
|
240
296
|
|
|
241
|
-
export namespace Data {
|
|
242
297
|
/**
|
|
243
|
-
* The
|
|
298
|
+
* The vendor identifier of integration
|
|
244
299
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* The expiration year of the default payment method
|
|
258
|
-
*/
|
|
259
|
-
cardExpiryYear: number | null;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* The last 4 digits of the default payment method
|
|
263
|
-
*/
|
|
264
|
-
cardLast4Digits: string | null;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* The default payment method type
|
|
268
|
-
*/
|
|
269
|
-
type: 'CARD' | 'BANK' | 'CASH_APP';
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export interface Integration {
|
|
273
|
-
/**
|
|
274
|
-
* Integration details
|
|
275
|
-
*/
|
|
276
|
-
id: string;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Synced entity id
|
|
280
|
-
*/
|
|
281
|
-
syncedEntityId: string | null;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* The vendor identifier of integration
|
|
285
|
-
*/
|
|
286
|
-
vendorIdentifier:
|
|
287
|
-
| 'AUTH0'
|
|
288
|
-
| 'ZUORA'
|
|
289
|
-
| 'STRIPE'
|
|
290
|
-
| 'HUBSPOT'
|
|
291
|
-
| 'AWS_MARKETPLACE'
|
|
292
|
-
| 'SNOWFLAKE'
|
|
293
|
-
| 'SALESFORCE'
|
|
294
|
-
| 'BIG_QUERY'
|
|
295
|
-
| 'OPEN_FGA'
|
|
296
|
-
| 'APP_STORE';
|
|
297
|
-
}
|
|
300
|
+
vendorIdentifier:
|
|
301
|
+
| 'AUTH0'
|
|
302
|
+
| 'ZUORA'
|
|
303
|
+
| 'STRIPE'
|
|
304
|
+
| 'HUBSPOT'
|
|
305
|
+
| 'AWS_MARKETPLACE'
|
|
306
|
+
| 'SNOWFLAKE'
|
|
307
|
+
| 'SALESFORCE'
|
|
308
|
+
| 'BIG_QUERY'
|
|
309
|
+
| 'OPEN_FGA'
|
|
310
|
+
| 'APP_STORE';
|
|
298
311
|
}
|
|
299
312
|
}
|
|
300
313
|
|
|
@@ -366,6 +379,9 @@ export namespace CustomerCreateParams {
|
|
|
366
379
|
type: 'CARD' | 'BANK' | 'CASH_APP';
|
|
367
380
|
}
|
|
368
381
|
|
|
382
|
+
/**
|
|
383
|
+
* External billing or CRM integration link
|
|
384
|
+
*/
|
|
369
385
|
export interface Integration {
|
|
370
386
|
/**
|
|
371
387
|
* Integration details
|
|
@@ -422,6 +438,9 @@ export interface CustomerUpdateParams {
|
|
|
422
438
|
}
|
|
423
439
|
|
|
424
440
|
export namespace CustomerUpdateParams {
|
|
441
|
+
/**
|
|
442
|
+
* External billing or CRM integration link
|
|
443
|
+
*/
|
|
425
444
|
export interface Integration {
|
|
426
445
|
/**
|
|
427
446
|
* Integration details
|
|
@@ -450,22 +469,7 @@ export namespace CustomerUpdateParams {
|
|
|
450
469
|
}
|
|
451
470
|
}
|
|
452
471
|
|
|
453
|
-
export interface CustomerListParams {
|
|
454
|
-
/**
|
|
455
|
-
* Ending before this UUID for pagination
|
|
456
|
-
*/
|
|
457
|
-
endingBefore?: string;
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* Items per page
|
|
461
|
-
*/
|
|
462
|
-
limit?: number;
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Starting after this UUID for pagination
|
|
466
|
-
*/
|
|
467
|
-
startingAfter?: string;
|
|
468
|
-
}
|
|
472
|
+
export interface CustomerListParams extends MyCursorIDPageParams {}
|
|
469
473
|
|
|
470
474
|
Customers.PaymentMethod = PaymentMethod;
|
|
471
475
|
Customers.Usage = Usage;
|
|
@@ -474,6 +478,7 @@ export declare namespace Customers {
|
|
|
474
478
|
export {
|
|
475
479
|
type CustomerResponse as CustomerResponse,
|
|
476
480
|
type CustomerListResponse as CustomerListResponse,
|
|
481
|
+
type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
|
|
477
482
|
type CustomerCreateParams as CustomerCreateParams,
|
|
478
483
|
type CustomerUpdateParams as CustomerUpdateParams,
|
|
479
484
|
type CustomerListParams as CustomerListParams,
|
|
@@ -481,9 +486,5 @@ export declare namespace Customers {
|
|
|
481
486
|
|
|
482
487
|
export { PaymentMethod as PaymentMethod, type PaymentMethodAttachParams as PaymentMethodAttachParams };
|
|
483
488
|
|
|
484
|
-
export {
|
|
485
|
-
Usage as Usage,
|
|
486
|
-
type UsageRetrieveResponse as UsageRetrieveResponse,
|
|
487
|
-
type UsageRetrieveParams as UsageRetrieveParams,
|
|
488
|
-
};
|
|
489
|
+
export { Usage as Usage };
|
|
489
490
|
}
|
|
@@ -7,6 +7,7 @@ export {
|
|
|
7
7
|
type CustomerCreateParams,
|
|
8
8
|
type CustomerUpdateParams,
|
|
9
9
|
type CustomerListParams,
|
|
10
|
+
type CustomerListResponsesMyCursorIDPage,
|
|
10
11
|
} from './customers';
|
|
11
12
|
export { PaymentMethod, type PaymentMethodAttachParams } from './payment-method';
|
|
12
|
-
export { Usage
|
|
13
|
+
export { Usage } from './usage';
|
|
@@ -8,7 +8,7 @@ import { path } from '../../../internal/utils/path';
|
|
|
8
8
|
|
|
9
9
|
export class PaymentMethod extends APIResource {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Attach payment method
|
|
12
12
|
*/
|
|
13
13
|
attach(
|
|
14
14
|
id: string,
|
|
@@ -19,7 +19,7 @@ export class PaymentMethod extends APIResource {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Detach payment method
|
|
23
23
|
*/
|
|
24
24
|
detach(id: string, options?: RequestOptions): APIPromise<CustomersAPI.CustomerResponse> {
|
|
25
25
|
return this._client.delete(path`/api/v1/customers/${id}/payment-method`, options);
|
|
@@ -52,6 +52,9 @@ export interface PaymentMethodAttachParams {
|
|
|
52
52
|
| 'OPEN_FGA'
|
|
53
53
|
| 'APP_STORE';
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Customers selected currency
|
|
57
|
+
*/
|
|
55
58
|
billingCurrency?:
|
|
56
59
|
| 'usd'
|
|
57
60
|
| 'aed'
|
|
@@ -1,132 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
-
import { path } from '../../../internal/utils/path';
|
|
7
4
|
|
|
8
|
-
export class Usage extends APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* Perform retrieval on a Usage history
|
|
11
|
-
*/
|
|
12
|
-
retrieve(
|
|
13
|
-
featureID: string,
|
|
14
|
-
params: UsageRetrieveParams,
|
|
15
|
-
options?: RequestOptions,
|
|
16
|
-
): APIPromise<UsageRetrieveResponse> {
|
|
17
|
-
const { customerId, ...query } = params;
|
|
18
|
-
return this._client.get(path`/api/v1/customers/${customerId}/usage/features/${featureID}`, {
|
|
19
|
-
query,
|
|
20
|
-
...options,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface UsageRetrieveResponse {
|
|
26
|
-
data: UsageRetrieveResponse.Data;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export namespace UsageRetrieveResponse {
|
|
30
|
-
export interface Data {
|
|
31
|
-
/**
|
|
32
|
-
* Markers for events that affecting feature usage
|
|
33
|
-
*/
|
|
34
|
-
markers: Array<Data.Marker>;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Series of usage history
|
|
38
|
-
*/
|
|
39
|
-
series: Array<Data.Series>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export namespace Data {
|
|
43
|
-
export interface Marker {
|
|
44
|
-
/**
|
|
45
|
-
* Timestamp of the marker
|
|
46
|
-
*/
|
|
47
|
-
timestamp: string;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Type of marker for a usage history point
|
|
51
|
-
*/
|
|
52
|
-
type: 'PERIODIC_RESET' | 'SUBSCRIPTION_CHANGE_RESET';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface Series {
|
|
56
|
-
/**
|
|
57
|
-
* Points in the usage history series
|
|
58
|
-
*/
|
|
59
|
-
points: Array<Series.Point>;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Tags for the usage history series
|
|
63
|
-
*/
|
|
64
|
-
tags: Array<Series.Tag>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export namespace Series {
|
|
68
|
-
export interface Point {
|
|
69
|
-
/**
|
|
70
|
-
* Indicates whether there was usage reset in this point, see `markers` for details
|
|
71
|
-
*/
|
|
72
|
-
isResetPoint: boolean;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Timestamp of the usage history point
|
|
76
|
-
*/
|
|
77
|
-
timestamp: string;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Value of the usage history point
|
|
81
|
-
*/
|
|
82
|
-
value: number;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface Tag {
|
|
86
|
-
/**
|
|
87
|
-
* Key of the tag
|
|
88
|
-
*/
|
|
89
|
-
key: string;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Value of the tag
|
|
93
|
-
*/
|
|
94
|
-
value: string;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface UsageRetrieveParams {
|
|
101
|
-
/**
|
|
102
|
-
* Path param: Customer id
|
|
103
|
-
*/
|
|
104
|
-
customerId: string;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Query param: The start date of the range
|
|
108
|
-
*/
|
|
109
|
-
startDate: string;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Query param: The end date of the range
|
|
113
|
-
*/
|
|
114
|
-
endDate?: string;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Query param
|
|
118
|
-
*/
|
|
119
|
-
groupBy?: string;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Query param: Resource id
|
|
123
|
-
*/
|
|
124
|
-
resourceId?: string | null;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export declare namespace Usage {
|
|
128
|
-
export {
|
|
129
|
-
type UsageRetrieveResponse as UsageRetrieveResponse,
|
|
130
|
-
type UsageRetrieveParams as UsageRetrieveParams,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
5
|
+
export class Usage extends APIResource {}
|
|
@@ -7,6 +7,7 @@ export {
|
|
|
7
7
|
type CouponListResponse,
|
|
8
8
|
type CouponCreateParams,
|
|
9
9
|
type CouponListParams,
|
|
10
|
+
type CouponListResponsesMyCursorIDPage,
|
|
10
11
|
} from './coupons';
|
|
11
12
|
export {
|
|
12
13
|
Customers,
|
|
@@ -15,6 +16,7 @@ export {
|
|
|
15
16
|
type CustomerCreateParams,
|
|
16
17
|
type CustomerUpdateParams,
|
|
17
18
|
type CustomerListParams,
|
|
19
|
+
type CustomerListResponsesMyCursorIDPage,
|
|
18
20
|
} from './customers/index';
|
|
19
21
|
export {
|
|
20
22
|
Subscriptions,
|
|
@@ -31,6 +33,7 @@ export {
|
|
|
31
33
|
type SubscriptionMigrateParams,
|
|
32
34
|
type SubscriptionPreviewParams,
|
|
33
35
|
type SubscriptionTransferParams,
|
|
36
|
+
type SubscriptionListResponsesMyCursorIDPage,
|
|
34
37
|
} from './subscriptions/index';
|
|
35
38
|
export {
|
|
36
39
|
V1,
|
|
@@ -7,7 +7,7 @@ import { path } from '../../../internal/utils/path';
|
|
|
7
7
|
|
|
8
8
|
export class FutureUpdate extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Cancel pending payment update
|
|
11
11
|
*/
|
|
12
12
|
cancelPendingPayment(
|
|
13
13
|
id: string,
|
|
@@ -17,13 +17,16 @@ export class FutureUpdate extends APIResource {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Cancel scheduled update
|
|
21
21
|
*/
|
|
22
22
|
cancelSchedule(id: string, options?: RequestOptions): APIPromise<FutureUpdateCancelScheduleResponse> {
|
|
23
23
|
return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/schedule`, options);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Response object
|
|
29
|
+
*/
|
|
27
30
|
export interface FutureUpdateCancelPendingPaymentResponse {
|
|
28
31
|
data: FutureUpdateCancelPendingPaymentResponse.Data;
|
|
29
32
|
}
|
|
@@ -37,6 +40,9 @@ export namespace FutureUpdateCancelPendingPaymentResponse {
|
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Response object
|
|
45
|
+
*/
|
|
40
46
|
export interface FutureUpdateCancelScheduleResponse {
|
|
41
47
|
data: FutureUpdateCancelScheduleResponse.Data;
|
|
42
48
|
}
|