@viu/emporix-sdk 1.0.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 +407 -0
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/cart.cjs +214 -0
- package/dist/cart.cjs.map +1 -0
- package/dist/cart.d.cts +1807 -0
- package/dist/cart.d.ts +1807 -0
- package/dist/cart.js +4 -0
- package/dist/cart.js.map +1 -0
- package/dist/category.cjs +97 -0
- package/dist/category.cjs.map +1 -0
- package/dist/category.d.cts +313 -0
- package/dist/category.d.ts +313 -0
- package/dist/category.js +4 -0
- package/dist/category.js.map +1 -0
- package/dist/checkout.cjs +98 -0
- package/dist/checkout.cjs.map +1 -0
- package/dist/checkout.d.cts +252 -0
- package/dist/checkout.d.ts +252 -0
- package/dist/checkout.js +4 -0
- package/dist/checkout.js.map +1 -0
- package/dist/chunk-4BJUCCKJ.js +86 -0
- package/dist/chunk-4BJUCCKJ.js.map +1 -0
- package/dist/chunk-6UNFMCHZ.js +95 -0
- package/dist/chunk-6UNFMCHZ.js.map +1 -0
- package/dist/chunk-B56JZNI7.js +49 -0
- package/dist/chunk-B56JZNI7.js.map +1 -0
- package/dist/chunk-BFQ732VZ.js +11 -0
- package/dist/chunk-BFQ732VZ.js.map +1 -0
- package/dist/chunk-F3WAQH2E.js +120 -0
- package/dist/chunk-F3WAQH2E.js.map +1 -0
- package/dist/chunk-GWJ2U2CP.js +14 -0
- package/dist/chunk-GWJ2U2CP.js.map +1 -0
- package/dist/chunk-HEO34WLO.js +47 -0
- package/dist/chunk-HEO34WLO.js.map +1 -0
- package/dist/chunk-HKPZI7Y5.js +30 -0
- package/dist/chunk-HKPZI7Y5.js.map +1 -0
- package/dist/chunk-IEZHGU7F.js +171 -0
- package/dist/chunk-IEZHGU7F.js.map +1 -0
- package/dist/chunk-KTODT6DV.js +86 -0
- package/dist/chunk-KTODT6DV.js.map +1 -0
- package/dist/chunk-NM7VDXBR.js +57 -0
- package/dist/chunk-NM7VDXBR.js.map +1 -0
- package/dist/chunk-OMYVOOSX.js +57 -0
- package/dist/chunk-OMYVOOSX.js.map +1 -0
- package/dist/chunk-QDABAMVN.js +89 -0
- package/dist/chunk-QDABAMVN.js.map +1 -0
- package/dist/chunk-RXVVFNYN.js +56 -0
- package/dist/chunk-RXVVFNYN.js.map +1 -0
- package/dist/chunk-SKX7KCMH.js +23 -0
- package/dist/chunk-SKX7KCMH.js.map +1 -0
- package/dist/chunk-TLH6SLAF.js +215 -0
- package/dist/chunk-TLH6SLAF.js.map +1 -0
- package/dist/chunk-Z6PNI5VT.js +142 -0
- package/dist/chunk-Z6PNI5VT.js.map +1 -0
- package/dist/companies.cjs +58 -0
- package/dist/companies.cjs.map +1 -0
- package/dist/companies.d.cts +31 -0
- package/dist/companies.d.ts +31 -0
- package/dist/companies.js +3 -0
- package/dist/companies.js.map +1 -0
- package/dist/contacts.cjs +51 -0
- package/dist/contacts.cjs.map +1 -0
- package/dist/contacts.d.cts +28 -0
- package/dist/contacts.d.ts +28 -0
- package/dist/contacts.js +3 -0
- package/dist/contacts.js.map +1 -0
- package/dist/context-vKgzZ-5f.d.cts +329 -0
- package/dist/context-vKgzZ-5f.d.ts +329 -0
- package/dist/customer-groups.cjs +25 -0
- package/dist/customer-groups.cjs.map +1 -0
- package/dist/customer-groups.d.cts +36 -0
- package/dist/customer-groups.d.ts +36 -0
- package/dist/customer-groups.js +3 -0
- package/dist/customer-groups.js.map +1 -0
- package/dist/customer.cjs +262 -0
- package/dist/customer.cjs.map +1 -0
- package/dist/customer.d.cts +386 -0
- package/dist/customer.d.ts +386 -0
- package/dist/customer.js +5 -0
- package/dist/customer.js.map +1 -0
- package/dist/index.cjs +2075 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +218 -0
- package/dist/index.d.ts +218 -0
- package/dist/index.js +791 -0
- package/dist/index.js.map +1 -0
- package/dist/locations.cjs +59 -0
- package/dist/locations.cjs.map +1 -0
- package/dist/locations.d.cts +30 -0
- package/dist/locations.d.ts +30 -0
- package/dist/locations.js +3 -0
- package/dist/locations.js.map +1 -0
- package/dist/media.cjs +123 -0
- package/dist/media.cjs.map +1 -0
- package/dist/media.d.cts +219 -0
- package/dist/media.d.ts +219 -0
- package/dist/media.js +3 -0
- package/dist/media.js.map +1 -0
- package/dist/orders.cjs +98 -0
- package/dist/orders.cjs.map +1 -0
- package/dist/orders.d.cts +167 -0
- package/dist/orders.d.ts +167 -0
- package/dist/orders.js +3 -0
- package/dist/orders.js.map +1 -0
- package/dist/payment.cjs +77 -0
- package/dist/payment.cjs.map +1 -0
- package/dist/payment.d.cts +110 -0
- package/dist/payment.d.ts +110 -0
- package/dist/payment.js +5 -0
- package/dist/payment.js.map +1 -0
- package/dist/price.cjs +88 -0
- package/dist/price.cjs.map +1 -0
- package/dist/price.d.cts +445 -0
- package/dist/price.d.ts +445 -0
- package/dist/price.js +4 -0
- package/dist/price.js.map +1 -0
- package/dist/product.cjs +100 -0
- package/dist/product.cjs.map +1 -0
- package/dist/product.d.cts +400 -0
- package/dist/product.d.ts +400 -0
- package/dist/product.js +4 -0
- package/dist/product.js.map +1 -0
- package/dist/segment.cjs +189 -0
- package/dist/segment.cjs.map +1 -0
- package/dist/segment.d.cts +241 -0
- package/dist/segment.d.ts +241 -0
- package/dist/segment.js +5 -0
- package/dist/segment.js.map +1 -0
- package/dist/types.gen-D1QuqPLs.d.cts +166 -0
- package/dist/types.gen-D1QuqPLs.d.ts +166 -0
- package/package.json +141 -0
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { C as ClientContext, b as AuthContext, P as PaginatedItems } from './context-vKgzZ-5f.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Localized value which can have different structure which depends on provided `Content-Language` header.
|
|
5
|
+
*/
|
|
6
|
+
type LocalizedValue = string | {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Indicates the product type, which is immutable. Once the product type is set, it cannot be updated.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
type ProductType = 'BASIC' | 'BUNDLE' | 'PARENT_VARIANT' | 'VARIANT' | 'DYNAMIC_VARIANT';
|
|
14
|
+
/**
|
|
15
|
+
* Indicates the product type, which is immutable. This property is taken into account only for insert operations.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
type ProductTypeUpdate = 'BASIC' | 'BUNDLE' | 'PARENT_VARIANT' | 'VARIANT' | 'DYNAMIC_VARIANT';
|
|
19
|
+
/**
|
|
20
|
+
* Indicates the template that has been used during the product creation. After assigning a template to the product, the new attributes can be defined under the `productTemplateAttributes` key in the `mixins` field. In case of variant attributes, the attributes should be defined under `productVariantAttributes`. The attributes are then validated in accordance with their definition in the template.
|
|
21
|
+
*
|
|
22
|
+
* **Note:** The template with defined variant attributes can be used only in PARENT_VARIANT and VARIANT types of product.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
type Template = {
|
|
26
|
+
/**
|
|
27
|
+
* Identifier of the product template.
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Product template version.
|
|
32
|
+
*/
|
|
33
|
+
version: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* List of bundled products
|
|
37
|
+
*/
|
|
38
|
+
type BundledProducts = Array<{
|
|
39
|
+
/**
|
|
40
|
+
* Identifier of the bundled product.
|
|
41
|
+
*/
|
|
42
|
+
productId: string;
|
|
43
|
+
/**
|
|
44
|
+
* Amount of bundled products. Must be a positive number.
|
|
45
|
+
*/
|
|
46
|
+
amount: number;
|
|
47
|
+
}>;
|
|
48
|
+
type Value = {
|
|
49
|
+
key?: string | number | boolean;
|
|
50
|
+
};
|
|
51
|
+
type Values = Array<Value>;
|
|
52
|
+
/**
|
|
53
|
+
* This field contains all information about attributes and their values that are used for creating variants. It is presented in the form of a map, where 'key' is the name of the attribute and 'value' is the list of values of that attribute. The attributes and their values are based on their definitions in the `template` element assigned to the parent variant. Each attribute defined in the product template is flagged as a `variantAttribute`. Only the attributes that have this flag set as `true` can be used in the `variantAttributes` field.
|
|
54
|
+
*/
|
|
55
|
+
type VariantAttributes = {
|
|
56
|
+
[key: string]: Values;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.
|
|
60
|
+
*
|
|
61
|
+
* It is a unique identifier, which stores information about a resource, such as its type, ID or name of the tenant.
|
|
62
|
+
*/
|
|
63
|
+
type Yrn = string;
|
|
64
|
+
/**
|
|
65
|
+
* Map of key-value pairs that associates tax classes with locations (countries). The key of the map should be specified as the existing location/country identifier (see the country-service). The value of the map entry should contain a tax class code (see the tax-service).
|
|
66
|
+
* Information about the association is required for price matching mechanism (see the price-service#MatchPrice).
|
|
67
|
+
*/
|
|
68
|
+
type TaxClasses = {
|
|
69
|
+
[key: string]: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Flag indicating whether the product has been published or not.
|
|
73
|
+
*/
|
|
74
|
+
type Published = boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Mixins request.
|
|
77
|
+
*/
|
|
78
|
+
type ProductMixins = {
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Metadata request.
|
|
83
|
+
*/
|
|
84
|
+
type ProductMetadataCore = {
|
|
85
|
+
/**
|
|
86
|
+
* Links to the mixin schemas.
|
|
87
|
+
*/
|
|
88
|
+
mixins?: {
|
|
89
|
+
[key: string]: unknown;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Metadata with the version information.
|
|
94
|
+
*/
|
|
95
|
+
type ProductMetadataWithVersion = ProductMetadataCore & {
|
|
96
|
+
/**
|
|
97
|
+
* Version of the document
|
|
98
|
+
*/
|
|
99
|
+
version?: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Metadata for GET requests.
|
|
103
|
+
*/
|
|
104
|
+
type ProductMetadataGet = ProductMetadataWithVersion & {
|
|
105
|
+
/**
|
|
106
|
+
* List of mixin schemas used for classification.
|
|
107
|
+
*/
|
|
108
|
+
classificationMixins?: Array<{
|
|
109
|
+
/**
|
|
110
|
+
* Name of the mixin
|
|
111
|
+
*/
|
|
112
|
+
name?: string;
|
|
113
|
+
/**
|
|
114
|
+
* The mixins path that should be used when defining attributes on a product. It's built based on the following pattern - `class_<sourceCategory.code>_<name>`.
|
|
115
|
+
*/
|
|
116
|
+
mixinPath?: string;
|
|
117
|
+
/**
|
|
118
|
+
* URL of the mixin schema defined on the category level.
|
|
119
|
+
*/
|
|
120
|
+
schemaUrl?: string;
|
|
121
|
+
/**
|
|
122
|
+
* If given mixin has been already used in the product, then this field contains the URL of the used mixin schema.
|
|
123
|
+
*/
|
|
124
|
+
usedSchemaUrl?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Indicates whether the used mixin schema is obsolete - `usedSchemaUrl` differs from `schemaUrl`.
|
|
127
|
+
*/
|
|
128
|
+
obsoleteSchemaUrlUsed?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Indicates whether the mixin is required.
|
|
131
|
+
*/
|
|
132
|
+
required?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Unique identifier of the category from which the mixin comes from. Can be this category ID or one of the parent categories IDs.
|
|
135
|
+
*/
|
|
136
|
+
sourceCategoryId?: string;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* Creation date in the ISO 8601 standard.
|
|
140
|
+
*/
|
|
141
|
+
createdAt?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Modification date in the ISO 8601 standard.
|
|
144
|
+
*/
|
|
145
|
+
modifiedAt?: string;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Unique resource identifier.
|
|
149
|
+
*/
|
|
150
|
+
type Id = string;
|
|
151
|
+
/**
|
|
152
|
+
* Media files attached to the product.
|
|
153
|
+
*/
|
|
154
|
+
type ProductMedia = Array<{
|
|
155
|
+
id?: string;
|
|
156
|
+
yrn?: Yrn;
|
|
157
|
+
contentType?: string;
|
|
158
|
+
createdAt?: string;
|
|
159
|
+
uploadLink?: string;
|
|
160
|
+
url?: string;
|
|
161
|
+
cloudinaryUrl?: string;
|
|
162
|
+
uncommittedMedia?: boolean;
|
|
163
|
+
tags?: Array<string>;
|
|
164
|
+
customAttributes?: {
|
|
165
|
+
[key: string]: unknown;
|
|
166
|
+
};
|
|
167
|
+
}>;
|
|
168
|
+
type ProductCore = {
|
|
169
|
+
name?: LocalizedValue;
|
|
170
|
+
/**
|
|
171
|
+
* Unique product identifier, defined by the user.
|
|
172
|
+
*/
|
|
173
|
+
code?: string;
|
|
174
|
+
description?: LocalizedValue;
|
|
175
|
+
vendor?: Vendor;
|
|
176
|
+
taxClasses?: TaxClasses;
|
|
177
|
+
published?: Published;
|
|
178
|
+
/**
|
|
179
|
+
* Mark the product as weight-dependent if the line item price could change after packaging, as this is necessary to ensure that credit card payments can be authorized.
|
|
180
|
+
*/
|
|
181
|
+
weightDependent?: boolean;
|
|
182
|
+
mixins?: ProductMixins;
|
|
183
|
+
/**
|
|
184
|
+
* List of items in a relationship with the main product. Assuming that in the system the following relation types are defined: `ACCESSORY` and `CONSUMABLE`, the two products: `Printer` and `Ink` exist, then the `Ink` product can be used as a related item with type `CONSUMABLE` for the Printer product.
|
|
185
|
+
* In order to find all printers for which the ink is defined as a `CONSUMABLE` then `q-param` can be used:
|
|
186
|
+
* `products?q=relatedItems.type:CONSUMABLE relatedItems.refId:Ink_Id`
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
189
|
+
relatedItems?: Array<RelatedItem>;
|
|
190
|
+
/**
|
|
191
|
+
* ID of brand.
|
|
192
|
+
*/
|
|
193
|
+
brandId?: string;
|
|
194
|
+
brand?: Brand;
|
|
195
|
+
/**
|
|
196
|
+
* Collection of label IDs.
|
|
197
|
+
*/
|
|
198
|
+
labelIds?: Array<string>;
|
|
199
|
+
labels?: Array<Label>;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Brand data expanded from `brandId`.
|
|
203
|
+
*/
|
|
204
|
+
type Brand = {
|
|
205
|
+
id?: string;
|
|
206
|
+
name?: string;
|
|
207
|
+
description?: string;
|
|
208
|
+
localizedName?: {
|
|
209
|
+
[key: string]: string;
|
|
210
|
+
};
|
|
211
|
+
localizedDescription?: {
|
|
212
|
+
[key: string]: string;
|
|
213
|
+
};
|
|
214
|
+
image?: string;
|
|
215
|
+
cloudinaryUrl?: string;
|
|
216
|
+
mediaId?: string;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Overlay metadata for a label.
|
|
220
|
+
*/
|
|
221
|
+
type LabelOverlay = {
|
|
222
|
+
isTrue?: boolean;
|
|
223
|
+
position?: number;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Label data expanded from `labelIds`.
|
|
227
|
+
*/
|
|
228
|
+
type Label = {
|
|
229
|
+
id?: string;
|
|
230
|
+
name?: string;
|
|
231
|
+
description?: LocalizedValue;
|
|
232
|
+
image?: string;
|
|
233
|
+
cloudinaryUrl?: string;
|
|
234
|
+
mediaId?: string;
|
|
235
|
+
overlay?: LabelOverlay;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Products of the BASIC type.
|
|
239
|
+
*/
|
|
240
|
+
type BasicProduct = ProductCore & {
|
|
241
|
+
metadata?: ProductMetadataCore;
|
|
242
|
+
template?: Template;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Creating products of the BASIC type.
|
|
246
|
+
*/
|
|
247
|
+
type BasicProductCreation = BasicProduct & {
|
|
248
|
+
/**
|
|
249
|
+
* Custom product identifier. If not provided, it is automatically generated.
|
|
250
|
+
*/
|
|
251
|
+
id?: string;
|
|
252
|
+
productType?: ProductType;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Products of the BASIC type.
|
|
256
|
+
*/
|
|
257
|
+
type BasicProductWithId = BasicProductCreation & {
|
|
258
|
+
id?: Id;
|
|
259
|
+
yrn?: Yrn;
|
|
260
|
+
media?: ProductMedia;
|
|
261
|
+
metadata?: ProductMetadataGet;
|
|
262
|
+
/**
|
|
263
|
+
* Customer segment IDs assigned to the product.
|
|
264
|
+
*/
|
|
265
|
+
customerSegmentIds?: Array<string>;
|
|
266
|
+
/**
|
|
267
|
+
* Category IDs assigned to the product.
|
|
268
|
+
*/
|
|
269
|
+
categoryIds?: Array<string>;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Products of the BUNDLE type.
|
|
273
|
+
*/
|
|
274
|
+
type BundleProduct = ProductCore & {
|
|
275
|
+
metadata?: ProductMetadataCore;
|
|
276
|
+
template?: Template;
|
|
277
|
+
bundledProducts: BundledProducts;
|
|
278
|
+
productType: ProductTypeUpdate;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Creating products of the BUNDLE type.
|
|
282
|
+
*/
|
|
283
|
+
type BundleProductCreation = BundleProduct & {
|
|
284
|
+
/**
|
|
285
|
+
* Custom product identifier. If not provided, it is automatically generated.
|
|
286
|
+
*/
|
|
287
|
+
id?: string;
|
|
288
|
+
productType?: ProductType;
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Products of the BUNDLE type.
|
|
292
|
+
*/
|
|
293
|
+
type BundleProductWithId = BundleProductCreation & {
|
|
294
|
+
id?: Id;
|
|
295
|
+
yrn?: Yrn;
|
|
296
|
+
media?: ProductMedia;
|
|
297
|
+
metadata?: ProductMetadataGet;
|
|
298
|
+
/**
|
|
299
|
+
* Customer segment IDs assigned to the product.
|
|
300
|
+
*/
|
|
301
|
+
customerSegmentIds?: Array<string>;
|
|
302
|
+
/**
|
|
303
|
+
* Category IDs assigned to the product.
|
|
304
|
+
*/
|
|
305
|
+
categoryIds?: Array<string>;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Products of the PARENT_VARIANT type.
|
|
309
|
+
*/
|
|
310
|
+
type ParentVariantProduct = ProductCore & {
|
|
311
|
+
metadata?: ProductMetadataCore;
|
|
312
|
+
template: Template;
|
|
313
|
+
variantAttributes: VariantAttributes;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Creating products of the PARENT_VARIANT type.
|
|
317
|
+
*/
|
|
318
|
+
type ParentVariantProductCreation = ParentVariantProduct & {
|
|
319
|
+
/**
|
|
320
|
+
* Custom product identifier. If not provided, it is automatically generated.
|
|
321
|
+
*/
|
|
322
|
+
id?: string;
|
|
323
|
+
productType?: ProductType;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Products of the PARENT_VARIANT type.
|
|
327
|
+
*/
|
|
328
|
+
type ParentVariantProductWithId = ParentVariantProductCreation & {
|
|
329
|
+
id?: Id;
|
|
330
|
+
yrn?: Yrn;
|
|
331
|
+
media?: ProductMedia;
|
|
332
|
+
metadata?: ProductMetadataGet;
|
|
333
|
+
/**
|
|
334
|
+
* Customer segment IDs assigned to the product.
|
|
335
|
+
*/
|
|
336
|
+
customerSegmentIds?: Array<string>;
|
|
337
|
+
/**
|
|
338
|
+
* Category IDs assigned to the product.
|
|
339
|
+
*/
|
|
340
|
+
categoryIds?: Array<string>;
|
|
341
|
+
};
|
|
342
|
+
type Vendor = {
|
|
343
|
+
/**
|
|
344
|
+
* An identifier of a vendor to whom the product belongs.
|
|
345
|
+
*/
|
|
346
|
+
id: string;
|
|
347
|
+
/**
|
|
348
|
+
* Vendor name.
|
|
349
|
+
*/
|
|
350
|
+
name?: string;
|
|
351
|
+
};
|
|
352
|
+
type RelatedItem = {
|
|
353
|
+
/**
|
|
354
|
+
* Identifier of a product which is in the relationship with the main product. The product identifier has to exist.
|
|
355
|
+
*/
|
|
356
|
+
refId: string;
|
|
357
|
+
/**
|
|
358
|
+
* A relation type. The type has to exist in the system. All relation types are defined in configuration service under `relation_types` key.
|
|
359
|
+
*/
|
|
360
|
+
type: string;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
/** A product as returned by the Product service (all generated fields). */
|
|
364
|
+
type Product = BasicProductWithId | BundleProductWithId | ParentVariantProductWithId;
|
|
365
|
+
/** A single product media entry (generated; `ProductMedia` is the list type). */
|
|
366
|
+
type Media = ProductMedia[number];
|
|
367
|
+
/** Catalog reads. Default auth: anonymous; pass customer for personalized pricing. */
|
|
368
|
+
declare class ProductService {
|
|
369
|
+
private readonly ctx;
|
|
370
|
+
constructor(ctx: ClientContext);
|
|
371
|
+
/** Fetches one product by id. */
|
|
372
|
+
get(productId: string, _opts?: Record<string, never>, auth?: AuthContext): Promise<Product>;
|
|
373
|
+
/** Fetches one product by its code. */
|
|
374
|
+
getByCode(code: string, auth?: AuthContext): Promise<Product>;
|
|
375
|
+
/** One page of products. */
|
|
376
|
+
list(params?: {
|
|
377
|
+
pageNumber?: number;
|
|
378
|
+
pageSize?: number;
|
|
379
|
+
}, auth?: AuthContext): Promise<PaginatedItems<Product>>;
|
|
380
|
+
/** Async-iterates every product across pages. */
|
|
381
|
+
listAll(params?: {
|
|
382
|
+
pageSize?: number;
|
|
383
|
+
}, auth?: AuthContext): AsyncIterable<Product>;
|
|
384
|
+
/** Searches products by free-text query. */
|
|
385
|
+
search(query: string, params?: {
|
|
386
|
+
pageNumber?: number;
|
|
387
|
+
pageSize?: number;
|
|
388
|
+
}, auth?: AuthContext): Promise<PaginatedItems<Product>>;
|
|
389
|
+
/**
|
|
390
|
+
* Bulk fetch by id. POSTs `/products/search` with `q="id:(id1,id2,…)"`,
|
|
391
|
+
* chunking when the list is larger than `options.chunkSize` (default
|
|
392
|
+
* 100). An empty list short-circuits with no HTTP call. **Order is not
|
|
393
|
+
* guaranteed** across chunks — re-index by `id` if order matters.
|
|
394
|
+
*/
|
|
395
|
+
searchByIds(ids: string[], options?: {
|
|
396
|
+
chunkSize?: number;
|
|
397
|
+
}, auth?: AuthContext): Promise<Product[]>;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export { type Media, type Product, ProductService };
|