dodopayments 2.23.2 → 2.24.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 +46 -0
- package/bin/migration-config.json +187 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +9 -2
- package/client.js.map +1 -1
- package/client.mjs +9 -2
- package/client.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/checkout-sessions.d.mts +17 -2
- package/resources/checkout-sessions.d.mts.map +1 -1
- package/resources/checkout-sessions.d.ts +17 -2
- package/resources/checkout-sessions.d.ts.map +1 -1
- package/resources/customers/customer-portal.d.mts +5 -0
- package/resources/customers/customer-portal.d.mts.map +1 -1
- package/resources/customers/customer-portal.d.ts +5 -0
- package/resources/customers/customer-portal.d.ts.map +1 -1
- package/resources/customers/customer-portal.js +2 -2
- package/resources/customers/customer-portal.js.map +1 -1
- package/resources/customers/customer-portal.mjs +2 -2
- package/resources/customers/customer-portal.mjs.map +1 -1
- package/resources/customers/customers.d.mts +5 -0
- package/resources/customers/customers.d.mts.map +1 -1
- package/resources/customers/customers.d.ts +5 -0
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invoices/payments.d.mts +1 -0
- package/resources/invoices/payments.d.mts.map +1 -1
- package/resources/invoices/payments.d.ts +1 -0
- package/resources/invoices/payments.d.ts.map +1 -1
- package/resources/invoices/payments.js +7 -0
- package/resources/invoices/payments.js.map +1 -1
- package/resources/invoices/payments.mjs +7 -0
- package/resources/invoices/payments.mjs.map +1 -1
- package/resources/payments.d.mts +5 -0
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +5 -0
- package/resources/payments.d.ts.map +1 -1
- package/resources/product-collections/groups/groups.d.mts +107 -0
- package/resources/product-collections/groups/groups.d.mts.map +1 -0
- package/resources/product-collections/groups/groups.d.ts +107 -0
- package/resources/product-collections/groups/groups.d.ts.map +1 -0
- package/resources/product-collections/groups/groups.js +37 -0
- package/resources/product-collections/groups/groups.js.map +1 -0
- package/resources/product-collections/groups/groups.mjs +32 -0
- package/resources/product-collections/groups/groups.mjs.map +1 -0
- package/resources/product-collections/groups/index.d.mts +3 -0
- package/resources/product-collections/groups/index.d.mts.map +1 -0
- package/resources/product-collections/groups/index.d.ts +3 -0
- package/resources/product-collections/groups/index.d.ts.map +1 -0
- package/resources/product-collections/groups/index.js +9 -0
- package/resources/product-collections/groups/index.js.map +1 -0
- package/resources/product-collections/groups/index.mjs +4 -0
- package/resources/product-collections/groups/index.mjs.map +1 -0
- package/resources/product-collections/groups/items.d.mts +91 -0
- package/resources/product-collections/groups/items.d.mts.map +1 -0
- package/resources/product-collections/groups/items.d.ts +91 -0
- package/resources/product-collections/groups/items.d.ts.map +1 -0
- package/resources/product-collections/groups/items.js +30 -0
- package/resources/product-collections/groups/items.js.map +1 -0
- package/resources/product-collections/groups/items.mjs +26 -0
- package/resources/product-collections/groups/items.mjs.map +1 -0
- package/resources/product-collections/groups.d.mts +2 -0
- package/resources/product-collections/groups.d.mts.map +1 -0
- package/resources/product-collections/groups.d.ts +2 -0
- package/resources/product-collections/groups.d.ts.map +1 -0
- package/resources/product-collections/groups.js +6 -0
- package/resources/product-collections/groups.js.map +1 -0
- package/resources/product-collections/groups.mjs +3 -0
- package/resources/product-collections/groups.mjs.map +1 -0
- package/resources/product-collections/index.d.mts +3 -0
- package/resources/product-collections/index.d.mts.map +1 -0
- package/resources/product-collections/index.d.ts +3 -0
- package/resources/product-collections/index.d.ts.map +1 -0
- package/resources/product-collections/index.js +9 -0
- package/resources/product-collections/index.js.map +1 -0
- package/resources/product-collections/index.mjs +4 -0
- package/resources/product-collections/index.mjs.map +1 -0
- package/resources/product-collections/product-collections.d.mts +307 -0
- package/resources/product-collections/product-collections.d.mts.map +1 -0
- package/resources/product-collections/product-collections.d.ts +307 -0
- package/resources/product-collections/product-collections.d.ts.map +1 -0
- package/resources/product-collections/product-collections.js +49 -0
- package/resources/product-collections/product-collections.js.map +1 -0
- package/resources/product-collections/product-collections.mjs +44 -0
- package/resources/product-collections/product-collections.mjs.map +1 -0
- package/resources/product-collections.d.mts +2 -0
- package/resources/product-collections.d.mts.map +1 -0
- package/resources/product-collections.d.ts +2 -0
- package/resources/product-collections.d.ts.map +1 -0
- package/resources/product-collections.js +6 -0
- package/resources/product-collections.js.map +1 -0
- package/resources/product-collections.mjs +3 -0
- package/resources/product-collections.mjs.map +1 -0
- package/resources/subscriptions.d.mts +147 -3
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +147 -3
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +6 -0
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +6 -0
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/your-webhook-url.d.mts +85 -0
- package/resources/your-webhook-url.d.mts.map +1 -0
- package/resources/your-webhook-url.d.ts +85 -0
- package/resources/your-webhook-url.d.ts.map +1 -0
- package/resources/your-webhook-url.js +26 -0
- package/resources/your-webhook-url.js.map +1 -0
- package/resources/your-webhook-url.mjs +22 -0
- package/resources/your-webhook-url.mjs.map +1 -0
- package/src/client.ts +37 -2
- package/src/resources/checkout-sessions.ts +20 -2
- package/src/resources/customers/customer-portal.ts +8 -2
- package/src/resources/customers/customers.ts +5 -0
- package/src/resources/index.ts +14 -0
- package/src/resources/invoices/payments.ts +8 -0
- package/src/resources/payments.ts +5 -0
- package/src/resources/product-collections/groups/groups.ts +174 -0
- package/src/resources/product-collections/groups/index.ts +16 -0
- package/src/resources/product-collections/groups/items.ts +149 -0
- package/src/resources/product-collections/groups.ts +3 -0
- package/src/resources/product-collections/index.ts +22 -0
- package/src/resources/product-collections/product-collections.ts +472 -0
- package/src/resources/product-collections.ts +3 -0
- package/src/resources/subscriptions.ts +193 -3
- package/src/resources/your-webhook-url.ts +138 -0
- 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
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as MiscAPI from "../misc.mjs";
|
|
3
|
+
import * as ProductsAPI from "../products/products.mjs";
|
|
4
|
+
import * as GroupsAPI from "./groups/groups.mjs";
|
|
5
|
+
import { GroupCreateParams, GroupCreateResponse, GroupDeleteParams, GroupUpdateParams, Groups } from "./groups/groups.mjs";
|
|
6
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
7
|
+
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../../core/pagination.mjs";
|
|
8
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
9
|
+
export declare class ProductCollections extends APIResource {
|
|
10
|
+
groups: GroupsAPI.Groups;
|
|
11
|
+
create(body: ProductCollectionCreateParams, options?: RequestOptions): APIPromise<ProductCollectionCreateResponse>;
|
|
12
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ProductCollectionRetrieveResponse>;
|
|
13
|
+
update(id: string, body: ProductCollectionUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
14
|
+
list(query?: ProductCollectionListParams | null | undefined, options?: RequestOptions): PagePromise<ProductCollectionListResponsesDefaultPageNumberPagination, ProductCollectionListResponse>;
|
|
15
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
16
|
+
unarchive(id: string, options?: RequestOptions): APIPromise<ProductCollectionUnarchiveResponse>;
|
|
17
|
+
updateImages(id: string, params?: ProductCollectionUpdateImagesParams | null | undefined, options?: RequestOptions): APIPromise<ProductCollectionUpdateImagesResponse>;
|
|
18
|
+
}
|
|
19
|
+
export type ProductCollectionListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<ProductCollectionListResponse>;
|
|
20
|
+
export interface ProductCollectionCreateResponse {
|
|
21
|
+
/**
|
|
22
|
+
* Unique identifier for the product collection
|
|
23
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
* Brand ID for the collection
|
|
27
|
+
*/
|
|
28
|
+
brand_id: string;
|
|
29
|
+
/**
|
|
30
|
+
* Timestamp when the collection was created
|
|
31
|
+
*/
|
|
32
|
+
created_at: string;
|
|
33
|
+
/**
|
|
34
|
+
* Groups in this collection
|
|
35
|
+
*/
|
|
36
|
+
groups: Array<ProductCollectionCreateResponse.Group>;
|
|
37
|
+
/**
|
|
38
|
+
* Name of the collection
|
|
39
|
+
*/
|
|
40
|
+
name: string;
|
|
41
|
+
/**
|
|
42
|
+
* Timestamp when the collection was last updated
|
|
43
|
+
*/
|
|
44
|
+
updated_at: string;
|
|
45
|
+
/**
|
|
46
|
+
* Description of the collection
|
|
47
|
+
*/
|
|
48
|
+
description?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* URL of the collection image
|
|
51
|
+
*/
|
|
52
|
+
image?: string | null;
|
|
53
|
+
}
|
|
54
|
+
export declare namespace ProductCollectionCreateResponse {
|
|
55
|
+
interface Group {
|
|
56
|
+
group_id: string;
|
|
57
|
+
products: Array<Group.Product>;
|
|
58
|
+
status: boolean;
|
|
59
|
+
group_name?: string | null;
|
|
60
|
+
}
|
|
61
|
+
namespace Group {
|
|
62
|
+
interface Product {
|
|
63
|
+
id: string;
|
|
64
|
+
addons_count: number;
|
|
65
|
+
files_count: number;
|
|
66
|
+
/**
|
|
67
|
+
* Whether this product has any credit entitlements attached
|
|
68
|
+
*/
|
|
69
|
+
has_credit_entitlements: boolean;
|
|
70
|
+
is_recurring: boolean;
|
|
71
|
+
license_key_enabled: boolean;
|
|
72
|
+
meters_count: number;
|
|
73
|
+
product_id: string;
|
|
74
|
+
status: boolean;
|
|
75
|
+
currency?: MiscAPI.Currency | null;
|
|
76
|
+
description?: string | null;
|
|
77
|
+
name?: string | null;
|
|
78
|
+
price?: number | null;
|
|
79
|
+
/**
|
|
80
|
+
* One-time price details.
|
|
81
|
+
*/
|
|
82
|
+
price_detail?: ProductsAPI.Price | null;
|
|
83
|
+
/**
|
|
84
|
+
* Represents the different categories of taxation applicable to various products
|
|
85
|
+
* and services.
|
|
86
|
+
*/
|
|
87
|
+
tax_category?: MiscAPI.TaxCategory | null;
|
|
88
|
+
tax_inclusive?: boolean | null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export interface ProductCollectionRetrieveResponse {
|
|
93
|
+
/**
|
|
94
|
+
* Unique identifier for the product collection
|
|
95
|
+
*/
|
|
96
|
+
id: string;
|
|
97
|
+
/**
|
|
98
|
+
* Brand ID for the collection
|
|
99
|
+
*/
|
|
100
|
+
brand_id: string;
|
|
101
|
+
/**
|
|
102
|
+
* Timestamp when the collection was created
|
|
103
|
+
*/
|
|
104
|
+
created_at: string;
|
|
105
|
+
/**
|
|
106
|
+
* Groups in this collection
|
|
107
|
+
*/
|
|
108
|
+
groups: Array<ProductCollectionRetrieveResponse.Group>;
|
|
109
|
+
/**
|
|
110
|
+
* Name of the collection
|
|
111
|
+
*/
|
|
112
|
+
name: string;
|
|
113
|
+
/**
|
|
114
|
+
* Timestamp when the collection was last updated
|
|
115
|
+
*/
|
|
116
|
+
updated_at: string;
|
|
117
|
+
/**
|
|
118
|
+
* Description of the collection
|
|
119
|
+
*/
|
|
120
|
+
description?: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* URL of the collection image
|
|
123
|
+
*/
|
|
124
|
+
image?: string | null;
|
|
125
|
+
}
|
|
126
|
+
export declare namespace ProductCollectionRetrieveResponse {
|
|
127
|
+
interface Group {
|
|
128
|
+
group_id: string;
|
|
129
|
+
products: Array<Group.Product>;
|
|
130
|
+
status: boolean;
|
|
131
|
+
group_name?: string | null;
|
|
132
|
+
}
|
|
133
|
+
namespace Group {
|
|
134
|
+
interface Product {
|
|
135
|
+
id: string;
|
|
136
|
+
addons_count: number;
|
|
137
|
+
files_count: number;
|
|
138
|
+
/**
|
|
139
|
+
* Whether this product has any credit entitlements attached
|
|
140
|
+
*/
|
|
141
|
+
has_credit_entitlements: boolean;
|
|
142
|
+
is_recurring: boolean;
|
|
143
|
+
license_key_enabled: boolean;
|
|
144
|
+
meters_count: number;
|
|
145
|
+
product_id: string;
|
|
146
|
+
status: boolean;
|
|
147
|
+
currency?: MiscAPI.Currency | null;
|
|
148
|
+
description?: string | null;
|
|
149
|
+
name?: string | null;
|
|
150
|
+
price?: number | null;
|
|
151
|
+
/**
|
|
152
|
+
* One-time price details.
|
|
153
|
+
*/
|
|
154
|
+
price_detail?: ProductsAPI.Price | null;
|
|
155
|
+
/**
|
|
156
|
+
* Represents the different categories of taxation applicable to various products
|
|
157
|
+
* and services.
|
|
158
|
+
*/
|
|
159
|
+
tax_category?: MiscAPI.TaxCategory | null;
|
|
160
|
+
tax_inclusive?: boolean | null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export interface ProductCollectionListResponse {
|
|
165
|
+
/**
|
|
166
|
+
* Collection ID
|
|
167
|
+
*/
|
|
168
|
+
id: string;
|
|
169
|
+
/**
|
|
170
|
+
* Timestamp when created
|
|
171
|
+
*/
|
|
172
|
+
created_at: string;
|
|
173
|
+
/**
|
|
174
|
+
* Collection name
|
|
175
|
+
*/
|
|
176
|
+
name: string;
|
|
177
|
+
/**
|
|
178
|
+
* Number of products in the collection
|
|
179
|
+
*/
|
|
180
|
+
products_count: number;
|
|
181
|
+
/**
|
|
182
|
+
* Timestamp when last updated
|
|
183
|
+
*/
|
|
184
|
+
updated_at: string;
|
|
185
|
+
/**
|
|
186
|
+
* Collection description
|
|
187
|
+
*/
|
|
188
|
+
description?: string | null;
|
|
189
|
+
/**
|
|
190
|
+
* Collection image URL
|
|
191
|
+
*/
|
|
192
|
+
image?: string | null;
|
|
193
|
+
}
|
|
194
|
+
export interface ProductCollectionUnarchiveResponse {
|
|
195
|
+
/**
|
|
196
|
+
* Collection ID that was unarchived
|
|
197
|
+
*/
|
|
198
|
+
collection_id: string;
|
|
199
|
+
/**
|
|
200
|
+
* Product IDs that were excluded because they are archived
|
|
201
|
+
*/
|
|
202
|
+
excluded_product_ids: Array<string>;
|
|
203
|
+
/**
|
|
204
|
+
* Success message
|
|
205
|
+
*/
|
|
206
|
+
message: string;
|
|
207
|
+
}
|
|
208
|
+
export interface ProductCollectionUpdateImagesResponse {
|
|
209
|
+
/**
|
|
210
|
+
* Presigned S3 URL for uploading the image
|
|
211
|
+
*/
|
|
212
|
+
url: string;
|
|
213
|
+
/**
|
|
214
|
+
* Optional image ID (present when force_update is true)
|
|
215
|
+
*/
|
|
216
|
+
image_id?: string | null;
|
|
217
|
+
}
|
|
218
|
+
export interface ProductCollectionCreateParams {
|
|
219
|
+
/**
|
|
220
|
+
* Groups of products in this collection
|
|
221
|
+
*/
|
|
222
|
+
groups: Array<ProductCollectionCreateParams.Group>;
|
|
223
|
+
/**
|
|
224
|
+
* Name of the product collection
|
|
225
|
+
*/
|
|
226
|
+
name: string;
|
|
227
|
+
/**
|
|
228
|
+
* Brand id for the collection, if not provided will default to primary brand
|
|
229
|
+
*/
|
|
230
|
+
brand_id?: string | null;
|
|
231
|
+
/**
|
|
232
|
+
* Optional description of the product collection
|
|
233
|
+
*/
|
|
234
|
+
description?: string | null;
|
|
235
|
+
}
|
|
236
|
+
export declare namespace ProductCollectionCreateParams {
|
|
237
|
+
interface Group {
|
|
238
|
+
/**
|
|
239
|
+
* Products in this group
|
|
240
|
+
*/
|
|
241
|
+
products: Array<Group.Product>;
|
|
242
|
+
/**
|
|
243
|
+
* Optional group name. Multiple groups can have null names, but named groups must
|
|
244
|
+
* be unique per collection
|
|
245
|
+
*/
|
|
246
|
+
group_name?: string | null;
|
|
247
|
+
/**
|
|
248
|
+
* Status of the group (defaults to true if not provided)
|
|
249
|
+
*/
|
|
250
|
+
status?: boolean | null;
|
|
251
|
+
}
|
|
252
|
+
namespace Group {
|
|
253
|
+
interface Product {
|
|
254
|
+
/**
|
|
255
|
+
* Product ID to include in the group
|
|
256
|
+
*/
|
|
257
|
+
product_id: string;
|
|
258
|
+
/**
|
|
259
|
+
* Status of the product in this group (defaults to true if not provided)
|
|
260
|
+
*/
|
|
261
|
+
status?: boolean | null;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
export interface ProductCollectionUpdateParams {
|
|
266
|
+
/**
|
|
267
|
+
* Optional brand_id update
|
|
268
|
+
*/
|
|
269
|
+
brand_id?: string | null;
|
|
270
|
+
/**
|
|
271
|
+
* Optional description update - pass null to remove, omit to keep unchanged
|
|
272
|
+
*/
|
|
273
|
+
description?: string | null;
|
|
274
|
+
/**
|
|
275
|
+
* Optional new order for groups (array of group UUIDs in desired order)
|
|
276
|
+
*/
|
|
277
|
+
group_order?: Array<string> | null;
|
|
278
|
+
/**
|
|
279
|
+
* Optional image update - pass null to remove, omit to keep unchanged
|
|
280
|
+
*/
|
|
281
|
+
image_id?: string | null;
|
|
282
|
+
/**
|
|
283
|
+
* Optional new name for the collection
|
|
284
|
+
*/
|
|
285
|
+
name?: string | null;
|
|
286
|
+
}
|
|
287
|
+
export interface ProductCollectionListParams extends DefaultPageNumberPaginationParams {
|
|
288
|
+
/**
|
|
289
|
+
* List archived collections
|
|
290
|
+
*/
|
|
291
|
+
archived?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Filter by Brand id
|
|
294
|
+
*/
|
|
295
|
+
brand_id?: string;
|
|
296
|
+
}
|
|
297
|
+
export interface ProductCollectionUpdateImagesParams {
|
|
298
|
+
/**
|
|
299
|
+
* If true, generates a new image ID to force cache invalidation
|
|
300
|
+
*/
|
|
301
|
+
force_update?: boolean | null;
|
|
302
|
+
}
|
|
303
|
+
export declare namespace ProductCollections {
|
|
304
|
+
export { type ProductCollectionCreateResponse as ProductCollectionCreateResponse, type ProductCollectionRetrieveResponse as ProductCollectionRetrieveResponse, type ProductCollectionListResponse as ProductCollectionListResponse, type ProductCollectionUnarchiveResponse as ProductCollectionUnarchiveResponse, type ProductCollectionUpdateImagesResponse as ProductCollectionUpdateImagesResponse, type ProductCollectionListResponsesDefaultPageNumberPagination as ProductCollectionListResponsesDefaultPageNumberPagination, type ProductCollectionCreateParams as ProductCollectionCreateParams, type ProductCollectionUpdateParams as ProductCollectionUpdateParams, type ProductCollectionListParams as ProductCollectionListParams, type ProductCollectionUpdateImagesParams as ProductCollectionUpdateImagesParams, };
|
|
305
|
+
export { Groups as Groups, type GroupCreateResponse as GroupCreateResponse, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupDeleteParams as GroupDeleteParams, };
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=product-collections.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-collections.d.mts","sourceRoot":"","sources":["../../src/resources/product-collections/product-collections.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,KAAK,WAAW;OAChB,KAAK,SAAS;OACd,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACP;OACM,EAAE,UAAU,EAAE;OACd,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,WAAW,EACZ;OAEM,EAAE,cAAc,EAAE;AAGzB,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D,MAAM,CACJ,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU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"}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as MiscAPI from "../misc.js";
|
|
3
|
+
import * as ProductsAPI from "../products/products.js";
|
|
4
|
+
import * as GroupsAPI from "./groups/groups.js";
|
|
5
|
+
import { GroupCreateParams, GroupCreateResponse, GroupDeleteParams, GroupUpdateParams, Groups } from "./groups/groups.js";
|
|
6
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
7
|
+
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams, PagePromise } from "../../core/pagination.js";
|
|
8
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
9
|
+
export declare class ProductCollections extends APIResource {
|
|
10
|
+
groups: GroupsAPI.Groups;
|
|
11
|
+
create(body: ProductCollectionCreateParams, options?: RequestOptions): APIPromise<ProductCollectionCreateResponse>;
|
|
12
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ProductCollectionRetrieveResponse>;
|
|
13
|
+
update(id: string, body: ProductCollectionUpdateParams, options?: RequestOptions): APIPromise<void>;
|
|
14
|
+
list(query?: ProductCollectionListParams | null | undefined, options?: RequestOptions): PagePromise<ProductCollectionListResponsesDefaultPageNumberPagination, ProductCollectionListResponse>;
|
|
15
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
16
|
+
unarchive(id: string, options?: RequestOptions): APIPromise<ProductCollectionUnarchiveResponse>;
|
|
17
|
+
updateImages(id: string, params?: ProductCollectionUpdateImagesParams | null | undefined, options?: RequestOptions): APIPromise<ProductCollectionUpdateImagesResponse>;
|
|
18
|
+
}
|
|
19
|
+
export type ProductCollectionListResponsesDefaultPageNumberPagination = DefaultPageNumberPagination<ProductCollectionListResponse>;
|
|
20
|
+
export interface ProductCollectionCreateResponse {
|
|
21
|
+
/**
|
|
22
|
+
* Unique identifier for the product collection
|
|
23
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
* Brand ID for the collection
|
|
27
|
+
*/
|
|
28
|
+
brand_id: string;
|
|
29
|
+
/**
|
|
30
|
+
* Timestamp when the collection was created
|
|
31
|
+
*/
|
|
32
|
+
created_at: string;
|
|
33
|
+
/**
|
|
34
|
+
* Groups in this collection
|
|
35
|
+
*/
|
|
36
|
+
groups: Array<ProductCollectionCreateResponse.Group>;
|
|
37
|
+
/**
|
|
38
|
+
* Name of the collection
|
|
39
|
+
*/
|
|
40
|
+
name: string;
|
|
41
|
+
/**
|
|
42
|
+
* Timestamp when the collection was last updated
|
|
43
|
+
*/
|
|
44
|
+
updated_at: string;
|
|
45
|
+
/**
|
|
46
|
+
* Description of the collection
|
|
47
|
+
*/
|
|
48
|
+
description?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* URL of the collection image
|
|
51
|
+
*/
|
|
52
|
+
image?: string | null;
|
|
53
|
+
}
|
|
54
|
+
export declare namespace ProductCollectionCreateResponse {
|
|
55
|
+
interface Group {
|
|
56
|
+
group_id: string;
|
|
57
|
+
products: Array<Group.Product>;
|
|
58
|
+
status: boolean;
|
|
59
|
+
group_name?: string | null;
|
|
60
|
+
}
|
|
61
|
+
namespace Group {
|
|
62
|
+
interface Product {
|
|
63
|
+
id: string;
|
|
64
|
+
addons_count: number;
|
|
65
|
+
files_count: number;
|
|
66
|
+
/**
|
|
67
|
+
* Whether this product has any credit entitlements attached
|
|
68
|
+
*/
|
|
69
|
+
has_credit_entitlements: boolean;
|
|
70
|
+
is_recurring: boolean;
|
|
71
|
+
license_key_enabled: boolean;
|
|
72
|
+
meters_count: number;
|
|
73
|
+
product_id: string;
|
|
74
|
+
status: boolean;
|
|
75
|
+
currency?: MiscAPI.Currency | null;
|
|
76
|
+
description?: string | null;
|
|
77
|
+
name?: string | null;
|
|
78
|
+
price?: number | null;
|
|
79
|
+
/**
|
|
80
|
+
* One-time price details.
|
|
81
|
+
*/
|
|
82
|
+
price_detail?: ProductsAPI.Price | null;
|
|
83
|
+
/**
|
|
84
|
+
* Represents the different categories of taxation applicable to various products
|
|
85
|
+
* and services.
|
|
86
|
+
*/
|
|
87
|
+
tax_category?: MiscAPI.TaxCategory | null;
|
|
88
|
+
tax_inclusive?: boolean | null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export interface ProductCollectionRetrieveResponse {
|
|
93
|
+
/**
|
|
94
|
+
* Unique identifier for the product collection
|
|
95
|
+
*/
|
|
96
|
+
id: string;
|
|
97
|
+
/**
|
|
98
|
+
* Brand ID for the collection
|
|
99
|
+
*/
|
|
100
|
+
brand_id: string;
|
|
101
|
+
/**
|
|
102
|
+
* Timestamp when the collection was created
|
|
103
|
+
*/
|
|
104
|
+
created_at: string;
|
|
105
|
+
/**
|
|
106
|
+
* Groups in this collection
|
|
107
|
+
*/
|
|
108
|
+
groups: Array<ProductCollectionRetrieveResponse.Group>;
|
|
109
|
+
/**
|
|
110
|
+
* Name of the collection
|
|
111
|
+
*/
|
|
112
|
+
name: string;
|
|
113
|
+
/**
|
|
114
|
+
* Timestamp when the collection was last updated
|
|
115
|
+
*/
|
|
116
|
+
updated_at: string;
|
|
117
|
+
/**
|
|
118
|
+
* Description of the collection
|
|
119
|
+
*/
|
|
120
|
+
description?: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* URL of the collection image
|
|
123
|
+
*/
|
|
124
|
+
image?: string | null;
|
|
125
|
+
}
|
|
126
|
+
export declare namespace ProductCollectionRetrieveResponse {
|
|
127
|
+
interface Group {
|
|
128
|
+
group_id: string;
|
|
129
|
+
products: Array<Group.Product>;
|
|
130
|
+
status: boolean;
|
|
131
|
+
group_name?: string | null;
|
|
132
|
+
}
|
|
133
|
+
namespace Group {
|
|
134
|
+
interface Product {
|
|
135
|
+
id: string;
|
|
136
|
+
addons_count: number;
|
|
137
|
+
files_count: number;
|
|
138
|
+
/**
|
|
139
|
+
* Whether this product has any credit entitlements attached
|
|
140
|
+
*/
|
|
141
|
+
has_credit_entitlements: boolean;
|
|
142
|
+
is_recurring: boolean;
|
|
143
|
+
license_key_enabled: boolean;
|
|
144
|
+
meters_count: number;
|
|
145
|
+
product_id: string;
|
|
146
|
+
status: boolean;
|
|
147
|
+
currency?: MiscAPI.Currency | null;
|
|
148
|
+
description?: string | null;
|
|
149
|
+
name?: string | null;
|
|
150
|
+
price?: number | null;
|
|
151
|
+
/**
|
|
152
|
+
* One-time price details.
|
|
153
|
+
*/
|
|
154
|
+
price_detail?: ProductsAPI.Price | null;
|
|
155
|
+
/**
|
|
156
|
+
* Represents the different categories of taxation applicable to various products
|
|
157
|
+
* and services.
|
|
158
|
+
*/
|
|
159
|
+
tax_category?: MiscAPI.TaxCategory | null;
|
|
160
|
+
tax_inclusive?: boolean | null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export interface ProductCollectionListResponse {
|
|
165
|
+
/**
|
|
166
|
+
* Collection ID
|
|
167
|
+
*/
|
|
168
|
+
id: string;
|
|
169
|
+
/**
|
|
170
|
+
* Timestamp when created
|
|
171
|
+
*/
|
|
172
|
+
created_at: string;
|
|
173
|
+
/**
|
|
174
|
+
* Collection name
|
|
175
|
+
*/
|
|
176
|
+
name: string;
|
|
177
|
+
/**
|
|
178
|
+
* Number of products in the collection
|
|
179
|
+
*/
|
|
180
|
+
products_count: number;
|
|
181
|
+
/**
|
|
182
|
+
* Timestamp when last updated
|
|
183
|
+
*/
|
|
184
|
+
updated_at: string;
|
|
185
|
+
/**
|
|
186
|
+
* Collection description
|
|
187
|
+
*/
|
|
188
|
+
description?: string | null;
|
|
189
|
+
/**
|
|
190
|
+
* Collection image URL
|
|
191
|
+
*/
|
|
192
|
+
image?: string | null;
|
|
193
|
+
}
|
|
194
|
+
export interface ProductCollectionUnarchiveResponse {
|
|
195
|
+
/**
|
|
196
|
+
* Collection ID that was unarchived
|
|
197
|
+
*/
|
|
198
|
+
collection_id: string;
|
|
199
|
+
/**
|
|
200
|
+
* Product IDs that were excluded because they are archived
|
|
201
|
+
*/
|
|
202
|
+
excluded_product_ids: Array<string>;
|
|
203
|
+
/**
|
|
204
|
+
* Success message
|
|
205
|
+
*/
|
|
206
|
+
message: string;
|
|
207
|
+
}
|
|
208
|
+
export interface ProductCollectionUpdateImagesResponse {
|
|
209
|
+
/**
|
|
210
|
+
* Presigned S3 URL for uploading the image
|
|
211
|
+
*/
|
|
212
|
+
url: string;
|
|
213
|
+
/**
|
|
214
|
+
* Optional image ID (present when force_update is true)
|
|
215
|
+
*/
|
|
216
|
+
image_id?: string | null;
|
|
217
|
+
}
|
|
218
|
+
export interface ProductCollectionCreateParams {
|
|
219
|
+
/**
|
|
220
|
+
* Groups of products in this collection
|
|
221
|
+
*/
|
|
222
|
+
groups: Array<ProductCollectionCreateParams.Group>;
|
|
223
|
+
/**
|
|
224
|
+
* Name of the product collection
|
|
225
|
+
*/
|
|
226
|
+
name: string;
|
|
227
|
+
/**
|
|
228
|
+
* Brand id for the collection, if not provided will default to primary brand
|
|
229
|
+
*/
|
|
230
|
+
brand_id?: string | null;
|
|
231
|
+
/**
|
|
232
|
+
* Optional description of the product collection
|
|
233
|
+
*/
|
|
234
|
+
description?: string | null;
|
|
235
|
+
}
|
|
236
|
+
export declare namespace ProductCollectionCreateParams {
|
|
237
|
+
interface Group {
|
|
238
|
+
/**
|
|
239
|
+
* Products in this group
|
|
240
|
+
*/
|
|
241
|
+
products: Array<Group.Product>;
|
|
242
|
+
/**
|
|
243
|
+
* Optional group name. Multiple groups can have null names, but named groups must
|
|
244
|
+
* be unique per collection
|
|
245
|
+
*/
|
|
246
|
+
group_name?: string | null;
|
|
247
|
+
/**
|
|
248
|
+
* Status of the group (defaults to true if not provided)
|
|
249
|
+
*/
|
|
250
|
+
status?: boolean | null;
|
|
251
|
+
}
|
|
252
|
+
namespace Group {
|
|
253
|
+
interface Product {
|
|
254
|
+
/**
|
|
255
|
+
* Product ID to include in the group
|
|
256
|
+
*/
|
|
257
|
+
product_id: string;
|
|
258
|
+
/**
|
|
259
|
+
* Status of the product in this group (defaults to true if not provided)
|
|
260
|
+
*/
|
|
261
|
+
status?: boolean | null;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
export interface ProductCollectionUpdateParams {
|
|
266
|
+
/**
|
|
267
|
+
* Optional brand_id update
|
|
268
|
+
*/
|
|
269
|
+
brand_id?: string | null;
|
|
270
|
+
/**
|
|
271
|
+
* Optional description update - pass null to remove, omit to keep unchanged
|
|
272
|
+
*/
|
|
273
|
+
description?: string | null;
|
|
274
|
+
/**
|
|
275
|
+
* Optional new order for groups (array of group UUIDs in desired order)
|
|
276
|
+
*/
|
|
277
|
+
group_order?: Array<string> | null;
|
|
278
|
+
/**
|
|
279
|
+
* Optional image update - pass null to remove, omit to keep unchanged
|
|
280
|
+
*/
|
|
281
|
+
image_id?: string | null;
|
|
282
|
+
/**
|
|
283
|
+
* Optional new name for the collection
|
|
284
|
+
*/
|
|
285
|
+
name?: string | null;
|
|
286
|
+
}
|
|
287
|
+
export interface ProductCollectionListParams extends DefaultPageNumberPaginationParams {
|
|
288
|
+
/**
|
|
289
|
+
* List archived collections
|
|
290
|
+
*/
|
|
291
|
+
archived?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Filter by Brand id
|
|
294
|
+
*/
|
|
295
|
+
brand_id?: string;
|
|
296
|
+
}
|
|
297
|
+
export interface ProductCollectionUpdateImagesParams {
|
|
298
|
+
/**
|
|
299
|
+
* If true, generates a new image ID to force cache invalidation
|
|
300
|
+
*/
|
|
301
|
+
force_update?: boolean | null;
|
|
302
|
+
}
|
|
303
|
+
export declare namespace ProductCollections {
|
|
304
|
+
export { type ProductCollectionCreateResponse as ProductCollectionCreateResponse, type ProductCollectionRetrieveResponse as ProductCollectionRetrieveResponse, type ProductCollectionListResponse as ProductCollectionListResponse, type ProductCollectionUnarchiveResponse as ProductCollectionUnarchiveResponse, type ProductCollectionUpdateImagesResponse as ProductCollectionUpdateImagesResponse, type ProductCollectionListResponsesDefaultPageNumberPagination as ProductCollectionListResponsesDefaultPageNumberPagination, type ProductCollectionCreateParams as ProductCollectionCreateParams, type ProductCollectionUpdateParams as ProductCollectionUpdateParams, type ProductCollectionListParams as ProductCollectionListParams, type ProductCollectionUpdateImagesParams as ProductCollectionUpdateImagesParams, };
|
|
305
|
+
export { Groups as Groups, type GroupCreateResponse as GroupCreateResponse, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupDeleteParams as GroupDeleteParams, };
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=product-collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-collections.d.ts","sourceRoot":"","sources":["../../src/resources/product-collections/product-collections.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,OAAO;OACZ,KAAK,WAAW;OAChB,KAAK,SAAS;OACd,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACP;OACM,EAAE,UAAU,EAAE;OACd,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,WAAW,EACZ;OAEM,EAAE,cAAc,EAAE;AAGzB,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D,MAAM,CACJ,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iCAAiC,CAAC;IAI7F,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQnG,IAAI,CACF,KAAK,GAAE,2BAA2B,GAAG,IAAI,GAAG,SAAc,EAC1D,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,yDAAyD,EAAE,6B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AAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,2BAA4B,SAAQ,iCAAiC;IACpF;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B;AAID,MAAM,CAAC,OAAO,WAAW,kBAAkB,CAAC;IAC1C,OAAO,EACL,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,yDAAyD,IAAI,yDAAyD,EAC3H,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,mCAAmC,IAAI,mCAAmC,GAChF,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ProductCollections = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const GroupsAPI = tslib_1.__importStar(require("./groups/groups.js"));
|
|
8
|
+
const groups_1 = require("./groups/groups.js");
|
|
9
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
10
|
+
const headers_1 = require("../../internal/headers.js");
|
|
11
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
12
|
+
class ProductCollections extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.groups = new GroupsAPI.Groups(this._client);
|
|
16
|
+
}
|
|
17
|
+
create(body, options) {
|
|
18
|
+
return this._client.post('/product-collections', { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
retrieve(id, options) {
|
|
21
|
+
return this._client.get((0, path_1.path) `/product-collections/${id}`, options);
|
|
22
|
+
}
|
|
23
|
+
update(id, body, options) {
|
|
24
|
+
return this._client.patch((0, path_1.path) `/product-collections/${id}`, {
|
|
25
|
+
body,
|
|
26
|
+
...options,
|
|
27
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
list(query = {}, options) {
|
|
31
|
+
return this._client.getAPIList('/product-collections', (pagination_1.DefaultPageNumberPagination), { query, ...options });
|
|
32
|
+
}
|
|
33
|
+
delete(id, options) {
|
|
34
|
+
return this._client.delete((0, path_1.path) `/product-collections/${id}`, {
|
|
35
|
+
...options,
|
|
36
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
unarchive(id, options) {
|
|
40
|
+
return this._client.post((0, path_1.path) `/product-collections/${id}/unarchive`, options);
|
|
41
|
+
}
|
|
42
|
+
updateImages(id, params = {}, options) {
|
|
43
|
+
const { force_update } = params ?? {};
|
|
44
|
+
return this._client.put((0, path_1.path) `/product-collections/${id}/images`, { query: { force_update }, ...options });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.ProductCollections = ProductCollections;
|
|
48
|
+
ProductCollections.Groups = groups_1.Groups;
|
|
49
|
+
//# sourceMappingURL=product-collections.js.map
|