@stigg/typescript 0.1.0-alpha.2 → 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 +17 -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 +28 -78
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +28 -78
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +3 -3
- package/resources/v1/coupons.mjs +3 -3
- package/resources/v1/customers/customers.d.mts +132 -48
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +132 -48
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +21 -15
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +21 -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 +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/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 +11 -19
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +11 -19
- 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.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +2 -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 +1354 -446
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +1354 -446
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +29 -11
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +30 -12
- 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 -149
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -149
- 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 +28 -211
- package/src/resources/v1/customers/customers.ts +167 -62
- package/src/resources/v1/customers/index.ts +10 -2
- package/src/resources/v1/customers/payment-method.ts +5 -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 +11 -27
- package/src/resources/v1/subscriptions/index.ts +8 -11
- package/src/resources/v1/subscriptions/subscriptions.ts +2987 -689
- package/src/resources/v1/usage.ts +283 -0
- package/src/resources/v1/v1.ts +50 -197
- 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 -98
- package/resources/v1/customers/usage.d.mts.map +0 -1
- package/resources/v1/customers/usage.d.ts +0 -98
- package/resources/v1/customers/usage.d.ts.map +0 -1
- package/resources/v1/customers/usage.js +0 -20
- package/resources/v1/customers/usage.js.map +0 -1
- package/resources/v1/customers/usage.mjs +0 -16
- package/resources/v1/customers/usage.mjs.map +0 -1
- package/src/resources/v1/customers/usage.ts +0 -132
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
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
|
+
|
|
8
|
+
export class PromotionalEntitlements extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a promotional entitlements
|
|
11
|
+
*/
|
|
12
|
+
grant(
|
|
13
|
+
customerID: string,
|
|
14
|
+
body: PromotionalEntitlementGrantParams,
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<PromotionalEntitlementGrantResponse> {
|
|
17
|
+
return this._client.post(path`/api/v1/customers/${customerID}/promotional`, { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Revoke promotional entitlement
|
|
22
|
+
*/
|
|
23
|
+
revoke(
|
|
24
|
+
featureID: string,
|
|
25
|
+
params: PromotionalEntitlementRevokeParams,
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): APIPromise<PromotionalEntitlementRevokeResponse> {
|
|
28
|
+
const { customerId } = params;
|
|
29
|
+
return this._client.delete(path`/api/v1/customers/${customerId}/promotional/${featureID}`, options);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Response object
|
|
35
|
+
*/
|
|
36
|
+
export interface PromotionalEntitlementGrantResponse {
|
|
37
|
+
data: Array<PromotionalEntitlementGrantResponse.Data>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export namespace PromotionalEntitlementGrantResponse {
|
|
41
|
+
/**
|
|
42
|
+
* Granted feature entitlement
|
|
43
|
+
*/
|
|
44
|
+
export interface Data {
|
|
45
|
+
/**
|
|
46
|
+
* Unique identifier for the entity
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Timestamp of when the record was created
|
|
52
|
+
*/
|
|
53
|
+
createdAt: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The description of the entitlement
|
|
57
|
+
*/
|
|
58
|
+
description: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The end date of the promotional entitlement
|
|
62
|
+
*/
|
|
63
|
+
endDate: string | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The enum values of the entitlement
|
|
67
|
+
*/
|
|
68
|
+
enumValues: Array<string> | null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The unique identifier for the environment
|
|
72
|
+
*/
|
|
73
|
+
environmentId: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Feature group IDs associated with this entitlement
|
|
77
|
+
*/
|
|
78
|
+
featureGroupIds: Array<string> | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The unique identifier of the entitlement feature
|
|
82
|
+
*/
|
|
83
|
+
featureId: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Whether the entitlement has a soft limit
|
|
87
|
+
*/
|
|
88
|
+
hasSoftLimit: boolean | null;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Whether the entitlement has an unlimited usage
|
|
92
|
+
*/
|
|
93
|
+
hasUnlimitedUsage: boolean | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Whether the entitlement is visible
|
|
97
|
+
*/
|
|
98
|
+
isVisible: boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The grant period of the promotional entitlement
|
|
102
|
+
*/
|
|
103
|
+
period: '1 week' | '1 month' | '6 month' | '1 year' | 'lifetime' | 'custom';
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The reset period of the entitlement
|
|
107
|
+
*/
|
|
108
|
+
resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The reset period configuration of the entitlement
|
|
112
|
+
*/
|
|
113
|
+
resetPeriodConfiguration:
|
|
114
|
+
| Data.YearlyResetPeriodConfig
|
|
115
|
+
| Data.MonthlyResetPeriodConfig
|
|
116
|
+
| Data.WeeklyResetPeriodConfig
|
|
117
|
+
| null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The start date of the entitlement
|
|
121
|
+
*/
|
|
122
|
+
startDate: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The status of the entitlement
|
|
126
|
+
*/
|
|
127
|
+
status: 'Active' | 'Expired' | 'Paused';
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Timestamp of when the record was last updated
|
|
131
|
+
*/
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The usage limit of the entitlement
|
|
136
|
+
*/
|
|
137
|
+
usageLimit: number | null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export namespace Data {
|
|
141
|
+
/**
|
|
142
|
+
* Yearly reset configuration
|
|
143
|
+
*/
|
|
144
|
+
export interface YearlyResetPeriodConfig {
|
|
145
|
+
/**
|
|
146
|
+
* Reset anchor (SubscriptionStart)
|
|
147
|
+
*/
|
|
148
|
+
accordingTo: 'SubscriptionStart';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Monthly reset configuration
|
|
153
|
+
*/
|
|
154
|
+
export interface MonthlyResetPeriodConfig {
|
|
155
|
+
/**
|
|
156
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
157
|
+
*/
|
|
158
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Weekly reset configuration
|
|
163
|
+
*/
|
|
164
|
+
export interface WeeklyResetPeriodConfig {
|
|
165
|
+
/**
|
|
166
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
167
|
+
*/
|
|
168
|
+
accordingTo:
|
|
169
|
+
| 'SubscriptionStart'
|
|
170
|
+
| 'EverySunday'
|
|
171
|
+
| 'EveryMonday'
|
|
172
|
+
| 'EveryTuesday'
|
|
173
|
+
| 'EveryWednesday'
|
|
174
|
+
| 'EveryThursday'
|
|
175
|
+
| 'EveryFriday'
|
|
176
|
+
| 'EverySaturday';
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Response object
|
|
183
|
+
*/
|
|
184
|
+
export interface PromotionalEntitlementRevokeResponse {
|
|
185
|
+
/**
|
|
186
|
+
* Granted feature entitlement
|
|
187
|
+
*/
|
|
188
|
+
data: PromotionalEntitlementRevokeResponse.Data;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export namespace PromotionalEntitlementRevokeResponse {
|
|
192
|
+
/**
|
|
193
|
+
* Granted feature entitlement
|
|
194
|
+
*/
|
|
195
|
+
export interface Data {
|
|
196
|
+
/**
|
|
197
|
+
* Unique identifier for the entity
|
|
198
|
+
*/
|
|
199
|
+
id: string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Timestamp of when the record was created
|
|
203
|
+
*/
|
|
204
|
+
createdAt: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The description of the entitlement
|
|
208
|
+
*/
|
|
209
|
+
description: string | null;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The end date of the promotional entitlement
|
|
213
|
+
*/
|
|
214
|
+
endDate: string | null;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The enum values of the entitlement
|
|
218
|
+
*/
|
|
219
|
+
enumValues: Array<string> | null;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The unique identifier for the environment
|
|
223
|
+
*/
|
|
224
|
+
environmentId: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Feature group IDs associated with this entitlement
|
|
228
|
+
*/
|
|
229
|
+
featureGroupIds: Array<string> | null;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The unique identifier of the entitlement feature
|
|
233
|
+
*/
|
|
234
|
+
featureId: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Whether the entitlement has a soft limit
|
|
238
|
+
*/
|
|
239
|
+
hasSoftLimit: boolean | null;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Whether the entitlement has an unlimited usage
|
|
243
|
+
*/
|
|
244
|
+
hasUnlimitedUsage: boolean | null;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Whether the entitlement is visible
|
|
248
|
+
*/
|
|
249
|
+
isVisible: boolean;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* The grant period of the promotional entitlement
|
|
253
|
+
*/
|
|
254
|
+
period: '1 week' | '1 month' | '6 month' | '1 year' | 'lifetime' | 'custom';
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The reset period of the entitlement
|
|
258
|
+
*/
|
|
259
|
+
resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* The reset period configuration of the entitlement
|
|
263
|
+
*/
|
|
264
|
+
resetPeriodConfiguration:
|
|
265
|
+
| Data.YearlyResetPeriodConfig
|
|
266
|
+
| Data.MonthlyResetPeriodConfig
|
|
267
|
+
| Data.WeeklyResetPeriodConfig
|
|
268
|
+
| null;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The start date of the entitlement
|
|
272
|
+
*/
|
|
273
|
+
startDate: string;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The status of the entitlement
|
|
277
|
+
*/
|
|
278
|
+
status: 'Active' | 'Expired' | 'Paused';
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Timestamp of when the record was last updated
|
|
282
|
+
*/
|
|
283
|
+
updatedAt: string;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* The usage limit of the entitlement
|
|
287
|
+
*/
|
|
288
|
+
usageLimit: number | null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export namespace Data {
|
|
292
|
+
/**
|
|
293
|
+
* Yearly reset configuration
|
|
294
|
+
*/
|
|
295
|
+
export interface YearlyResetPeriodConfig {
|
|
296
|
+
/**
|
|
297
|
+
* Reset anchor (SubscriptionStart)
|
|
298
|
+
*/
|
|
299
|
+
accordingTo: 'SubscriptionStart';
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Monthly reset configuration
|
|
304
|
+
*/
|
|
305
|
+
export interface MonthlyResetPeriodConfig {
|
|
306
|
+
/**
|
|
307
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
308
|
+
*/
|
|
309
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Weekly reset configuration
|
|
314
|
+
*/
|
|
315
|
+
export interface WeeklyResetPeriodConfig {
|
|
316
|
+
/**
|
|
317
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
318
|
+
*/
|
|
319
|
+
accordingTo:
|
|
320
|
+
| 'SubscriptionStart'
|
|
321
|
+
| 'EverySunday'
|
|
322
|
+
| 'EveryMonday'
|
|
323
|
+
| 'EveryTuesday'
|
|
324
|
+
| 'EveryWednesday'
|
|
325
|
+
| 'EveryThursday'
|
|
326
|
+
| 'EveryFriday'
|
|
327
|
+
| 'EverySaturday';
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface PromotionalEntitlementGrantParams {
|
|
333
|
+
/**
|
|
334
|
+
* Promotional entitlements to grant
|
|
335
|
+
*/
|
|
336
|
+
promotionalEntitlements: Array<PromotionalEntitlementGrantParams.PromotionalEntitlement>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export namespace PromotionalEntitlementGrantParams {
|
|
340
|
+
/**
|
|
341
|
+
* Single entitlement grant config
|
|
342
|
+
*/
|
|
343
|
+
export interface PromotionalEntitlement {
|
|
344
|
+
/**
|
|
345
|
+
* The custom end date of the promotional entitlement
|
|
346
|
+
*/
|
|
347
|
+
customEndDate: string | null;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* The enum values of the entitlement
|
|
351
|
+
*/
|
|
352
|
+
enumValues: Array<string> | null;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* The unique identifier of the entitlement feature
|
|
356
|
+
*/
|
|
357
|
+
featureId: string;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Whether the entitlement has a soft limit
|
|
361
|
+
*/
|
|
362
|
+
hasSoftLimit: boolean | null;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Whether the entitlement has an unlimited usage
|
|
366
|
+
*/
|
|
367
|
+
hasUnlimitedUsage: boolean | null;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Whether the entitlement is visible
|
|
371
|
+
*/
|
|
372
|
+
isVisible: boolean | null;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* The monthly reset period configuration of the entitlement, defined when reset
|
|
376
|
+
* period is monthly
|
|
377
|
+
*/
|
|
378
|
+
monthlyResetPeriodConfiguration: PromotionalEntitlement.MonthlyResetPeriodConfiguration | null;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* The grant period of the promotional entitlement
|
|
382
|
+
*/
|
|
383
|
+
period: '1 week' | '1 month' | '6 month' | '1 year' | 'lifetime' | 'custom';
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* The reset period of the entitlement
|
|
387
|
+
*/
|
|
388
|
+
resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The usage limit of the entitlement
|
|
392
|
+
*/
|
|
393
|
+
usageLimit: number | null;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* The weekly reset period configuration of the entitlement, defined when reset
|
|
397
|
+
* period is weekly
|
|
398
|
+
*/
|
|
399
|
+
weeklyResetPeriodConfiguration: PromotionalEntitlement.WeeklyResetPeriodConfiguration | null;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* The yearly reset period configuration of the entitlement, defined when reset
|
|
403
|
+
* period is yearly
|
|
404
|
+
*/
|
|
405
|
+
yearlyResetPeriodConfiguration: PromotionalEntitlement.YearlyResetPeriodConfiguration | null;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export namespace PromotionalEntitlement {
|
|
409
|
+
/**
|
|
410
|
+
* The monthly reset period configuration of the entitlement, defined when reset
|
|
411
|
+
* period is monthly
|
|
412
|
+
*/
|
|
413
|
+
export interface MonthlyResetPeriodConfiguration {
|
|
414
|
+
/**
|
|
415
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
416
|
+
*/
|
|
417
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* The weekly reset period configuration of the entitlement, defined when reset
|
|
422
|
+
* period is weekly
|
|
423
|
+
*/
|
|
424
|
+
export interface WeeklyResetPeriodConfiguration {
|
|
425
|
+
/**
|
|
426
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
427
|
+
*/
|
|
428
|
+
accordingTo:
|
|
429
|
+
| 'SubscriptionStart'
|
|
430
|
+
| 'EverySunday'
|
|
431
|
+
| 'EveryMonday'
|
|
432
|
+
| 'EveryTuesday'
|
|
433
|
+
| 'EveryWednesday'
|
|
434
|
+
| 'EveryThursday'
|
|
435
|
+
| 'EveryFriday'
|
|
436
|
+
| 'EverySaturday';
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* The yearly reset period configuration of the entitlement, defined when reset
|
|
441
|
+
* period is yearly
|
|
442
|
+
*/
|
|
443
|
+
export interface YearlyResetPeriodConfiguration {
|
|
444
|
+
/**
|
|
445
|
+
* Reset anchor (SubscriptionStart)
|
|
446
|
+
*/
|
|
447
|
+
accordingTo: 'SubscriptionStart';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export interface PromotionalEntitlementRevokeParams {
|
|
453
|
+
/**
|
|
454
|
+
* The unique identifier of the customer
|
|
455
|
+
*/
|
|
456
|
+
customerId: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export declare namespace PromotionalEntitlements {
|
|
460
|
+
export {
|
|
461
|
+
type PromotionalEntitlementGrantResponse as PromotionalEntitlementGrantResponse,
|
|
462
|
+
type PromotionalEntitlementRevokeResponse as PromotionalEntitlementRevokeResponse,
|
|
463
|
+
type PromotionalEntitlementGrantParams as PromotionalEntitlementGrantParams,
|
|
464
|
+
type PromotionalEntitlementRevokeParams as PromotionalEntitlementRevokeParams,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Events extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Report usage events
|
|
10
|
+
*/
|
|
11
|
+
report(body: EventReportParams, options?: RequestOptions): APIPromise<EventReportResponse> {
|
|
12
|
+
return this._client.post('/api/v1/events', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Response object
|
|
18
|
+
*/
|
|
19
|
+
export interface EventReportResponse {
|
|
20
|
+
/**
|
|
21
|
+
* Empty success response confirming that events were successfully ingested and
|
|
22
|
+
* queued for processing by Stigg's metering system.
|
|
23
|
+
*/
|
|
24
|
+
data: unknown;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface EventReportParams {
|
|
28
|
+
/**
|
|
29
|
+
* A list of usage events to report
|
|
30
|
+
*/
|
|
31
|
+
events: Array<EventReportParams.Event>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export namespace EventReportParams {
|
|
35
|
+
/**
|
|
36
|
+
* Raw usage event
|
|
37
|
+
*/
|
|
38
|
+
export interface Event {
|
|
39
|
+
/**
|
|
40
|
+
* Customer id
|
|
41
|
+
*/
|
|
42
|
+
customerId: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The name of the usage event
|
|
46
|
+
*/
|
|
47
|
+
eventName: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Idempotency key
|
|
51
|
+
*/
|
|
52
|
+
idempotencyKey: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Dimensions associated with the usage event
|
|
56
|
+
*/
|
|
57
|
+
dimensions?: { [key: string]: string | number | boolean };
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resource id
|
|
61
|
+
*/
|
|
62
|
+
resourceId?: string | null;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Timestamp
|
|
66
|
+
*/
|
|
67
|
+
timestamp?: string;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export declare namespace Events {
|
|
72
|
+
export { type EventReportResponse as EventReportResponse, type EventReportParams as EventReportParams };
|
|
73
|
+
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
4
|
Coupons,
|
|
5
|
-
type
|
|
6
|
-
type CouponRetrieveResponse,
|
|
5
|
+
type Coupon,
|
|
7
6
|
type CouponListResponse,
|
|
8
7
|
type CouponCreateParams,
|
|
9
8
|
type CouponListParams,
|
|
@@ -13,32 +12,37 @@ export {
|
|
|
13
12
|
Customers,
|
|
14
13
|
type CustomerResponse,
|
|
15
14
|
type CustomerListResponse,
|
|
16
|
-
type
|
|
15
|
+
type CustomerImportResponse,
|
|
17
16
|
type CustomerUpdateParams,
|
|
18
17
|
type CustomerListParams,
|
|
18
|
+
type CustomerImportParams,
|
|
19
|
+
type CustomerProvisionParams,
|
|
19
20
|
type CustomerListResponsesMyCursorIDPage,
|
|
20
21
|
} from './customers/index';
|
|
22
|
+
export { Events, type EventReportResponse, type EventReportParams } from './events';
|
|
21
23
|
export {
|
|
22
24
|
Subscriptions,
|
|
23
|
-
type
|
|
24
|
-
type SubscriptionRetrieveResponse,
|
|
25
|
+
type Subscription,
|
|
25
26
|
type SubscriptionListResponse,
|
|
26
|
-
type
|
|
27
|
-
type SubscriptionMigrateResponse,
|
|
27
|
+
type SubscriptionImportResponse,
|
|
28
28
|
type SubscriptionPreviewResponse,
|
|
29
|
-
type
|
|
30
|
-
type
|
|
29
|
+
type SubscriptionProvisionResponse,
|
|
30
|
+
type SubscriptionUpdateParams,
|
|
31
31
|
type SubscriptionListParams,
|
|
32
|
+
type SubscriptionCancelParams,
|
|
32
33
|
type SubscriptionDelegateParams,
|
|
34
|
+
type SubscriptionImportParams,
|
|
33
35
|
type SubscriptionMigrateParams,
|
|
34
36
|
type SubscriptionPreviewParams,
|
|
37
|
+
type SubscriptionProvisionParams,
|
|
35
38
|
type SubscriptionTransferParams,
|
|
36
39
|
type SubscriptionListResponsesMyCursorIDPage,
|
|
37
40
|
} from './subscriptions/index';
|
|
38
41
|
export {
|
|
39
|
-
|
|
40
|
-
type
|
|
41
|
-
type
|
|
42
|
-
type
|
|
43
|
-
type
|
|
44
|
-
} from './
|
|
42
|
+
Usage,
|
|
43
|
+
type UsageHistoryResponse,
|
|
44
|
+
type UsageReportResponse,
|
|
45
|
+
type UsageHistoryParams,
|
|
46
|
+
type UsageReportParams,
|
|
47
|
+
} from './usage';
|
|
48
|
+
export { V1 } from './v1';
|
|
@@ -7,41 +7,28 @@ 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
|
-
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
|
+
* Cancel scheduled update
|
|
21
18
|
*/
|
|
22
|
-
cancelSchedule(id: string, options?: RequestOptions): APIPromise<
|
|
19
|
+
cancelSchedule(id: string, options?: RequestOptions): APIPromise<CancelSubscription> {
|
|
23
20
|
return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/schedule`, options);
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Response object
|
|
26
|
+
*/
|
|
27
|
+
export interface CancelSubscription {
|
|
28
|
+
data: CancelSubscription.Data;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export namespace
|
|
32
|
-
export interface Data {
|
|
33
|
-
/**
|
|
34
|
-
* Subscription ID
|
|
35
|
-
*/
|
|
36
|
-
id: string;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface FutureUpdateCancelScheduleResponse {
|
|
41
|
-
data: FutureUpdateCancelScheduleResponse.Data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export namespace FutureUpdateCancelScheduleResponse {
|
|
31
|
+
export namespace CancelSubscription {
|
|
45
32
|
export interface Data {
|
|
46
33
|
/**
|
|
47
34
|
* Subscription ID
|
|
@@ -51,8 +38,5 @@ export namespace FutureUpdateCancelScheduleResponse {
|
|
|
51
38
|
}
|
|
52
39
|
|
|
53
40
|
export declare namespace FutureUpdate {
|
|
54
|
-
export {
|
|
55
|
-
type FutureUpdateCancelPendingPaymentResponse as FutureUpdateCancelPendingPaymentResponse,
|
|
56
|
-
type FutureUpdateCancelScheduleResponse as FutureUpdateCancelScheduleResponse,
|
|
57
|
-
};
|
|
41
|
+
export { type CancelSubscription as CancelSubscription };
|
|
58
42
|
}
|
|
@@ -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';
|