@stigg/typescript 0.1.0-alpha.3 → 0.1.0-alpha.4
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 +8 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +6 -89
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +6 -89
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/customers/customers.d.mts +106 -46
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +106 -46
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +16 -10
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +16 -10
- 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 +3 -3
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +350 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.d.ts +350 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.js +23 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -0
- package/resources/v1/customers/promotional-entitlements.mjs +19 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
- package/resources/v1/events.d.mts +62 -0
- package/resources/v1/events.d.mts.map +1 -0
- package/resources/v1/events.d.ts +62 -0
- package/resources/v1/events.d.ts.map +1 -0
- package/resources/v1/events.js +15 -0
- package/resources/v1/events.js.map +1 -0
- package/resources/v1/events.mjs +11 -0
- package/resources/v1/events.mjs.map +1 -0
- package/resources/v1/index.d.mts +6 -4
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +6 -4
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +3 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +6 -20
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +6 -20
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/index.d.mts +2 -2
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +2 -2
- 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 +1 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +963 -1049
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +963 -1049
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +24 -6
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +25 -7
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/usage.d.mts +229 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +229 -0
- package/resources/v1/usage.d.ts.map +1 -0
- package/resources/v1/usage.js +23 -0
- package/resources/v1/usage.js.map +1 -0
- package/resources/v1/usage.mjs +19 -0
- package/resources/v1/usage.mjs.map +1 -0
- package/resources/v1/v1.d.mts +14 -172
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -172
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +8 -12
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +8 -12
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +2 -14
- package/src/resources/index.ts +1 -7
- package/src/resources/v1/coupons.ts +6 -222
- package/src/resources/v1/customers/customers.ts +142 -57
- package/src/resources/v1/customers/index.ts +10 -2
- package/src/resources/v1/customers/promotional-entitlements.ts +466 -0
- package/src/resources/v1/events.ts +73 -0
- package/src/resources/v1/index.ts +19 -15
- package/src/resources/v1/subscriptions/future-update.ts +6 -28
- package/src/resources/v1/subscriptions/index.ts +8 -11
- package/src/resources/v1/subscriptions/subscriptions.ts +2541 -2304
- package/src/resources/v1/usage.ts +283 -0
- package/src/resources/v1/v1.ts +50 -220
- 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
- package/resources/v1/customers/usage.d.mts +0 -4
- package/resources/v1/customers/usage.d.mts.map +0 -1
- package/resources/v1/customers/usage.d.ts +0 -4
- package/resources/v1/customers/usage.d.ts.map +0 -1
- package/resources/v1/customers/usage.js +0 -9
- package/resources/v1/customers/usage.js.map +0 -1
- package/resources/v1/customers/usage.mjs +0 -5
- package/resources/v1/customers/usage.mjs.map +0 -1
- package/src/resources/v1/customers/usage.ts +0 -5
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as PaymentMethodAPI from './payment-method';
|
|
5
5
|
import { PaymentMethod, PaymentMethodAttachParams } from './payment-method';
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
6
|
+
import * as PromotionalEntitlementsAPI from './promotional-entitlements';
|
|
7
|
+
import {
|
|
8
|
+
PromotionalEntitlementGrantParams,
|
|
9
|
+
PromotionalEntitlementGrantResponse,
|
|
10
|
+
PromotionalEntitlementRevokeParams,
|
|
11
|
+
PromotionalEntitlementRevokeResponse,
|
|
12
|
+
PromotionalEntitlements,
|
|
13
|
+
} from './promotional-entitlements';
|
|
8
14
|
import { APIPromise } from '../../../core/api-promise';
|
|
9
15
|
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
|
|
10
16
|
import { RequestOptions } from '../../../internal/request-options';
|
|
@@ -12,14 +18,8 @@ import { path } from '../../../internal/utils/path';
|
|
|
12
18
|
|
|
13
19
|
export class Customers extends APIResource {
|
|
14
20
|
paymentMethod: PaymentMethodAPI.PaymentMethod = new PaymentMethodAPI.PaymentMethod(this._client);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Provision customer
|
|
19
|
-
*/
|
|
20
|
-
create(body: CustomerCreateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
21
|
-
return this._client.post('/api/v1/customers', { body, ...options });
|
|
22
|
-
}
|
|
21
|
+
promotionalEntitlements: PromotionalEntitlementsAPI.PromotionalEntitlements =
|
|
22
|
+
new PromotionalEntitlementsAPI.PromotionalEntitlements(this._client);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Get a single customer by ID
|
|
@@ -55,6 +55,20 @@ export class Customers extends APIResource {
|
|
|
55
55
|
return this._client.post(path`/api/v1/customers/${id}/archive`, options);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Bulk import customers
|
|
60
|
+
*/
|
|
61
|
+
import(body: CustomerImportParams, options?: RequestOptions): APIPromise<CustomerImportResponse> {
|
|
62
|
+
return this._client.post('/api/v1/customers/import', { body, ...options });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Provision customer
|
|
67
|
+
*/
|
|
68
|
+
provision(body: CustomerProvisionParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
69
|
+
return this._client.post('/api/v1/customers', { body, ...options });
|
|
70
|
+
}
|
|
71
|
+
|
|
58
72
|
/**
|
|
59
73
|
* Unarchive customer
|
|
60
74
|
*/
|
|
@@ -311,21 +325,33 @@ export namespace CustomerListResponse {
|
|
|
311
325
|
}
|
|
312
326
|
}
|
|
313
327
|
|
|
314
|
-
|
|
328
|
+
/**
|
|
329
|
+
* Response object
|
|
330
|
+
*/
|
|
331
|
+
export interface CustomerImportResponse {
|
|
315
332
|
/**
|
|
316
|
-
*
|
|
333
|
+
* List of newly created customer IDs from the import operation.
|
|
317
334
|
*/
|
|
318
|
-
|
|
335
|
+
data: CustomerImportResponse.Data;
|
|
336
|
+
}
|
|
319
337
|
|
|
338
|
+
export namespace CustomerImportResponse {
|
|
320
339
|
/**
|
|
321
|
-
*
|
|
340
|
+
* List of newly created customer IDs from the import operation.
|
|
322
341
|
*/
|
|
323
|
-
|
|
342
|
+
export interface Data {
|
|
343
|
+
/**
|
|
344
|
+
* Customer IDs created during import
|
|
345
|
+
*/
|
|
346
|
+
newCustomers: Array<string>;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
324
349
|
|
|
350
|
+
export interface CustomerUpdateParams {
|
|
325
351
|
/**
|
|
326
|
-
*
|
|
352
|
+
* Customer level coupon
|
|
327
353
|
*/
|
|
328
|
-
|
|
354
|
+
couponId?: string | null;
|
|
329
355
|
|
|
330
356
|
/**
|
|
331
357
|
* The email of the customer
|
|
@@ -335,7 +361,7 @@ export interface CustomerCreateParams {
|
|
|
335
361
|
/**
|
|
336
362
|
* List of integrations
|
|
337
363
|
*/
|
|
338
|
-
integrations?: Array<
|
|
364
|
+
integrations?: Array<CustomerUpdateParams.Integration>;
|
|
339
365
|
|
|
340
366
|
/**
|
|
341
367
|
* Additional metadata
|
|
@@ -348,37 +374,7 @@ export interface CustomerCreateParams {
|
|
|
348
374
|
name?: string | null;
|
|
349
375
|
}
|
|
350
376
|
|
|
351
|
-
export namespace
|
|
352
|
-
/**
|
|
353
|
-
* The default payment method details
|
|
354
|
-
*/
|
|
355
|
-
export interface DefaultPaymentMethod {
|
|
356
|
-
/**
|
|
357
|
-
* The default payment method id
|
|
358
|
-
*/
|
|
359
|
-
billingId: string | null;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* The expiration month of the default payment method
|
|
363
|
-
*/
|
|
364
|
-
cardExpiryMonth: number | null;
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* The expiration year of the default payment method
|
|
368
|
-
*/
|
|
369
|
-
cardExpiryYear: number | null;
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* The last 4 digits of the default payment method
|
|
373
|
-
*/
|
|
374
|
-
cardLast4Digits: string | null;
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* The default payment method type
|
|
378
|
-
*/
|
|
379
|
-
type: 'CARD' | 'BANK' | 'CASH_APP';
|
|
380
|
-
}
|
|
381
|
-
|
|
377
|
+
export namespace CustomerUpdateParams {
|
|
382
378
|
/**
|
|
383
379
|
* External billing or CRM integration link
|
|
384
380
|
*/
|
|
@@ -410,12 +406,65 @@ export namespace CustomerCreateParams {
|
|
|
410
406
|
}
|
|
411
407
|
}
|
|
412
408
|
|
|
413
|
-
export interface
|
|
409
|
+
export interface CustomerListParams extends MyCursorIDPageParams {}
|
|
410
|
+
|
|
411
|
+
export interface CustomerImportParams {
|
|
412
|
+
/**
|
|
413
|
+
* List of customer objects to import
|
|
414
|
+
*/
|
|
415
|
+
customers: Array<CustomerImportParams.Customer>;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export namespace CustomerImportParams {
|
|
419
|
+
export interface Customer {
|
|
420
|
+
/**
|
|
421
|
+
* Customer slug
|
|
422
|
+
*/
|
|
423
|
+
id: string;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* The email of the customer
|
|
427
|
+
*/
|
|
428
|
+
email: string | null;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* The name of the customer
|
|
432
|
+
*/
|
|
433
|
+
name: string | null;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Additional metadata
|
|
437
|
+
*/
|
|
438
|
+
metadata?: { [key: string]: string };
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Billing provider payment method id
|
|
442
|
+
*/
|
|
443
|
+
paymentMethodId?: string;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Timestamp of when the record was last updated
|
|
447
|
+
*/
|
|
448
|
+
updatedAt?: string;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export interface CustomerProvisionParams {
|
|
453
|
+
/**
|
|
454
|
+
* Customer slug
|
|
455
|
+
*/
|
|
456
|
+
id: string;
|
|
457
|
+
|
|
414
458
|
/**
|
|
415
459
|
* Customer level coupon
|
|
416
460
|
*/
|
|
417
461
|
couponId?: string | null;
|
|
418
462
|
|
|
463
|
+
/**
|
|
464
|
+
* The default payment method details
|
|
465
|
+
*/
|
|
466
|
+
defaultPaymentMethod?: CustomerProvisionParams.DefaultPaymentMethod | null;
|
|
467
|
+
|
|
419
468
|
/**
|
|
420
469
|
* The email of the customer
|
|
421
470
|
*/
|
|
@@ -424,7 +473,7 @@ export interface CustomerUpdateParams {
|
|
|
424
473
|
/**
|
|
425
474
|
* List of integrations
|
|
426
475
|
*/
|
|
427
|
-
integrations?: Array<
|
|
476
|
+
integrations?: Array<CustomerProvisionParams.Integration>;
|
|
428
477
|
|
|
429
478
|
/**
|
|
430
479
|
* Additional metadata
|
|
@@ -437,7 +486,37 @@ export interface CustomerUpdateParams {
|
|
|
437
486
|
name?: string | null;
|
|
438
487
|
}
|
|
439
488
|
|
|
440
|
-
export namespace
|
|
489
|
+
export namespace CustomerProvisionParams {
|
|
490
|
+
/**
|
|
491
|
+
* The default payment method details
|
|
492
|
+
*/
|
|
493
|
+
export interface DefaultPaymentMethod {
|
|
494
|
+
/**
|
|
495
|
+
* The default payment method id
|
|
496
|
+
*/
|
|
497
|
+
billingId: string | null;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The expiration month of the default payment method
|
|
501
|
+
*/
|
|
502
|
+
cardExpiryMonth: number | null;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* The expiration year of the default payment method
|
|
506
|
+
*/
|
|
507
|
+
cardExpiryYear: number | null;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* The last 4 digits of the default payment method
|
|
511
|
+
*/
|
|
512
|
+
cardLast4Digits: string | null;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* The default payment method type
|
|
516
|
+
*/
|
|
517
|
+
type: 'CARD' | 'BANK' | 'CASH_APP';
|
|
518
|
+
}
|
|
519
|
+
|
|
441
520
|
/**
|
|
442
521
|
* External billing or CRM integration link
|
|
443
522
|
*/
|
|
@@ -469,22 +548,28 @@ export namespace CustomerUpdateParams {
|
|
|
469
548
|
}
|
|
470
549
|
}
|
|
471
550
|
|
|
472
|
-
export interface CustomerListParams extends MyCursorIDPageParams {}
|
|
473
|
-
|
|
474
551
|
Customers.PaymentMethod = PaymentMethod;
|
|
475
|
-
Customers.
|
|
552
|
+
Customers.PromotionalEntitlements = PromotionalEntitlements;
|
|
476
553
|
|
|
477
554
|
export declare namespace Customers {
|
|
478
555
|
export {
|
|
479
556
|
type CustomerResponse as CustomerResponse,
|
|
480
557
|
type CustomerListResponse as CustomerListResponse,
|
|
558
|
+
type CustomerImportResponse as CustomerImportResponse,
|
|
481
559
|
type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
|
|
482
|
-
type CustomerCreateParams as CustomerCreateParams,
|
|
483
560
|
type CustomerUpdateParams as CustomerUpdateParams,
|
|
484
561
|
type CustomerListParams as CustomerListParams,
|
|
562
|
+
type CustomerImportParams as CustomerImportParams,
|
|
563
|
+
type CustomerProvisionParams as CustomerProvisionParams,
|
|
485
564
|
};
|
|
486
565
|
|
|
487
566
|
export { PaymentMethod as PaymentMethod, type PaymentMethodAttachParams as PaymentMethodAttachParams };
|
|
488
567
|
|
|
489
|
-
export {
|
|
568
|
+
export {
|
|
569
|
+
PromotionalEntitlements as PromotionalEntitlements,
|
|
570
|
+
type PromotionalEntitlementGrantResponse as PromotionalEntitlementGrantResponse,
|
|
571
|
+
type PromotionalEntitlementRevokeResponse as PromotionalEntitlementRevokeResponse,
|
|
572
|
+
type PromotionalEntitlementGrantParams as PromotionalEntitlementGrantParams,
|
|
573
|
+
type PromotionalEntitlementRevokeParams as PromotionalEntitlementRevokeParams,
|
|
574
|
+
};
|
|
490
575
|
}
|
|
@@ -4,10 +4,18 @@ export {
|
|
|
4
4
|
Customers,
|
|
5
5
|
type CustomerResponse,
|
|
6
6
|
type CustomerListResponse,
|
|
7
|
-
type
|
|
7
|
+
type CustomerImportResponse,
|
|
8
8
|
type CustomerUpdateParams,
|
|
9
9
|
type CustomerListParams,
|
|
10
|
+
type CustomerImportParams,
|
|
11
|
+
type CustomerProvisionParams,
|
|
10
12
|
type CustomerListResponsesMyCursorIDPage,
|
|
11
13
|
} from './customers';
|
|
12
14
|
export { PaymentMethod, type PaymentMethodAttachParams } from './payment-method';
|
|
13
|
-
export {
|
|
15
|
+
export {
|
|
16
|
+
PromotionalEntitlements,
|
|
17
|
+
type PromotionalEntitlementGrantResponse,
|
|
18
|
+
type PromotionalEntitlementRevokeResponse,
|
|
19
|
+
type PromotionalEntitlementGrantParams,
|
|
20
|
+
type PromotionalEntitlementRevokeParams,
|
|
21
|
+
} from './promotional-entitlements';
|