@wix/auto_sdk_suppliers-hub_products 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/build/cjs/index.d.ts +175 -0
- package/build/cjs/index.js +1670 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +25 -0
- package/build/cjs/index.typings.js +1420 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1915 -0
- package/build/cjs/meta.js +1120 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.ts +2721 -0
- package/build/es/index.d.mts +175 -0
- package/build/es/index.mjs +1611 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +25 -0
- package/build/es/index.typings.mjs +1364 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +1915 -0
- package/build/es/meta.mjs +1063 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.mts +2721 -0
- package/build/internal/cjs/index.d.ts +175 -0
- package/build/internal/cjs/index.js +1670 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +25 -0
- package/build/internal/cjs/index.typings.js +1420 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1915 -0
- package/build/internal/cjs/meta.js +1120 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.ts +2721 -0
- package/build/internal/es/index.d.mts +175 -0
- package/build/internal/es/index.mjs +1611 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +25 -0
- package/build/internal/es/index.typings.mjs +1364 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1915 -0
- package/build/internal/es/meta.mjs +1063 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.mts +2721 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
package/build/cjs/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.ts
ADDED
|
@@ -0,0 +1,2721 @@
|
|
|
1
|
+
import * as _wix_sdk_types from '@wix/sdk-types';
|
|
2
|
+
import { QuerySpec, SearchSpec, Query, Search, NonNullablePaths } from '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A product provided by a business partner and displayed in the Wix Marketplace.
|
|
6
|
+
*
|
|
7
|
+
* Products can be of type DROPSHIPPING, WHOLESALE, or both.
|
|
8
|
+
* Wix users can discover and add these products to their stores.
|
|
9
|
+
*/
|
|
10
|
+
interface Product {
|
|
11
|
+
/**
|
|
12
|
+
* Product ID.
|
|
13
|
+
* @format GUID
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
_id?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Date and time the product was created.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
_createdDate?: Date | null;
|
|
22
|
+
/**
|
|
23
|
+
* Date and time the product was updated.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
_updatedDate?: Date | null;
|
|
27
|
+
/** Information about the business partner providing this product. */
|
|
28
|
+
providerInfo?: ProviderInfo;
|
|
29
|
+
/**
|
|
30
|
+
* Product name.
|
|
31
|
+
* @minLength 1
|
|
32
|
+
* @maxLength 100
|
|
33
|
+
*/
|
|
34
|
+
name?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Product description.
|
|
37
|
+
* @maxLength 64000
|
|
38
|
+
*/
|
|
39
|
+
description?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the product is visible in the Marketplace.
|
|
42
|
+
*
|
|
43
|
+
* Default: `true`
|
|
44
|
+
*/
|
|
45
|
+
visible?: boolean | null;
|
|
46
|
+
/** Product media. */
|
|
47
|
+
media?: Media;
|
|
48
|
+
/**
|
|
49
|
+
* Business model types this product supports.
|
|
50
|
+
* @minSize 1
|
|
51
|
+
* @maxSize 2
|
|
52
|
+
*/
|
|
53
|
+
types?: ProductTypeWithLiterals[];
|
|
54
|
+
/**
|
|
55
|
+
* Product options that customers can choose from.
|
|
56
|
+
*
|
|
57
|
+
* Options display available product variations like size and color to help buyers make purchase decisions.
|
|
58
|
+
* Currently, options are informational only and don't create separate inventory items or variants.
|
|
59
|
+
*
|
|
60
|
+
* There are 2 predefined option types you can use:
|
|
61
|
+
* - `color`: Color choices for the product. Values should be standard color names. For example, `"Black"`, `"White"`, `"Yellow"`.
|
|
62
|
+
* - `size`: Size choices for the product. Values should be standard size labels. For example, `"S"`, `"M"`, `"L"`, `"XL"`.
|
|
63
|
+
* @maxSize 6
|
|
64
|
+
*/
|
|
65
|
+
options?: ProductOption[];
|
|
66
|
+
/**
|
|
67
|
+
* Promotional ribbon text displayed on the product.
|
|
68
|
+
*
|
|
69
|
+
* For example, `"New Arrival"` or `"Bestseller"`.
|
|
70
|
+
* @minLength 1
|
|
71
|
+
* @maxLength 30
|
|
72
|
+
*/
|
|
73
|
+
ribbonName?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Brand name.
|
|
76
|
+
* @minLength 1
|
|
77
|
+
* @maxLength 50
|
|
78
|
+
*/
|
|
79
|
+
brand?: string | null;
|
|
80
|
+
/** Time required to process orders before shipping. */
|
|
81
|
+
orderProcessingTime?: TimeInterval;
|
|
82
|
+
/**
|
|
83
|
+
* Countries and regions where this product can be shipped, with location-specific pricing and timing.
|
|
84
|
+
* @maxSize 100
|
|
85
|
+
*/
|
|
86
|
+
shippingDestinations?: ShippingDestination[];
|
|
87
|
+
/**
|
|
88
|
+
* Minimum price, in USD.
|
|
89
|
+
* @decimalValue options { gte:0, lte:999999999, maxScale:2 }
|
|
90
|
+
*/
|
|
91
|
+
minimumPrice?: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* Country where the product is manufactured or originates from, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
|
|
94
|
+
* @format COUNTRY
|
|
95
|
+
*/
|
|
96
|
+
productOrigin?: string | null;
|
|
97
|
+
/**
|
|
98
|
+
* List of categories that directly contain this product.
|
|
99
|
+
*
|
|
100
|
+
* Each category's namespace must match at least one of the product's types.
|
|
101
|
+
* For example, if a product has type `DROPSHIPPING`, its categories must use `DROPSHIPPING_NAMESPACE`.
|
|
102
|
+
* Products with both `DROPSHIPPING` and `WHOLESALE` types can have categories from both namespaces.
|
|
103
|
+
* @maxSize 50
|
|
104
|
+
*/
|
|
105
|
+
directCategories?: ProductCategory[];
|
|
106
|
+
/**
|
|
107
|
+
* List of categories that directly contain this product, as well as their parent categories.
|
|
108
|
+
* @readonly
|
|
109
|
+
* @maxSize 2000
|
|
110
|
+
*/
|
|
111
|
+
allCategories?: ProductCategory[];
|
|
112
|
+
/**
|
|
113
|
+
* Wholesale-specific configuration including tiered pricing and minimum order quantities.
|
|
114
|
+
*
|
|
115
|
+
* Required when `types` includes `WHOLESALE`.
|
|
116
|
+
*/
|
|
117
|
+
wholesaleOptions?: WholesaleOptions;
|
|
118
|
+
/** Information about the supplier including name, rating, and trust status. */
|
|
119
|
+
supplierInfo?: SupplierInfo;
|
|
120
|
+
/**
|
|
121
|
+
* Print-on-demand-specific configuration including supported print technologies and mockup assets.
|
|
122
|
+
*
|
|
123
|
+
* Required when `types` include `PRINT_ON_DEMAND`.
|
|
124
|
+
*/
|
|
125
|
+
printOnDemandOptions?: PrintOnDemandOptions;
|
|
126
|
+
/**
|
|
127
|
+
* Information about the product sizing
|
|
128
|
+
* @maxSize 5
|
|
129
|
+
*/
|
|
130
|
+
sizeGuides?: SizeGuide[];
|
|
131
|
+
/** Product tags for organization and filtering. */
|
|
132
|
+
tags?: Tags;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Information about the business partner providing the product.
|
|
136
|
+
*
|
|
137
|
+
* Provider information is immutable after product creation.
|
|
138
|
+
*/
|
|
139
|
+
interface ProviderInfo {
|
|
140
|
+
/**
|
|
141
|
+
* Provider application ID.
|
|
142
|
+
* @format GUID
|
|
143
|
+
* @readonly
|
|
144
|
+
*/
|
|
145
|
+
appId?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Unique product identifier on the provider's platform.
|
|
148
|
+
*
|
|
149
|
+
* This field serves as the external system's primary key for synchronization and prevents
|
|
150
|
+
* duplicate products from being created. Once set, you can't change this field.
|
|
151
|
+
* @minLength 1
|
|
152
|
+
* @maxLength 36
|
|
153
|
+
* @immutable
|
|
154
|
+
*/
|
|
155
|
+
productId?: string | null;
|
|
156
|
+
/**
|
|
157
|
+
* Date and time the product was created on the provider's platform.
|
|
158
|
+
*
|
|
159
|
+
* This field helps maintain the connection to the original product source.
|
|
160
|
+
* Once set, you can't change this field.
|
|
161
|
+
* @immutable
|
|
162
|
+
*/
|
|
163
|
+
productCreatedDate?: Date | null;
|
|
164
|
+
/**
|
|
165
|
+
* Product URL on the provider's platform.
|
|
166
|
+
* @format WEB_URL
|
|
167
|
+
*/
|
|
168
|
+
url?: string | null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Product media.
|
|
172
|
+
*
|
|
173
|
+
* The first image in the `items` array becomes the main image.
|
|
174
|
+
*/
|
|
175
|
+
interface Media {
|
|
176
|
+
/**
|
|
177
|
+
* Primary product image, automatically set from the first item in the `items` array.
|
|
178
|
+
* @readonly
|
|
179
|
+
*/
|
|
180
|
+
main?: string;
|
|
181
|
+
/**
|
|
182
|
+
* Product images. The first image becomes the main image.
|
|
183
|
+
* @maxSize 15
|
|
184
|
+
*/
|
|
185
|
+
items?: string[];
|
|
186
|
+
}
|
|
187
|
+
interface FocalPoint {
|
|
188
|
+
/** X-coordinate of the focal point. */
|
|
189
|
+
x?: number;
|
|
190
|
+
/** Y-coordinate of the focal point. */
|
|
191
|
+
y?: number;
|
|
192
|
+
/** crop by height */
|
|
193
|
+
height?: number | null;
|
|
194
|
+
/** crop by width */
|
|
195
|
+
width?: number | null;
|
|
196
|
+
}
|
|
197
|
+
/** Business model types that products can support. */
|
|
198
|
+
declare enum ProductType {
|
|
199
|
+
/** Product is fulfilled by the supplier without inventory management by the store owner. */
|
|
200
|
+
DROPSHIPPING = "DROPSHIPPING",
|
|
201
|
+
/** Product is sold in bulk quantities with tiered pricing. */
|
|
202
|
+
WHOLESALE = "WHOLESALE",
|
|
203
|
+
/** Product is manufactured after purchase; no pre‑held inventory. */
|
|
204
|
+
PRINT_ON_DEMAND = "PRINT_ON_DEMAND"
|
|
205
|
+
}
|
|
206
|
+
/** @enumType */
|
|
207
|
+
type ProductTypeWithLiterals = ProductType | 'DROPSHIPPING' | 'WHOLESALE' | 'PRINT_ON_DEMAND';
|
|
208
|
+
/**
|
|
209
|
+
* Product option like size, color, or material.
|
|
210
|
+
*
|
|
211
|
+
* Each option can have multiple values that customers can choose from.
|
|
212
|
+
*/
|
|
213
|
+
interface ProductOption {
|
|
214
|
+
/**
|
|
215
|
+
* Option name.
|
|
216
|
+
*
|
|
217
|
+
* There are 2 predefined options you can use:
|
|
218
|
+
* - `color`: Represents color choices for the product. Values should be standard color names. For example, `"Black"`, `"White"`, `"Yellow"`.
|
|
219
|
+
* - `size`: Represents size choices for the product. Values should be standard size labels. For example, `"S"`, `"M"`, `"L"`, `"XL"`.
|
|
220
|
+
* @minLength 1
|
|
221
|
+
* @maxLength 50
|
|
222
|
+
*/
|
|
223
|
+
name?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Optional description explaining the option.
|
|
226
|
+
* @maxLength 200
|
|
227
|
+
*/
|
|
228
|
+
description?: string | null;
|
|
229
|
+
/**
|
|
230
|
+
* Available values for this option.
|
|
231
|
+
* @maxSize 100
|
|
232
|
+
*/
|
|
233
|
+
values?: OptionValue[];
|
|
234
|
+
}
|
|
235
|
+
/** A single value for a product option. */
|
|
236
|
+
interface OptionValue extends OptionValueValueOneOf {
|
|
237
|
+
/**
|
|
238
|
+
* Simple text value.
|
|
239
|
+
*
|
|
240
|
+
* For example, `"L"` for size or `"Cotton"` for material.
|
|
241
|
+
* @minLength 1
|
|
242
|
+
* @maxLength 50
|
|
243
|
+
*/
|
|
244
|
+
simpleValue?: string;
|
|
245
|
+
/** Color option with name and hex code. */
|
|
246
|
+
color?: ColorOption;
|
|
247
|
+
}
|
|
248
|
+
/** @oneof */
|
|
249
|
+
interface OptionValueValueOneOf {
|
|
250
|
+
/**
|
|
251
|
+
* Simple text value.
|
|
252
|
+
*
|
|
253
|
+
* For example, `"L"` for size or `"Cotton"` for material.
|
|
254
|
+
* @minLength 1
|
|
255
|
+
* @maxLength 50
|
|
256
|
+
*/
|
|
257
|
+
simpleValue?: string;
|
|
258
|
+
/** Color option with name and hex code. */
|
|
259
|
+
color?: ColorOption;
|
|
260
|
+
}
|
|
261
|
+
/** Color option with display name and hex color code. */
|
|
262
|
+
interface ColorOption {
|
|
263
|
+
/**
|
|
264
|
+
* Color name.
|
|
265
|
+
*
|
|
266
|
+
* For example, `"Black"` or `"Navy Blue"`.
|
|
267
|
+
* Use 'Multicolor' for mixed colors. When using 'Multicolor', do not provide a hex value.
|
|
268
|
+
* @minLength 1
|
|
269
|
+
* @maxLength 50
|
|
270
|
+
*/
|
|
271
|
+
name?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Hex color code.
|
|
274
|
+
*
|
|
275
|
+
* For example, `"#000000"` for black. Omit for 'Multicolor'.
|
|
276
|
+
* @format COLOR_HEX
|
|
277
|
+
*/
|
|
278
|
+
hex?: string | null;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Time range with minimum and maximum values.
|
|
282
|
+
*
|
|
283
|
+
* Used for processing times, shipping times, and other duration ranges.
|
|
284
|
+
*/
|
|
285
|
+
interface TimeInterval {
|
|
286
|
+
/** Minimum time in the range. */
|
|
287
|
+
min?: TimeValue;
|
|
288
|
+
/** Maximum time in the range. */
|
|
289
|
+
max?: TimeValue;
|
|
290
|
+
}
|
|
291
|
+
/** Time duration with numeric value and unit. */
|
|
292
|
+
interface TimeValue {
|
|
293
|
+
/**
|
|
294
|
+
* Numeric time value. For example, `2` for "2 days".
|
|
295
|
+
* @min 1
|
|
296
|
+
*/
|
|
297
|
+
value?: number;
|
|
298
|
+
/** Time unit for the value. */
|
|
299
|
+
unit?: TimeUnitWithLiterals;
|
|
300
|
+
}
|
|
301
|
+
/** Units of time for duration values. */
|
|
302
|
+
declare enum TimeUnit {
|
|
303
|
+
/** Days. */
|
|
304
|
+
DAY = "DAY",
|
|
305
|
+
/** Weeks. */
|
|
306
|
+
WEEK = "WEEK",
|
|
307
|
+
/** Months. */
|
|
308
|
+
MONTH = "MONTH"
|
|
309
|
+
}
|
|
310
|
+
/** @enumType */
|
|
311
|
+
type TimeUnitWithLiterals = TimeUnit | 'DAY' | 'WEEK' | 'MONTH';
|
|
312
|
+
/**
|
|
313
|
+
* Shipping information for a specific destination or region.
|
|
314
|
+
*
|
|
315
|
+
* Defines where a product can be shipped and the associated costs and timing.
|
|
316
|
+
*/
|
|
317
|
+
interface ShippingDestination extends ShippingDestinationCountriesOptionsOneOf {
|
|
318
|
+
/**
|
|
319
|
+
* Specific countries.
|
|
320
|
+
*
|
|
321
|
+
* Used when `countrySelections` is `SPECIFIC_COUNTRY`.
|
|
322
|
+
*/
|
|
323
|
+
specificCountrySelections?: Countries;
|
|
324
|
+
/** Indicates if shipping applies to selected countries or to all other regions. */
|
|
325
|
+
countrySelections?: CountrySelectionsWithLiterals;
|
|
326
|
+
/**
|
|
327
|
+
* Minimum shipping cost to this destination in USD.
|
|
328
|
+
* @decimalValue options { gte:0, lte:999999999, maxScale:3 }
|
|
329
|
+
*/
|
|
330
|
+
minimumShippingCost?: string;
|
|
331
|
+
/** Expected shipping time to this destination. */
|
|
332
|
+
shippingTime?: TimeInterval;
|
|
333
|
+
/**
|
|
334
|
+
* Minimum Product Cost to the Shipping Location
|
|
335
|
+
* @decimalValue options { gte:0, lte:999999999, maxScale:3 }
|
|
336
|
+
*/
|
|
337
|
+
minimumProductCost?: string | null;
|
|
338
|
+
}
|
|
339
|
+
/** @oneof */
|
|
340
|
+
interface ShippingDestinationCountriesOptionsOneOf {
|
|
341
|
+
/**
|
|
342
|
+
* Specific countries.
|
|
343
|
+
*
|
|
344
|
+
* Used when `countrySelections` is `SPECIFIC_COUNTRY`.
|
|
345
|
+
*/
|
|
346
|
+
specificCountrySelections?: Countries;
|
|
347
|
+
}
|
|
348
|
+
/** Shipping destination selection type. */
|
|
349
|
+
declare enum CountrySelections {
|
|
350
|
+
/** All countries not specifically listed elsewhere. */
|
|
351
|
+
REST_OF_THE_WORLD = "REST_OF_THE_WORLD",
|
|
352
|
+
/** Specific countries listed in the `countries` field. */
|
|
353
|
+
SPECIFIC_COUNTRY = "SPECIFIC_COUNTRY"
|
|
354
|
+
}
|
|
355
|
+
/** @enumType */
|
|
356
|
+
type CountrySelectionsWithLiterals = CountrySelections | 'REST_OF_THE_WORLD' | 'SPECIFIC_COUNTRY';
|
|
357
|
+
interface Countries {
|
|
358
|
+
/**
|
|
359
|
+
* Country codes, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1) format.
|
|
360
|
+
* @format COUNTRY
|
|
361
|
+
* @minSize 1
|
|
362
|
+
* @maxSize 100
|
|
363
|
+
*/
|
|
364
|
+
countries?: string[] | null;
|
|
365
|
+
}
|
|
366
|
+
/** Inventory information for a product including count tier and quantity. */
|
|
367
|
+
interface Inventory {
|
|
368
|
+
/**
|
|
369
|
+
* Abstracted inventory level calculated from quantity.
|
|
370
|
+
* @readonly
|
|
371
|
+
*/
|
|
372
|
+
tier?: InventoryTierWithLiterals;
|
|
373
|
+
/**
|
|
374
|
+
* Exact inventory quantity.
|
|
375
|
+
*
|
|
376
|
+
* Always returned when tier is `LOW` for [Get Product](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/products/get-product).
|
|
377
|
+
* Returned as request parameter when tier is not `LOW` for [Get Product](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/products/get-product).
|
|
378
|
+
* Not returned for [Search Products](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/products/search-products).
|
|
379
|
+
*/
|
|
380
|
+
quantity?: number | null;
|
|
381
|
+
}
|
|
382
|
+
/** Abstracted inventory levels. */
|
|
383
|
+
declare enum InventoryTier {
|
|
384
|
+
/** No inventory available. */
|
|
385
|
+
EMPTY = "EMPTY",
|
|
386
|
+
/** Low inventory level. */
|
|
387
|
+
LOW = "LOW",
|
|
388
|
+
/** Medium inventory level. */
|
|
389
|
+
MEDIUM = "MEDIUM",
|
|
390
|
+
/** High inventory level. */
|
|
391
|
+
HIGH = "HIGH"
|
|
392
|
+
}
|
|
393
|
+
/** @enumType */
|
|
394
|
+
type InventoryTierWithLiterals = InventoryTier | 'EMPTY' | 'LOW' | 'MEDIUM' | 'HIGH';
|
|
395
|
+
/** Category assignment information for a product. */
|
|
396
|
+
interface ProductCategory {
|
|
397
|
+
/**
|
|
398
|
+
* Category ID.
|
|
399
|
+
* @format GUID
|
|
400
|
+
*/
|
|
401
|
+
_id?: string;
|
|
402
|
+
/**
|
|
403
|
+
* Product's position within this category.
|
|
404
|
+
* @max 200
|
|
405
|
+
* @readonly
|
|
406
|
+
*/
|
|
407
|
+
index?: number | null;
|
|
408
|
+
/** The namespace of the category tree this assignment belongs to. */
|
|
409
|
+
namespace?: CategoryNamespaceWithLiterals;
|
|
410
|
+
}
|
|
411
|
+
/** Defines the available category trees namespaces. */
|
|
412
|
+
declare enum CategoryNamespace {
|
|
413
|
+
/** Namespace for the dropshipping category tree. */
|
|
414
|
+
DROPSHIPPING_NAMESPACE = "DROPSHIPPING_NAMESPACE",
|
|
415
|
+
/** Namespace for the wholesale category tree. */
|
|
416
|
+
WHOLESALE_NAMESPACE = "WHOLESALE_NAMESPACE",
|
|
417
|
+
/** Namespace for the print on demand category tree. */
|
|
418
|
+
PRINT_ON_DEMAND_NAMESPACE = "PRINT_ON_DEMAND_NAMESPACE"
|
|
419
|
+
}
|
|
420
|
+
/** @enumType */
|
|
421
|
+
type CategoryNamespaceWithLiterals = CategoryNamespace | 'DROPSHIPPING_NAMESPACE' | 'WHOLESALE_NAMESPACE' | 'PRINT_ON_DEMAND_NAMESPACE';
|
|
422
|
+
/**
|
|
423
|
+
* Configuration for wholesale products including tiered pricing.
|
|
424
|
+
*
|
|
425
|
+
* Required when product types include `WHOLESALE`.
|
|
426
|
+
*/
|
|
427
|
+
interface WholesaleOptions {
|
|
428
|
+
/**
|
|
429
|
+
* Tiered pricing based on order quantity ranges.
|
|
430
|
+
*
|
|
431
|
+
* Price tiers must be continuous with no gaps in quantity ranges.
|
|
432
|
+
* For example, if tier 1 covers quantities 1-100, tier 2 must start at 101.
|
|
433
|
+
* The system validates tier continuity when creating or updating products.
|
|
434
|
+
* @maxSize 5
|
|
435
|
+
*/
|
|
436
|
+
priceTiers?: PriceTier[];
|
|
437
|
+
/**
|
|
438
|
+
* Minimum quantity required for wholesale orders.
|
|
439
|
+
* @min 1
|
|
440
|
+
*/
|
|
441
|
+
minimumOrderQuantity?: number | null;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Price tier with quantity range and corresponding pricing.
|
|
445
|
+
*
|
|
446
|
+
* Defines pricing for a specific quantity range in wholesale orders.
|
|
447
|
+
*/
|
|
448
|
+
interface PriceTier {
|
|
449
|
+
/**
|
|
450
|
+
* Minimum price for this quantity tier in USD.
|
|
451
|
+
*
|
|
452
|
+
* If `priceTo` isn't specified, this price applies to all quantities in the tier.
|
|
453
|
+
* @decimalValue options { gte:0, lte:999999999, maxScale:3 }
|
|
454
|
+
*/
|
|
455
|
+
priceFrom?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Maximum price for this quantity tier in USD.
|
|
458
|
+
*
|
|
459
|
+
* Optional for fixed-price tiers.
|
|
460
|
+
* @decimalValue options { gte:0, lte:999999999, maxScale:3 }
|
|
461
|
+
*/
|
|
462
|
+
priceTo?: string | null;
|
|
463
|
+
/**
|
|
464
|
+
* Minimum quantity for this price tier, inclusive.
|
|
465
|
+
* @min 1
|
|
466
|
+
*/
|
|
467
|
+
countFrom?: number | null;
|
|
468
|
+
/**
|
|
469
|
+
* Maximum quantity for this price tier, inclusive.
|
|
470
|
+
*
|
|
471
|
+
* If not specified, this tier applies to all quantities greater or equal to `countFrom`.
|
|
472
|
+
* @min 1
|
|
473
|
+
*/
|
|
474
|
+
countTo?: number | null;
|
|
475
|
+
}
|
|
476
|
+
interface SupplierInfo {
|
|
477
|
+
/**
|
|
478
|
+
* Supplier ID.
|
|
479
|
+
*
|
|
480
|
+
* When provided, references a supplier in the Marketplace Supplier service.
|
|
481
|
+
* The system automatically retrieves and populates the supplier's name, rating, and verification status.
|
|
482
|
+
* @format GUID
|
|
483
|
+
*/
|
|
484
|
+
_id?: string | null;
|
|
485
|
+
/**
|
|
486
|
+
* Supplier name.
|
|
487
|
+
*
|
|
488
|
+
* Automatically populated from the Supplier service when `id` is provided.
|
|
489
|
+
* @minLength 1
|
|
490
|
+
* @maxLength 200
|
|
491
|
+
* @readonly
|
|
492
|
+
*/
|
|
493
|
+
name?: string | null;
|
|
494
|
+
/**
|
|
495
|
+
* Supplier rating from 1.00 to 5.00.
|
|
496
|
+
*
|
|
497
|
+
* Automatically populated from the Supplier service when `id` is provided.
|
|
498
|
+
* @decimalValue options { gte:1, lte:5, maxScale:2 }
|
|
499
|
+
* @readonly
|
|
500
|
+
*/
|
|
501
|
+
rating?: string | null;
|
|
502
|
+
/**
|
|
503
|
+
* Whether the supplier has been verified by the Marketplace.
|
|
504
|
+
*
|
|
505
|
+
* Verified suppliers have completed the Marketplace verification process.
|
|
506
|
+
* Automatically populated from the Supplier service when `id` is provided.
|
|
507
|
+
*
|
|
508
|
+
* Default: `false`
|
|
509
|
+
* @readonly
|
|
510
|
+
*/
|
|
511
|
+
verified?: boolean;
|
|
512
|
+
}
|
|
513
|
+
interface PrintOnDemandOptions {
|
|
514
|
+
/**
|
|
515
|
+
* Set of possible print technologies for the Product
|
|
516
|
+
* @minSize 1
|
|
517
|
+
* @maxSize 3
|
|
518
|
+
*/
|
|
519
|
+
printTechnologies?: PrintTechnologyWithLiterals[];
|
|
520
|
+
/**
|
|
521
|
+
* Mockup image of the product with 'Your Image Here' text.
|
|
522
|
+
* @readonly
|
|
523
|
+
*/
|
|
524
|
+
mockupImage?: string;
|
|
525
|
+
}
|
|
526
|
+
declare enum PrintTechnology {
|
|
527
|
+
/** Transfers printed on film and heat-pressed onto fabric. */
|
|
528
|
+
DIRECT_TO_FILM = "DIRECT_TO_FILM",
|
|
529
|
+
/** Ink directly onto garment. */
|
|
530
|
+
DIRECT_TO_GARMENT = "DIRECT_TO_GARMENT",
|
|
531
|
+
/** Panels are printed first, then sewn. All‑over coverage with precise placements. */
|
|
532
|
+
CUT_SEW_SUBLIMATION = "CUT_SEW_SUBLIMATION",
|
|
533
|
+
/** Non‑DTG digital methods (e.g., roll‑to‑roll). */
|
|
534
|
+
DIGITAL_PRINTING = "DIGITAL_PRINTING",
|
|
535
|
+
/** Stitched threads, premium look. */
|
|
536
|
+
EMBROIDERY = "EMBROIDERY",
|
|
537
|
+
/** Dye infused into polyester/poly‑coated substrates. */
|
|
538
|
+
SUBLIMATION = "SUBLIMATION",
|
|
539
|
+
/** Cures ink with UV light on rigid or treated surfaces. */
|
|
540
|
+
UV_PRINTING = "UV_PRINTING",
|
|
541
|
+
/** Pattern/design is knitted, not printed. */
|
|
542
|
+
KNITWEAR = "KNITWEAR",
|
|
543
|
+
/** Designs are printed directly onto rolls of fabric, which are then cut and sewn into the final product. */
|
|
544
|
+
DIRECT_TO_FABRIC = "DIRECT_TO_FABRIC"
|
|
545
|
+
}
|
|
546
|
+
/** @enumType */
|
|
547
|
+
type PrintTechnologyWithLiterals = PrintTechnology | 'DIRECT_TO_FILM' | 'DIRECT_TO_GARMENT' | 'CUT_SEW_SUBLIMATION' | 'DIGITAL_PRINTING' | 'EMBROIDERY' | 'SUBLIMATION' | 'UV_PRINTING' | 'KNITWEAR' | 'DIRECT_TO_FABRIC';
|
|
548
|
+
interface SizeGuide {
|
|
549
|
+
/** Sizes units (inches or cm) */
|
|
550
|
+
measurementUnit?: MeasurementUnitWithLiterals;
|
|
551
|
+
/**
|
|
552
|
+
* Text description of the size guide
|
|
553
|
+
* @maxLength 8000
|
|
554
|
+
*/
|
|
555
|
+
description?: string | null;
|
|
556
|
+
/**
|
|
557
|
+
* Image for the size guide
|
|
558
|
+
* @format WEB_URL
|
|
559
|
+
*/
|
|
560
|
+
imageUrl?: string | null;
|
|
561
|
+
/**
|
|
562
|
+
* Text description of the image content
|
|
563
|
+
* @maxLength 8000
|
|
564
|
+
*/
|
|
565
|
+
imageDescription?: string | null;
|
|
566
|
+
/**
|
|
567
|
+
* Sizes specifications
|
|
568
|
+
* @maxSize 10
|
|
569
|
+
*/
|
|
570
|
+
specifications?: Specification[];
|
|
571
|
+
}
|
|
572
|
+
declare enum MeasurementUnit {
|
|
573
|
+
CM = "CM",
|
|
574
|
+
INCHES = "INCHES"
|
|
575
|
+
}
|
|
576
|
+
/** @enumType */
|
|
577
|
+
type MeasurementUnitWithLiterals = MeasurementUnit | 'CM' | 'INCHES';
|
|
578
|
+
interface Specification {
|
|
579
|
+
/**
|
|
580
|
+
* What is measured, e.g. chest, waist, sleeve
|
|
581
|
+
* @maxLength 50
|
|
582
|
+
*/
|
|
583
|
+
category?: string;
|
|
584
|
+
/**
|
|
585
|
+
* Measurements for different sizes
|
|
586
|
+
* @minSize 1
|
|
587
|
+
* @maxSize 50
|
|
588
|
+
*/
|
|
589
|
+
measurements?: Measurement[];
|
|
590
|
+
}
|
|
591
|
+
interface Measurement extends MeasurementValueOneOf {
|
|
592
|
+
/**
|
|
593
|
+
* The value of the size in case of single value
|
|
594
|
+
* @minLength 1
|
|
595
|
+
* @maxLength 50
|
|
596
|
+
*/
|
|
597
|
+
singleValue?: string;
|
|
598
|
+
/** The value of the size in case of range (min/max) */
|
|
599
|
+
range?: MeasurementValueRange;
|
|
600
|
+
/**
|
|
601
|
+
* Product size, e.g. S, M, L
|
|
602
|
+
* @maxLength 50
|
|
603
|
+
*/
|
|
604
|
+
sizeLabel?: string;
|
|
605
|
+
}
|
|
606
|
+
/** @oneof */
|
|
607
|
+
interface MeasurementValueOneOf {
|
|
608
|
+
/**
|
|
609
|
+
* The value of the size in case of single value
|
|
610
|
+
* @minLength 1
|
|
611
|
+
* @maxLength 50
|
|
612
|
+
*/
|
|
613
|
+
singleValue?: string;
|
|
614
|
+
/** The value of the size in case of range (min/max) */
|
|
615
|
+
range?: MeasurementValueRange;
|
|
616
|
+
}
|
|
617
|
+
interface MeasurementValueRange {
|
|
618
|
+
/**
|
|
619
|
+
* Minimum value
|
|
620
|
+
* @minLength 1
|
|
621
|
+
* @maxLength 50
|
|
622
|
+
*/
|
|
623
|
+
minimum?: string;
|
|
624
|
+
/**
|
|
625
|
+
* Maximum value
|
|
626
|
+
* @minLength 1
|
|
627
|
+
* @maxLength 50
|
|
628
|
+
*/
|
|
629
|
+
maximum?: string;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Common object for tags.
|
|
633
|
+
* Should be use as in this example:
|
|
634
|
+
* message Foo {
|
|
635
|
+
* option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo";
|
|
636
|
+
* string id = 1;
|
|
637
|
+
* ...
|
|
638
|
+
* Tags tags = 5
|
|
639
|
+
* }
|
|
640
|
+
*
|
|
641
|
+
* example of taggable entity
|
|
642
|
+
* {
|
|
643
|
+
* id: "123"
|
|
644
|
+
* tags: {
|
|
645
|
+
* public_tags: {
|
|
646
|
+
* tag_ids:["11","22"]
|
|
647
|
+
* },
|
|
648
|
+
* private_tags: {
|
|
649
|
+
* tag_ids: ["33", "44"]
|
|
650
|
+
* }
|
|
651
|
+
* }
|
|
652
|
+
* }
|
|
653
|
+
*/
|
|
654
|
+
interface Tags {
|
|
655
|
+
/** Tags that require an additional permission in order to access them, normally not given to site members or visitors. */
|
|
656
|
+
privateTags?: TagList;
|
|
657
|
+
/** Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. */
|
|
658
|
+
publicTags?: TagList;
|
|
659
|
+
}
|
|
660
|
+
interface TagList {
|
|
661
|
+
/**
|
|
662
|
+
* List of tag IDs.
|
|
663
|
+
* @maxSize 100
|
|
664
|
+
* @maxLength 5
|
|
665
|
+
*/
|
|
666
|
+
tagIds?: string[];
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Event payload for product tag modifications.
|
|
670
|
+
*
|
|
671
|
+
* Triggered when product tags are updated via bulk tag operations.
|
|
672
|
+
*/
|
|
673
|
+
interface TagsModified {
|
|
674
|
+
/** Product with updated tags. */
|
|
675
|
+
product?: Product;
|
|
676
|
+
/** Tags that were added to the product. */
|
|
677
|
+
assignedTags?: Tags;
|
|
678
|
+
/** Tags that were removed from the product. */
|
|
679
|
+
unassignedTags?: Tags;
|
|
680
|
+
}
|
|
681
|
+
interface CreateProductRequest {
|
|
682
|
+
/** Product to create. Must include all required fields for the specified product types. */
|
|
683
|
+
product: Product;
|
|
684
|
+
}
|
|
685
|
+
interface CreateProductResponse {
|
|
686
|
+
/** Created product with assigned ID and read-only fields populated. */
|
|
687
|
+
product?: Product;
|
|
688
|
+
}
|
|
689
|
+
interface GetProductRequest {
|
|
690
|
+
/**
|
|
691
|
+
* Product ID.
|
|
692
|
+
* @format GUID
|
|
693
|
+
*/
|
|
694
|
+
productId: string;
|
|
695
|
+
}
|
|
696
|
+
/** Additional fields that can be requested in API responses. */
|
|
697
|
+
declare enum RequestedField {
|
|
698
|
+
/** Include exact inventory quantity in the response. */
|
|
699
|
+
INVENTORY_QUANTITY = "INVENTORY_QUANTITY"
|
|
700
|
+
}
|
|
701
|
+
/** @enumType */
|
|
702
|
+
type RequestedFieldWithLiterals = RequestedField | 'INVENTORY_QUANTITY';
|
|
703
|
+
interface GetProductResponse {
|
|
704
|
+
/** Retrieved product. */
|
|
705
|
+
product?: Product;
|
|
706
|
+
}
|
|
707
|
+
interface UpdateProductRequest {
|
|
708
|
+
/** Product to update. May be partial - only fields to be updated need to be provided. */
|
|
709
|
+
product: Product;
|
|
710
|
+
}
|
|
711
|
+
interface UpdateProductResponse {
|
|
712
|
+
/** Updated product. */
|
|
713
|
+
product?: Product;
|
|
714
|
+
}
|
|
715
|
+
interface DeleteProductRequest {
|
|
716
|
+
/**
|
|
717
|
+
* Product ID.
|
|
718
|
+
* @format GUID
|
|
719
|
+
*/
|
|
720
|
+
productId: string;
|
|
721
|
+
}
|
|
722
|
+
interface DeleteProductResponse {
|
|
723
|
+
}
|
|
724
|
+
interface BulkCreateProductsRequest {
|
|
725
|
+
/**
|
|
726
|
+
* Products to create. Each must include all required fields for the specified product types.
|
|
727
|
+
* @minSize 1
|
|
728
|
+
* @maxSize 100
|
|
729
|
+
*/
|
|
730
|
+
products: Product[];
|
|
731
|
+
/**
|
|
732
|
+
* Whether to return the created products in the response.
|
|
733
|
+
*
|
|
734
|
+
* Default: `false`
|
|
735
|
+
*/
|
|
736
|
+
returnEntity?: boolean;
|
|
737
|
+
}
|
|
738
|
+
interface BulkCreateProductsResponse {
|
|
739
|
+
/**
|
|
740
|
+
* Results of the bulk create operation, one per input product.
|
|
741
|
+
* @minSize 1
|
|
742
|
+
* @maxSize 100
|
|
743
|
+
*/
|
|
744
|
+
results?: BulkProductResult[];
|
|
745
|
+
/** Metadata about the bulk operation including success and failure counts. */
|
|
746
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
747
|
+
}
|
|
748
|
+
interface ItemMetadata {
|
|
749
|
+
/**
|
|
750
|
+
* Item ID. Should always be available, unless it's impossible. For example, when failing to create an item.
|
|
751
|
+
* @format GUID
|
|
752
|
+
*/
|
|
753
|
+
_id?: string | null;
|
|
754
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
755
|
+
originalIndex?: number;
|
|
756
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
757
|
+
success?: boolean;
|
|
758
|
+
/** Details about the error in case of failure. */
|
|
759
|
+
error?: ApplicationError;
|
|
760
|
+
}
|
|
761
|
+
interface ApplicationError {
|
|
762
|
+
/** Error code. */
|
|
763
|
+
code?: string;
|
|
764
|
+
/** Description of the error. */
|
|
765
|
+
description?: string;
|
|
766
|
+
/** Data related to the error. */
|
|
767
|
+
data?: Record<string, any> | null;
|
|
768
|
+
}
|
|
769
|
+
interface BulkProductResult {
|
|
770
|
+
/** Metadata regarding the specific single create operation */
|
|
771
|
+
itemMetadata?: ItemMetadata;
|
|
772
|
+
/** Only exists if `returnEntity` was set to true in the request */
|
|
773
|
+
item?: Product;
|
|
774
|
+
}
|
|
775
|
+
interface BulkActionMetadata {
|
|
776
|
+
/** Number of items that were successfully processed. */
|
|
777
|
+
totalSuccesses?: number;
|
|
778
|
+
/** Number of items that couldn't be processed. */
|
|
779
|
+
totalFailures?: number;
|
|
780
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
781
|
+
undetailedFailures?: number;
|
|
782
|
+
}
|
|
783
|
+
interface BulkUpdateProductsRequest {
|
|
784
|
+
/**
|
|
785
|
+
* Products to update. Each can be partial based on its field mask.
|
|
786
|
+
* @minSize 1
|
|
787
|
+
* @maxSize 100
|
|
788
|
+
*/
|
|
789
|
+
products: MaskedProduct[];
|
|
790
|
+
/**
|
|
791
|
+
* Whether to return the updated products in the response.
|
|
792
|
+
*
|
|
793
|
+
* Default: `false`
|
|
794
|
+
*/
|
|
795
|
+
returnEntity?: boolean;
|
|
796
|
+
}
|
|
797
|
+
interface MaskedProduct {
|
|
798
|
+
/** Product to update. May be partial - only fields to be updated need to be provided. */
|
|
799
|
+
product?: Product;
|
|
800
|
+
}
|
|
801
|
+
interface BulkUpdateProductsResponse {
|
|
802
|
+
/**
|
|
803
|
+
* Results
|
|
804
|
+
* @minSize 1
|
|
805
|
+
* @maxSize 100
|
|
806
|
+
*/
|
|
807
|
+
results?: BulkUpdateProductsResponseBulkProductResult[];
|
|
808
|
+
/** Metadata regarding the bulk update operation */
|
|
809
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
810
|
+
}
|
|
811
|
+
interface BulkUpdateProductsResponseBulkProductResult {
|
|
812
|
+
/** Metadata regarding the specific single update operation */
|
|
813
|
+
itemMetadata?: ItemMetadata;
|
|
814
|
+
/** Only exists if `returnEntity` was set to true in the request */
|
|
815
|
+
item?: Product;
|
|
816
|
+
}
|
|
817
|
+
interface BulkDeleteProductsRequest {
|
|
818
|
+
/**
|
|
819
|
+
* Product IDs to delete.
|
|
820
|
+
* @minSize 1
|
|
821
|
+
* @maxSize 100
|
|
822
|
+
* @format GUID
|
|
823
|
+
*/
|
|
824
|
+
productIds: string[];
|
|
825
|
+
}
|
|
826
|
+
interface BulkDeleteProductsResponse {
|
|
827
|
+
/**
|
|
828
|
+
* Results
|
|
829
|
+
* @minSize 1
|
|
830
|
+
* @maxSize 100
|
|
831
|
+
*/
|
|
832
|
+
results?: BulkDeleteProductsResponseBulkProductResult[];
|
|
833
|
+
/** Metadata regarding the bulk delete operation */
|
|
834
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
835
|
+
}
|
|
836
|
+
interface BulkDeleteProductsResponseBulkProductResult {
|
|
837
|
+
/** Metadata regarding the specific single delete operation */
|
|
838
|
+
itemMetadata?: ItemMetadata;
|
|
839
|
+
}
|
|
840
|
+
interface QueryProductsRequest {
|
|
841
|
+
/** Query parameters including filter, sort, and paging options. */
|
|
842
|
+
query?: CommonCursorQuery;
|
|
843
|
+
}
|
|
844
|
+
interface CommonCursorQuery extends CommonCursorQueryPagingMethodOneOf {
|
|
845
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
846
|
+
cursorPaging?: CommonCursorPaging;
|
|
847
|
+
/**
|
|
848
|
+
* Filter object in the following format:
|
|
849
|
+
* `"filter" : {
|
|
850
|
+
* "fieldName1": "value1",
|
|
851
|
+
* "fieldName2":{"$operator":"value2"}
|
|
852
|
+
* }`
|
|
853
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
854
|
+
*/
|
|
855
|
+
filter?: Record<string, any> | null;
|
|
856
|
+
/**
|
|
857
|
+
* Sort object in the following format:
|
|
858
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
859
|
+
* @maxSize 5
|
|
860
|
+
*/
|
|
861
|
+
sort?: CommonSorting[];
|
|
862
|
+
}
|
|
863
|
+
/** @oneof */
|
|
864
|
+
interface CommonCursorQueryPagingMethodOneOf {
|
|
865
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
866
|
+
cursorPaging?: CommonCursorPaging;
|
|
867
|
+
}
|
|
868
|
+
interface CommonSorting {
|
|
869
|
+
/**
|
|
870
|
+
* Name of the field to sort by.
|
|
871
|
+
* @maxLength 512
|
|
872
|
+
*/
|
|
873
|
+
fieldName?: string;
|
|
874
|
+
/** Sort order. */
|
|
875
|
+
order?: CommonSortOrderWithLiterals;
|
|
876
|
+
/**
|
|
877
|
+
* Filters to specify which element to use for sorting when `fieldName` refers to a repeated field marked as `MATCH_ITEMS`.
|
|
878
|
+
*
|
|
879
|
+
* These filters ensure the correct element is selected from the collection for sorting. Multiple filters are combined using the `AND` operator.
|
|
880
|
+
*
|
|
881
|
+
* For example, for a document like `{"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}`,
|
|
882
|
+
* if `nestedField` is marked as `MATCH_ITEMS`, sorting by price in the US region requires:
|
|
883
|
+
* `{fieldName: "nestedField.price", "selectItemsBy": [{"nestedField.region": "US"}]}`.
|
|
884
|
+
* @maxSize 10
|
|
885
|
+
*/
|
|
886
|
+
selectItemsBy?: Record<string, any>[] | null;
|
|
887
|
+
}
|
|
888
|
+
declare enum CommonSortOrder {
|
|
889
|
+
ASC = "ASC",
|
|
890
|
+
DESC = "DESC"
|
|
891
|
+
}
|
|
892
|
+
/** @enumType */
|
|
893
|
+
type CommonSortOrderWithLiterals = CommonSortOrder | 'ASC' | 'DESC';
|
|
894
|
+
interface CommonCursorPaging {
|
|
895
|
+
/**
|
|
896
|
+
* Maximum number of items to return in the results.
|
|
897
|
+
* @max 100
|
|
898
|
+
*/
|
|
899
|
+
limit?: number | null;
|
|
900
|
+
/**
|
|
901
|
+
* Pointer to the next or previous page in the list of results.
|
|
902
|
+
*
|
|
903
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
904
|
+
* Not relevant for the first request.
|
|
905
|
+
* @maxLength 16000
|
|
906
|
+
*/
|
|
907
|
+
cursor?: string | null;
|
|
908
|
+
}
|
|
909
|
+
interface QueryProductsResponse {
|
|
910
|
+
/** Products matching the query. */
|
|
911
|
+
products?: Product[];
|
|
912
|
+
/** Paging information for retrieving additional results. */
|
|
913
|
+
pagingMetadata?: CommonCursorPagingMetadata;
|
|
914
|
+
}
|
|
915
|
+
interface CommonCursorPagingMetadata {
|
|
916
|
+
/** Number of items returned in the response. */
|
|
917
|
+
count?: number | null;
|
|
918
|
+
/** Cursor strings that point to the next page, previous page, or both. */
|
|
919
|
+
cursors?: CommonCursors;
|
|
920
|
+
/**
|
|
921
|
+
* Whether there are more pages to retrieve following the current page.
|
|
922
|
+
*
|
|
923
|
+
* + `true`: Another page of results can be retrieved.
|
|
924
|
+
* + `false`: This is the last page.
|
|
925
|
+
*/
|
|
926
|
+
hasNext?: boolean | null;
|
|
927
|
+
}
|
|
928
|
+
interface CommonCursors {
|
|
929
|
+
/**
|
|
930
|
+
* Cursor string pointing to the next page in the list of results.
|
|
931
|
+
* @maxLength 16000
|
|
932
|
+
*/
|
|
933
|
+
next?: string | null;
|
|
934
|
+
/**
|
|
935
|
+
* Cursor pointing to the previous page in the list of results.
|
|
936
|
+
* @maxLength 16000
|
|
937
|
+
*/
|
|
938
|
+
prev?: string | null;
|
|
939
|
+
}
|
|
940
|
+
interface SearchProductsRequest {
|
|
941
|
+
/** Search parameters including filter, sort, full-text search, and aggregations. */
|
|
942
|
+
search?: CursorSearch;
|
|
943
|
+
}
|
|
944
|
+
interface CursorSearch extends CursorSearchPagingMethodOneOf {
|
|
945
|
+
/**
|
|
946
|
+
* Cursor pointing to page of results.
|
|
947
|
+
* When requesting 'cursor_paging.cursor', no `filter`, `sort` or `search` can be provided.
|
|
948
|
+
*/
|
|
949
|
+
cursorPaging?: CommonCursorPaging;
|
|
950
|
+
/** A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf) */
|
|
951
|
+
filter?: Record<string, any> | null;
|
|
952
|
+
/**
|
|
953
|
+
* Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]
|
|
954
|
+
* @maxSize 10
|
|
955
|
+
*/
|
|
956
|
+
sort?: CommonSorting[];
|
|
957
|
+
/**
|
|
958
|
+
* Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.
|
|
959
|
+
* @maxSize 10
|
|
960
|
+
*/
|
|
961
|
+
aggregations?: Aggregation[];
|
|
962
|
+
/** Free text to match in searchable fields */
|
|
963
|
+
search?: SearchDetails;
|
|
964
|
+
/**
|
|
965
|
+
* UTC offset or IANA time zone. Valid values are
|
|
966
|
+
* ISO 8601 UTC offsets, such as +02:00 or -06:00,
|
|
967
|
+
* and IANA time zone IDs, such as Europe/Rome
|
|
968
|
+
*
|
|
969
|
+
* Affects all filters and aggregations returned values.
|
|
970
|
+
* You may override this behavior in a specific filter by providing
|
|
971
|
+
* timestamps including time zone. e.g. `"2023-12-20T10:52:34.795Z"`
|
|
972
|
+
* @maxLength 50
|
|
973
|
+
*/
|
|
974
|
+
timeZone?: string | null;
|
|
975
|
+
}
|
|
976
|
+
/** @oneof */
|
|
977
|
+
interface CursorSearchPagingMethodOneOf {
|
|
978
|
+
/**
|
|
979
|
+
* Cursor pointing to page of results.
|
|
980
|
+
* When requesting 'cursor_paging.cursor', no `filter`, `sort` or `search` can be provided.
|
|
981
|
+
*/
|
|
982
|
+
cursorPaging?: CommonCursorPaging;
|
|
983
|
+
}
|
|
984
|
+
interface Aggregation extends AggregationKindOneOf {
|
|
985
|
+
/** Value aggregation */
|
|
986
|
+
value?: ValueAggregation;
|
|
987
|
+
/** Range aggregation */
|
|
988
|
+
range?: RangeAggregation;
|
|
989
|
+
/** Scalar aggregation */
|
|
990
|
+
scalar?: ScalarAggregation;
|
|
991
|
+
/** Date histogram aggregation */
|
|
992
|
+
dateHistogram?: DateHistogramAggregation;
|
|
993
|
+
/** Nested aggregation */
|
|
994
|
+
nested?: NestedAggregation;
|
|
995
|
+
/**
|
|
996
|
+
* User-defined name of aggregation, should be unique, will appear in aggregation results
|
|
997
|
+
* @maxLength 100
|
|
998
|
+
*/
|
|
999
|
+
name?: string | null;
|
|
1000
|
+
/** Type of aggregation, client must provide matching aggregation field below */
|
|
1001
|
+
type?: AggregationTypeWithLiterals;
|
|
1002
|
+
/**
|
|
1003
|
+
* Field to aggregate by, use dot notation to specify json path
|
|
1004
|
+
* @maxLength 200
|
|
1005
|
+
*/
|
|
1006
|
+
fieldPath?: string;
|
|
1007
|
+
}
|
|
1008
|
+
/** @oneof */
|
|
1009
|
+
interface AggregationKindOneOf {
|
|
1010
|
+
/** Value aggregation */
|
|
1011
|
+
value?: ValueAggregation;
|
|
1012
|
+
/** Range aggregation */
|
|
1013
|
+
range?: RangeAggregation;
|
|
1014
|
+
/** Scalar aggregation */
|
|
1015
|
+
scalar?: ScalarAggregation;
|
|
1016
|
+
/** Date histogram aggregation */
|
|
1017
|
+
dateHistogram?: DateHistogramAggregation;
|
|
1018
|
+
/** Nested aggregation */
|
|
1019
|
+
nested?: NestedAggregation;
|
|
1020
|
+
}
|
|
1021
|
+
interface RangeBucket {
|
|
1022
|
+
/** Inclusive lower bound of the range. Required if to is not given */
|
|
1023
|
+
from?: number | null;
|
|
1024
|
+
/** Exclusive upper bound of the range. Required if from is not given */
|
|
1025
|
+
to?: number | null;
|
|
1026
|
+
}
|
|
1027
|
+
declare enum SortType {
|
|
1028
|
+
/** Should sort by number of matches */
|
|
1029
|
+
COUNT = "COUNT",
|
|
1030
|
+
/** Should sort by value of the field alphabetically */
|
|
1031
|
+
VALUE = "VALUE"
|
|
1032
|
+
}
|
|
1033
|
+
/** @enumType */
|
|
1034
|
+
type SortTypeWithLiterals = SortType | 'COUNT' | 'VALUE';
|
|
1035
|
+
declare enum SortDirection {
|
|
1036
|
+
/** Should sort in descending order */
|
|
1037
|
+
DESC = "DESC",
|
|
1038
|
+
/** Should sort in ascending order */
|
|
1039
|
+
ASC = "ASC"
|
|
1040
|
+
}
|
|
1041
|
+
/** @enumType */
|
|
1042
|
+
type SortDirectionWithLiterals = SortDirection | 'DESC' | 'ASC';
|
|
1043
|
+
declare enum MissingValues {
|
|
1044
|
+
/** Should missing values be excluded from the aggregation results */
|
|
1045
|
+
EXCLUDE = "EXCLUDE",
|
|
1046
|
+
/** Should missing values be included in the aggregation results */
|
|
1047
|
+
INCLUDE = "INCLUDE"
|
|
1048
|
+
}
|
|
1049
|
+
/** @enumType */
|
|
1050
|
+
type MissingValuesWithLiterals = MissingValues | 'EXCLUDE' | 'INCLUDE';
|
|
1051
|
+
interface IncludeMissingValuesOptions {
|
|
1052
|
+
/**
|
|
1053
|
+
* Can specify custom bucket name. Defaults are [string -> "N/A"], [int -> "0"], [bool -> "false"] ...
|
|
1054
|
+
* @maxLength 20
|
|
1055
|
+
*/
|
|
1056
|
+
addToBucket?: string;
|
|
1057
|
+
}
|
|
1058
|
+
declare enum ScalarType {
|
|
1059
|
+
/** Count of distinct values */
|
|
1060
|
+
COUNT_DISTINCT = "COUNT_DISTINCT",
|
|
1061
|
+
/** Minimum value */
|
|
1062
|
+
MIN = "MIN",
|
|
1063
|
+
/** Maximum value */
|
|
1064
|
+
MAX = "MAX"
|
|
1065
|
+
}
|
|
1066
|
+
/** @enumType */
|
|
1067
|
+
type ScalarTypeWithLiterals = ScalarType | 'COUNT_DISTINCT' | 'MIN' | 'MAX';
|
|
1068
|
+
interface ValueAggregation extends ValueAggregationOptionsOneOf {
|
|
1069
|
+
/** Options for including missing values */
|
|
1070
|
+
includeOptions?: IncludeMissingValuesOptions;
|
|
1071
|
+
/** Should sort by number of matches or value of the field */
|
|
1072
|
+
sortType?: SortTypeWithLiterals;
|
|
1073
|
+
/** Should sort in ascending or descending order */
|
|
1074
|
+
sortDirection?: SortDirectionWithLiterals;
|
|
1075
|
+
/** How many aggregations would you like to return? Can be between 1 and 250. 10 is the default. */
|
|
1076
|
+
limit?: number | null;
|
|
1077
|
+
/** Should missing values be included or excluded from the aggregation results. Default is EXCLUDE */
|
|
1078
|
+
missingValues?: MissingValuesWithLiterals;
|
|
1079
|
+
}
|
|
1080
|
+
/** @oneof */
|
|
1081
|
+
interface ValueAggregationOptionsOneOf {
|
|
1082
|
+
/** Options for including missing values */
|
|
1083
|
+
includeOptions?: IncludeMissingValuesOptions;
|
|
1084
|
+
}
|
|
1085
|
+
declare enum NestedAggregationType {
|
|
1086
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
1087
|
+
VALUE = "VALUE",
|
|
1088
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
1089
|
+
RANGE = "RANGE",
|
|
1090
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
1091
|
+
SCALAR = "SCALAR",
|
|
1092
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
1093
|
+
DATE_HISTOGRAM = "DATE_HISTOGRAM"
|
|
1094
|
+
}
|
|
1095
|
+
/** @enumType */
|
|
1096
|
+
type NestedAggregationTypeWithLiterals = NestedAggregationType | 'VALUE' | 'RANGE' | 'SCALAR' | 'DATE_HISTOGRAM';
|
|
1097
|
+
interface RangeAggregation {
|
|
1098
|
+
/**
|
|
1099
|
+
* List of range buckets, where during aggregation each entity will be placed in the first bucket where its value falls into based on provided range bounds
|
|
1100
|
+
* @maxSize 50
|
|
1101
|
+
*/
|
|
1102
|
+
buckets?: RangeBucket[];
|
|
1103
|
+
}
|
|
1104
|
+
interface ScalarAggregation {
|
|
1105
|
+
/** Define the operator for the scalar aggregation */
|
|
1106
|
+
type?: ScalarTypeWithLiterals;
|
|
1107
|
+
}
|
|
1108
|
+
interface DateHistogramAggregation {
|
|
1109
|
+
/** Interval for date histogram aggregation */
|
|
1110
|
+
interval?: IntervalWithLiterals;
|
|
1111
|
+
}
|
|
1112
|
+
declare enum Interval {
|
|
1113
|
+
/** Yearly interval */
|
|
1114
|
+
YEAR = "YEAR",
|
|
1115
|
+
/** Monthly interval */
|
|
1116
|
+
MONTH = "MONTH",
|
|
1117
|
+
/** Weekly interval */
|
|
1118
|
+
WEEK = "WEEK",
|
|
1119
|
+
/** Daily interval */
|
|
1120
|
+
DAY = "DAY",
|
|
1121
|
+
/** Hourly interval */
|
|
1122
|
+
HOUR = "HOUR",
|
|
1123
|
+
/** Minute interval */
|
|
1124
|
+
MINUTE = "MINUTE",
|
|
1125
|
+
/** Second interval */
|
|
1126
|
+
SECOND = "SECOND"
|
|
1127
|
+
}
|
|
1128
|
+
/** @enumType */
|
|
1129
|
+
type IntervalWithLiterals = Interval | 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
1130
|
+
interface NestedAggregationItem extends NestedAggregationItemKindOneOf {
|
|
1131
|
+
/** Value aggregation */
|
|
1132
|
+
value?: ValueAggregation;
|
|
1133
|
+
/** Range aggregation */
|
|
1134
|
+
range?: RangeAggregation;
|
|
1135
|
+
/** Scalar aggregation */
|
|
1136
|
+
scalar?: ScalarAggregation;
|
|
1137
|
+
/** Date histogram aggregation */
|
|
1138
|
+
dateHistogram?: DateHistogramAggregation;
|
|
1139
|
+
/**
|
|
1140
|
+
* User-defined name of aggregation, should be unique, will appear in aggregation results
|
|
1141
|
+
* @maxLength 100
|
|
1142
|
+
*/
|
|
1143
|
+
name?: string | null;
|
|
1144
|
+
/** Type of aggregation, client must provide matching aggregation field below */
|
|
1145
|
+
type?: NestedAggregationTypeWithLiterals;
|
|
1146
|
+
/**
|
|
1147
|
+
* Field to aggregate by, use dont notation to specify json path
|
|
1148
|
+
* @maxLength 200
|
|
1149
|
+
*/
|
|
1150
|
+
fieldPath?: string;
|
|
1151
|
+
}
|
|
1152
|
+
/** @oneof */
|
|
1153
|
+
interface NestedAggregationItemKindOneOf {
|
|
1154
|
+
/** Value aggregation */
|
|
1155
|
+
value?: ValueAggregation;
|
|
1156
|
+
/** Range aggregation */
|
|
1157
|
+
range?: RangeAggregation;
|
|
1158
|
+
/** Scalar aggregation */
|
|
1159
|
+
scalar?: ScalarAggregation;
|
|
1160
|
+
/** Date histogram aggregation */
|
|
1161
|
+
dateHistogram?: DateHistogramAggregation;
|
|
1162
|
+
}
|
|
1163
|
+
declare enum AggregationType {
|
|
1164
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
1165
|
+
VALUE = "VALUE",
|
|
1166
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
1167
|
+
RANGE = "RANGE",
|
|
1168
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
1169
|
+
SCALAR = "SCALAR",
|
|
1170
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
1171
|
+
DATE_HISTOGRAM = "DATE_HISTOGRAM",
|
|
1172
|
+
/** Multi-level aggregation, where each next aggregation is nested within previous one */
|
|
1173
|
+
NESTED = "NESTED"
|
|
1174
|
+
}
|
|
1175
|
+
/** @enumType */
|
|
1176
|
+
type AggregationTypeWithLiterals = AggregationType | 'VALUE' | 'RANGE' | 'SCALAR' | 'DATE_HISTOGRAM' | 'NESTED';
|
|
1177
|
+
/** Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one */
|
|
1178
|
+
interface NestedAggregation {
|
|
1179
|
+
/**
|
|
1180
|
+
* Flattened list of aggregations, where each next aggregation is nested within previous one
|
|
1181
|
+
* @minSize 2
|
|
1182
|
+
* @maxSize 3
|
|
1183
|
+
*/
|
|
1184
|
+
nestedAggregations?: NestedAggregationItem[];
|
|
1185
|
+
}
|
|
1186
|
+
interface SearchDetails {
|
|
1187
|
+
/**
|
|
1188
|
+
* Search term or expression
|
|
1189
|
+
* @maxLength 100
|
|
1190
|
+
*/
|
|
1191
|
+
expression?: string | null;
|
|
1192
|
+
}
|
|
1193
|
+
declare enum Mode {
|
|
1194
|
+
/** Any of the search terms must be present */
|
|
1195
|
+
OR = "OR",
|
|
1196
|
+
/** All search terms must be present */
|
|
1197
|
+
AND = "AND"
|
|
1198
|
+
}
|
|
1199
|
+
/** @enumType */
|
|
1200
|
+
type ModeWithLiterals = Mode | 'OR' | 'AND';
|
|
1201
|
+
interface SearchProductsResponse {
|
|
1202
|
+
/** Products matching the search criteria. */
|
|
1203
|
+
products?: Product[];
|
|
1204
|
+
/** Paging information for retrieving additional results. */
|
|
1205
|
+
pagingMetadata?: CommonCursorPagingMetadata;
|
|
1206
|
+
/** Aggregation results for faceted search. */
|
|
1207
|
+
aggregationData?: AggregationData;
|
|
1208
|
+
}
|
|
1209
|
+
interface AggregationData {
|
|
1210
|
+
/**
|
|
1211
|
+
* key = aggregation name (as derived from search request)
|
|
1212
|
+
* @maxSize 10000
|
|
1213
|
+
*/
|
|
1214
|
+
results?: AggregationResults[];
|
|
1215
|
+
}
|
|
1216
|
+
interface ValueAggregationResult {
|
|
1217
|
+
/**
|
|
1218
|
+
* Value of the field
|
|
1219
|
+
* @maxLength 100
|
|
1220
|
+
*/
|
|
1221
|
+
value?: string;
|
|
1222
|
+
/** Count of entities with this value */
|
|
1223
|
+
count?: number;
|
|
1224
|
+
}
|
|
1225
|
+
interface RangeAggregationResult {
|
|
1226
|
+
/** Inclusive lower bound of the range */
|
|
1227
|
+
from?: number | null;
|
|
1228
|
+
/** Exclusive upper bound of the range */
|
|
1229
|
+
to?: number | null;
|
|
1230
|
+
/** Count of entities in this range */
|
|
1231
|
+
count?: number;
|
|
1232
|
+
}
|
|
1233
|
+
interface NestedAggregationResults extends NestedAggregationResultsResultOneOf {
|
|
1234
|
+
/** Value aggregation results */
|
|
1235
|
+
values?: ValueResults;
|
|
1236
|
+
/** Range aggregation results */
|
|
1237
|
+
ranges?: RangeResults;
|
|
1238
|
+
/** Scalar aggregation results */
|
|
1239
|
+
scalar?: AggregationResultsScalarResult;
|
|
1240
|
+
/**
|
|
1241
|
+
* User-defined name of aggregation, matches the one provided in request
|
|
1242
|
+
* @maxLength 100
|
|
1243
|
+
*/
|
|
1244
|
+
name?: string;
|
|
1245
|
+
/** Type of aggregation that matches result */
|
|
1246
|
+
type?: AggregationTypeWithLiterals;
|
|
1247
|
+
/**
|
|
1248
|
+
* Field to aggregate by, matches the one provided in request
|
|
1249
|
+
* @maxLength 200
|
|
1250
|
+
*/
|
|
1251
|
+
fieldPath?: string;
|
|
1252
|
+
}
|
|
1253
|
+
/** @oneof */
|
|
1254
|
+
interface NestedAggregationResultsResultOneOf {
|
|
1255
|
+
/** Value aggregation results */
|
|
1256
|
+
values?: ValueResults;
|
|
1257
|
+
/** Range aggregation results */
|
|
1258
|
+
ranges?: RangeResults;
|
|
1259
|
+
/** Scalar aggregation results */
|
|
1260
|
+
scalar?: AggregationResultsScalarResult;
|
|
1261
|
+
}
|
|
1262
|
+
interface ValueResults {
|
|
1263
|
+
/**
|
|
1264
|
+
* List of value aggregations
|
|
1265
|
+
* @maxSize 250
|
|
1266
|
+
*/
|
|
1267
|
+
results?: ValueAggregationResult[];
|
|
1268
|
+
}
|
|
1269
|
+
interface RangeResults {
|
|
1270
|
+
/**
|
|
1271
|
+
* List of ranges returned in same order as requested
|
|
1272
|
+
* @maxSize 50
|
|
1273
|
+
*/
|
|
1274
|
+
results?: RangeAggregationResult[];
|
|
1275
|
+
}
|
|
1276
|
+
interface AggregationResultsScalarResult {
|
|
1277
|
+
/** Type of scalar aggregation */
|
|
1278
|
+
type?: ScalarTypeWithLiterals;
|
|
1279
|
+
/** Value of the scalar aggregation */
|
|
1280
|
+
value?: number;
|
|
1281
|
+
}
|
|
1282
|
+
interface NestedValueAggregationResult {
|
|
1283
|
+
/**
|
|
1284
|
+
* Value of the field
|
|
1285
|
+
* @maxLength 1000
|
|
1286
|
+
*/
|
|
1287
|
+
value?: string;
|
|
1288
|
+
/** Nested aggregations */
|
|
1289
|
+
nestedResults?: NestedAggregationResults;
|
|
1290
|
+
}
|
|
1291
|
+
interface ValueResult {
|
|
1292
|
+
/**
|
|
1293
|
+
* Value of the field
|
|
1294
|
+
* @maxLength 1000
|
|
1295
|
+
*/
|
|
1296
|
+
value?: string;
|
|
1297
|
+
/** Count of entities with this value */
|
|
1298
|
+
count?: number | null;
|
|
1299
|
+
}
|
|
1300
|
+
interface RangeResult {
|
|
1301
|
+
/** Inclusive lower bound of the range */
|
|
1302
|
+
from?: number | null;
|
|
1303
|
+
/** Exclusive upper bound of the range */
|
|
1304
|
+
to?: number | null;
|
|
1305
|
+
/** Count of entities in this range */
|
|
1306
|
+
count?: number | null;
|
|
1307
|
+
}
|
|
1308
|
+
interface ScalarResult {
|
|
1309
|
+
/** Value of the scalar aggregation */
|
|
1310
|
+
value?: number;
|
|
1311
|
+
}
|
|
1312
|
+
interface NestedResultValue extends NestedResultValueResultOneOf {
|
|
1313
|
+
/** Value aggregation result */
|
|
1314
|
+
value?: ValueResult;
|
|
1315
|
+
/** Range aggregation result */
|
|
1316
|
+
range?: RangeResult;
|
|
1317
|
+
/** Scalar aggregation result */
|
|
1318
|
+
scalar?: ScalarResult;
|
|
1319
|
+
/** Date histogram aggregation result */
|
|
1320
|
+
dateHistogram?: ValueResult;
|
|
1321
|
+
}
|
|
1322
|
+
/** @oneof */
|
|
1323
|
+
interface NestedResultValueResultOneOf {
|
|
1324
|
+
/** Value aggregation result */
|
|
1325
|
+
value?: ValueResult;
|
|
1326
|
+
/** Range aggregation result */
|
|
1327
|
+
range?: RangeResult;
|
|
1328
|
+
/** Scalar aggregation result */
|
|
1329
|
+
scalar?: ScalarResult;
|
|
1330
|
+
/** Date histogram aggregation result */
|
|
1331
|
+
dateHistogram?: ValueResult;
|
|
1332
|
+
}
|
|
1333
|
+
interface Results {
|
|
1334
|
+
/** List of nested aggregations */
|
|
1335
|
+
results?: Record<string, NestedResultValue>;
|
|
1336
|
+
}
|
|
1337
|
+
interface DateHistogramResult {
|
|
1338
|
+
/**
|
|
1339
|
+
* Date in ISO 8601 format
|
|
1340
|
+
* @maxLength 100
|
|
1341
|
+
*/
|
|
1342
|
+
value?: string;
|
|
1343
|
+
/** Count of documents in the bucket */
|
|
1344
|
+
count?: number;
|
|
1345
|
+
}
|
|
1346
|
+
interface GroupByValueResults {
|
|
1347
|
+
/**
|
|
1348
|
+
* List of value aggregations
|
|
1349
|
+
* @maxSize 1000
|
|
1350
|
+
*/
|
|
1351
|
+
results?: NestedValueAggregationResult[];
|
|
1352
|
+
}
|
|
1353
|
+
interface DateHistogramResults {
|
|
1354
|
+
/**
|
|
1355
|
+
* List of date histogram aggregations
|
|
1356
|
+
* @maxSize 200
|
|
1357
|
+
*/
|
|
1358
|
+
results?: DateHistogramResult[];
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Results of `NESTED` aggregation type in a flattened form
|
|
1362
|
+
* aggregations in resulting array are keyed by requested aggregation `name`.
|
|
1363
|
+
*/
|
|
1364
|
+
interface NestedResults {
|
|
1365
|
+
/**
|
|
1366
|
+
* List of nested aggregations
|
|
1367
|
+
* @maxSize 1000
|
|
1368
|
+
*/
|
|
1369
|
+
results?: Results[];
|
|
1370
|
+
}
|
|
1371
|
+
interface AggregationResults extends AggregationResultsResultOneOf {
|
|
1372
|
+
/** Value aggregation results */
|
|
1373
|
+
values?: ValueResults;
|
|
1374
|
+
/** Range aggregation results */
|
|
1375
|
+
ranges?: RangeResults;
|
|
1376
|
+
/** Scalar aggregation results */
|
|
1377
|
+
scalar?: AggregationResultsScalarResult;
|
|
1378
|
+
/** Group by value aggregation results */
|
|
1379
|
+
groupedByValue?: GroupByValueResults;
|
|
1380
|
+
/** Date histogram aggregation results */
|
|
1381
|
+
dateHistogram?: DateHistogramResults;
|
|
1382
|
+
/** Nested aggregation results */
|
|
1383
|
+
nested?: NestedResults;
|
|
1384
|
+
/**
|
|
1385
|
+
* User-defined name of aggregation as derived from search request
|
|
1386
|
+
* @maxLength 100
|
|
1387
|
+
*/
|
|
1388
|
+
name?: string;
|
|
1389
|
+
/** Type of aggregation that must match provided kind as derived from search request */
|
|
1390
|
+
type?: AggregationTypeWithLiterals;
|
|
1391
|
+
/**
|
|
1392
|
+
* Field to aggregate by as derived from search request
|
|
1393
|
+
* @maxLength 200
|
|
1394
|
+
*/
|
|
1395
|
+
fieldPath?: string;
|
|
1396
|
+
}
|
|
1397
|
+
/** @oneof */
|
|
1398
|
+
interface AggregationResultsResultOneOf {
|
|
1399
|
+
/** Value aggregation results */
|
|
1400
|
+
values?: ValueResults;
|
|
1401
|
+
/** Range aggregation results */
|
|
1402
|
+
ranges?: RangeResults;
|
|
1403
|
+
/** Scalar aggregation results */
|
|
1404
|
+
scalar?: AggregationResultsScalarResult;
|
|
1405
|
+
/** Group by value aggregation results */
|
|
1406
|
+
groupedByValue?: GroupByValueResults;
|
|
1407
|
+
/** Date histogram aggregation results */
|
|
1408
|
+
dateHistogram?: DateHistogramResults;
|
|
1409
|
+
/** Nested aggregation results */
|
|
1410
|
+
nested?: NestedResults;
|
|
1411
|
+
}
|
|
1412
|
+
interface BulkUpdateProductTagsRequest {
|
|
1413
|
+
/**
|
|
1414
|
+
* Product IDs to update tags for.
|
|
1415
|
+
* @minSize 1
|
|
1416
|
+
* @maxSize 100
|
|
1417
|
+
* @format GUID
|
|
1418
|
+
*/
|
|
1419
|
+
productIds: string[];
|
|
1420
|
+
/** Tags to assign to the products. */
|
|
1421
|
+
assignTags?: Tags;
|
|
1422
|
+
/** Tags to remove from the products. */
|
|
1423
|
+
unassignTags?: Tags;
|
|
1424
|
+
}
|
|
1425
|
+
interface BulkUpdateProductTagsResponse {
|
|
1426
|
+
/**
|
|
1427
|
+
* Results
|
|
1428
|
+
* @minSize 1
|
|
1429
|
+
* @maxSize 100
|
|
1430
|
+
*/
|
|
1431
|
+
results?: BulkUpdateProductTagsResult[];
|
|
1432
|
+
/** Metadata regarding the bulk update operation */
|
|
1433
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1434
|
+
}
|
|
1435
|
+
interface BulkUpdateProductTagsResult {
|
|
1436
|
+
/** Metadata regarding the specific single update operation */
|
|
1437
|
+
itemMetadata?: ItemMetadata;
|
|
1438
|
+
}
|
|
1439
|
+
interface BulkUpdateProductTagsByFilterRequest {
|
|
1440
|
+
/** Filter to select products for tag updates. Empty filter updates all products. */
|
|
1441
|
+
filter: Record<string, any> | null;
|
|
1442
|
+
/** Tags to assign to matching products. */
|
|
1443
|
+
assignTags?: Tags;
|
|
1444
|
+
/** Tags to remove from matching products. */
|
|
1445
|
+
unassignTags?: Tags;
|
|
1446
|
+
}
|
|
1447
|
+
interface BulkUpdateProductTagsByFilterResponse {
|
|
1448
|
+
/**
|
|
1449
|
+
* Job ID for tracking the asynchronous tag update operation.
|
|
1450
|
+
* @format GUID
|
|
1451
|
+
*/
|
|
1452
|
+
jobId?: string;
|
|
1453
|
+
}
|
|
1454
|
+
interface QueryCategoriesRequest {
|
|
1455
|
+
/** Query parameters including filter, sort, and paging options. */
|
|
1456
|
+
query?: CursorQuery;
|
|
1457
|
+
/** The namespace this category belongs to. */
|
|
1458
|
+
namespace: CategoryNamespaceWithLiterals;
|
|
1459
|
+
/** Whether non visible categories should be included in the response. Default is `false`. */
|
|
1460
|
+
returnNonVisibleCategories?: boolean;
|
|
1461
|
+
}
|
|
1462
|
+
interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
1463
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
1464
|
+
cursorPaging?: CursorPaging;
|
|
1465
|
+
/**
|
|
1466
|
+
* Filter object in the following format:
|
|
1467
|
+
* `"filter" : {
|
|
1468
|
+
* "fieldName1": "value1",
|
|
1469
|
+
* "fieldName2":{"$operator":"value2"}
|
|
1470
|
+
* }`
|
|
1471
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
1472
|
+
*/
|
|
1473
|
+
filter?: Record<string, any> | null;
|
|
1474
|
+
/**
|
|
1475
|
+
* Sort object in the following format:
|
|
1476
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
1477
|
+
* @maxSize 5
|
|
1478
|
+
*/
|
|
1479
|
+
sort?: Sorting[];
|
|
1480
|
+
}
|
|
1481
|
+
/** @oneof */
|
|
1482
|
+
interface CursorQueryPagingMethodOneOf {
|
|
1483
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
1484
|
+
cursorPaging?: CursorPaging;
|
|
1485
|
+
}
|
|
1486
|
+
interface Sorting {
|
|
1487
|
+
/**
|
|
1488
|
+
* Name of the field to sort by.
|
|
1489
|
+
* @maxLength 512
|
|
1490
|
+
*/
|
|
1491
|
+
fieldName?: string;
|
|
1492
|
+
/** Sort order. */
|
|
1493
|
+
order?: SortOrderWithLiterals;
|
|
1494
|
+
/**
|
|
1495
|
+
* Filters to specify which element to use for sorting when `fieldName` refers to a repeated field marked as `MATCH_ITEMS`.
|
|
1496
|
+
*
|
|
1497
|
+
* These filters ensure the correct element is selected from the collection for sorting. Multiple filters are combined using the `AND` operator.
|
|
1498
|
+
*
|
|
1499
|
+
* For example, for a document like `{"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}`,
|
|
1500
|
+
* if `nestedField` is marked as `MATCH_ITEMS`, sorting by price in the US region requires:
|
|
1501
|
+
* `{fieldName: "nestedField.price", "selectItemsBy": [{"nestedField.region": "US"}]}`.
|
|
1502
|
+
* @maxSize 10
|
|
1503
|
+
*/
|
|
1504
|
+
selectItemsBy?: Record<string, any>[] | null;
|
|
1505
|
+
}
|
|
1506
|
+
declare enum SortOrder {
|
|
1507
|
+
ASC = "ASC",
|
|
1508
|
+
DESC = "DESC"
|
|
1509
|
+
}
|
|
1510
|
+
/** @enumType */
|
|
1511
|
+
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
1512
|
+
interface CursorPaging {
|
|
1513
|
+
/**
|
|
1514
|
+
* Maximum number of items to return in the results.
|
|
1515
|
+
* @max 1000
|
|
1516
|
+
*/
|
|
1517
|
+
limit?: number | null;
|
|
1518
|
+
/**
|
|
1519
|
+
* Pointer to the next or previous page in the list of results.
|
|
1520
|
+
*
|
|
1521
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
1522
|
+
* Not relevant for the first request.
|
|
1523
|
+
* @maxLength 16000
|
|
1524
|
+
*/
|
|
1525
|
+
cursor?: string | null;
|
|
1526
|
+
}
|
|
1527
|
+
interface QueryCategoriesResponse {
|
|
1528
|
+
/** Categories matching the query. */
|
|
1529
|
+
categories?: Category[];
|
|
1530
|
+
/** Paging information for retrieving additional results. */
|
|
1531
|
+
pagingMetadata?: CursorPagingMetadata;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* A category for organizing Marketplace products.
|
|
1535
|
+
*
|
|
1536
|
+
* Categories form a hierarchical structure to help store owners discover relevant products.
|
|
1537
|
+
*/
|
|
1538
|
+
interface Category {
|
|
1539
|
+
/**
|
|
1540
|
+
* Category ID.
|
|
1541
|
+
* @format GUID
|
|
1542
|
+
* @readonly
|
|
1543
|
+
*/
|
|
1544
|
+
_id?: string | null;
|
|
1545
|
+
/**
|
|
1546
|
+
* Category name.
|
|
1547
|
+
* @minLength 1
|
|
1548
|
+
* @maxLength 80
|
|
1549
|
+
*/
|
|
1550
|
+
name?: string | null;
|
|
1551
|
+
/**
|
|
1552
|
+
* Category description.
|
|
1553
|
+
* @minLength 1
|
|
1554
|
+
* @maxLength 600
|
|
1555
|
+
*/
|
|
1556
|
+
description?: string | null;
|
|
1557
|
+
/**
|
|
1558
|
+
* Number of items in this category.
|
|
1559
|
+
* @readonly
|
|
1560
|
+
*/
|
|
1561
|
+
itemCount?: number;
|
|
1562
|
+
/**
|
|
1563
|
+
* Navigation path from root to this category.
|
|
1564
|
+
*
|
|
1565
|
+
* The current category isn't included in the list.
|
|
1566
|
+
* @readonly
|
|
1567
|
+
* @maxSize 5
|
|
1568
|
+
*/
|
|
1569
|
+
breadcrumbs?: Breadcrumb[];
|
|
1570
|
+
/**
|
|
1571
|
+
* Parent category information in the hierarchy.
|
|
1572
|
+
* @immutable
|
|
1573
|
+
*/
|
|
1574
|
+
parentCategory?: ParentCategory;
|
|
1575
|
+
/**
|
|
1576
|
+
* URL-friendly category identifier.
|
|
1577
|
+
* @format URL_SLUG
|
|
1578
|
+
*/
|
|
1579
|
+
slug?: string | null;
|
|
1580
|
+
/**
|
|
1581
|
+
* Whether the category is visible in the Marketplace.
|
|
1582
|
+
*
|
|
1583
|
+
* Default: `true`
|
|
1584
|
+
*/
|
|
1585
|
+
visible?: boolean | null;
|
|
1586
|
+
}
|
|
1587
|
+
interface Breadcrumb {
|
|
1588
|
+
/**
|
|
1589
|
+
* Ancestor category ID.
|
|
1590
|
+
* @format GUID
|
|
1591
|
+
*/
|
|
1592
|
+
categoryId?: string;
|
|
1593
|
+
/**
|
|
1594
|
+
* Ancestor category name.
|
|
1595
|
+
* @minLength 1
|
|
1596
|
+
* @maxLength 80
|
|
1597
|
+
*/
|
|
1598
|
+
categoryName?: string;
|
|
1599
|
+
/**
|
|
1600
|
+
* Ancestor category slug.
|
|
1601
|
+
* @minLength 1
|
|
1602
|
+
* @maxLength 100
|
|
1603
|
+
*/
|
|
1604
|
+
categorySlug?: string;
|
|
1605
|
+
}
|
|
1606
|
+
/** Information about a category's parent in the hierarchy. */
|
|
1607
|
+
interface ParentCategory {
|
|
1608
|
+
/**
|
|
1609
|
+
* Parent category ID.
|
|
1610
|
+
* @format GUID
|
|
1611
|
+
*/
|
|
1612
|
+
_id?: string | null;
|
|
1613
|
+
/**
|
|
1614
|
+
* Index position of the category within the parent category.
|
|
1615
|
+
* @readonly
|
|
1616
|
+
*/
|
|
1617
|
+
index?: number | null;
|
|
1618
|
+
}
|
|
1619
|
+
interface CursorPagingMetadata {
|
|
1620
|
+
/** Number of items returned in the response. */
|
|
1621
|
+
count?: number | null;
|
|
1622
|
+
/** Cursor strings that point to the next page, previous page, or both. */
|
|
1623
|
+
cursors?: Cursors;
|
|
1624
|
+
/**
|
|
1625
|
+
* Whether there are more pages to retrieve following the current page.
|
|
1626
|
+
*
|
|
1627
|
+
* + `true`: Another page of results can be retrieved.
|
|
1628
|
+
* + `false`: This is the last page.
|
|
1629
|
+
*/
|
|
1630
|
+
hasNext?: boolean | null;
|
|
1631
|
+
}
|
|
1632
|
+
interface Cursors {
|
|
1633
|
+
/**
|
|
1634
|
+
* Cursor string pointing to the next page in the list of results.
|
|
1635
|
+
* @maxLength 16000
|
|
1636
|
+
*/
|
|
1637
|
+
next?: string | null;
|
|
1638
|
+
/**
|
|
1639
|
+
* Cursor pointing to the previous page in the list of results.
|
|
1640
|
+
* @maxLength 16000
|
|
1641
|
+
*/
|
|
1642
|
+
prev?: string | null;
|
|
1643
|
+
}
|
|
1644
|
+
interface BulkAddProductsToStoreRequest {
|
|
1645
|
+
/**
|
|
1646
|
+
* Products to add to the user's store.
|
|
1647
|
+
* @minSize 1
|
|
1648
|
+
* @maxSize 50
|
|
1649
|
+
*/
|
|
1650
|
+
productReferences?: ProductReference[];
|
|
1651
|
+
}
|
|
1652
|
+
interface ProductReference {
|
|
1653
|
+
/**
|
|
1654
|
+
* Product ID.
|
|
1655
|
+
* @format GUID
|
|
1656
|
+
*/
|
|
1657
|
+
productId?: string;
|
|
1658
|
+
/**
|
|
1659
|
+
* Provider app ID.
|
|
1660
|
+
* @format GUID
|
|
1661
|
+
* @readonly
|
|
1662
|
+
*/
|
|
1663
|
+
appId?: string;
|
|
1664
|
+
/**
|
|
1665
|
+
* Additional metadata for the product reference.
|
|
1666
|
+
*
|
|
1667
|
+
* For example, internal identifiers on the provider's platform.
|
|
1668
|
+
*/
|
|
1669
|
+
options?: Record<string, any> | null;
|
|
1670
|
+
/**
|
|
1671
|
+
* Whether the product is visible in the store.
|
|
1672
|
+
*
|
|
1673
|
+
* Default: `false`
|
|
1674
|
+
*/
|
|
1675
|
+
visibleInStore?: boolean;
|
|
1676
|
+
}
|
|
1677
|
+
interface BulkAddProductsToStoreResponse {
|
|
1678
|
+
/**
|
|
1679
|
+
* Results of adding products to the store, one per input product.
|
|
1680
|
+
* @minSize 1
|
|
1681
|
+
* @maxSize 50
|
|
1682
|
+
*/
|
|
1683
|
+
results?: BulkAddProductToStoreResult[];
|
|
1684
|
+
/** Metadata about the bulk operation including success and failure counts. */
|
|
1685
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
1686
|
+
}
|
|
1687
|
+
interface BulkAddProductToStoreResult {
|
|
1688
|
+
/** Metadata regarding the specific single operation */
|
|
1689
|
+
itemMetadata?: ItemMetadata;
|
|
1690
|
+
/** Product added to the user's store */
|
|
1691
|
+
item?: ProductReference;
|
|
1692
|
+
}
|
|
1693
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
1694
|
+
createdEvent?: EntityCreatedEvent;
|
|
1695
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
1696
|
+
deletedEvent?: EntityDeletedEvent;
|
|
1697
|
+
actionEvent?: ActionEvent;
|
|
1698
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
1699
|
+
_id?: string;
|
|
1700
|
+
/**
|
|
1701
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
1702
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
1703
|
+
*/
|
|
1704
|
+
entityFqdn?: string;
|
|
1705
|
+
/**
|
|
1706
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
1707
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
1708
|
+
*/
|
|
1709
|
+
slug?: string;
|
|
1710
|
+
/** ID of the entity associated with the event. */
|
|
1711
|
+
entityId?: string;
|
|
1712
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
1713
|
+
eventTime?: Date | null;
|
|
1714
|
+
/**
|
|
1715
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1716
|
+
* (for example, GDPR).
|
|
1717
|
+
*/
|
|
1718
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1719
|
+
/** If present, indicates the action that triggered the event. */
|
|
1720
|
+
originatedFrom?: string | null;
|
|
1721
|
+
/**
|
|
1722
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
|
|
1723
|
+
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
1724
|
+
*/
|
|
1725
|
+
entityEventSequence?: string | null;
|
|
1726
|
+
}
|
|
1727
|
+
/** @oneof */
|
|
1728
|
+
interface DomainEventBodyOneOf {
|
|
1729
|
+
createdEvent?: EntityCreatedEvent;
|
|
1730
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
1731
|
+
deletedEvent?: EntityDeletedEvent;
|
|
1732
|
+
actionEvent?: ActionEvent;
|
|
1733
|
+
}
|
|
1734
|
+
interface EntityCreatedEvent {
|
|
1735
|
+
entity?: string;
|
|
1736
|
+
}
|
|
1737
|
+
interface RestoreInfo {
|
|
1738
|
+
deletedDate?: Date | null;
|
|
1739
|
+
}
|
|
1740
|
+
interface EntityUpdatedEvent {
|
|
1741
|
+
/**
|
|
1742
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1743
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
1744
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
1745
|
+
*/
|
|
1746
|
+
currentEntity?: string;
|
|
1747
|
+
}
|
|
1748
|
+
interface EntityDeletedEvent {
|
|
1749
|
+
/** Entity that was deleted. */
|
|
1750
|
+
deletedEntity?: string | null;
|
|
1751
|
+
}
|
|
1752
|
+
interface ActionEvent {
|
|
1753
|
+
body?: string;
|
|
1754
|
+
}
|
|
1755
|
+
interface Empty {
|
|
1756
|
+
}
|
|
1757
|
+
interface MessageEnvelope {
|
|
1758
|
+
/**
|
|
1759
|
+
* App instance ID.
|
|
1760
|
+
* @format GUID
|
|
1761
|
+
*/
|
|
1762
|
+
instanceId?: string | null;
|
|
1763
|
+
/**
|
|
1764
|
+
* Event type.
|
|
1765
|
+
* @maxLength 150
|
|
1766
|
+
*/
|
|
1767
|
+
eventType?: string;
|
|
1768
|
+
/** The identification type and identity data. */
|
|
1769
|
+
identity?: IdentificationData;
|
|
1770
|
+
/** Stringify payload. */
|
|
1771
|
+
data?: string;
|
|
1772
|
+
/** Details related to the account */
|
|
1773
|
+
accountInfo?: AccountInfo;
|
|
1774
|
+
}
|
|
1775
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
1776
|
+
/**
|
|
1777
|
+
* ID of a site visitor that has not logged in to the site.
|
|
1778
|
+
* @format GUID
|
|
1779
|
+
*/
|
|
1780
|
+
anonymousVisitorId?: string;
|
|
1781
|
+
/**
|
|
1782
|
+
* ID of a site visitor that has logged in to the site.
|
|
1783
|
+
* @format GUID
|
|
1784
|
+
*/
|
|
1785
|
+
memberId?: string;
|
|
1786
|
+
/**
|
|
1787
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
1788
|
+
* @format GUID
|
|
1789
|
+
*/
|
|
1790
|
+
wixUserId?: string;
|
|
1791
|
+
/**
|
|
1792
|
+
* ID of an app.
|
|
1793
|
+
* @format GUID
|
|
1794
|
+
*/
|
|
1795
|
+
appId?: string;
|
|
1796
|
+
/** @readonly */
|
|
1797
|
+
identityType?: WebhookIdentityTypeWithLiterals;
|
|
1798
|
+
}
|
|
1799
|
+
/** @oneof */
|
|
1800
|
+
interface IdentificationDataIdOneOf {
|
|
1801
|
+
/**
|
|
1802
|
+
* ID of a site visitor that has not logged in to the site.
|
|
1803
|
+
* @format GUID
|
|
1804
|
+
*/
|
|
1805
|
+
anonymousVisitorId?: string;
|
|
1806
|
+
/**
|
|
1807
|
+
* ID of a site visitor that has logged in to the site.
|
|
1808
|
+
* @format GUID
|
|
1809
|
+
*/
|
|
1810
|
+
memberId?: string;
|
|
1811
|
+
/**
|
|
1812
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
1813
|
+
* @format GUID
|
|
1814
|
+
*/
|
|
1815
|
+
wixUserId?: string;
|
|
1816
|
+
/**
|
|
1817
|
+
* ID of an app.
|
|
1818
|
+
* @format GUID
|
|
1819
|
+
*/
|
|
1820
|
+
appId?: string;
|
|
1821
|
+
}
|
|
1822
|
+
declare enum WebhookIdentityType {
|
|
1823
|
+
UNKNOWN = "UNKNOWN",
|
|
1824
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1825
|
+
MEMBER = "MEMBER",
|
|
1826
|
+
WIX_USER = "WIX_USER",
|
|
1827
|
+
APP = "APP"
|
|
1828
|
+
}
|
|
1829
|
+
/** @enumType */
|
|
1830
|
+
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
1831
|
+
interface AccountInfo {
|
|
1832
|
+
/**
|
|
1833
|
+
* ID of the Wix account associated with the event.
|
|
1834
|
+
* @format GUID
|
|
1835
|
+
*/
|
|
1836
|
+
accountId?: string | null;
|
|
1837
|
+
/**
|
|
1838
|
+
* ID of the parent Wix account. Only included when accountId belongs to a child account.
|
|
1839
|
+
* @format GUID
|
|
1840
|
+
*/
|
|
1841
|
+
parentAccountId?: string | null;
|
|
1842
|
+
/**
|
|
1843
|
+
* ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
|
|
1844
|
+
* @format GUID
|
|
1845
|
+
*/
|
|
1846
|
+
siteId?: string | null;
|
|
1847
|
+
}
|
|
1848
|
+
/** @docsIgnore */
|
|
1849
|
+
type BulkUpdateProductTagsApplicationErrors = {
|
|
1850
|
+
code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS';
|
|
1851
|
+
description?: string;
|
|
1852
|
+
data?: Record<string, any>;
|
|
1853
|
+
};
|
|
1854
|
+
/** @docsIgnore */
|
|
1855
|
+
type BulkUpdateProductTagsByFilterApplicationErrors = {
|
|
1856
|
+
code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS';
|
|
1857
|
+
description?: string;
|
|
1858
|
+
data?: Record<string, any>;
|
|
1859
|
+
};
|
|
1860
|
+
interface BaseEventMetadata {
|
|
1861
|
+
/**
|
|
1862
|
+
* App instance ID.
|
|
1863
|
+
* @format GUID
|
|
1864
|
+
*/
|
|
1865
|
+
instanceId?: string | null;
|
|
1866
|
+
/**
|
|
1867
|
+
* Event type.
|
|
1868
|
+
* @maxLength 150
|
|
1869
|
+
*/
|
|
1870
|
+
eventType?: string;
|
|
1871
|
+
/** The identification type and identity data. */
|
|
1872
|
+
identity?: IdentificationData;
|
|
1873
|
+
/** Details related to the account */
|
|
1874
|
+
accountInfo?: AccountInfo;
|
|
1875
|
+
}
|
|
1876
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
1877
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
1878
|
+
_id?: string;
|
|
1879
|
+
/**
|
|
1880
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
1881
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
1882
|
+
*/
|
|
1883
|
+
entityFqdn?: string;
|
|
1884
|
+
/**
|
|
1885
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
1886
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
1887
|
+
*/
|
|
1888
|
+
slug?: string;
|
|
1889
|
+
/** ID of the entity associated with the event. */
|
|
1890
|
+
entityId?: string;
|
|
1891
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
1892
|
+
eventTime?: Date | null;
|
|
1893
|
+
/**
|
|
1894
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1895
|
+
* (for example, GDPR).
|
|
1896
|
+
*/
|
|
1897
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1898
|
+
/** If present, indicates the action that triggered the event. */
|
|
1899
|
+
originatedFrom?: string | null;
|
|
1900
|
+
/**
|
|
1901
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
|
|
1902
|
+
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
1903
|
+
*/
|
|
1904
|
+
entityEventSequence?: string | null;
|
|
1905
|
+
accountInfo?: AccountInfoMetadata;
|
|
1906
|
+
}
|
|
1907
|
+
interface AccountInfoMetadata {
|
|
1908
|
+
/** ID of the Wix account associated with the event */
|
|
1909
|
+
accountId: string;
|
|
1910
|
+
/** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
|
|
1911
|
+
siteId?: string;
|
|
1912
|
+
/** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
|
|
1913
|
+
parentAccountId?: string;
|
|
1914
|
+
}
|
|
1915
|
+
interface ProductCreatedEnvelope {
|
|
1916
|
+
entity: Product;
|
|
1917
|
+
metadata: EventMetadata;
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Triggered when a product is created.
|
|
1921
|
+
* @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read
|
|
1922
|
+
* @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ
|
|
1923
|
+
* @permissionScope Read Marketplace
|
|
1924
|
+
* @permissionScopeId SCOPE.SUPPLIERS_HUB.READ_MARKETPLACE
|
|
1925
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_READ
|
|
1926
|
+
* @webhook
|
|
1927
|
+
* @eventType wix.suppliershub.marketplace_product.v1.product_created
|
|
1928
|
+
* @slug created
|
|
1929
|
+
* @documentationMaturity preview
|
|
1930
|
+
*/
|
|
1931
|
+
declare function onProductCreated(handler: (event: ProductCreatedEnvelope) => void | Promise<void>): void;
|
|
1932
|
+
interface ProductDeletedEnvelope {
|
|
1933
|
+
entity: Product;
|
|
1934
|
+
metadata: EventMetadata;
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Triggered when a product is deleted.
|
|
1938
|
+
* @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read
|
|
1939
|
+
* @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ
|
|
1940
|
+
* @permissionScope Read Marketplace
|
|
1941
|
+
* @permissionScopeId SCOPE.SUPPLIERS_HUB.READ_MARKETPLACE
|
|
1942
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_READ
|
|
1943
|
+
* @webhook
|
|
1944
|
+
* @eventType wix.suppliershub.marketplace_product.v1.product_deleted
|
|
1945
|
+
* @slug deleted
|
|
1946
|
+
* @documentationMaturity preview
|
|
1947
|
+
*/
|
|
1948
|
+
declare function onProductDeleted(handler: (event: ProductDeletedEnvelope) => void | Promise<void>): void;
|
|
1949
|
+
interface ProductTagsModifiedEnvelope {
|
|
1950
|
+
data: TagsModified;
|
|
1951
|
+
metadata: EventMetadata;
|
|
1952
|
+
}
|
|
1953
|
+
/**
|
|
1954
|
+
* Triggered when product tags are modified.
|
|
1955
|
+
* @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read
|
|
1956
|
+
* @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ
|
|
1957
|
+
* @permissionScope Read Marketplace
|
|
1958
|
+
* @permissionScopeId SCOPE.SUPPLIERS_HUB.READ_MARKETPLACE
|
|
1959
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_READ
|
|
1960
|
+
* @webhook
|
|
1961
|
+
* @eventType wix.suppliershub.marketplace_product.v1.product_tags_modified
|
|
1962
|
+
* @slug tags_modified
|
|
1963
|
+
* @documentationMaturity preview
|
|
1964
|
+
*/
|
|
1965
|
+
declare function onProductTagsModified(handler: (event: ProductTagsModifiedEnvelope) => void | Promise<void>): void;
|
|
1966
|
+
interface ProductUpdatedEnvelope {
|
|
1967
|
+
entity: Product;
|
|
1968
|
+
metadata: EventMetadata;
|
|
1969
|
+
/** @hidden */
|
|
1970
|
+
modifiedFields: Record<string, any>;
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* Triggered when a product is updated.
|
|
1974
|
+
* @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read
|
|
1975
|
+
* @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ
|
|
1976
|
+
* @permissionScope Read Marketplace
|
|
1977
|
+
* @permissionScopeId SCOPE.SUPPLIERS_HUB.READ_MARKETPLACE
|
|
1978
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_READ
|
|
1979
|
+
* @webhook
|
|
1980
|
+
* @eventType wix.suppliershub.marketplace_product.v1.product_updated
|
|
1981
|
+
* @slug updated
|
|
1982
|
+
* @documentationMaturity preview
|
|
1983
|
+
*/
|
|
1984
|
+
declare function onProductUpdated(handler: (event: ProductUpdatedEnvelope) => void | Promise<void>): void;
|
|
1985
|
+
/**
|
|
1986
|
+
* Creates a product in the Marketplace.
|
|
1987
|
+
*
|
|
1988
|
+
* Products must include all required fields for the specified types.
|
|
1989
|
+
* The first image in `media.items` becomes the main image.
|
|
1990
|
+
* @param product - Product to create. Must include all required fields for the specified product types.
|
|
1991
|
+
* @public
|
|
1992
|
+
* @documentationMaturity preview
|
|
1993
|
+
* @requiredField product
|
|
1994
|
+
* @requiredField product.directCategories._id
|
|
1995
|
+
* @requiredField product.directCategories.namespace
|
|
1996
|
+
* @requiredField product.media
|
|
1997
|
+
* @requiredField product.minimumPrice
|
|
1998
|
+
* @requiredField product.name
|
|
1999
|
+
* @requiredField product.options.name
|
|
2000
|
+
* @requiredField product.options.values
|
|
2001
|
+
* @requiredField product.providerInfo
|
|
2002
|
+
* @requiredField product.providerInfo.productId
|
|
2003
|
+
* @requiredField product.shippingDestinations.minimumShippingCost
|
|
2004
|
+
* @requiredField product.types
|
|
2005
|
+
* @requiredField product.wholesaleOptions.priceTiers.countFrom
|
|
2006
|
+
* @requiredField product.wholesaleOptions.priceTiers.priceFrom
|
|
2007
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_CREATE
|
|
2008
|
+
* @applicableIdentity APP
|
|
2009
|
+
* @returns Created product with assigned ID and read-only fields populated.
|
|
2010
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.CreateProduct
|
|
2011
|
+
*/
|
|
2012
|
+
declare function createProduct(product: NonNullablePaths<Product, `directCategories.${number}._id` | `directCategories.${number}.namespace` | `media` | `minimumPrice` | `name` | `options.${number}.name` | `options.${number}.values` | `providerInfo` | `providerInfo.productId` | `shippingDestinations.${number}.minimumShippingCost` | `types` | `wholesaleOptions.priceTiers.${number}.countFrom` | `wholesaleOptions.priceTiers.${number}.priceFrom`, 5>): Promise<NonNullablePaths<Product, `media.items` | `types` | `options` | `options.${number}.name` | `orderProcessingTime.min.value` | `orderProcessingTime.min.unit` | `shippingDestinations` | `shippingDestinations.${number}.countrySelections` | `shippingDestinations.${number}.minimumShippingCost` | `directCategories` | `directCategories.${number}._id` | `directCategories.${number}.namespace` | `allCategories` | `wholesaleOptions.priceTiers` | `wholesaleOptions.priceTiers.${number}.priceFrom` | `supplierInfo.verified` | `printOnDemandOptions.printTechnologies` | `sizeGuides` | `sizeGuides.${number}.measurementUnit` | `tags.privateTags.tagIds`, 5>>;
|
|
2013
|
+
/**
|
|
2014
|
+
* Retrieves a product by ID.
|
|
2015
|
+
* @param productId - Product ID.
|
|
2016
|
+
* @public
|
|
2017
|
+
* @documentationMaturity preview
|
|
2018
|
+
* @requiredField productId
|
|
2019
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_READ
|
|
2020
|
+
* @applicableIdentity APP
|
|
2021
|
+
* @returns Retrieved product.
|
|
2022
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.GetProduct
|
|
2023
|
+
*/
|
|
2024
|
+
declare function getProduct(productId: string): Promise<NonNullablePaths<Product, `media.items` | `types` | `options` | `options.${number}.name` | `orderProcessingTime.min.value` | `orderProcessingTime.min.unit` | `shippingDestinations` | `shippingDestinations.${number}.countrySelections` | `shippingDestinations.${number}.minimumShippingCost` | `directCategories` | `directCategories.${number}._id` | `directCategories.${number}.namespace` | `allCategories` | `wholesaleOptions.priceTiers` | `wholesaleOptions.priceTiers.${number}.priceFrom` | `supplierInfo.verified` | `printOnDemandOptions.printTechnologies` | `sizeGuides` | `sizeGuides.${number}.measurementUnit` | `tags.privateTags.tagIds`, 5>>;
|
|
2025
|
+
/**
|
|
2026
|
+
* Updates a product. Supports partial updates.
|
|
2027
|
+
*
|
|
2028
|
+
* Provider info fields (`providerInfo.productId` and `providerInfo.productCreatedDate`) are immutable and cannot be
|
|
2029
|
+
* changed after creation.
|
|
2030
|
+
* @param _id - Product ID.
|
|
2031
|
+
* @public
|
|
2032
|
+
* @documentationMaturity preview
|
|
2033
|
+
* @requiredField _id
|
|
2034
|
+
* @requiredField product
|
|
2035
|
+
* @requiredField product.directCategories._id
|
|
2036
|
+
* @requiredField product.directCategories.namespace
|
|
2037
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_UPDATE
|
|
2038
|
+
* @applicableIdentity APP
|
|
2039
|
+
* @returns Updated product.
|
|
2040
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.UpdateProduct
|
|
2041
|
+
*/
|
|
2042
|
+
declare function updateProduct(_id: string, product: NonNullablePaths<UpdateProduct, `directCategories.${number}._id` | `directCategories.${number}.namespace`, 4>): Promise<NonNullablePaths<Product, `media.items` | `types` | `options` | `options.${number}.name` | `orderProcessingTime.min.value` | `orderProcessingTime.min.unit` | `shippingDestinations` | `shippingDestinations.${number}.countrySelections` | `shippingDestinations.${number}.minimumShippingCost` | `directCategories` | `directCategories.${number}._id` | `directCategories.${number}.namespace` | `allCategories` | `wholesaleOptions.priceTiers` | `wholesaleOptions.priceTiers.${number}.priceFrom` | `supplierInfo.verified` | `printOnDemandOptions.printTechnologies` | `sizeGuides` | `sizeGuides.${number}.measurementUnit` | `tags.privateTags.tagIds`, 5>>;
|
|
2043
|
+
interface UpdateProduct {
|
|
2044
|
+
/**
|
|
2045
|
+
* Product ID.
|
|
2046
|
+
* @format GUID
|
|
2047
|
+
* @readonly
|
|
2048
|
+
*/
|
|
2049
|
+
_id?: string | null;
|
|
2050
|
+
/**
|
|
2051
|
+
* Date and time the product was created.
|
|
2052
|
+
* @readonly
|
|
2053
|
+
*/
|
|
2054
|
+
_createdDate?: Date | null;
|
|
2055
|
+
/**
|
|
2056
|
+
* Date and time the product was updated.
|
|
2057
|
+
* @readonly
|
|
2058
|
+
*/
|
|
2059
|
+
_updatedDate?: Date | null;
|
|
2060
|
+
/** Information about the business partner providing this product. */
|
|
2061
|
+
providerInfo?: ProviderInfo;
|
|
2062
|
+
/**
|
|
2063
|
+
* Product name.
|
|
2064
|
+
* @minLength 1
|
|
2065
|
+
* @maxLength 100
|
|
2066
|
+
*/
|
|
2067
|
+
name?: string | null;
|
|
2068
|
+
/**
|
|
2069
|
+
* Product description.
|
|
2070
|
+
* @maxLength 64000
|
|
2071
|
+
*/
|
|
2072
|
+
description?: string | null;
|
|
2073
|
+
/**
|
|
2074
|
+
* Whether the product is visible in the Marketplace.
|
|
2075
|
+
*
|
|
2076
|
+
* Default: `true`
|
|
2077
|
+
*/
|
|
2078
|
+
visible?: boolean | null;
|
|
2079
|
+
/** Product media. */
|
|
2080
|
+
media?: Media;
|
|
2081
|
+
/**
|
|
2082
|
+
* Business model types this product supports.
|
|
2083
|
+
* @minSize 1
|
|
2084
|
+
* @maxSize 2
|
|
2085
|
+
*/
|
|
2086
|
+
types?: ProductTypeWithLiterals[];
|
|
2087
|
+
/**
|
|
2088
|
+
* Product options that customers can choose from.
|
|
2089
|
+
*
|
|
2090
|
+
* Options display available product variations like size and color to help buyers make purchase decisions.
|
|
2091
|
+
* Currently, options are informational only and don't create separate inventory items or variants.
|
|
2092
|
+
*
|
|
2093
|
+
* There are 2 predefined option types you can use:
|
|
2094
|
+
* - `color`: Color choices for the product. Values should be standard color names. For example, `"Black"`, `"White"`, `"Yellow"`.
|
|
2095
|
+
* - `size`: Size choices for the product. Values should be standard size labels. For example, `"S"`, `"M"`, `"L"`, `"XL"`.
|
|
2096
|
+
* @maxSize 6
|
|
2097
|
+
*/
|
|
2098
|
+
options?: ProductOption[];
|
|
2099
|
+
/**
|
|
2100
|
+
* Promotional ribbon text displayed on the product.
|
|
2101
|
+
*
|
|
2102
|
+
* For example, `"New Arrival"` or `"Bestseller"`.
|
|
2103
|
+
* @minLength 1
|
|
2104
|
+
* @maxLength 30
|
|
2105
|
+
*/
|
|
2106
|
+
ribbonName?: string | null;
|
|
2107
|
+
/**
|
|
2108
|
+
* Brand name.
|
|
2109
|
+
* @minLength 1
|
|
2110
|
+
* @maxLength 50
|
|
2111
|
+
*/
|
|
2112
|
+
brand?: string | null;
|
|
2113
|
+
/** Time required to process orders before shipping. */
|
|
2114
|
+
orderProcessingTime?: TimeInterval;
|
|
2115
|
+
/**
|
|
2116
|
+
* Countries and regions where this product can be shipped, with location-specific pricing and timing.
|
|
2117
|
+
* @maxSize 100
|
|
2118
|
+
*/
|
|
2119
|
+
shippingDestinations?: ShippingDestination[];
|
|
2120
|
+
/**
|
|
2121
|
+
* Minimum price, in USD.
|
|
2122
|
+
* @decimalValue options { gte:0, lte:999999999, maxScale:2 }
|
|
2123
|
+
*/
|
|
2124
|
+
minimumPrice?: string | null;
|
|
2125
|
+
/**
|
|
2126
|
+
* Country where the product is manufactured or originates from, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
|
|
2127
|
+
* @format COUNTRY
|
|
2128
|
+
*/
|
|
2129
|
+
productOrigin?: string | null;
|
|
2130
|
+
/**
|
|
2131
|
+
* List of categories that directly contain this product.
|
|
2132
|
+
*
|
|
2133
|
+
* Each category's namespace must match at least one of the product's types.
|
|
2134
|
+
* For example, if a product has type `DROPSHIPPING`, its categories must use `DROPSHIPPING_NAMESPACE`.
|
|
2135
|
+
* Products with both `DROPSHIPPING` and `WHOLESALE` types can have categories from both namespaces.
|
|
2136
|
+
* @maxSize 50
|
|
2137
|
+
*/
|
|
2138
|
+
directCategories?: ProductCategory[];
|
|
2139
|
+
/**
|
|
2140
|
+
* List of categories that directly contain this product, as well as their parent categories.
|
|
2141
|
+
* @readonly
|
|
2142
|
+
* @maxSize 2000
|
|
2143
|
+
*/
|
|
2144
|
+
allCategories?: ProductCategory[];
|
|
2145
|
+
/**
|
|
2146
|
+
* Wholesale-specific configuration including tiered pricing and minimum order quantities.
|
|
2147
|
+
*
|
|
2148
|
+
* Required when `types` includes `WHOLESALE`.
|
|
2149
|
+
*/
|
|
2150
|
+
wholesaleOptions?: WholesaleOptions;
|
|
2151
|
+
/** Information about the supplier including name, rating, and trust status. */
|
|
2152
|
+
supplierInfo?: SupplierInfo;
|
|
2153
|
+
/**
|
|
2154
|
+
* Print-on-demand-specific configuration including supported print technologies and mockup assets.
|
|
2155
|
+
*
|
|
2156
|
+
* Required when `types` include `PRINT_ON_DEMAND`.
|
|
2157
|
+
*/
|
|
2158
|
+
printOnDemandOptions?: PrintOnDemandOptions;
|
|
2159
|
+
/**
|
|
2160
|
+
* Information about the product sizing
|
|
2161
|
+
* @maxSize 5
|
|
2162
|
+
*/
|
|
2163
|
+
sizeGuides?: SizeGuide[];
|
|
2164
|
+
/** Product tags for organization and filtering. */
|
|
2165
|
+
tags?: Tags;
|
|
2166
|
+
}
|
|
2167
|
+
/**
|
|
2168
|
+
* Deletes a product permanently from the Marketplace.
|
|
2169
|
+
*
|
|
2170
|
+
* This action cannot be undone. The product will no longer be available for store owners to add to their stores.
|
|
2171
|
+
* @param productId - Product ID.
|
|
2172
|
+
* @public
|
|
2173
|
+
* @documentationMaturity preview
|
|
2174
|
+
* @requiredField productId
|
|
2175
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_DELETE
|
|
2176
|
+
* @applicableIdentity APP
|
|
2177
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.DeleteProduct
|
|
2178
|
+
*/
|
|
2179
|
+
declare function deleteProduct(productId: string): Promise<void>;
|
|
2180
|
+
/**
|
|
2181
|
+
* Creates multiple products in a single request.
|
|
2182
|
+
*
|
|
2183
|
+
* Supports partial success - some products may be created successfully while others fail.
|
|
2184
|
+
* Each result includes an `itemMetadata` object indicating success or failure with error details.
|
|
2185
|
+
*
|
|
2186
|
+
* When handling failures, distinguish between validation errors which shouldn't be retried,
|
|
2187
|
+
* and transient errors which can be retried. Only retry failed items, not the entire batch.
|
|
2188
|
+
* @param products - Products to create. Each must include all required fields for the specified product types.
|
|
2189
|
+
* @public
|
|
2190
|
+
* @documentationMaturity preview
|
|
2191
|
+
* @requiredField products
|
|
2192
|
+
* @requiredField products.directCategories._id
|
|
2193
|
+
* @requiredField products.directCategories.namespace
|
|
2194
|
+
* @requiredField products.media
|
|
2195
|
+
* @requiredField products.minimumPrice
|
|
2196
|
+
* @requiredField products.name
|
|
2197
|
+
* @requiredField products.options.name
|
|
2198
|
+
* @requiredField products.options.values
|
|
2199
|
+
* @requiredField products.providerInfo
|
|
2200
|
+
* @requiredField products.providerInfo.productId
|
|
2201
|
+
* @requiredField products.shippingDestinations.minimumShippingCost
|
|
2202
|
+
* @requiredField products.types
|
|
2203
|
+
* @requiredField products.wholesaleOptions.priceTiers.countFrom
|
|
2204
|
+
* @requiredField products.wholesaleOptions.priceTiers.priceFrom
|
|
2205
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_CREATE
|
|
2206
|
+
* @applicableIdentity APP
|
|
2207
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkCreateProducts
|
|
2208
|
+
*/
|
|
2209
|
+
declare function bulkCreateProducts(products: NonNullablePaths<Product, `directCategories.${number}._id` | `directCategories.${number}.namespace` | `media` | `minimumPrice` | `name` | `options.${number}.name` | `options.${number}.values` | `providerInfo` | `providerInfo.productId` | `shippingDestinations.${number}.minimumShippingCost` | `types` | `wholesaleOptions.priceTiers.${number}.countFrom` | `wholesaleOptions.priceTiers.${number}.priceFrom`, 5>[], options?: BulkCreateProductsOptions): Promise<NonNullablePaths<BulkCreateProductsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.supplierInfo.verified` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
2210
|
+
interface BulkCreateProductsOptions {
|
|
2211
|
+
/**
|
|
2212
|
+
* Whether to return the created products in the response.
|
|
2213
|
+
*
|
|
2214
|
+
* Default: `false`
|
|
2215
|
+
*/
|
|
2216
|
+
returnEntity?: boolean;
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Updates multiple products in a single request.
|
|
2220
|
+
*
|
|
2221
|
+
* Supports partial success and partial field updates. Each result includes an `itemMetadata` object indicating success or failure with error details.
|
|
2222
|
+
*
|
|
2223
|
+
* When handling failures, distinguish between validation errors which shouldn't be retried,
|
|
2224
|
+
* and transient errors which can be retried. Only retry failed items, not the entire batch.
|
|
2225
|
+
* @param products - Products to update. Each can be partial based on its field mask.
|
|
2226
|
+
* @public
|
|
2227
|
+
* @documentationMaturity preview
|
|
2228
|
+
* @requiredField products
|
|
2229
|
+
* @requiredField products.product._id
|
|
2230
|
+
* @requiredField products.product.directCategories._id
|
|
2231
|
+
* @requiredField products.product.directCategories.namespace
|
|
2232
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_UPDATE
|
|
2233
|
+
* @applicableIdentity APP
|
|
2234
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkUpdateProducts
|
|
2235
|
+
*/
|
|
2236
|
+
declare function bulkUpdateProducts(products: NonNullablePaths<MaskedProduct, `product._id` | `product.directCategories.${number}._id` | `product.directCategories.${number}.namespace`, 5>[], options?: BulkUpdateProductsOptions): Promise<NonNullablePaths<BulkUpdateProductsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.supplierInfo.verified` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
2237
|
+
interface BulkUpdateProductsOptions {
|
|
2238
|
+
/**
|
|
2239
|
+
* Whether to return the updated products in the response.
|
|
2240
|
+
*
|
|
2241
|
+
* Default: `false`
|
|
2242
|
+
*/
|
|
2243
|
+
returnEntity?: boolean;
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* Deletes multiple products permanently in a single request. Supports partial success.
|
|
2247
|
+
*
|
|
2248
|
+
* Each result includes an `itemMetadata` object indicating success or failure with error details.
|
|
2249
|
+
* When handling failures, distinguish between validation errors which shouldn't be retried,
|
|
2250
|
+
* and transient errors which can be retried. Only retry failed items, not the entire batch.
|
|
2251
|
+
* @param productIds - Product IDs to delete.
|
|
2252
|
+
* @public
|
|
2253
|
+
* @documentationMaturity preview
|
|
2254
|
+
* @requiredField productIds
|
|
2255
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_DELETE
|
|
2256
|
+
* @applicableIdentity APP
|
|
2257
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkDeleteProducts
|
|
2258
|
+
*/
|
|
2259
|
+
declare function bulkDeleteProducts(productIds: string[]): Promise<NonNullablePaths<BulkDeleteProductsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
2260
|
+
/**
|
|
2261
|
+
* Retrieves a list of products with filtering, sorting, and cursor-based pagination.
|
|
2262
|
+
*
|
|
2263
|
+
* Provides real-time, strongly consistent results with filtering, sorting, and pagination.
|
|
2264
|
+
*
|
|
2265
|
+
* Use Query Products when you need accurate, up-to-date data such as for operational tasks or inventory checks.
|
|
2266
|
+
* For product discovery and browsing with full-text search capabilities, use [Search Products](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/products/search-products) instead.
|
|
2267
|
+
* @public
|
|
2268
|
+
* @documentationMaturity preview
|
|
2269
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_READ
|
|
2270
|
+
* @applicableIdentity APP
|
|
2271
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.QueryProducts
|
|
2272
|
+
*/
|
|
2273
|
+
declare function queryProducts(): ProductsQueryBuilder;
|
|
2274
|
+
interface QueryCursorResult {
|
|
2275
|
+
cursors: CommonCursors;
|
|
2276
|
+
hasNext: () => boolean;
|
|
2277
|
+
hasPrev: () => boolean;
|
|
2278
|
+
length: number;
|
|
2279
|
+
pageSize: number;
|
|
2280
|
+
}
|
|
2281
|
+
interface ProductsQueryResult extends QueryCursorResult {
|
|
2282
|
+
items: Product[];
|
|
2283
|
+
query: ProductsQueryBuilder;
|
|
2284
|
+
next: () => Promise<ProductsQueryResult>;
|
|
2285
|
+
prev: () => Promise<ProductsQueryResult>;
|
|
2286
|
+
}
|
|
2287
|
+
interface ProductsQueryBuilder {
|
|
2288
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2289
|
+
* @param value - Value to compare against.
|
|
2290
|
+
* @documentationMaturity preview
|
|
2291
|
+
*/
|
|
2292
|
+
eq: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'visible' | 'brand' | 'minimumPrice' | 'inventory.tier' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating' | 'supplierInfo.verified', value: any) => ProductsQueryBuilder;
|
|
2293
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2294
|
+
* @param value - Value to compare against.
|
|
2295
|
+
* @documentationMaturity preview
|
|
2296
|
+
*/
|
|
2297
|
+
ne: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'visible' | 'brand' | 'minimumPrice' | 'inventory.tier' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating' | 'supplierInfo.verified', value: any) => ProductsQueryBuilder;
|
|
2298
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2299
|
+
* @param value - Value to compare against.
|
|
2300
|
+
* @documentationMaturity preview
|
|
2301
|
+
*/
|
|
2302
|
+
ge: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'brand' | 'minimumPrice' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating', value: any) => ProductsQueryBuilder;
|
|
2303
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2304
|
+
* @param value - Value to compare against.
|
|
2305
|
+
* @documentationMaturity preview
|
|
2306
|
+
*/
|
|
2307
|
+
gt: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'brand' | 'minimumPrice' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating', value: any) => ProductsQueryBuilder;
|
|
2308
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2309
|
+
* @param value - Value to compare against.
|
|
2310
|
+
* @documentationMaturity preview
|
|
2311
|
+
*/
|
|
2312
|
+
le: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'brand' | 'minimumPrice' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating', value: any) => ProductsQueryBuilder;
|
|
2313
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
2314
|
+
* @param value - Value to compare against.
|
|
2315
|
+
* @documentationMaturity preview
|
|
2316
|
+
*/
|
|
2317
|
+
lt: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'brand' | 'minimumPrice' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating', value: any) => ProductsQueryBuilder;
|
|
2318
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
2319
|
+
* @param string - String to compare against. Case-insensitive.
|
|
2320
|
+
* @documentationMaturity preview
|
|
2321
|
+
*/
|
|
2322
|
+
startsWith: (propertyName: '_id' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'brand' | 'minimumPrice' | 'productOrigin' | 'directCategories.id' | 'allCategories.id' | 'supplierInfo.id' | 'supplierInfo.rating', value: string) => ProductsQueryBuilder;
|
|
2323
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
2324
|
+
* @param values - List of values to compare against.
|
|
2325
|
+
* @documentationMaturity preview
|
|
2326
|
+
*/
|
|
2327
|
+
hasSome: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'visible' | 'brand' | 'minimumPrice' | 'inventory.tier' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating' | 'supplierInfo.verified', value: any[]) => ProductsQueryBuilder;
|
|
2328
|
+
/** @documentationMaturity preview */
|
|
2329
|
+
in: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'visible' | 'brand' | 'minimumPrice' | 'inventory.tier' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating' | 'supplierInfo.verified', value: any) => ProductsQueryBuilder;
|
|
2330
|
+
/** @documentationMaturity preview */
|
|
2331
|
+
exists: (propertyName: '_id' | '_createdDate' | 'providerInfo.appId' | 'providerInfo.productId' | 'name' | 'visible' | 'brand' | 'minimumPrice' | 'inventory.tier' | 'productOrigin' | 'directCategories.id' | 'directCategories.index' | 'allCategories.id' | 'allCategories.index' | 'wholesaleOptions.minimumOrderQuantity' | 'supplierInfo.id' | 'supplierInfo.rating' | 'supplierInfo.verified', value: boolean) => ProductsQueryBuilder;
|
|
2332
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
2333
|
+
* @documentationMaturity preview
|
|
2334
|
+
*/
|
|
2335
|
+
ascending: (...propertyNames: Array<'_createdDate' | 'minimumPrice' | 'directCategories.index' | 'allCategories.index' | 'supplierInfo.rating'>) => ProductsQueryBuilder;
|
|
2336
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
2337
|
+
* @documentationMaturity preview
|
|
2338
|
+
*/
|
|
2339
|
+
descending: (...propertyNames: Array<'_createdDate' | 'minimumPrice' | 'directCategories.index' | 'allCategories.index' | 'supplierInfo.rating'>) => ProductsQueryBuilder;
|
|
2340
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
2341
|
+
* @documentationMaturity preview
|
|
2342
|
+
*/
|
|
2343
|
+
limit: (limit: number) => ProductsQueryBuilder;
|
|
2344
|
+
/** @param cursor - A pointer to specific record
|
|
2345
|
+
* @documentationMaturity preview
|
|
2346
|
+
*/
|
|
2347
|
+
skipTo: (cursor: string) => ProductsQueryBuilder;
|
|
2348
|
+
/** @documentationMaturity preview */
|
|
2349
|
+
find: () => Promise<ProductsQueryResult>;
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* @hidden
|
|
2353
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.QueryProducts
|
|
2354
|
+
* @requiredField query
|
|
2355
|
+
*/
|
|
2356
|
+
declare function typedQueryProducts(query: ProductQuery): Promise<NonNullablePaths<QueryProductsResponse, `products` | `products.${number}.orderProcessingTime.min.value` | `products.${number}.orderProcessingTime.min.unit` | `products.${number}.supplierInfo.verified`, 6>>;
|
|
2357
|
+
interface ProductQuerySpec extends QuerySpec {
|
|
2358
|
+
paging: 'cursor';
|
|
2359
|
+
wql: [
|
|
2360
|
+
{
|
|
2361
|
+
fields: [
|
|
2362
|
+
'allCategories',
|
|
2363
|
+
'directCategories',
|
|
2364
|
+
'options',
|
|
2365
|
+
'options.values',
|
|
2366
|
+
'shippingDestinations'
|
|
2367
|
+
];
|
|
2368
|
+
operators: ['$matchItems'];
|
|
2369
|
+
sort: 'NONE';
|
|
2370
|
+
},
|
|
2371
|
+
{
|
|
2372
|
+
fields: ['printOnDemandOptions.printTechnologies', 'types'];
|
|
2373
|
+
operators: ['$hasAll', '$hasSome'];
|
|
2374
|
+
sort: 'NONE';
|
|
2375
|
+
},
|
|
2376
|
+
{
|
|
2377
|
+
fields: [
|
|
2378
|
+
'_id',
|
|
2379
|
+
'brand',
|
|
2380
|
+
'inventory.tier',
|
|
2381
|
+
'name',
|
|
2382
|
+
'productOrigin',
|
|
2383
|
+
'providerInfo.appId',
|
|
2384
|
+
'providerInfo.productId',
|
|
2385
|
+
'supplierInfo._id',
|
|
2386
|
+
'supplierInfo.verified',
|
|
2387
|
+
'visible',
|
|
2388
|
+
'wholesaleOptions.minimumOrderQuantity'
|
|
2389
|
+
];
|
|
2390
|
+
operators: '*';
|
|
2391
|
+
sort: 'NONE';
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
fields: ['_createdDate', 'minimumPrice', 'supplierInfo.rating'];
|
|
2395
|
+
operators: '*';
|
|
2396
|
+
sort: 'BOTH';
|
|
2397
|
+
}
|
|
2398
|
+
];
|
|
2399
|
+
}
|
|
2400
|
+
type CommonQueryWithEntityContext = Query<Product, ProductQuerySpec>;
|
|
2401
|
+
type ProductQuery = {
|
|
2402
|
+
/**
|
|
2403
|
+
Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.
|
|
2404
|
+
*/
|
|
2405
|
+
cursorPaging?: {
|
|
2406
|
+
/**
|
|
2407
|
+
Maximum number of items to return in the results.
|
|
2408
|
+
@max: 100
|
|
2409
|
+
*/
|
|
2410
|
+
limit?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit'] | null;
|
|
2411
|
+
/**
|
|
2412
|
+
Pointer to the next or previous page in the list of results.
|
|
2413
|
+
|
|
2414
|
+
Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
2415
|
+
Not relevant for the first request.
|
|
2416
|
+
@maxLength: 16000
|
|
2417
|
+
*/
|
|
2418
|
+
cursor?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor'] | null;
|
|
2419
|
+
};
|
|
2420
|
+
/**
|
|
2421
|
+
Filter object in the following format:
|
|
2422
|
+
`"filter" : {
|
|
2423
|
+
"fieldName1": "value1",
|
|
2424
|
+
"fieldName2":{"$operator":"value2"}
|
|
2425
|
+
}`
|
|
2426
|
+
Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
2427
|
+
*/
|
|
2428
|
+
filter?: CommonQueryWithEntityContext['filter'] | null;
|
|
2429
|
+
/**
|
|
2430
|
+
Sort object in the following format:
|
|
2431
|
+
`[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
2432
|
+
@maxSize: 5
|
|
2433
|
+
*/
|
|
2434
|
+
sort?: {
|
|
2435
|
+
/**
|
|
2436
|
+
Name of the field to sort by.
|
|
2437
|
+
@maxLength: 512
|
|
2438
|
+
*/
|
|
2439
|
+
fieldName?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['fieldName'];
|
|
2440
|
+
/**
|
|
2441
|
+
Sort order.
|
|
2442
|
+
*/
|
|
2443
|
+
order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
|
|
2444
|
+
/**
|
|
2445
|
+
Filters to specify which element to use for sorting when `fieldName` refers to a repeated field marked as `MATCH_ITEMS`.
|
|
2446
|
+
|
|
2447
|
+
These filters ensure the correct element is selected from the collection for sorting. Multiple filters are combined using the `AND` operator.
|
|
2448
|
+
|
|
2449
|
+
For example, for a document like `{"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}`,
|
|
2450
|
+
if `nestedField` is marked as `MATCH_ITEMS`, sorting by price in the US region requires:
|
|
2451
|
+
`{fieldName: "nestedField.price", "selectItemsBy": [{"nestedField.region": "US"}]}`.
|
|
2452
|
+
@maxSize: 10
|
|
2453
|
+
*/
|
|
2454
|
+
selectItemsBy?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['selectItemsBy'] | null;
|
|
2455
|
+
}[];
|
|
2456
|
+
};
|
|
2457
|
+
declare const utils: {
|
|
2458
|
+
query: {
|
|
2459
|
+
QueryBuilder: () => _wix_sdk_types.QueryBuilder<Product, ProductQuerySpec, ProductQuery>;
|
|
2460
|
+
Filter: _wix_sdk_types.FilterFactory<Product, ProductQuerySpec>;
|
|
2461
|
+
Sort: _wix_sdk_types.SortFactory<ProductQuerySpec>;
|
|
2462
|
+
};
|
|
2463
|
+
search: {
|
|
2464
|
+
SearchBuilder: () => _wix_sdk_types.SearchBuilder<Product, ProductSearchSpec, ProductSearch>;
|
|
2465
|
+
Filter: _wix_sdk_types.FilterFactory<Product, ProductSearchSpec>;
|
|
2466
|
+
Sort: _wix_sdk_types.SortFactory<ProductSearchSpec>;
|
|
2467
|
+
SearchParams: _wix_sdk_types.SearchParamsFactory<ProductSearchSpec>;
|
|
2468
|
+
Aggregation: _wix_sdk_types.AggregationFactory<ProductSearchSpec>;
|
|
2469
|
+
};
|
|
2470
|
+
};
|
|
2471
|
+
interface ProductSearchSpec extends SearchSpec {
|
|
2472
|
+
searchable: ['brand', 'description', 'name'];
|
|
2473
|
+
aggregatable: [
|
|
2474
|
+
'_createdDate',
|
|
2475
|
+
'_id',
|
|
2476
|
+
'allCategories',
|
|
2477
|
+
'allCategories._id',
|
|
2478
|
+
'allCategories.index',
|
|
2479
|
+
'brand',
|
|
2480
|
+
'directCategories',
|
|
2481
|
+
'directCategories._id',
|
|
2482
|
+
'directCategories.index',
|
|
2483
|
+
'inventory.tier',
|
|
2484
|
+
'minimumPrice',
|
|
2485
|
+
'name',
|
|
2486
|
+
'options',
|
|
2487
|
+
'options.values',
|
|
2488
|
+
'printOnDemandOptions.printTechnologies',
|
|
2489
|
+
'productOrigin',
|
|
2490
|
+
'providerInfo.appId',
|
|
2491
|
+
'providerInfo.productId',
|
|
2492
|
+
'shippingDestinations',
|
|
2493
|
+
'supplierInfo._id',
|
|
2494
|
+
'supplierInfo.rating',
|
|
2495
|
+
'supplierInfo.verified',
|
|
2496
|
+
'types',
|
|
2497
|
+
'visible',
|
|
2498
|
+
'wholesaleOptions.minimumOrderQuantity'
|
|
2499
|
+
];
|
|
2500
|
+
paging: 'cursor';
|
|
2501
|
+
wql: [
|
|
2502
|
+
{
|
|
2503
|
+
operators: ['$matchItems'];
|
|
2504
|
+
fields: [
|
|
2505
|
+
'allCategories',
|
|
2506
|
+
'directCategories',
|
|
2507
|
+
'options',
|
|
2508
|
+
'options.values',
|
|
2509
|
+
'shippingDestinations'
|
|
2510
|
+
];
|
|
2511
|
+
sort: 'NONE';
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
operators: ['$hasAll', '$hasSome'];
|
|
2515
|
+
fields: ['printOnDemandOptions.printTechnologies', 'types'];
|
|
2516
|
+
sort: 'NONE';
|
|
2517
|
+
},
|
|
2518
|
+
{
|
|
2519
|
+
operators: '*';
|
|
2520
|
+
fields: [
|
|
2521
|
+
'_id',
|
|
2522
|
+
'brand',
|
|
2523
|
+
'inventory.tier',
|
|
2524
|
+
'name',
|
|
2525
|
+
'productOrigin',
|
|
2526
|
+
'providerInfo.appId',
|
|
2527
|
+
'providerInfo.productId',
|
|
2528
|
+
'supplierInfo._id',
|
|
2529
|
+
'supplierInfo.verified',
|
|
2530
|
+
'visible',
|
|
2531
|
+
'wholesaleOptions.minimumOrderQuantity'
|
|
2532
|
+
];
|
|
2533
|
+
sort: 'NONE';
|
|
2534
|
+
},
|
|
2535
|
+
{
|
|
2536
|
+
operators: '*';
|
|
2537
|
+
fields: ['_createdDate', 'minimumPrice', 'supplierInfo.rating'];
|
|
2538
|
+
sort: 'BOTH';
|
|
2539
|
+
}
|
|
2540
|
+
];
|
|
2541
|
+
}
|
|
2542
|
+
type CommonSearchWithEntityContext = Search<Product, ProductSearchSpec>;
|
|
2543
|
+
type ProductSearch = {
|
|
2544
|
+
/**
|
|
2545
|
+
Cursor pointing to page of results.
|
|
2546
|
+
When requesting 'cursor_paging.cursor', no `filter`, `sort` or `search` can be provided.
|
|
2547
|
+
*/
|
|
2548
|
+
cursorPaging?: {
|
|
2549
|
+
/**
|
|
2550
|
+
Maximum number of items to return in the results.
|
|
2551
|
+
@max: 100
|
|
2552
|
+
*/
|
|
2553
|
+
limit?: NonNullable<CommonSearchWithEntityContext['cursorPaging']>['limit'] | null;
|
|
2554
|
+
/**
|
|
2555
|
+
Pointer to the next or previous page in the list of results.
|
|
2556
|
+
|
|
2557
|
+
Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
2558
|
+
Not relevant for the first request.
|
|
2559
|
+
@maxLength: 16000
|
|
2560
|
+
*/
|
|
2561
|
+
cursor?: NonNullable<CommonSearchWithEntityContext['cursorPaging']>['cursor'] | null;
|
|
2562
|
+
};
|
|
2563
|
+
/**
|
|
2564
|
+
A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf)
|
|
2565
|
+
*/
|
|
2566
|
+
filter?: CommonSearchWithEntityContext['filter'] | null;
|
|
2567
|
+
/**
|
|
2568
|
+
Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]
|
|
2569
|
+
@maxSize: 10
|
|
2570
|
+
*/
|
|
2571
|
+
sort?: {
|
|
2572
|
+
/**
|
|
2573
|
+
Name of the field to sort by.
|
|
2574
|
+
@maxLength: 512
|
|
2575
|
+
*/
|
|
2576
|
+
fieldName?: NonNullable<CommonSearchWithEntityContext['sort']>[number]['fieldName'];
|
|
2577
|
+
/**
|
|
2578
|
+
Sort order.
|
|
2579
|
+
*/
|
|
2580
|
+
order?: NonNullable<CommonSearchWithEntityContext['sort']>[number]['order'];
|
|
2581
|
+
/**
|
|
2582
|
+
Filters to specify which element to use for sorting when `fieldName` refers to a repeated field marked as `MATCH_ITEMS`.
|
|
2583
|
+
|
|
2584
|
+
These filters ensure the correct element is selected from the collection for sorting. Multiple filters are combined using the `AND` operator.
|
|
2585
|
+
|
|
2586
|
+
For example, for a document like `{"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}`,
|
|
2587
|
+
if `nestedField` is marked as `MATCH_ITEMS`, sorting by price in the US region requires:
|
|
2588
|
+
`{fieldName: "nestedField.price", "selectItemsBy": [{"nestedField.region": "US"}]}`.
|
|
2589
|
+
@maxSize: 10
|
|
2590
|
+
*/
|
|
2591
|
+
selectItemsBy?: NonNullable<CommonSearchWithEntityContext['sort']>[number]['selectItemsBy'] | null;
|
|
2592
|
+
}[];
|
|
2593
|
+
/**
|
|
2594
|
+
Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.
|
|
2595
|
+
@maxSize: 10
|
|
2596
|
+
*/
|
|
2597
|
+
aggregations?: {
|
|
2598
|
+
/**
|
|
2599
|
+
Value aggregation
|
|
2600
|
+
*/
|
|
2601
|
+
value?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['value'];
|
|
2602
|
+
/**
|
|
2603
|
+
Range aggregation
|
|
2604
|
+
*/
|
|
2605
|
+
range?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['range'];
|
|
2606
|
+
/**
|
|
2607
|
+
Scalar aggregation
|
|
2608
|
+
*/
|
|
2609
|
+
scalar?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['scalar'];
|
|
2610
|
+
/**
|
|
2611
|
+
Date histogram aggregation
|
|
2612
|
+
*/
|
|
2613
|
+
dateHistogram?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['dateHistogram'];
|
|
2614
|
+
/**
|
|
2615
|
+
Nested aggregation
|
|
2616
|
+
*/
|
|
2617
|
+
nested?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['nested'];
|
|
2618
|
+
/**
|
|
2619
|
+
User-defined name of aggregation, should be unique, will appear in aggregation results
|
|
2620
|
+
@maxLength: 100
|
|
2621
|
+
*/
|
|
2622
|
+
name?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['name'] | null;
|
|
2623
|
+
/**
|
|
2624
|
+
Type of aggregation, client must provide matching aggregation field below
|
|
2625
|
+
*/
|
|
2626
|
+
type?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['type'];
|
|
2627
|
+
/**
|
|
2628
|
+
Field to aggregate by, use dot notation to specify json path
|
|
2629
|
+
@maxLength: 200
|
|
2630
|
+
*/
|
|
2631
|
+
fieldPath?: NonNullable<CommonSearchWithEntityContext['aggregations']>[number]['fieldPath'];
|
|
2632
|
+
}[];
|
|
2633
|
+
/**
|
|
2634
|
+
Free text to match in searchable fields
|
|
2635
|
+
*/
|
|
2636
|
+
search?: {
|
|
2637
|
+
/**
|
|
2638
|
+
Search term or expression
|
|
2639
|
+
@maxLength: 100
|
|
2640
|
+
*/
|
|
2641
|
+
expression?: NonNullable<CommonSearchWithEntityContext['search']>['expression'] | null;
|
|
2642
|
+
};
|
|
2643
|
+
/**
|
|
2644
|
+
UTC offset or IANA time zone. Valid values are
|
|
2645
|
+
ISO 8601 UTC offsets, such as +02:00 or -06:00,
|
|
2646
|
+
and IANA time zone IDs, such as Europe/Rome
|
|
2647
|
+
|
|
2648
|
+
Affects all filters and aggregations returned values.
|
|
2649
|
+
You may override this behavior in a specific filter by providing
|
|
2650
|
+
timestamps including time zone. e.g. `"2023-12-20T10:52:34.795Z"`
|
|
2651
|
+
@maxLength: 50
|
|
2652
|
+
*/
|
|
2653
|
+
timeZone?: CommonSearchWithEntityContext['timeZone'] | null;
|
|
2654
|
+
};
|
|
2655
|
+
/**
|
|
2656
|
+
* Updates tags on multiple products by product IDs.
|
|
2657
|
+
*
|
|
2658
|
+
* A tag that appears both in the list of assign and unassign tags, will be assigned
|
|
2659
|
+
* @param productIds - Product IDs to update tags for.
|
|
2660
|
+
* @public
|
|
2661
|
+
* @documentationMaturity preview
|
|
2662
|
+
* @requiredField productIds
|
|
2663
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_UPDATE_TAGS
|
|
2664
|
+
* @applicableIdentity APP
|
|
2665
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkUpdateProductTags
|
|
2666
|
+
*/
|
|
2667
|
+
declare function bulkUpdateProductTags(productIds: string[], options?: BulkUpdateProductTagsOptions): Promise<NonNullablePaths<BulkUpdateProductTagsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6> & {
|
|
2668
|
+
__applicationErrorsType?: BulkUpdateProductTagsApplicationErrors;
|
|
2669
|
+
}>;
|
|
2670
|
+
interface BulkUpdateProductTagsOptions {
|
|
2671
|
+
/** Tags to assign to the products. */
|
|
2672
|
+
assignTags?: Tags;
|
|
2673
|
+
/** Tags to remove from the products. */
|
|
2674
|
+
unassignTags?: Tags;
|
|
2675
|
+
}
|
|
2676
|
+
/**
|
|
2677
|
+
* Updates tags on multiple products matching a filter.
|
|
2678
|
+
*
|
|
2679
|
+
* This operation runs asynchronously because it can potentially affect thousands of products.
|
|
2680
|
+
* The response includes a `jobId` for tracking the operation's progress.
|
|
2681
|
+
*
|
|
2682
|
+
* An empty filter updates all products. If a tag appears in both assign and unassign lists, it will be assigned.
|
|
2683
|
+
* @param filter - Filter to select products for tag updates. Empty filter updates all products.
|
|
2684
|
+
* @public
|
|
2685
|
+
* @documentationMaturity preview
|
|
2686
|
+
* @requiredField filter
|
|
2687
|
+
* @permissionId SUPPLIERS_HUB.PRODUCT_UPDATE_TAGS
|
|
2688
|
+
* @applicableIdentity APP
|
|
2689
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkUpdateProductTagsByFilter
|
|
2690
|
+
*/
|
|
2691
|
+
declare function bulkUpdateProductTagsByFilter(filter: Record<string, any>, options?: BulkUpdateProductTagsByFilterOptions): Promise<NonNullablePaths<BulkUpdateProductTagsByFilterResponse, `jobId`, 2> & {
|
|
2692
|
+
__applicationErrorsType?: BulkUpdateProductTagsByFilterApplicationErrors;
|
|
2693
|
+
}>;
|
|
2694
|
+
interface BulkUpdateProductTagsByFilterOptions {
|
|
2695
|
+
/** Tags to assign to matching products. */
|
|
2696
|
+
assignTags?: Tags;
|
|
2697
|
+
/** Tags to remove from matching products. */
|
|
2698
|
+
unassignTags?: Tags;
|
|
2699
|
+
}
|
|
2700
|
+
/**
|
|
2701
|
+
* Queries categories using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
2702
|
+
*
|
|
2703
|
+
* Supports filtering, sorting, and pagination.
|
|
2704
|
+
* @public
|
|
2705
|
+
* @documentationMaturity preview
|
|
2706
|
+
* @requiredField options.namespace
|
|
2707
|
+
* @permissionId SUPPLIERS_HUB.CATEGORY_READ
|
|
2708
|
+
* @applicableIdentity APP
|
|
2709
|
+
* @fqn wix.suppliershub.marketplace.product.v1.MarketplaceProduct.QueryCategories
|
|
2710
|
+
*/
|
|
2711
|
+
declare function queryCategories(options?: NonNullablePaths<QueryCategoriesOptions, `namespace`, 2>): Promise<NonNullablePaths<QueryCategoriesResponse, `categories` | `categories.${number}.itemCount`, 4>>;
|
|
2712
|
+
interface QueryCategoriesOptions {
|
|
2713
|
+
/** Query parameters including filter, sort, and paging options. */
|
|
2714
|
+
query?: CursorQuery;
|
|
2715
|
+
/** The namespace this category belongs to. */
|
|
2716
|
+
namespace: CategoryNamespaceWithLiterals;
|
|
2717
|
+
/** Whether non visible categories should be included in the response. Default is `false`. */
|
|
2718
|
+
returnNonVisibleCategories?: boolean;
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
export { type ShippingDestination as $, MissingValues as A, type BulkCreateProductsOptions as B, CountrySelections as C, ScalarType as D, Interval as E, AggregationType as F, Mode as G, SortOrder as H, InventoryTier as I, type ProviderInfo as J, type Media as K, type FocalPoint as L, type MaskedProduct as M, NestedAggregationType as N, type ProductOption as O, type Product as P, type QueryCategoriesOptions as Q, RequestedField as R, type SearchProductsResponse as S, TimeUnit as T, type UpdateProduct as U, type OptionValue as V, WebhookIdentityType as W, type OptionValueValueOneOf as X, type ColorOption as Y, type TimeInterval as Z, type TimeValue as _, type BulkCreateProductsResponse as a, type RangeResults as a$, type ShippingDestinationCountriesOptionsOneOf as a0, type Countries as a1, type Inventory as a2, type ProductCategory as a3, type WholesaleOptions as a4, type PriceTier as a5, type SupplierInfo as a6, type PrintOnDemandOptions as a7, type SizeGuide as a8, type Specification as a9, type CommonSorting as aA, type CommonCursorPaging as aB, type QueryProductsResponse as aC, type CommonCursorPagingMetadata as aD, type CommonCursors as aE, type SearchProductsRequest as aF, type CursorSearch as aG, type CursorSearchPagingMethodOneOf as aH, type Aggregation as aI, type AggregationKindOneOf as aJ, type RangeBucket as aK, type IncludeMissingValuesOptions as aL, type ValueAggregation as aM, type ValueAggregationOptionsOneOf as aN, type RangeAggregation as aO, type ScalarAggregation as aP, type DateHistogramAggregation as aQ, type NestedAggregationItem as aR, type NestedAggregationItemKindOneOf as aS, type NestedAggregation as aT, type SearchDetails as aU, type AggregationData as aV, type ValueAggregationResult as aW, type RangeAggregationResult as aX, type NestedAggregationResults as aY, type NestedAggregationResultsResultOneOf as aZ, type ValueResults as a_, type Measurement as aa, type MeasurementValueOneOf as ab, type MeasurementValueRange as ac, type Tags as ad, type TagList as ae, type TagsModified as af, type CreateProductRequest as ag, type CreateProductResponse as ah, type GetProductRequest as ai, type GetProductResponse as aj, type UpdateProductRequest as ak, type UpdateProductResponse as al, type DeleteProductRequest as am, type DeleteProductResponse as an, type BulkCreateProductsRequest as ao, type ItemMetadata as ap, type ApplicationError as aq, type BulkProductResult as ar, type BulkActionMetadata as as, type BulkUpdateProductsRequest as at, type BulkUpdateProductsResponseBulkProductResult as au, type BulkDeleteProductsRequest as av, type BulkDeleteProductsResponseBulkProductResult as aw, type QueryProductsRequest as ax, type CommonCursorQuery as ay, type CommonCursorQueryPagingMethodOneOf as az, type BulkUpdateProductsOptions as b, type NestedAggregationTypeWithLiterals as b$, type AggregationResultsScalarResult as b0, type NestedValueAggregationResult as b1, type ValueResult as b2, type RangeResult as b3, type ScalarResult as b4, type NestedResultValue as b5, type NestedResultValueResultOneOf as b6, type Results as b7, type DateHistogramResult as b8, type GroupByValueResults as b9, type EntityDeletedEvent as bA, type ActionEvent as bB, type Empty as bC, type MessageEnvelope as bD, type IdentificationData as bE, type IdentificationDataIdOneOf as bF, type AccountInfo as bG, type BaseEventMetadata as bH, type EventMetadata as bI, type AccountInfoMetadata as bJ, type ProductsQueryResult as bK, type ProductQuerySpec as bL, type ProductSearchSpec as bM, utils as bN, type ProductTypeWithLiterals as bO, type TimeUnitWithLiterals as bP, type CountrySelectionsWithLiterals as bQ, type InventoryTierWithLiterals as bR, type CategoryNamespaceWithLiterals as bS, type PrintTechnologyWithLiterals as bT, type MeasurementUnitWithLiterals as bU, type RequestedFieldWithLiterals as bV, type CommonSortOrderWithLiterals as bW, type SortTypeWithLiterals as bX, type SortDirectionWithLiterals as bY, type MissingValuesWithLiterals as bZ, type ScalarTypeWithLiterals as b_, type DateHistogramResults as ba, type NestedResults as bb, type AggregationResults as bc, type AggregationResultsResultOneOf as bd, type BulkUpdateProductTagsRequest as be, type BulkUpdateProductTagsResult as bf, type BulkUpdateProductTagsByFilterRequest as bg, type QueryCategoriesRequest as bh, type CursorQuery as bi, type CursorQueryPagingMethodOneOf as bj, type Sorting as bk, type CursorPaging as bl, type Category as bm, type Breadcrumb as bn, type ParentCategory as bo, type CursorPagingMetadata as bp, type Cursors as bq, type BulkAddProductsToStoreRequest as br, type ProductReference as bs, type BulkAddProductsToStoreResponse as bt, type BulkAddProductToStoreResult as bu, type DomainEvent as bv, type DomainEventBodyOneOf as bw, type EntityCreatedEvent as bx, type RestoreInfo as by, type EntityUpdatedEvent as bz, type BulkUpdateProductsResponse as c, type IntervalWithLiterals as c0, type AggregationTypeWithLiterals as c1, type ModeWithLiterals as c2, type SortOrderWithLiterals as c3, type WebhookIdentityTypeWithLiterals as c4, type CommonQueryWithEntityContext as c5, type CommonSearchWithEntityContext as c6, onProductCreated as c7, onProductDeleted as c8, onProductTagsModified as c9, onProductUpdated as ca, createProduct as cb, getProduct as cc, updateProduct as cd, deleteProduct as ce, bulkCreateProducts as cf, bulkUpdateProducts as cg, bulkDeleteProducts as ch, queryProducts as ci, bulkUpdateProductTags as cj, bulkUpdateProductTagsByFilter as ck, queryCategories as cl, type BulkDeleteProductsResponse as d, type ProductSearch as e, type BulkUpdateProductTagsOptions as f, type BulkUpdateProductTagsResponse as g, type BulkUpdateProductTagsApplicationErrors as h, type BulkUpdateProductTagsByFilterOptions as i, type BulkUpdateProductTagsByFilterResponse as j, type BulkUpdateProductTagsByFilterApplicationErrors as k, type QueryCategoriesResponse as l, type ProductCreatedEnvelope as m, type ProductDeletedEnvelope as n, type ProductTagsModifiedEnvelope as o, type ProductUpdatedEnvelope as p, type ProductsQueryBuilder as q, type ProductQuery as r, ProductType as s, typedQueryProducts as t, CategoryNamespace as u, PrintTechnology as v, MeasurementUnit as w, CommonSortOrder as x, SortType as y, SortDirection as z };
|