@usehercules/sdk 1.10.1 → 1.11.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 +9 -0
- package/README.md +7 -7
- package/package.json +1 -1
- package/resources/beta/commerce/commerce.d.mts +31 -11
- package/resources/beta/commerce/commerce.d.mts.map +1 -1
- package/resources/beta/commerce/commerce.d.ts +31 -11
- package/resources/beta/commerce/commerce.d.ts.map +1 -1
- package/resources/beta/commerce/commerce.js +4 -0
- package/resources/beta/commerce/commerce.js.map +1 -1
- package/resources/beta/commerce/commerce.mjs +4 -0
- package/resources/beta/commerce/commerce.mjs.map +1 -1
- package/resources/beta/commerce/coupons.d.mts +7 -184
- package/resources/beta/commerce/coupons.d.mts.map +1 -1
- package/resources/beta/commerce/coupons.d.ts +7 -184
- package/resources/beta/commerce/coupons.d.ts.map +1 -1
- package/resources/beta/commerce/coupons.js +1 -4
- package/resources/beta/commerce/coupons.js.map +1 -1
- package/resources/beta/commerce/coupons.mjs +1 -4
- package/resources/beta/commerce/coupons.mjs.map +1 -1
- package/resources/beta/commerce/customers.d.mts +24 -239
- package/resources/beta/commerce/customers.d.mts.map +1 -1
- package/resources/beta/commerce/customers.d.ts +24 -239
- package/resources/beta/commerce/customers.d.ts.map +1 -1
- package/resources/beta/commerce/customers.js +1 -4
- package/resources/beta/commerce/customers.js.map +1 -1
- package/resources/beta/commerce/customers.mjs +1 -4
- package/resources/beta/commerce/customers.mjs.map +1 -1
- package/resources/beta/commerce/features.d.mts +127 -0
- package/resources/beta/commerce/features.d.mts.map +1 -0
- package/resources/beta/commerce/features.d.ts +127 -0
- package/resources/beta/commerce/features.d.ts.map +1 -0
- package/resources/beta/commerce/features.js +49 -0
- package/resources/beta/commerce/features.js.map +1 -0
- package/resources/beta/commerce/features.mjs +45 -0
- package/resources/beta/commerce/features.mjs.map +1 -0
- package/resources/beta/commerce/index.d.mts +4 -3
- package/resources/beta/commerce/index.d.mts.map +1 -1
- package/resources/beta/commerce/index.d.ts +4 -3
- package/resources/beta/commerce/index.d.ts.map +1 -1
- package/resources/beta/commerce/index.js +3 -1
- package/resources/beta/commerce/index.js.map +1 -1
- package/resources/beta/commerce/index.mjs +1 -0
- package/resources/beta/commerce/index.mjs.map +1 -1
- package/resources/beta/commerce/products/index.d.mts +2 -2
- package/resources/beta/commerce/products/index.d.mts.map +1 -1
- package/resources/beta/commerce/products/index.d.ts +2 -2
- package/resources/beta/commerce/products/index.d.ts.map +1 -1
- package/resources/beta/commerce/products/index.js.map +1 -1
- package/resources/beta/commerce/products/index.mjs.map +1 -1
- package/resources/beta/commerce/products/products.d.mts +17 -673
- package/resources/beta/commerce/products/products.d.mts.map +1 -1
- package/resources/beta/commerce/products/products.d.ts +17 -673
- package/resources/beta/commerce/products/products.d.ts.map +1 -1
- package/resources/beta/commerce/products/products.js +1 -4
- package/resources/beta/commerce/products/products.js.map +1 -1
- package/resources/beta/commerce/products/products.mjs +1 -4
- package/resources/beta/commerce/products/products.mjs.map +1 -1
- package/resources/beta/commerce/products/variants.d.mts +12 -540
- package/resources/beta/commerce/products/variants.d.mts.map +1 -1
- package/resources/beta/commerce/products/variants.d.ts +12 -540
- package/resources/beta/commerce/products/variants.d.ts.map +1 -1
- package/resources/beta/commerce/products/variants.js +4 -1
- package/resources/beta/commerce/products/variants.js.map +1 -1
- package/resources/beta/commerce/products/variants.mjs +4 -1
- package/resources/beta/commerce/products/variants.mjs.map +1 -1
- package/src/resources/beta/commerce/commerce.ts +57 -35
- package/src/resources/beta/commerce/coupons.ts +9 -231
- package/src/resources/beta/commerce/customers.ts +27 -291
- package/src/resources/beta/commerce/features.ts +175 -0
- package/src/resources/beta/commerce/index.ts +15 -15
- package/src/resources/beta/commerce/products/index.ts +4 -12
- package/src/resources/beta/commerce/products/products.ts +21 -800
- package/src/resources/beta/commerce/products/variants.ts +17 -658
- 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
|
@@ -12,11 +12,7 @@ export class Variants extends APIResource {
|
|
|
12
12
|
* pricing tiers or configurations (e.g., Basic at $10/month, Pro at $25/month). A
|
|
13
13
|
* Stripe Price is automatically created.
|
|
14
14
|
*/
|
|
15
|
-
create(
|
|
16
|
-
productID: string,
|
|
17
|
-
body: VariantCreateParams,
|
|
18
|
-
options?: RequestOptions,
|
|
19
|
-
): APIPromise<VariantCreateResponse> {
|
|
15
|
+
create(productID: string, body: VariantCreateParams, options?: RequestOptions): APIPromise<Variant> {
|
|
20
16
|
return this._client.post(path`/v1/commerce/products/${productID}/variants`, { body, ...options });
|
|
21
17
|
}
|
|
22
18
|
|
|
@@ -24,11 +20,7 @@ export class Variants extends APIResource {
|
|
|
24
20
|
* Updates an existing variant. Use this to modify the name, description, or active
|
|
25
21
|
* status. Pricing cannot be changed after creation—create a new variant instead.
|
|
26
22
|
*/
|
|
27
|
-
update(
|
|
28
|
-
variantID: string,
|
|
29
|
-
params: VariantUpdateParams,
|
|
30
|
-
options?: RequestOptions,
|
|
31
|
-
): APIPromise<VariantUpdateResponse> {
|
|
23
|
+
update(variantID: string, params: VariantUpdateParams, options?: RequestOptions): APIPromise<Variant> {
|
|
32
24
|
const { product_id, ...body } = params;
|
|
33
25
|
return this._client.patch(path`/v1/commerce/products/${product_id}/variants/${variantID}`, {
|
|
34
26
|
body,
|
|
@@ -44,23 +36,18 @@ export class Variants extends APIResource {
|
|
|
44
36
|
productID: string,
|
|
45
37
|
query: VariantListParams | null | undefined = {},
|
|
46
38
|
options?: RequestOptions,
|
|
47
|
-
): PagePromise<
|
|
48
|
-
return this._client.getAPIList(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
);
|
|
39
|
+
): PagePromise<VariantsCursorIDPage, Variant> {
|
|
40
|
+
return this._client.getAPIList(path`/v1/commerce/products/${productID}/variants`, CursorIDPage<Variant>, {
|
|
41
|
+
query,
|
|
42
|
+
...options,
|
|
43
|
+
});
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
/**
|
|
56
47
|
* Archives a variant, preventing new subscriptions. The associated Stripe Price is
|
|
57
48
|
* also archived. Existing subscriptions remain active.
|
|
58
49
|
*/
|
|
59
|
-
archive(
|
|
60
|
-
variantID: string,
|
|
61
|
-
params: VariantArchiveParams,
|
|
62
|
-
options?: RequestOptions,
|
|
63
|
-
): APIPromise<VariantArchiveResponse> {
|
|
50
|
+
archive(variantID: string, params: VariantArchiveParams, options?: RequestOptions): APIPromise<Variant> {
|
|
64
51
|
const { product_id } = params;
|
|
65
52
|
return this._client.delete(path`/v1/commerce/products/${product_id}/variants/${variantID}`, options);
|
|
66
53
|
}
|
|
@@ -69,644 +56,20 @@ export class Variants extends APIResource {
|
|
|
69
56
|
* Retrieves a variant by ID. Returns the variant object including pricing details
|
|
70
57
|
* and status.
|
|
71
58
|
*/
|
|
72
|
-
get(variantID: string, params: VariantGetParams, options?: RequestOptions): APIPromise<
|
|
59
|
+
get(variantID: string, params: VariantGetParams, options?: RequestOptions): APIPromise<Variant> {
|
|
73
60
|
const { product_id } = params;
|
|
74
61
|
return this._client.get(path`/v1/commerce/products/${product_id}/variants/${variantID}`, options);
|
|
75
62
|
}
|
|
76
63
|
}
|
|
77
64
|
|
|
78
|
-
export type
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* A product variant representing a specific tier or configuration. Each variant
|
|
82
|
-
* has its own pricing. Variants allow a single product to have multiple pricing
|
|
83
|
-
* options (e.g., Basic, Pro, Enterprise tiers).
|
|
84
|
-
*/
|
|
85
|
-
export interface VariantCreateResponse {
|
|
86
|
-
/**
|
|
87
|
-
* Unique identifier for the topic subscription
|
|
88
|
-
*/
|
|
89
|
-
id: string;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Whether the variant is available for new purchases
|
|
93
|
-
*/
|
|
94
|
-
active: boolean;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Timestamp when the variant was created
|
|
98
|
-
*/
|
|
99
|
-
created: string;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Display name for the variant (e.g., Basic, Standard, Premium)
|
|
103
|
-
*/
|
|
104
|
-
name: string;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Three-letter ISO currency code
|
|
108
|
-
*/
|
|
109
|
-
currency?: string;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
113
|
-
*/
|
|
114
|
-
default_price?: VariantCreateResponse.DefaultPrice | null;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Detailed description of what this variant includes
|
|
118
|
-
*/
|
|
119
|
-
description?: string | null;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Media attachments (images, videos) for the variant
|
|
123
|
-
*/
|
|
124
|
-
media?: Array<VariantCreateResponse.Media>;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Custom metadata for the variant
|
|
128
|
-
*/
|
|
129
|
-
metadata?: { [key: string]: unknown };
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Recurring billing configuration for subscription variants
|
|
133
|
-
*/
|
|
134
|
-
recurring?: VariantCreateResponse.Recurring | null;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
|
|
138
|
-
*/
|
|
139
|
-
unit_amount?: number;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export namespace VariantCreateResponse {
|
|
143
|
-
/**
|
|
144
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
145
|
-
*/
|
|
146
|
-
export interface DefaultPrice {
|
|
147
|
-
/**
|
|
148
|
-
* Unique identifier for the topic subscription
|
|
149
|
-
*/
|
|
150
|
-
id: string;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Three-letter ISO currency code (e.g., usd, eur)
|
|
154
|
-
*/
|
|
155
|
-
currency: string;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Billing frequency for recurring prices: day, week, month, or year. Null for
|
|
159
|
-
* one-time prices.
|
|
160
|
-
*/
|
|
161
|
-
interval: 'day' | 'week' | 'month' | 'year' | null;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Number of intervals between billings for recurring prices. Null for one-time
|
|
165
|
-
* prices.
|
|
166
|
-
*/
|
|
167
|
-
interval_count: number | null;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Price type: one_time for single purchases, recurring for subscriptions
|
|
171
|
-
*/
|
|
172
|
-
type: 'one_time' | 'recurring';
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Price amount in the smallest currency unit (e.g., cents)
|
|
176
|
-
*/
|
|
177
|
-
unit_amount: number | null;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Media attachment for products or variants
|
|
182
|
-
*/
|
|
183
|
-
export interface Media {
|
|
184
|
-
/**
|
|
185
|
-
* CDN file ID
|
|
186
|
-
*/
|
|
187
|
-
id: string;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Display order in gallery (0-indexed)
|
|
191
|
-
*/
|
|
192
|
-
display_order: number;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Type of media: image or video
|
|
196
|
-
*/
|
|
197
|
-
type: 'image' | 'video';
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* CDN URL of the media resource
|
|
201
|
-
*/
|
|
202
|
-
url: string;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* File size in bytes
|
|
206
|
-
*/
|
|
207
|
-
file_size?: number;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Original filename
|
|
211
|
-
*/
|
|
212
|
-
filename?: string;
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Optimized thumbnail URL for images
|
|
216
|
-
*/
|
|
217
|
-
thumbnail_url?: string;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Recurring billing configuration for subscription variants
|
|
222
|
-
*/
|
|
223
|
-
export interface Recurring {
|
|
224
|
-
/**
|
|
225
|
-
* Billing frequency: day, week, month, or year
|
|
226
|
-
*/
|
|
227
|
-
interval: 'day' | 'week' | 'month' | 'year';
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Number of intervals between billings
|
|
231
|
-
*/
|
|
232
|
-
interval_count?: number;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* A product variant representing a specific tier or configuration. Each variant
|
|
238
|
-
* has its own pricing. Variants allow a single product to have multiple pricing
|
|
239
|
-
* options (e.g., Basic, Pro, Enterprise tiers).
|
|
240
|
-
*/
|
|
241
|
-
export interface VariantUpdateResponse {
|
|
242
|
-
/**
|
|
243
|
-
* Unique identifier for the topic subscription
|
|
244
|
-
*/
|
|
245
|
-
id: string;
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Whether the variant is available for new purchases
|
|
249
|
-
*/
|
|
250
|
-
active: boolean;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Timestamp when the variant was created
|
|
254
|
-
*/
|
|
255
|
-
created: string;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Display name for the variant (e.g., Basic, Standard, Premium)
|
|
259
|
-
*/
|
|
260
|
-
name: string;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Three-letter ISO currency code
|
|
264
|
-
*/
|
|
265
|
-
currency?: string;
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
269
|
-
*/
|
|
270
|
-
default_price?: VariantUpdateResponse.DefaultPrice | null;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Detailed description of what this variant includes
|
|
274
|
-
*/
|
|
275
|
-
description?: string | null;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Media attachments (images, videos) for the variant
|
|
279
|
-
*/
|
|
280
|
-
media?: Array<VariantUpdateResponse.Media>;
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Custom metadata for the variant
|
|
284
|
-
*/
|
|
285
|
-
metadata?: { [key: string]: unknown };
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Recurring billing configuration for subscription variants
|
|
289
|
-
*/
|
|
290
|
-
recurring?: VariantUpdateResponse.Recurring | null;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
|
|
294
|
-
*/
|
|
295
|
-
unit_amount?: number;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export namespace VariantUpdateResponse {
|
|
299
|
-
/**
|
|
300
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
301
|
-
*/
|
|
302
|
-
export interface DefaultPrice {
|
|
303
|
-
/**
|
|
304
|
-
* Unique identifier for the topic subscription
|
|
305
|
-
*/
|
|
306
|
-
id: string;
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Three-letter ISO currency code (e.g., usd, eur)
|
|
310
|
-
*/
|
|
311
|
-
currency: string;
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Billing frequency for recurring prices: day, week, month, or year. Null for
|
|
315
|
-
* one-time prices.
|
|
316
|
-
*/
|
|
317
|
-
interval: 'day' | 'week' | 'month' | 'year' | null;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Number of intervals between billings for recurring prices. Null for one-time
|
|
321
|
-
* prices.
|
|
322
|
-
*/
|
|
323
|
-
interval_count: number | null;
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Price type: one_time for single purchases, recurring for subscriptions
|
|
327
|
-
*/
|
|
328
|
-
type: 'one_time' | 'recurring';
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Price amount in the smallest currency unit (e.g., cents)
|
|
332
|
-
*/
|
|
333
|
-
unit_amount: number | null;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Media attachment for products or variants
|
|
338
|
-
*/
|
|
339
|
-
export interface Media {
|
|
340
|
-
/**
|
|
341
|
-
* CDN file ID
|
|
342
|
-
*/
|
|
343
|
-
id: string;
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Display order in gallery (0-indexed)
|
|
347
|
-
*/
|
|
348
|
-
display_order: number;
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Type of media: image or video
|
|
352
|
-
*/
|
|
353
|
-
type: 'image' | 'video';
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* CDN URL of the media resource
|
|
357
|
-
*/
|
|
358
|
-
url: string;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* File size in bytes
|
|
362
|
-
*/
|
|
363
|
-
file_size?: number;
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Original filename
|
|
367
|
-
*/
|
|
368
|
-
filename?: string;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Optimized thumbnail URL for images
|
|
372
|
-
*/
|
|
373
|
-
thumbnail_url?: string;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Recurring billing configuration for subscription variants
|
|
378
|
-
*/
|
|
379
|
-
export interface Recurring {
|
|
380
|
-
/**
|
|
381
|
-
* Billing frequency: day, week, month, or year
|
|
382
|
-
*/
|
|
383
|
-
interval: 'day' | 'week' | 'month' | 'year';
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Number of intervals between billings
|
|
387
|
-
*/
|
|
388
|
-
interval_count?: number;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* A product variant representing a specific tier or configuration. Each variant
|
|
394
|
-
* has its own pricing. Variants allow a single product to have multiple pricing
|
|
395
|
-
* options (e.g., Basic, Pro, Enterprise tiers).
|
|
396
|
-
*/
|
|
397
|
-
export interface VariantListResponse {
|
|
398
|
-
/**
|
|
399
|
-
* Unique identifier for the topic subscription
|
|
400
|
-
*/
|
|
401
|
-
id: string;
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Whether the variant is available for new purchases
|
|
405
|
-
*/
|
|
406
|
-
active: boolean;
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Timestamp when the variant was created
|
|
410
|
-
*/
|
|
411
|
-
created: string;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Display name for the variant (e.g., Basic, Standard, Premium)
|
|
415
|
-
*/
|
|
416
|
-
name: string;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Three-letter ISO currency code
|
|
420
|
-
*/
|
|
421
|
-
currency?: string;
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
425
|
-
*/
|
|
426
|
-
default_price?: VariantListResponse.DefaultPrice | null;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Detailed description of what this variant includes
|
|
430
|
-
*/
|
|
431
|
-
description?: string | null;
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Media attachments (images, videos) for the variant
|
|
435
|
-
*/
|
|
436
|
-
media?: Array<VariantListResponse.Media>;
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Custom metadata for the variant
|
|
440
|
-
*/
|
|
441
|
-
metadata?: { [key: string]: unknown };
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Recurring billing configuration for subscription variants
|
|
445
|
-
*/
|
|
446
|
-
recurring?: VariantListResponse.Recurring | null;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
|
|
450
|
-
*/
|
|
451
|
-
unit_amount?: number;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
export namespace VariantListResponse {
|
|
455
|
-
/**
|
|
456
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
457
|
-
*/
|
|
458
|
-
export interface DefaultPrice {
|
|
459
|
-
/**
|
|
460
|
-
* Unique identifier for the topic subscription
|
|
461
|
-
*/
|
|
462
|
-
id: string;
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Three-letter ISO currency code (e.g., usd, eur)
|
|
466
|
-
*/
|
|
467
|
-
currency: string;
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Billing frequency for recurring prices: day, week, month, or year. Null for
|
|
471
|
-
* one-time prices.
|
|
472
|
-
*/
|
|
473
|
-
interval: 'day' | 'week' | 'month' | 'year' | null;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Number of intervals between billings for recurring prices. Null for one-time
|
|
477
|
-
* prices.
|
|
478
|
-
*/
|
|
479
|
-
interval_count: number | null;
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Price type: one_time for single purchases, recurring for subscriptions
|
|
483
|
-
*/
|
|
484
|
-
type: 'one_time' | 'recurring';
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Price amount in the smallest currency unit (e.g., cents)
|
|
488
|
-
*/
|
|
489
|
-
unit_amount: number | null;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Media attachment for products or variants
|
|
494
|
-
*/
|
|
495
|
-
export interface Media {
|
|
496
|
-
/**
|
|
497
|
-
* CDN file ID
|
|
498
|
-
*/
|
|
499
|
-
id: string;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Display order in gallery (0-indexed)
|
|
503
|
-
*/
|
|
504
|
-
display_order: number;
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Type of media: image or video
|
|
508
|
-
*/
|
|
509
|
-
type: 'image' | 'video';
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* CDN URL of the media resource
|
|
513
|
-
*/
|
|
514
|
-
url: string;
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* File size in bytes
|
|
518
|
-
*/
|
|
519
|
-
file_size?: number;
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* Original filename
|
|
523
|
-
*/
|
|
524
|
-
filename?: string;
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* Optimized thumbnail URL for images
|
|
528
|
-
*/
|
|
529
|
-
thumbnail_url?: string;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* Recurring billing configuration for subscription variants
|
|
534
|
-
*/
|
|
535
|
-
export interface Recurring {
|
|
536
|
-
/**
|
|
537
|
-
* Billing frequency: day, week, month, or year
|
|
538
|
-
*/
|
|
539
|
-
interval: 'day' | 'week' | 'month' | 'year';
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Number of intervals between billings
|
|
543
|
-
*/
|
|
544
|
-
interval_count?: number;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* A product variant representing a specific tier or configuration. Each variant
|
|
550
|
-
* has its own pricing. Variants allow a single product to have multiple pricing
|
|
551
|
-
* options (e.g., Basic, Pro, Enterprise tiers).
|
|
552
|
-
*/
|
|
553
|
-
export interface VariantArchiveResponse {
|
|
554
|
-
/**
|
|
555
|
-
* Unique identifier for the topic subscription
|
|
556
|
-
*/
|
|
557
|
-
id: string;
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Whether the variant is available for new purchases
|
|
561
|
-
*/
|
|
562
|
-
active: boolean;
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Timestamp when the variant was created
|
|
566
|
-
*/
|
|
567
|
-
created: string;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Display name for the variant (e.g., Basic, Standard, Premium)
|
|
571
|
-
*/
|
|
572
|
-
name: string;
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* Three-letter ISO currency code
|
|
576
|
-
*/
|
|
577
|
-
currency?: string;
|
|
578
|
-
|
|
579
|
-
/**
|
|
580
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
581
|
-
*/
|
|
582
|
-
default_price?: VariantArchiveResponse.DefaultPrice | null;
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* Detailed description of what this variant includes
|
|
586
|
-
*/
|
|
587
|
-
description?: string | null;
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* Media attachments (images, videos) for the variant
|
|
591
|
-
*/
|
|
592
|
-
media?: Array<VariantArchiveResponse.Media>;
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Custom metadata for the variant
|
|
596
|
-
*/
|
|
597
|
-
metadata?: { [key: string]: unknown };
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* Recurring billing configuration for subscription variants
|
|
601
|
-
*/
|
|
602
|
-
recurring?: VariantArchiveResponse.Recurring | null;
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
|
|
606
|
-
*/
|
|
607
|
-
unit_amount?: number;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
export namespace VariantArchiveResponse {
|
|
611
|
-
/**
|
|
612
|
-
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
613
|
-
*/
|
|
614
|
-
export interface DefaultPrice {
|
|
615
|
-
/**
|
|
616
|
-
* Unique identifier for the topic subscription
|
|
617
|
-
*/
|
|
618
|
-
id: string;
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Three-letter ISO currency code (e.g., usd, eur)
|
|
622
|
-
*/
|
|
623
|
-
currency: string;
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Billing frequency for recurring prices: day, week, month, or year. Null for
|
|
627
|
-
* one-time prices.
|
|
628
|
-
*/
|
|
629
|
-
interval: 'day' | 'week' | 'month' | 'year' | null;
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* Number of intervals between billings for recurring prices. Null for one-time
|
|
633
|
-
* prices.
|
|
634
|
-
*/
|
|
635
|
-
interval_count: number | null;
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* Price type: one_time for single purchases, recurring for subscriptions
|
|
639
|
-
*/
|
|
640
|
-
type: 'one_time' | 'recurring';
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* Price amount in the smallest currency unit (e.g., cents)
|
|
644
|
-
*/
|
|
645
|
-
unit_amount: number | null;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Media attachment for products or variants
|
|
650
|
-
*/
|
|
651
|
-
export interface Media {
|
|
652
|
-
/**
|
|
653
|
-
* CDN file ID
|
|
654
|
-
*/
|
|
655
|
-
id: string;
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* Display order in gallery (0-indexed)
|
|
659
|
-
*/
|
|
660
|
-
display_order: number;
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* Type of media: image or video
|
|
664
|
-
*/
|
|
665
|
-
type: 'image' | 'video';
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* CDN URL of the media resource
|
|
669
|
-
*/
|
|
670
|
-
url: string;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* File size in bytes
|
|
674
|
-
*/
|
|
675
|
-
file_size?: number;
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* Original filename
|
|
679
|
-
*/
|
|
680
|
-
filename?: string;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Optimized thumbnail URL for images
|
|
684
|
-
*/
|
|
685
|
-
thumbnail_url?: string;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
/**
|
|
689
|
-
* Recurring billing configuration for subscription variants
|
|
690
|
-
*/
|
|
691
|
-
export interface Recurring {
|
|
692
|
-
/**
|
|
693
|
-
* Billing frequency: day, week, month, or year
|
|
694
|
-
*/
|
|
695
|
-
interval: 'day' | 'week' | 'month' | 'year';
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Number of intervals between billings
|
|
699
|
-
*/
|
|
700
|
-
interval_count?: number;
|
|
701
|
-
}
|
|
702
|
-
}
|
|
65
|
+
export type VariantsCursorIDPage = CursorIDPage<Variant>;
|
|
703
66
|
|
|
704
67
|
/**
|
|
705
68
|
* A product variant representing a specific tier or configuration. Each variant
|
|
706
69
|
* has its own pricing. Variants allow a single product to have multiple pricing
|
|
707
70
|
* options (e.g., Basic, Pro, Enterprise tiers).
|
|
708
71
|
*/
|
|
709
|
-
export interface
|
|
72
|
+
export interface Variant {
|
|
710
73
|
/**
|
|
711
74
|
* Unique identifier for the topic subscription
|
|
712
75
|
*/
|
|
@@ -735,7 +98,7 @@ export interface VariantGetResponse {
|
|
|
735
98
|
/**
|
|
736
99
|
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
737
100
|
*/
|
|
738
|
-
default_price?:
|
|
101
|
+
default_price?: Variant.DefaultPrice | null;
|
|
739
102
|
|
|
740
103
|
/**
|
|
741
104
|
* Detailed description of what this variant includes
|
|
@@ -745,7 +108,7 @@ export interface VariantGetResponse {
|
|
|
745
108
|
/**
|
|
746
109
|
* Media attachments (images, videos) for the variant
|
|
747
110
|
*/
|
|
748
|
-
media?: Array<
|
|
111
|
+
media?: Array<Variant.Media>;
|
|
749
112
|
|
|
750
113
|
/**
|
|
751
114
|
* Custom metadata for the variant
|
|
@@ -755,7 +118,7 @@ export interface VariantGetResponse {
|
|
|
755
118
|
/**
|
|
756
119
|
* Recurring billing configuration for subscription variants
|
|
757
120
|
*/
|
|
758
|
-
recurring?:
|
|
121
|
+
recurring?: Variant.Recurring | null;
|
|
759
122
|
|
|
760
123
|
/**
|
|
761
124
|
* Price amount in the smallest currency unit (e.g., cents). 0 for free variants.
|
|
@@ -763,7 +126,7 @@ export interface VariantGetResponse {
|
|
|
763
126
|
unit_amount?: number;
|
|
764
127
|
}
|
|
765
128
|
|
|
766
|
-
export namespace
|
|
129
|
+
export namespace Variant {
|
|
767
130
|
/**
|
|
768
131
|
* Price configuration for a product. Can be one-time or recurring (subscription).
|
|
769
132
|
*/
|
|
@@ -1015,12 +378,8 @@ export interface VariantGetParams {
|
|
|
1015
378
|
|
|
1016
379
|
export declare namespace Variants {
|
|
1017
380
|
export {
|
|
1018
|
-
type
|
|
1019
|
-
type
|
|
1020
|
-
type VariantListResponse as VariantListResponse,
|
|
1021
|
-
type VariantArchiveResponse as VariantArchiveResponse,
|
|
1022
|
-
type VariantGetResponse as VariantGetResponse,
|
|
1023
|
-
type VariantListResponsesCursorIDPage as VariantListResponsesCursorIDPage,
|
|
381
|
+
type Variant as Variant,
|
|
382
|
+
type VariantsCursorIDPage as VariantsCursorIDPage,
|
|
1024
383
|
type VariantCreateParams as VariantCreateParams,
|
|
1025
384
|
type VariantUpdateParams as VariantUpdateParams,
|
|
1026
385
|
type VariantListParams as VariantListParams,
|