@stigg/typescript 0.1.0-alpha.3 → 0.1.0-alpha.7
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 +61 -0
- package/README.md +9 -0
- package/client.d.mts +6 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -8
- package/client.d.ts.map +1 -1
- package/client.js +16 -21
- package/client.js.map +1 -1
- package/client.mjs +17 -22
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- 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 +55 -96
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +55 -96
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +4 -3
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +4 -3
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +170 -46
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +170 -46
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +32 -15
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +32 -15
- 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/payment-method.d.mts +4 -2
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +4 -2
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +4 -2
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +4 -2
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +352 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.d.ts +352 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.js +25 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -0
- package/resources/v1/customers/promotional-entitlements.mjs +21 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
- package/resources/v1/events.d.mts +63 -0
- package/resources/v1/events.d.mts.map +1 -0
- package/resources/v1/events.d.ts +63 -0
- package/resources/v1/events.d.ts.map +1 -0
- package/resources/v1/events.js +16 -0
- package/resources/v1/events.js.map +1 -0
- package/resources/v1/events.mjs +12 -0
- package/resources/v1/events.mjs.map +1 -0
- package/resources/v1/index.d.mts +7 -4
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +7 -4
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +7 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +4 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/products.d.mts +126 -0
- package/resources/v1/products.d.mts.map +1 -0
- package/resources/v1/products.d.ts +126 -0
- package/resources/v1/products.d.ts.map +1 -0
- package/resources/v1/products.js +19 -0
- package/resources/v1/products.js.map +1 -0
- package/resources/v1/products.mjs +15 -0
- package/resources/v1/products.mjs.map +1 -0
- package/resources/v1/subscriptions/future-update.d.mts +9 -22
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +9 -22
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +3 -2
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +3 -2
- 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 +987 -949
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +987 -949
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +39 -11
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +40 -12
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/usage.d.mts +230 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +230 -0
- package/resources/v1/usage.d.ts.map +1 -0
- package/resources/v1/usage.js +24 -0
- package/resources/v1/usage.js.map +1 -0
- package/resources/v1/usage.mjs +20 -0
- package/resources/v1/usage.mjs.map +1 -0
- package/resources/v1/v1.d.mts +18 -172
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +18 -172
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +12 -12
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +12 -12
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +25 -40
- package/src/internal/parse.ts +6 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/resources/index.ts +1 -7
- package/src/resources/v1/coupons.ts +63 -231
- package/src/resources/v1/customers/customers.ts +234 -60
- package/src/resources/v1/customers/index.ts +13 -2
- package/src/resources/v1/customers/payment-method.ts +4 -2
- package/src/resources/v1/customers/promotional-entitlements.ts +468 -0
- package/src/resources/v1/events.ts +74 -0
- package/src/resources/v1/index.ts +28 -15
- package/src/resources/v1/products.ts +162 -0
- package/src/resources/v1/subscriptions/future-update.ts +9 -30
- package/src/resources/v1/subscriptions/index.ts +8 -11
- package/src/resources/v1/subscriptions/subscriptions.ts +2699 -2280
- package/src/resources/v1/usage.ts +284 -0
- package/src/resources/v1/v1.ts +72 -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
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../core/pagination';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Products extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves a paginated list of products in the environment.
|
|
10
|
+
*/
|
|
11
|
+
listProducts(
|
|
12
|
+
query: ProductListProductsParams | null | undefined = {},
|
|
13
|
+
options?: RequestOptions,
|
|
14
|
+
): PagePromise<ProductListProductsResponsesMyCursorIDPage, ProductListProductsResponse> {
|
|
15
|
+
return this._client.getAPIList('/api/v1/products', MyCursorIDPage<ProductListProductsResponse>, {
|
|
16
|
+
query,
|
|
17
|
+
...options,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type ProductListProductsResponsesMyCursorIDPage = MyCursorIDPage<ProductListProductsResponse>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Product configuration object
|
|
26
|
+
*/
|
|
27
|
+
export interface ProductListProductsResponse {
|
|
28
|
+
/**
|
|
29
|
+
* The unique identifier for the entity
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Timestamp of when the record was created
|
|
35
|
+
*/
|
|
36
|
+
createdAt: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Description of the product
|
|
40
|
+
*/
|
|
41
|
+
description: string | null;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Display name of the product
|
|
45
|
+
*/
|
|
46
|
+
displayName: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Metadata associated with the entity
|
|
50
|
+
*/
|
|
51
|
+
metadata: { [key: string]: string };
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Indicates if multiple subscriptions to this product are allowed
|
|
55
|
+
*/
|
|
56
|
+
multipleSubscriptions: boolean;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The status of the product
|
|
60
|
+
*/
|
|
61
|
+
status: 'PUBLISHED' | 'ARCHIVED';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Timestamp of when the record was last updated
|
|
65
|
+
*/
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Product behavior settings for subscription lifecycle management.
|
|
70
|
+
*/
|
|
71
|
+
productSettings?: ProductListProductsResponse.ProductSettings;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export namespace ProductListProductsResponse {
|
|
75
|
+
/**
|
|
76
|
+
* Product behavior settings for subscription lifecycle management.
|
|
77
|
+
*/
|
|
78
|
+
export interface ProductSettings {
|
|
79
|
+
/**
|
|
80
|
+
* Time when the subscription will be cancelled
|
|
81
|
+
*/
|
|
82
|
+
subscriptionCancellationTime: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE' | 'SPECIFIC_DATE';
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Setup for the end of the subscription
|
|
86
|
+
*/
|
|
87
|
+
subscriptionEndSetup: 'DOWNGRADE_TO_FREE' | 'CANCEL_SUBSCRIPTION';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Setup for the start of the subscription
|
|
91
|
+
*/
|
|
92
|
+
subscriptionStartSetup: 'PLAN_SELECTION' | 'TRIAL_PERIOD' | 'FREE_PLAN';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* ID of the plan to downgrade to at the end of the billing period
|
|
96
|
+
*/
|
|
97
|
+
downgradePlanId?: string | null;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Indicates if the subscription should be prorated at the end of the billing
|
|
101
|
+
* period
|
|
102
|
+
*/
|
|
103
|
+
prorateAtEndOfBillingPeriod?: boolean | null;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* ID of the plan to start the subscription with
|
|
107
|
+
*/
|
|
108
|
+
subscriptionStartPlanId?: string | null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ProductListProductsParams extends MyCursorIDPageParams {
|
|
113
|
+
/**
|
|
114
|
+
* Filter by entity ID
|
|
115
|
+
*/
|
|
116
|
+
id?: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Filter by creation date using range operators: gt, gte, lt, lte
|
|
120
|
+
*/
|
|
121
|
+
createdAt?: ProductListProductsParams.CreatedAt;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Filter by product status. Supports comma-separated values for multiple statuses
|
|
125
|
+
*/
|
|
126
|
+
status?: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export namespace ProductListProductsParams {
|
|
130
|
+
/**
|
|
131
|
+
* Filter by creation date using range operators: gt, gte, lt, lte
|
|
132
|
+
*/
|
|
133
|
+
export interface CreatedAt {
|
|
134
|
+
/**
|
|
135
|
+
* Greater than the specified createdAt value
|
|
136
|
+
*/
|
|
137
|
+
gt?: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Greater than or equal to the specified createdAt value
|
|
141
|
+
*/
|
|
142
|
+
gte?: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Less than the specified createdAt value
|
|
146
|
+
*/
|
|
147
|
+
lt?: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Less than or equal to the specified createdAt value
|
|
151
|
+
*/
|
|
152
|
+
lte?: string;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export declare namespace Products {
|
|
157
|
+
export {
|
|
158
|
+
type ProductListProductsResponse as ProductListProductsResponse,
|
|
159
|
+
type ProductListProductsResponsesMyCursorIDPage as ProductListProductsResponsesMyCursorIDPage,
|
|
160
|
+
type ProductListProductsParams as ProductListProductsParams,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
@@ -7,19 +7,17 @@ import { path } from '../../../internal/utils/path';
|
|
|
7
7
|
|
|
8
8
|
export class FutureUpdate extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Cancels a subscription update that is pending payment completion.
|
|
11
11
|
*/
|
|
12
|
-
cancelPendingPayment(
|
|
13
|
-
id: string,
|
|
14
|
-
options?: RequestOptions,
|
|
15
|
-
): APIPromise<FutureUpdateCancelPendingPaymentResponse> {
|
|
12
|
+
cancelPendingPayment(id: string, options?: RequestOptions): APIPromise<CancelSubscription> {
|
|
16
13
|
return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/pending-payment`, options);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
/**
|
|
20
|
-
*
|
|
17
|
+
* Cancels a scheduled subscription update, such as a future downgrade or plan
|
|
18
|
+
* change.
|
|
21
19
|
*/
|
|
22
|
-
cancelSchedule(id: string, options?: RequestOptions): APIPromise<
|
|
20
|
+
cancelSchedule(id: string, options?: RequestOptions): APIPromise<CancelSubscription> {
|
|
23
21
|
return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/schedule`, options);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
@@ -27,27 +25,11 @@ export class FutureUpdate extends APIResource {
|
|
|
27
25
|
/**
|
|
28
26
|
* Response object
|
|
29
27
|
*/
|
|
30
|
-
export interface
|
|
31
|
-
data:
|
|
28
|
+
export interface CancelSubscription {
|
|
29
|
+
data: CancelSubscription.Data;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
export namespace
|
|
35
|
-
export interface Data {
|
|
36
|
-
/**
|
|
37
|
-
* Subscription ID
|
|
38
|
-
*/
|
|
39
|
-
id: string;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Response object
|
|
45
|
-
*/
|
|
46
|
-
export interface FutureUpdateCancelScheduleResponse {
|
|
47
|
-
data: FutureUpdateCancelScheduleResponse.Data;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export namespace FutureUpdateCancelScheduleResponse {
|
|
32
|
+
export namespace CancelSubscription {
|
|
51
33
|
export interface Data {
|
|
52
34
|
/**
|
|
53
35
|
* Subscription ID
|
|
@@ -57,8 +39,5 @@ export namespace FutureUpdateCancelScheduleResponse {
|
|
|
57
39
|
}
|
|
58
40
|
|
|
59
41
|
export declare namespace FutureUpdate {
|
|
60
|
-
export {
|
|
61
|
-
type FutureUpdateCancelPendingPaymentResponse as FutureUpdateCancelPendingPaymentResponse,
|
|
62
|
-
type FutureUpdateCancelScheduleResponse as FutureUpdateCancelScheduleResponse,
|
|
63
|
-
};
|
|
42
|
+
export { type CancelSubscription as CancelSubscription };
|
|
64
43
|
}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
FutureUpdate,
|
|
5
|
-
type FutureUpdateCancelPendingPaymentResponse,
|
|
6
|
-
type FutureUpdateCancelScheduleResponse,
|
|
7
|
-
} from './future-update';
|
|
3
|
+
export { FutureUpdate, type CancelSubscription } from './future-update';
|
|
8
4
|
export {
|
|
9
5
|
Subscriptions,
|
|
10
|
-
type
|
|
11
|
-
type SubscriptionRetrieveResponse,
|
|
6
|
+
type Subscription,
|
|
12
7
|
type SubscriptionListResponse,
|
|
13
|
-
type
|
|
14
|
-
type SubscriptionMigrateResponse,
|
|
8
|
+
type SubscriptionImportResponse,
|
|
15
9
|
type SubscriptionPreviewResponse,
|
|
16
|
-
type
|
|
17
|
-
type
|
|
10
|
+
type SubscriptionProvisionResponse,
|
|
11
|
+
type SubscriptionUpdateParams,
|
|
18
12
|
type SubscriptionListParams,
|
|
13
|
+
type SubscriptionCancelParams,
|
|
19
14
|
type SubscriptionDelegateParams,
|
|
15
|
+
type SubscriptionImportParams,
|
|
20
16
|
type SubscriptionMigrateParams,
|
|
21
17
|
type SubscriptionPreviewParams,
|
|
18
|
+
type SubscriptionProvisionParams,
|
|
22
19
|
type SubscriptionTransferParams,
|
|
23
20
|
type SubscriptionListResponsesMyCursorIDPage,
|
|
24
21
|
} from './subscriptions';
|