@wix/auto_sdk_stores_products-v-3 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 +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.context.js +127 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.http.js +5527 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.meta.js +522 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.public.js +690 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.types.js +886 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8300 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.universal.js +3404 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.context.js +40 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.http.js +5498 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.meta.js +470 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.public.js +577 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.types.js +882 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8300 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.universal.js +3350 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.context.js +127 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.http.js +5527 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.meta.js +522 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.public.js +690 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.types.js +886 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8320 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.universal.js +3404 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.context.js +40 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.http.js +5498 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.meta.js +470 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.public.js +577 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.types.js +882 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8320 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.universal.js +3350 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,3350 @@
|
|
|
1
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
2
|
+
import { queryBuilder } from '@wix/sdk-runtime/query-builder';
|
|
3
|
+
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
|
4
|
+
import * as ambassadorWixStoresCatalogV3Product from './stores-catalog-v3-product-products-v-3.http.js';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
|
|
7
|
+
import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
|
|
8
|
+
import { transformSDKVideoV2ToRESTVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
|
|
9
|
+
import { transformRESTVideoV2ToSDKVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
|
|
10
|
+
import { transformSDKPageURLV2ToRESTPageURLV2 } from '@wix/sdk-runtime/transformations/page-url-v2';
|
|
11
|
+
import { transformRESTPageURLV2ToSDKPageURLV2 } from '@wix/sdk-runtime/transformations/page-url-v2';
|
|
12
|
+
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
|
|
13
|
+
export var NodeType;
|
|
14
|
+
(function (NodeType) {
|
|
15
|
+
NodeType["PARAGRAPH"] = "PARAGRAPH";
|
|
16
|
+
NodeType["TEXT"] = "TEXT";
|
|
17
|
+
NodeType["HEADING"] = "HEADING";
|
|
18
|
+
NodeType["BULLETED_LIST"] = "BULLETED_LIST";
|
|
19
|
+
NodeType["ORDERED_LIST"] = "ORDERED_LIST";
|
|
20
|
+
NodeType["LIST_ITEM"] = "LIST_ITEM";
|
|
21
|
+
NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
|
|
22
|
+
NodeType["CODE_BLOCK"] = "CODE_BLOCK";
|
|
23
|
+
NodeType["VIDEO"] = "VIDEO";
|
|
24
|
+
NodeType["DIVIDER"] = "DIVIDER";
|
|
25
|
+
NodeType["FILE"] = "FILE";
|
|
26
|
+
NodeType["GALLERY"] = "GALLERY";
|
|
27
|
+
NodeType["GIF"] = "GIF";
|
|
28
|
+
NodeType["HTML"] = "HTML";
|
|
29
|
+
NodeType["IMAGE"] = "IMAGE";
|
|
30
|
+
NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
|
|
31
|
+
/** @deprecated */
|
|
32
|
+
NodeType["MAP"] = "MAP";
|
|
33
|
+
NodeType["POLL"] = "POLL";
|
|
34
|
+
NodeType["APP_EMBED"] = "APP_EMBED";
|
|
35
|
+
NodeType["BUTTON"] = "BUTTON";
|
|
36
|
+
NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
|
|
37
|
+
NodeType["TABLE"] = "TABLE";
|
|
38
|
+
NodeType["EMBED"] = "EMBED";
|
|
39
|
+
NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
|
|
40
|
+
NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
|
|
41
|
+
NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
|
|
42
|
+
NodeType["TABLE_CELL"] = "TABLE_CELL";
|
|
43
|
+
NodeType["TABLE_ROW"] = "TABLE_ROW";
|
|
44
|
+
NodeType["EXTERNAL"] = "EXTERNAL";
|
|
45
|
+
NodeType["AUDIO"] = "AUDIO";
|
|
46
|
+
NodeType["CAPTION"] = "CAPTION";
|
|
47
|
+
NodeType["LAYOUT"] = "LAYOUT";
|
|
48
|
+
NodeType["LAYOUT_CELL"] = "LAYOUT_CELL";
|
|
49
|
+
})(NodeType || (NodeType = {}));
|
|
50
|
+
export var WidthType;
|
|
51
|
+
(function (WidthType) {
|
|
52
|
+
/** Width matches the content width */
|
|
53
|
+
WidthType["CONTENT"] = "CONTENT";
|
|
54
|
+
/** Small Width */
|
|
55
|
+
WidthType["SMALL"] = "SMALL";
|
|
56
|
+
/** Width will match the original asset width */
|
|
57
|
+
WidthType["ORIGINAL"] = "ORIGINAL";
|
|
58
|
+
/** coast-to-coast display */
|
|
59
|
+
WidthType["FULL_WIDTH"] = "FULL_WIDTH";
|
|
60
|
+
})(WidthType || (WidthType = {}));
|
|
61
|
+
export var PluginContainerDataAlignment;
|
|
62
|
+
(function (PluginContainerDataAlignment) {
|
|
63
|
+
/** Center Alignment */
|
|
64
|
+
PluginContainerDataAlignment["CENTER"] = "CENTER";
|
|
65
|
+
/** Left Alignment */
|
|
66
|
+
PluginContainerDataAlignment["LEFT"] = "LEFT";
|
|
67
|
+
/** Right Alignment */
|
|
68
|
+
PluginContainerDataAlignment["RIGHT"] = "RIGHT";
|
|
69
|
+
})(PluginContainerDataAlignment || (PluginContainerDataAlignment = {}));
|
|
70
|
+
export var Type;
|
|
71
|
+
(function (Type) {
|
|
72
|
+
/** Regular link button */
|
|
73
|
+
Type["LINK"] = "LINK";
|
|
74
|
+
/** Triggers custom action that is defined in plugin configuration by the consumer */
|
|
75
|
+
Type["ACTION"] = "ACTION";
|
|
76
|
+
})(Type || (Type = {}));
|
|
77
|
+
export var Target;
|
|
78
|
+
(function (Target) {
|
|
79
|
+
/** Opens the linked document in the same frame as it was clicked (this is default) */
|
|
80
|
+
Target["SELF"] = "SELF";
|
|
81
|
+
/** Opens the linked document in a new window or tab */
|
|
82
|
+
Target["BLANK"] = "BLANK";
|
|
83
|
+
/** Opens the linked document in the parent frame */
|
|
84
|
+
Target["PARENT"] = "PARENT";
|
|
85
|
+
/** Opens the linked document in the full body of the window */
|
|
86
|
+
Target["TOP"] = "TOP";
|
|
87
|
+
})(Target || (Target = {}));
|
|
88
|
+
export var TextAlignment;
|
|
89
|
+
(function (TextAlignment) {
|
|
90
|
+
/** browser default, eqivalent to `initial` */
|
|
91
|
+
TextAlignment["AUTO"] = "AUTO";
|
|
92
|
+
/** Left align */
|
|
93
|
+
TextAlignment["LEFT"] = "LEFT";
|
|
94
|
+
/** Right align */
|
|
95
|
+
TextAlignment["RIGHT"] = "RIGHT";
|
|
96
|
+
/** Center align */
|
|
97
|
+
TextAlignment["CENTER"] = "CENTER";
|
|
98
|
+
/** Text is spaced to line up its left and right edges to the left and right edges of the line box, except for the last line */
|
|
99
|
+
TextAlignment["JUSTIFY"] = "JUSTIFY";
|
|
100
|
+
})(TextAlignment || (TextAlignment = {}));
|
|
101
|
+
export var LineStyle;
|
|
102
|
+
(function (LineStyle) {
|
|
103
|
+
/** Single Line */
|
|
104
|
+
LineStyle["SINGLE"] = "SINGLE";
|
|
105
|
+
/** Double Line */
|
|
106
|
+
LineStyle["DOUBLE"] = "DOUBLE";
|
|
107
|
+
/** Dashed Line */
|
|
108
|
+
LineStyle["DASHED"] = "DASHED";
|
|
109
|
+
/** Dotted Line */
|
|
110
|
+
LineStyle["DOTTED"] = "DOTTED";
|
|
111
|
+
})(LineStyle || (LineStyle = {}));
|
|
112
|
+
export var Width;
|
|
113
|
+
(function (Width) {
|
|
114
|
+
/** Large line */
|
|
115
|
+
Width["LARGE"] = "LARGE";
|
|
116
|
+
/** Medium line */
|
|
117
|
+
Width["MEDIUM"] = "MEDIUM";
|
|
118
|
+
/** Small line */
|
|
119
|
+
Width["SMALL"] = "SMALL";
|
|
120
|
+
})(Width || (Width = {}));
|
|
121
|
+
export var Alignment;
|
|
122
|
+
(function (Alignment) {
|
|
123
|
+
/** Center alignment */
|
|
124
|
+
Alignment["CENTER"] = "CENTER";
|
|
125
|
+
/** Left alignment */
|
|
126
|
+
Alignment["LEFT"] = "LEFT";
|
|
127
|
+
/** Right alignment */
|
|
128
|
+
Alignment["RIGHT"] = "RIGHT";
|
|
129
|
+
})(Alignment || (Alignment = {}));
|
|
130
|
+
export var ViewMode;
|
|
131
|
+
(function (ViewMode) {
|
|
132
|
+
/** No PDF view */
|
|
133
|
+
ViewMode["NONE"] = "NONE";
|
|
134
|
+
/** Full PDF view */
|
|
135
|
+
ViewMode["FULL"] = "FULL";
|
|
136
|
+
/** Mini PDF view */
|
|
137
|
+
ViewMode["MINI"] = "MINI";
|
|
138
|
+
})(ViewMode || (ViewMode = {}));
|
|
139
|
+
export var LayoutType;
|
|
140
|
+
(function (LayoutType) {
|
|
141
|
+
/** Collage type */
|
|
142
|
+
LayoutType["COLLAGE"] = "COLLAGE";
|
|
143
|
+
/** Masonry type */
|
|
144
|
+
LayoutType["MASONRY"] = "MASONRY";
|
|
145
|
+
/** Grid type */
|
|
146
|
+
LayoutType["GRID"] = "GRID";
|
|
147
|
+
/** Thumbnail type */
|
|
148
|
+
LayoutType["THUMBNAIL"] = "THUMBNAIL";
|
|
149
|
+
/** Slider type */
|
|
150
|
+
LayoutType["SLIDER"] = "SLIDER";
|
|
151
|
+
/** Slideshow type */
|
|
152
|
+
LayoutType["SLIDESHOW"] = "SLIDESHOW";
|
|
153
|
+
/** Panorama type */
|
|
154
|
+
LayoutType["PANORAMA"] = "PANORAMA";
|
|
155
|
+
/** Column type */
|
|
156
|
+
LayoutType["COLUMN"] = "COLUMN";
|
|
157
|
+
/** Magic type */
|
|
158
|
+
LayoutType["MAGIC"] = "MAGIC";
|
|
159
|
+
/** Fullsize images type */
|
|
160
|
+
LayoutType["FULLSIZE"] = "FULLSIZE";
|
|
161
|
+
})(LayoutType || (LayoutType = {}));
|
|
162
|
+
export var Orientation;
|
|
163
|
+
(function (Orientation) {
|
|
164
|
+
/** Rows Orientation */
|
|
165
|
+
Orientation["ROWS"] = "ROWS";
|
|
166
|
+
/** Columns Orientation */
|
|
167
|
+
Orientation["COLUMNS"] = "COLUMNS";
|
|
168
|
+
})(Orientation || (Orientation = {}));
|
|
169
|
+
export var Crop;
|
|
170
|
+
(function (Crop) {
|
|
171
|
+
/** Crop to fill */
|
|
172
|
+
Crop["FILL"] = "FILL";
|
|
173
|
+
/** Crop to fit */
|
|
174
|
+
Crop["FIT"] = "FIT";
|
|
175
|
+
})(Crop || (Crop = {}));
|
|
176
|
+
export var ThumbnailsAlignment;
|
|
177
|
+
(function (ThumbnailsAlignment) {
|
|
178
|
+
/** Top alignment */
|
|
179
|
+
ThumbnailsAlignment["TOP"] = "TOP";
|
|
180
|
+
/** Right alignment */
|
|
181
|
+
ThumbnailsAlignment["RIGHT"] = "RIGHT";
|
|
182
|
+
/** Bottom alignment */
|
|
183
|
+
ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
|
|
184
|
+
/** Left alignment */
|
|
185
|
+
ThumbnailsAlignment["LEFT"] = "LEFT";
|
|
186
|
+
/** No thumbnail */
|
|
187
|
+
ThumbnailsAlignment["NONE"] = "NONE";
|
|
188
|
+
})(ThumbnailsAlignment || (ThumbnailsAlignment = {}));
|
|
189
|
+
export var GIFType;
|
|
190
|
+
(function (GIFType) {
|
|
191
|
+
GIFType["GIF"] = "GIF";
|
|
192
|
+
GIFType["STICKER"] = "STICKER";
|
|
193
|
+
})(GIFType || (GIFType = {}));
|
|
194
|
+
export var Source;
|
|
195
|
+
(function (Source) {
|
|
196
|
+
Source["HTML"] = "HTML";
|
|
197
|
+
Source["ADSENSE"] = "ADSENSE";
|
|
198
|
+
})(Source || (Source = {}));
|
|
199
|
+
export var MapType;
|
|
200
|
+
(function (MapType) {
|
|
201
|
+
/** Roadmap map type */
|
|
202
|
+
MapType["ROADMAP"] = "ROADMAP";
|
|
203
|
+
/** Satellite map type */
|
|
204
|
+
MapType["SATELITE"] = "SATELITE";
|
|
205
|
+
/** Hybrid map type */
|
|
206
|
+
MapType["HYBRID"] = "HYBRID";
|
|
207
|
+
/** Terrain map type */
|
|
208
|
+
MapType["TERRAIN"] = "TERRAIN";
|
|
209
|
+
})(MapType || (MapType = {}));
|
|
210
|
+
export var ViewRole;
|
|
211
|
+
(function (ViewRole) {
|
|
212
|
+
/** Only Poll creator can view the results */
|
|
213
|
+
ViewRole["CREATOR"] = "CREATOR";
|
|
214
|
+
/** Anyone who voted can see the results */
|
|
215
|
+
ViewRole["VOTERS"] = "VOTERS";
|
|
216
|
+
/** Anyone can see the results, even if one didn't vote */
|
|
217
|
+
ViewRole["EVERYONE"] = "EVERYONE";
|
|
218
|
+
})(ViewRole || (ViewRole = {}));
|
|
219
|
+
export var VoteRole;
|
|
220
|
+
(function (VoteRole) {
|
|
221
|
+
/** Logged in member */
|
|
222
|
+
VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
|
|
223
|
+
/** Anyone */
|
|
224
|
+
VoteRole["ALL"] = "ALL";
|
|
225
|
+
})(VoteRole || (VoteRole = {}));
|
|
226
|
+
export var PollLayoutType;
|
|
227
|
+
(function (PollLayoutType) {
|
|
228
|
+
/** List */
|
|
229
|
+
PollLayoutType["LIST"] = "LIST";
|
|
230
|
+
/** Grid */
|
|
231
|
+
PollLayoutType["GRID"] = "GRID";
|
|
232
|
+
})(PollLayoutType || (PollLayoutType = {}));
|
|
233
|
+
export var PollLayoutDirection;
|
|
234
|
+
(function (PollLayoutDirection) {
|
|
235
|
+
/** Left-to-right */
|
|
236
|
+
PollLayoutDirection["LTR"] = "LTR";
|
|
237
|
+
/** Right-to-left */
|
|
238
|
+
PollLayoutDirection["RTL"] = "RTL";
|
|
239
|
+
})(PollLayoutDirection || (PollLayoutDirection = {}));
|
|
240
|
+
export var BackgroundType;
|
|
241
|
+
(function (BackgroundType) {
|
|
242
|
+
/** Color background type */
|
|
243
|
+
BackgroundType["COLOR"] = "COLOR";
|
|
244
|
+
/** Image background type */
|
|
245
|
+
BackgroundType["IMAGE"] = "IMAGE";
|
|
246
|
+
/** Gradiant background type */
|
|
247
|
+
BackgroundType["GRADIENT"] = "GRADIENT";
|
|
248
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
249
|
+
export var DecorationType;
|
|
250
|
+
(function (DecorationType) {
|
|
251
|
+
DecorationType["BOLD"] = "BOLD";
|
|
252
|
+
DecorationType["ITALIC"] = "ITALIC";
|
|
253
|
+
DecorationType["UNDERLINE"] = "UNDERLINE";
|
|
254
|
+
DecorationType["SPOILER"] = "SPOILER";
|
|
255
|
+
DecorationType["ANCHOR"] = "ANCHOR";
|
|
256
|
+
DecorationType["MENTION"] = "MENTION";
|
|
257
|
+
DecorationType["LINK"] = "LINK";
|
|
258
|
+
DecorationType["COLOR"] = "COLOR";
|
|
259
|
+
DecorationType["FONT_SIZE"] = "FONT_SIZE";
|
|
260
|
+
DecorationType["EXTERNAL"] = "EXTERNAL";
|
|
261
|
+
})(DecorationType || (DecorationType = {}));
|
|
262
|
+
export var FontType;
|
|
263
|
+
(function (FontType) {
|
|
264
|
+
FontType["PX"] = "PX";
|
|
265
|
+
FontType["EM"] = "EM";
|
|
266
|
+
})(FontType || (FontType = {}));
|
|
267
|
+
export var AppType;
|
|
268
|
+
(function (AppType) {
|
|
269
|
+
AppType["PRODUCT"] = "PRODUCT";
|
|
270
|
+
AppType["EVENT"] = "EVENT";
|
|
271
|
+
AppType["BOOKING"] = "BOOKING";
|
|
272
|
+
})(AppType || (AppType = {}));
|
|
273
|
+
export var InitialExpandedItems;
|
|
274
|
+
(function (InitialExpandedItems) {
|
|
275
|
+
/** First item will be expended initally */
|
|
276
|
+
InitialExpandedItems["FIRST"] = "FIRST";
|
|
277
|
+
/** All items will expended initally */
|
|
278
|
+
InitialExpandedItems["ALL"] = "ALL";
|
|
279
|
+
/** All items collapsed initally */
|
|
280
|
+
InitialExpandedItems["NONE"] = "NONE";
|
|
281
|
+
})(InitialExpandedItems || (InitialExpandedItems = {}));
|
|
282
|
+
export var Direction;
|
|
283
|
+
(function (Direction) {
|
|
284
|
+
/** Left-to-right */
|
|
285
|
+
Direction["LTR"] = "LTR";
|
|
286
|
+
/** Right-to-left */
|
|
287
|
+
Direction["RTL"] = "RTL";
|
|
288
|
+
})(Direction || (Direction = {}));
|
|
289
|
+
export var VerticalAlignment;
|
|
290
|
+
(function (VerticalAlignment) {
|
|
291
|
+
/** Top alignment */
|
|
292
|
+
VerticalAlignment["TOP"] = "TOP";
|
|
293
|
+
/** Middle alignment */
|
|
294
|
+
VerticalAlignment["MIDDLE"] = "MIDDLE";
|
|
295
|
+
/** Bottom alignment */
|
|
296
|
+
VerticalAlignment["BOTTOM"] = "BOTTOM";
|
|
297
|
+
})(VerticalAlignment || (VerticalAlignment = {}));
|
|
298
|
+
/**
|
|
299
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
300
|
+
* `Value` type union.
|
|
301
|
+
*
|
|
302
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
303
|
+
*/
|
|
304
|
+
export var NullValue;
|
|
305
|
+
(function (NullValue) {
|
|
306
|
+
/** Null value. */
|
|
307
|
+
NullValue["NULL_VALUE"] = "NULL_VALUE";
|
|
308
|
+
})(NullValue || (NullValue = {}));
|
|
309
|
+
export var MediaType;
|
|
310
|
+
(function (MediaType) {
|
|
311
|
+
MediaType["UNKNOWN_MEDIA_TYPE"] = "UNKNOWN_MEDIA_TYPE";
|
|
312
|
+
/** Image media type. */
|
|
313
|
+
MediaType["IMAGE"] = "IMAGE";
|
|
314
|
+
/** Video media type. */
|
|
315
|
+
MediaType["VIDEO"] = "VIDEO";
|
|
316
|
+
})(MediaType || (MediaType = {}));
|
|
317
|
+
export var ProductOptionRenderType;
|
|
318
|
+
(function (ProductOptionRenderType) {
|
|
319
|
+
/** Not implemented. */
|
|
320
|
+
ProductOptionRenderType["UNKNOWN_OPTION_RENDER_TYPE"] = "UNKNOWN_OPTION_RENDER_TYPE";
|
|
321
|
+
/** Text choices. */
|
|
322
|
+
ProductOptionRenderType["TEXT_CHOICES"] = "TEXT_CHOICES";
|
|
323
|
+
/** Swatch choices. */
|
|
324
|
+
ProductOptionRenderType["SWATCH_CHOICES"] = "SWATCH_CHOICES";
|
|
325
|
+
})(ProductOptionRenderType || (ProductOptionRenderType = {}));
|
|
326
|
+
export var ChoiceType;
|
|
327
|
+
(function (ChoiceType) {
|
|
328
|
+
ChoiceType["UNKNOWN_CHOICE_TYPE"] = "UNKNOWN_CHOICE_TYPE";
|
|
329
|
+
/** Text choice. */
|
|
330
|
+
ChoiceType["CHOICE_TEXT"] = "CHOICE_TEXT";
|
|
331
|
+
/** Single color choice. */
|
|
332
|
+
ChoiceType["ONE_COLOR"] = "ONE_COLOR";
|
|
333
|
+
/** Multiple colors choice. */
|
|
334
|
+
ChoiceType["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
|
|
335
|
+
/** Image choice. */
|
|
336
|
+
ChoiceType["IMAGE"] = "IMAGE";
|
|
337
|
+
})(ChoiceType || (ChoiceType = {}));
|
|
338
|
+
export var ModifierRenderType;
|
|
339
|
+
(function (ModifierRenderType) {
|
|
340
|
+
/** Not implemented. */
|
|
341
|
+
ModifierRenderType["UNKNOWN_MODIFIER_RENDER_TYPE"] = "UNKNOWN_MODIFIER_RENDER_TYPE";
|
|
342
|
+
/** Free text. */
|
|
343
|
+
ModifierRenderType["FREE_TEXT"] = "FREE_TEXT";
|
|
344
|
+
/** Text choices. */
|
|
345
|
+
ModifierRenderType["TEXT_CHOICES"] = "TEXT_CHOICES";
|
|
346
|
+
/** Swatch choices. */
|
|
347
|
+
ModifierRenderType["SWATCH_CHOICES"] = "SWATCH_CHOICES";
|
|
348
|
+
})(ModifierRenderType || (ModifierRenderType = {}));
|
|
349
|
+
export var InventoryAvailabilityStatus;
|
|
350
|
+
(function (InventoryAvailabilityStatus) {
|
|
351
|
+
InventoryAvailabilityStatus["UNKNOWN_AVAILABILITY_STATUS"] = "UNKNOWN_AVAILABILITY_STATUS";
|
|
352
|
+
/** All variants are in stock and available for purchase. */
|
|
353
|
+
InventoryAvailabilityStatus["IN_STOCK"] = "IN_STOCK";
|
|
354
|
+
/** All variants are out of stock. */
|
|
355
|
+
InventoryAvailabilityStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
356
|
+
/** Some variants are out of stock and some are in stock and available for purchase. */
|
|
357
|
+
InventoryAvailabilityStatus["PARTIALLY_OUT_OF_STOCK"] = "PARTIALLY_OUT_OF_STOCK";
|
|
358
|
+
})(InventoryAvailabilityStatus || (InventoryAvailabilityStatus = {}));
|
|
359
|
+
export var PreorderStatus;
|
|
360
|
+
(function (PreorderStatus) {
|
|
361
|
+
PreorderStatus["UNKNOWN_PREORDER_STATUS"] = "UNKNOWN_PREORDER_STATUS";
|
|
362
|
+
/** All variants are enabled for preorder. */
|
|
363
|
+
PreorderStatus["ENABLED"] = "ENABLED";
|
|
364
|
+
/** All variants are disabled for preorder. */
|
|
365
|
+
PreorderStatus["DISABLED"] = "DISABLED";
|
|
366
|
+
/** Some variants are disabled and some are enabled for preorder. */
|
|
367
|
+
PreorderStatus["PARTIALLY_ENABLED"] = "PARTIALLY_ENABLED";
|
|
368
|
+
})(PreorderStatus || (PreorderStatus = {}));
|
|
369
|
+
export var ProductPreorderAvailability;
|
|
370
|
+
(function (ProductPreorderAvailability) {
|
|
371
|
+
ProductPreorderAvailability["UNKNOWN_PREORDER_AVAILABILITY_STATUS"] = "UNKNOWN_PREORDER_AVAILABILITY_STATUS";
|
|
372
|
+
/** All the product variants are available for preorder. */
|
|
373
|
+
ProductPreorderAvailability["ALL_VARIANTS"] = "ALL_VARIANTS";
|
|
374
|
+
/** None of the product variants are available for preorder. */
|
|
375
|
+
ProductPreorderAvailability["NO_VARIANTS"] = "NO_VARIANTS";
|
|
376
|
+
/** Some of the product variants are available for preorder. */
|
|
377
|
+
ProductPreorderAvailability["SOME_VARIANTS"] = "SOME_VARIANTS";
|
|
378
|
+
})(ProductPreorderAvailability || (ProductPreorderAvailability = {}));
|
|
379
|
+
export var ProductType;
|
|
380
|
+
(function (ProductType) {
|
|
381
|
+
/** Not implemented. */
|
|
382
|
+
ProductType["UNKNOWN_PRODUCT_TYPE"] = "UNKNOWN_PRODUCT_TYPE";
|
|
383
|
+
/** Physical product. */
|
|
384
|
+
ProductType["PHYSICAL"] = "PHYSICAL";
|
|
385
|
+
/** Digital product. */
|
|
386
|
+
ProductType["DIGITAL"] = "DIGITAL";
|
|
387
|
+
})(ProductType || (ProductType = {}));
|
|
388
|
+
export var MeasurementUnit;
|
|
389
|
+
(function (MeasurementUnit) {
|
|
390
|
+
MeasurementUnit["UNSPECIFIED"] = "UNSPECIFIED";
|
|
391
|
+
MeasurementUnit["ML"] = "ML";
|
|
392
|
+
MeasurementUnit["CL"] = "CL";
|
|
393
|
+
MeasurementUnit["L"] = "L";
|
|
394
|
+
MeasurementUnit["CBM"] = "CBM";
|
|
395
|
+
MeasurementUnit["MG"] = "MG";
|
|
396
|
+
MeasurementUnit["G"] = "G";
|
|
397
|
+
MeasurementUnit["KG"] = "KG";
|
|
398
|
+
MeasurementUnit["MM"] = "MM";
|
|
399
|
+
MeasurementUnit["CM"] = "CM";
|
|
400
|
+
MeasurementUnit["M"] = "M";
|
|
401
|
+
MeasurementUnit["SQM"] = "SQM";
|
|
402
|
+
MeasurementUnit["OZ"] = "OZ";
|
|
403
|
+
MeasurementUnit["LB"] = "LB";
|
|
404
|
+
MeasurementUnit["FLOZ"] = "FLOZ";
|
|
405
|
+
MeasurementUnit["PT"] = "PT";
|
|
406
|
+
MeasurementUnit["QT"] = "QT";
|
|
407
|
+
MeasurementUnit["GAL"] = "GAL";
|
|
408
|
+
MeasurementUnit["IN"] = "IN";
|
|
409
|
+
MeasurementUnit["FT"] = "FT";
|
|
410
|
+
MeasurementUnit["YD"] = "YD";
|
|
411
|
+
MeasurementUnit["SQFT"] = "SQFT";
|
|
412
|
+
})(MeasurementUnit || (MeasurementUnit = {}));
|
|
413
|
+
export var WeightUnit;
|
|
414
|
+
(function (WeightUnit) {
|
|
415
|
+
/** Weight unit can't be classified, due to an error */
|
|
416
|
+
WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
417
|
+
/** Kilograms */
|
|
418
|
+
WeightUnit["KG"] = "KG";
|
|
419
|
+
/** Pounds */
|
|
420
|
+
WeightUnit["LB"] = "LB";
|
|
421
|
+
})(WeightUnit || (WeightUnit = {}));
|
|
422
|
+
export var FileType;
|
|
423
|
+
(function (FileType) {
|
|
424
|
+
/** Unspecified file type. */
|
|
425
|
+
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
426
|
+
/** Secure picture file. */
|
|
427
|
+
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
428
|
+
/** Secure video file. */
|
|
429
|
+
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
430
|
+
/** Secure document file. */
|
|
431
|
+
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
432
|
+
/** Secure music file. */
|
|
433
|
+
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
434
|
+
/** Secure archive file. */
|
|
435
|
+
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
436
|
+
})(FileType || (FileType = {}));
|
|
437
|
+
/** Frequency unit of recurring payment */
|
|
438
|
+
export var SubscriptionFrequency;
|
|
439
|
+
(function (SubscriptionFrequency) {
|
|
440
|
+
SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
|
|
441
|
+
SubscriptionFrequency["DAY"] = "DAY";
|
|
442
|
+
SubscriptionFrequency["WEEK"] = "WEEK";
|
|
443
|
+
SubscriptionFrequency["MONTH"] = "MONTH";
|
|
444
|
+
SubscriptionFrequency["YEAR"] = "YEAR";
|
|
445
|
+
})(SubscriptionFrequency || (SubscriptionFrequency = {}));
|
|
446
|
+
export var DiscountType;
|
|
447
|
+
(function (DiscountType) {
|
|
448
|
+
DiscountType["UNKNOWN_DISCOUNT"] = "UNKNOWN_DISCOUNT";
|
|
449
|
+
/** Discount by a specific amount. */
|
|
450
|
+
DiscountType["AMOUNT"] = "AMOUNT";
|
|
451
|
+
/** Discount by a percentage. */
|
|
452
|
+
DiscountType["PERCENT"] = "PERCENT";
|
|
453
|
+
})(DiscountType || (DiscountType = {}));
|
|
454
|
+
export var CommonSortOrder;
|
|
455
|
+
(function (CommonSortOrder) {
|
|
456
|
+
CommonSortOrder["ASC"] = "ASC";
|
|
457
|
+
CommonSortOrder["DESC"] = "DESC";
|
|
458
|
+
})(CommonSortOrder || (CommonSortOrder = {}));
|
|
459
|
+
export var ProductMediaMediaType;
|
|
460
|
+
(function (ProductMediaMediaType) {
|
|
461
|
+
ProductMediaMediaType["UNKNOWN_MEDIA_TYPE"] = "UNKNOWN_MEDIA_TYPE";
|
|
462
|
+
/** Image media type. */
|
|
463
|
+
ProductMediaMediaType["IMAGE"] = "IMAGE";
|
|
464
|
+
/** Video media type. */
|
|
465
|
+
ProductMediaMediaType["VIDEO"] = "VIDEO";
|
|
466
|
+
})(ProductMediaMediaType || (ProductMediaMediaType = {}));
|
|
467
|
+
export var SecuredMediaFileType;
|
|
468
|
+
(function (SecuredMediaFileType) {
|
|
469
|
+
/** Unspecified file type. */
|
|
470
|
+
SecuredMediaFileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
471
|
+
/** Secure picture file. */
|
|
472
|
+
SecuredMediaFileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
473
|
+
/** Secure video file. */
|
|
474
|
+
SecuredMediaFileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
475
|
+
/** Secure document file. */
|
|
476
|
+
SecuredMediaFileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
477
|
+
/** Secure music file. */
|
|
478
|
+
SecuredMediaFileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
479
|
+
/** Secure archive file. */
|
|
480
|
+
SecuredMediaFileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
481
|
+
})(SecuredMediaFileType || (SecuredMediaFileType = {}));
|
|
482
|
+
export var V3ProductType;
|
|
483
|
+
(function (V3ProductType) {
|
|
484
|
+
/** Not implemented. */
|
|
485
|
+
V3ProductType["UNKNOWN_PRODUCT_TYPE"] = "UNKNOWN_PRODUCT_TYPE";
|
|
486
|
+
/** Physical product. */
|
|
487
|
+
V3ProductType["PHYSICAL"] = "PHYSICAL";
|
|
488
|
+
/** Digital product. */
|
|
489
|
+
V3ProductType["DIGITAL"] = "DIGITAL";
|
|
490
|
+
})(V3ProductType || (V3ProductType = {}));
|
|
491
|
+
export var Enum;
|
|
492
|
+
(function (Enum) {
|
|
493
|
+
/** Default value. Means that permission not set */
|
|
494
|
+
Enum["UNKNOWN"] = "UNKNOWN";
|
|
495
|
+
/** Protected exposure. Exposed to members and owners */
|
|
496
|
+
Enum["PROTECTED"] = "PROTECTED";
|
|
497
|
+
/** Private exposure. Exposed to owners */
|
|
498
|
+
Enum["PRIVATE"] = "PRIVATE";
|
|
499
|
+
/** Public exposure. Visible to everyone */
|
|
500
|
+
Enum["PUBLIC"] = "PUBLIC";
|
|
501
|
+
/** Used for partial updates, to state that exposure is not changing */
|
|
502
|
+
Enum["UNCHANGED"] = "UNCHANGED";
|
|
503
|
+
/** Protected to members of permitted groups and owners */
|
|
504
|
+
Enum["GROUP_PROTECTED"] = "GROUP_PROTECTED";
|
|
505
|
+
})(Enum || (Enum = {}));
|
|
506
|
+
export var State;
|
|
507
|
+
(function (State) {
|
|
508
|
+
/** default state */
|
|
509
|
+
State["Unknown"] = "Unknown";
|
|
510
|
+
/** metasite does not require site search indexing */
|
|
511
|
+
State["Off"] = "Off";
|
|
512
|
+
/** metasite requires site search indexing */
|
|
513
|
+
State["On"] = "On";
|
|
514
|
+
})(State || (State = {}));
|
|
515
|
+
export var WebhookIdentityType;
|
|
516
|
+
(function (WebhookIdentityType) {
|
|
517
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
518
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
519
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
520
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
521
|
+
WebhookIdentityType["APP"] = "APP";
|
|
522
|
+
})(WebhookIdentityType || (WebhookIdentityType = {}));
|
|
523
|
+
export var SingleEntityOpsRequestedFields;
|
|
524
|
+
(function (SingleEntityOpsRequestedFields) {
|
|
525
|
+
/** Not implemented. */
|
|
526
|
+
SingleEntityOpsRequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
527
|
+
SingleEntityOpsRequestedFields["URL"] = "URL";
|
|
528
|
+
SingleEntityOpsRequestedFields["CURRENCY"] = "CURRENCY";
|
|
529
|
+
SingleEntityOpsRequestedFields["INFO_SECTION"] = "INFO_SECTION";
|
|
530
|
+
/** You can request merchant data only if you have the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope. */
|
|
531
|
+
SingleEntityOpsRequestedFields["MERCHANT_DATA"] = "MERCHANT_DATA";
|
|
532
|
+
SingleEntityOpsRequestedFields["PLAIN_DESCRIPTION"] = "PLAIN_DESCRIPTION";
|
|
533
|
+
SingleEntityOpsRequestedFields["INFO_SECTION_PLAIN_DESCRIPTION"] = "INFO_SECTION_PLAIN_DESCRIPTION";
|
|
534
|
+
SingleEntityOpsRequestedFields["SUBSCRIPTION_PRICES_INFO"] = "SUBSCRIPTION_PRICES_INFO";
|
|
535
|
+
SingleEntityOpsRequestedFields["BREADCRUMBS_INFO"] = "BREADCRUMBS_INFO";
|
|
536
|
+
SingleEntityOpsRequestedFields["WEIGHT_MEASUREMENT_UNIT_INFO"] = "WEIGHT_MEASUREMENT_UNIT_INFO";
|
|
537
|
+
SingleEntityOpsRequestedFields["VARIANT_OPTION_CHOICE_NAMES"] = "VARIANT_OPTION_CHOICE_NAMES";
|
|
538
|
+
SingleEntityOpsRequestedFields["MEDIA_ITEMS_INFO"] = "MEDIA_ITEMS_INFO";
|
|
539
|
+
SingleEntityOpsRequestedFields["DESCRIPTION"] = "DESCRIPTION";
|
|
540
|
+
SingleEntityOpsRequestedFields["DIRECT_CATEGORIES_INFO"] = "DIRECT_CATEGORIES_INFO";
|
|
541
|
+
SingleEntityOpsRequestedFields["ALL_CATEGORIES_INFO"] = "ALL_CATEGORIES_INFO";
|
|
542
|
+
SingleEntityOpsRequestedFields["INFO_SECTION_DESCRIPTION"] = "INFO_SECTION_DESCRIPTION";
|
|
543
|
+
SingleEntityOpsRequestedFields["THUMBNAIL"] = "THUMBNAIL";
|
|
544
|
+
})(SingleEntityOpsRequestedFields || (SingleEntityOpsRequestedFields = {}));
|
|
545
|
+
export var AvailabilityStatus;
|
|
546
|
+
(function (AvailabilityStatus) {
|
|
547
|
+
AvailabilityStatus["UNKNOWN_AVAILABILITY_STATUS"] = "UNKNOWN_AVAILABILITY_STATUS";
|
|
548
|
+
/** Product is out of stock. */
|
|
549
|
+
AvailabilityStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
550
|
+
/** Product is in stock. See `quantity` field for exact amount in stock. */
|
|
551
|
+
AvailabilityStatus["IN_STOCK"] = "IN_STOCK";
|
|
552
|
+
/** Product is only available for preorder. See `preorderInfo` field for more info. */
|
|
553
|
+
AvailabilityStatus["PREORDER"] = "PREORDER";
|
|
554
|
+
})(AvailabilityStatus || (AvailabilityStatus = {}));
|
|
555
|
+
export var RequestedFields;
|
|
556
|
+
(function (RequestedFields) {
|
|
557
|
+
/** Not implemented. */
|
|
558
|
+
RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
559
|
+
RequestedFields["URL"] = "URL";
|
|
560
|
+
RequestedFields["CURRENCY"] = "CURRENCY";
|
|
561
|
+
RequestedFields["INFO_SECTION"] = "INFO_SECTION";
|
|
562
|
+
/** You can request merchant data only if you have the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope. */
|
|
563
|
+
RequestedFields["MERCHANT_DATA"] = "MERCHANT_DATA";
|
|
564
|
+
RequestedFields["PLAIN_DESCRIPTION"] = "PLAIN_DESCRIPTION";
|
|
565
|
+
RequestedFields["INFO_SECTION_PLAIN_DESCRIPTION"] = "INFO_SECTION_PLAIN_DESCRIPTION";
|
|
566
|
+
RequestedFields["SUBSCRIPTION_PRICES_INFO"] = "SUBSCRIPTION_PRICES_INFO";
|
|
567
|
+
RequestedFields["BREADCRUMBS_INFO"] = "BREADCRUMBS_INFO";
|
|
568
|
+
RequestedFields["WEIGHT_MEASUREMENT_UNIT_INFO"] = "WEIGHT_MEASUREMENT_UNIT_INFO";
|
|
569
|
+
RequestedFields["VARIANT_OPTION_CHOICE_NAMES"] = "VARIANT_OPTION_CHOICE_NAMES";
|
|
570
|
+
RequestedFields["MEDIA_ITEMS_INFO"] = "MEDIA_ITEMS_INFO";
|
|
571
|
+
RequestedFields["DESCRIPTION"] = "DESCRIPTION";
|
|
572
|
+
RequestedFields["DIRECT_CATEGORIES_INFO"] = "DIRECT_CATEGORIES_INFO";
|
|
573
|
+
RequestedFields["ALL_CATEGORIES_INFO"] = "ALL_CATEGORIES_INFO";
|
|
574
|
+
RequestedFields["INFO_SECTION_DESCRIPTION"] = "INFO_SECTION_DESCRIPTION";
|
|
575
|
+
RequestedFields["THUMBNAIL"] = "THUMBNAIL";
|
|
576
|
+
})(RequestedFields || (RequestedFields = {}));
|
|
577
|
+
export var CommonSearchDetailsMode;
|
|
578
|
+
(function (CommonSearchDetailsMode) {
|
|
579
|
+
/** Any of the search terms must be present */
|
|
580
|
+
CommonSearchDetailsMode["OR"] = "OR";
|
|
581
|
+
/** All search terms must be present */
|
|
582
|
+
CommonSearchDetailsMode["AND"] = "AND";
|
|
583
|
+
})(CommonSearchDetailsMode || (CommonSearchDetailsMode = {}));
|
|
584
|
+
export var UpstreamWixCommonSortOrder;
|
|
585
|
+
(function (UpstreamWixCommonSortOrder) {
|
|
586
|
+
UpstreamWixCommonSortOrder["ASC"] = "ASC";
|
|
587
|
+
UpstreamWixCommonSortOrder["DESC"] = "DESC";
|
|
588
|
+
})(UpstreamWixCommonSortOrder || (UpstreamWixCommonSortOrder = {}));
|
|
589
|
+
export var AggregationValueAggregationSortType;
|
|
590
|
+
(function (AggregationValueAggregationSortType) {
|
|
591
|
+
/** Should sort by number of matches */
|
|
592
|
+
AggregationValueAggregationSortType["COUNT"] = "COUNT";
|
|
593
|
+
/** Should sort by value of the field alphabetically */
|
|
594
|
+
AggregationValueAggregationSortType["VALUE"] = "VALUE";
|
|
595
|
+
})(AggregationValueAggregationSortType || (AggregationValueAggregationSortType = {}));
|
|
596
|
+
export var AggregationValueAggregationSortDirection;
|
|
597
|
+
(function (AggregationValueAggregationSortDirection) {
|
|
598
|
+
/** Should sort in descending order */
|
|
599
|
+
AggregationValueAggregationSortDirection["DESC"] = "DESC";
|
|
600
|
+
/** Should sort in ascending order */
|
|
601
|
+
AggregationValueAggregationSortDirection["ASC"] = "ASC";
|
|
602
|
+
})(AggregationValueAggregationSortDirection || (AggregationValueAggregationSortDirection = {}));
|
|
603
|
+
export var AggregationValueAggregationMissingValues;
|
|
604
|
+
(function (AggregationValueAggregationMissingValues) {
|
|
605
|
+
/** Should missing values be excluded from the aggregation results */
|
|
606
|
+
AggregationValueAggregationMissingValues["EXCLUDE"] = "EXCLUDE";
|
|
607
|
+
/** Should missing values be included in the aggregation results */
|
|
608
|
+
AggregationValueAggregationMissingValues["INCLUDE"] = "INCLUDE";
|
|
609
|
+
})(AggregationValueAggregationMissingValues || (AggregationValueAggregationMissingValues = {}));
|
|
610
|
+
export var WixCommonScalarType;
|
|
611
|
+
(function (WixCommonScalarType) {
|
|
612
|
+
WixCommonScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
613
|
+
/** Count of distinct values */
|
|
614
|
+
WixCommonScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
615
|
+
/** Minimum value */
|
|
616
|
+
WixCommonScalarType["MIN"] = "MIN";
|
|
617
|
+
/** Maximum value */
|
|
618
|
+
WixCommonScalarType["MAX"] = "MAX";
|
|
619
|
+
})(WixCommonScalarType || (WixCommonScalarType = {}));
|
|
620
|
+
export var AggregationNestedAggregationNestedAggregationType;
|
|
621
|
+
(function (AggregationNestedAggregationNestedAggregationType) {
|
|
622
|
+
AggregationNestedAggregationNestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
623
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
624
|
+
AggregationNestedAggregationNestedAggregationType["VALUE"] = "VALUE";
|
|
625
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
626
|
+
AggregationNestedAggregationNestedAggregationType["RANGE"] = "RANGE";
|
|
627
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
628
|
+
AggregationNestedAggregationNestedAggregationType["SCALAR"] = "SCALAR";
|
|
629
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
630
|
+
AggregationNestedAggregationNestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
631
|
+
})(AggregationNestedAggregationNestedAggregationType || (AggregationNestedAggregationNestedAggregationType = {}));
|
|
632
|
+
export var AggregationDateHistogramAggregationInterval;
|
|
633
|
+
(function (AggregationDateHistogramAggregationInterval) {
|
|
634
|
+
AggregationDateHistogramAggregationInterval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
635
|
+
/** Yearly interval */
|
|
636
|
+
AggregationDateHistogramAggregationInterval["YEAR"] = "YEAR";
|
|
637
|
+
/** Monthly interval */
|
|
638
|
+
AggregationDateHistogramAggregationInterval["MONTH"] = "MONTH";
|
|
639
|
+
/** Weekly interval */
|
|
640
|
+
AggregationDateHistogramAggregationInterval["WEEK"] = "WEEK";
|
|
641
|
+
/** Daily interval */
|
|
642
|
+
AggregationDateHistogramAggregationInterval["DAY"] = "DAY";
|
|
643
|
+
/** Hourly interval */
|
|
644
|
+
AggregationDateHistogramAggregationInterval["HOUR"] = "HOUR";
|
|
645
|
+
/** Minute interval */
|
|
646
|
+
AggregationDateHistogramAggregationInterval["MINUTE"] = "MINUTE";
|
|
647
|
+
/** Second interval */
|
|
648
|
+
AggregationDateHistogramAggregationInterval["SECOND"] = "SECOND";
|
|
649
|
+
})(AggregationDateHistogramAggregationInterval || (AggregationDateHistogramAggregationInterval = {}));
|
|
650
|
+
export var WixCommonAggregationType;
|
|
651
|
+
(function (WixCommonAggregationType) {
|
|
652
|
+
WixCommonAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
653
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
654
|
+
WixCommonAggregationType["VALUE"] = "VALUE";
|
|
655
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
656
|
+
WixCommonAggregationType["RANGE"] = "RANGE";
|
|
657
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
658
|
+
WixCommonAggregationType["SCALAR"] = "SCALAR";
|
|
659
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
660
|
+
WixCommonAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
661
|
+
/** Multi-level aggregation, where each next aggregation is nested within previous one */
|
|
662
|
+
WixCommonAggregationType["NESTED"] = "NESTED";
|
|
663
|
+
})(WixCommonAggregationType || (WixCommonAggregationType = {}));
|
|
664
|
+
export var BulkAdjustProductVariantsByFilterRequestRoundingStrategy;
|
|
665
|
+
(function (BulkAdjustProductVariantsByFilterRequestRoundingStrategy) {
|
|
666
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["UNKNOWN_ROUNDING_STRATEGY"] = "UNKNOWN_ROUNDING_STRATEGY";
|
|
667
|
+
/**
|
|
668
|
+
* Calculated prices will be saved without rounding to keep max possible precision. It's still good idea to round numbers before displaying them.
|
|
669
|
+
* Example: input $3.5555 -> saved value $3.5555
|
|
670
|
+
*/
|
|
671
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["NO_ROUNDING"] = "NO_ROUNDING";
|
|
672
|
+
/**
|
|
673
|
+
* Calculated prices will be rounded according to currency precision.
|
|
674
|
+
* Example: input $3.5555 -> saved value $3.56, input ¥3.5555 -> saved value ¥4
|
|
675
|
+
*/
|
|
676
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["CURRENCY_PRECISION"] = "CURRENCY_PRECISION";
|
|
677
|
+
/**
|
|
678
|
+
* Calculated prices will be rounded to nearest whole number.
|
|
679
|
+
* Example: input $3.5555 -> saved value $4
|
|
680
|
+
*/
|
|
681
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["NEAREST_WHOLE_NUMBER"] = "NEAREST_WHOLE_NUMBER";
|
|
682
|
+
})(BulkAdjustProductVariantsByFilterRequestRoundingStrategy || (BulkAdjustProductVariantsByFilterRequestRoundingStrategy = {}));
|
|
683
|
+
export var SortOrder;
|
|
684
|
+
(function (SortOrder) {
|
|
685
|
+
/** Ascending order. */
|
|
686
|
+
SortOrder["ASC"] = "ASC";
|
|
687
|
+
/** Descending order. */
|
|
688
|
+
SortOrder["DESC"] = "DESC";
|
|
689
|
+
})(SortOrder || (SortOrder = {}));
|
|
690
|
+
export var SortType;
|
|
691
|
+
(function (SortType) {
|
|
692
|
+
/** Should sort by number of matches. */
|
|
693
|
+
SortType["COUNT"] = "COUNT";
|
|
694
|
+
/** Should sort by value of the field alphabetically. */
|
|
695
|
+
SortType["VALUE"] = "VALUE";
|
|
696
|
+
})(SortType || (SortType = {}));
|
|
697
|
+
export var SortDirection;
|
|
698
|
+
(function (SortDirection) {
|
|
699
|
+
/** Should sort by descending order. */
|
|
700
|
+
SortDirection["DESC"] = "DESC";
|
|
701
|
+
/** Should sort by ascending order. */
|
|
702
|
+
SortDirection["ASC"] = "ASC";
|
|
703
|
+
})(SortDirection || (SortDirection = {}));
|
|
704
|
+
export var MissingValues;
|
|
705
|
+
(function (MissingValues) {
|
|
706
|
+
/** Exclude missing values from the aggregation results. */
|
|
707
|
+
MissingValues["EXCLUDE"] = "EXCLUDE";
|
|
708
|
+
/** Include missing values from the aggregation results. */
|
|
709
|
+
MissingValues["INCLUDE"] = "INCLUDE";
|
|
710
|
+
})(MissingValues || (MissingValues = {}));
|
|
711
|
+
export var ScalarType;
|
|
712
|
+
(function (ScalarType) {
|
|
713
|
+
/** Undefined scalar type. */
|
|
714
|
+
ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
715
|
+
/** Count of distinct values. */
|
|
716
|
+
ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
717
|
+
/** Minimum value. */
|
|
718
|
+
ScalarType["MIN"] = "MIN";
|
|
719
|
+
/** Maximum value. */
|
|
720
|
+
ScalarType["MAX"] = "MAX";
|
|
721
|
+
})(ScalarType || (ScalarType = {}));
|
|
722
|
+
export var NestedAggregationType;
|
|
723
|
+
(function (NestedAggregationType) {
|
|
724
|
+
/** Undefined nested aggregation type. */
|
|
725
|
+
NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
726
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
727
|
+
NestedAggregationType["VALUE"] = "VALUE";
|
|
728
|
+
/** An aggregation where user can define set of ranges - each representing a bucket. */
|
|
729
|
+
NestedAggregationType["RANGE"] = "RANGE";
|
|
730
|
+
/** A single-value metric aggregation. For example: min, max, sum, avg. */
|
|
731
|
+
NestedAggregationType["SCALAR"] = "SCALAR";
|
|
732
|
+
/** An aggregation where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
733
|
+
NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
734
|
+
})(NestedAggregationType || (NestedAggregationType = {}));
|
|
735
|
+
export var Interval;
|
|
736
|
+
(function (Interval) {
|
|
737
|
+
/** Undefined interval type. */
|
|
738
|
+
Interval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
739
|
+
/** Yearly interval. */
|
|
740
|
+
Interval["YEAR"] = "YEAR";
|
|
741
|
+
/** Monthly interval. */
|
|
742
|
+
Interval["MONTH"] = "MONTH";
|
|
743
|
+
/** Weekly interval. */
|
|
744
|
+
Interval["WEEK"] = "WEEK";
|
|
745
|
+
/** Daily interval. */
|
|
746
|
+
Interval["DAY"] = "DAY";
|
|
747
|
+
/** Hourly interval. */
|
|
748
|
+
Interval["HOUR"] = "HOUR";
|
|
749
|
+
/** Minute interval. */
|
|
750
|
+
Interval["MINUTE"] = "MINUTE";
|
|
751
|
+
/** Second interval. */
|
|
752
|
+
Interval["SECOND"] = "SECOND";
|
|
753
|
+
})(Interval || (Interval = {}));
|
|
754
|
+
export var AggregationType;
|
|
755
|
+
(function (AggregationType) {
|
|
756
|
+
/** Undefined aggregation type. */
|
|
757
|
+
AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
758
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
759
|
+
AggregationType["VALUE"] = "VALUE";
|
|
760
|
+
/** An aggregation where a user can define set of ranges - each representing a bucket. */
|
|
761
|
+
AggregationType["RANGE"] = "RANGE";
|
|
762
|
+
/** A single-value metric aggregation. For example: min, max, sum, avg. */
|
|
763
|
+
AggregationType["SCALAR"] = "SCALAR";
|
|
764
|
+
/** An aggregation where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
765
|
+
AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
766
|
+
/** A Multi-level aggregation where each next aggregation is nested within previous one. */
|
|
767
|
+
AggregationType["NESTED"] = "NESTED";
|
|
768
|
+
})(AggregationType || (AggregationType = {}));
|
|
769
|
+
export var Mode;
|
|
770
|
+
(function (Mode) {
|
|
771
|
+
/** Any of the search terms must be present. */
|
|
772
|
+
Mode["OR"] = "OR";
|
|
773
|
+
/** All search terms must be present. */
|
|
774
|
+
Mode["AND"] = "AND";
|
|
775
|
+
})(Mode || (Mode = {}));
|
|
776
|
+
export var WixCommonSortOrder;
|
|
777
|
+
(function (WixCommonSortOrder) {
|
|
778
|
+
WixCommonSortOrder["ASC"] = "ASC";
|
|
779
|
+
WixCommonSortOrder["DESC"] = "DESC";
|
|
780
|
+
})(WixCommonSortOrder || (WixCommonSortOrder = {}));
|
|
781
|
+
export var ValueAggregationSortType;
|
|
782
|
+
(function (ValueAggregationSortType) {
|
|
783
|
+
/** Sort by number of matches. */
|
|
784
|
+
ValueAggregationSortType["COUNT"] = "COUNT";
|
|
785
|
+
/** Sort by value of the field alphabetically. */
|
|
786
|
+
ValueAggregationSortType["VALUE"] = "VALUE";
|
|
787
|
+
})(ValueAggregationSortType || (ValueAggregationSortType = {}));
|
|
788
|
+
export var ValueAggregationSortDirection;
|
|
789
|
+
(function (ValueAggregationSortDirection) {
|
|
790
|
+
/** Sort in descending order. */
|
|
791
|
+
ValueAggregationSortDirection["DESC"] = "DESC";
|
|
792
|
+
/** Sort in ascending order. */
|
|
793
|
+
ValueAggregationSortDirection["ASC"] = "ASC";
|
|
794
|
+
})(ValueAggregationSortDirection || (ValueAggregationSortDirection = {}));
|
|
795
|
+
export var ValueAggregationMissingValues;
|
|
796
|
+
(function (ValueAggregationMissingValues) {
|
|
797
|
+
/** Exclude missing values from the aggregation results. */
|
|
798
|
+
ValueAggregationMissingValues["EXCLUDE"] = "EXCLUDE";
|
|
799
|
+
/** Include missing values in the aggregation results. */
|
|
800
|
+
ValueAggregationMissingValues["INCLUDE"] = "INCLUDE";
|
|
801
|
+
})(ValueAggregationMissingValues || (ValueAggregationMissingValues = {}));
|
|
802
|
+
export var CommonScalarType;
|
|
803
|
+
(function (CommonScalarType) {
|
|
804
|
+
CommonScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
805
|
+
/** Count of distinct values. */
|
|
806
|
+
CommonScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
807
|
+
/** Minimum value. */
|
|
808
|
+
CommonScalarType["MIN"] = "MIN";
|
|
809
|
+
/** Maximum value. */
|
|
810
|
+
CommonScalarType["MAX"] = "MAX";
|
|
811
|
+
})(CommonScalarType || (CommonScalarType = {}));
|
|
812
|
+
export var NestedAggregationNestedAggregationType;
|
|
813
|
+
(function (NestedAggregationNestedAggregationType) {
|
|
814
|
+
NestedAggregationNestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
815
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
816
|
+
NestedAggregationNestedAggregationType["VALUE"] = "VALUE";
|
|
817
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket. */
|
|
818
|
+
NestedAggregationNestedAggregationType["RANGE"] = "RANGE";
|
|
819
|
+
/** A single-value metric aggregation. For example, min, max, sum, avg. */
|
|
820
|
+
NestedAggregationNestedAggregationType["SCALAR"] = "SCALAR";
|
|
821
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.). */
|
|
822
|
+
NestedAggregationNestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
823
|
+
})(NestedAggregationNestedAggregationType || (NestedAggregationNestedAggregationType = {}));
|
|
824
|
+
export var DateHistogramAggregationInterval;
|
|
825
|
+
(function (DateHistogramAggregationInterval) {
|
|
826
|
+
DateHistogramAggregationInterval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
827
|
+
/** Yearly interval */
|
|
828
|
+
DateHistogramAggregationInterval["YEAR"] = "YEAR";
|
|
829
|
+
/** Monthly interval */
|
|
830
|
+
DateHistogramAggregationInterval["MONTH"] = "MONTH";
|
|
831
|
+
/** Weekly interval */
|
|
832
|
+
DateHistogramAggregationInterval["WEEK"] = "WEEK";
|
|
833
|
+
/** Daily interval */
|
|
834
|
+
DateHistogramAggregationInterval["DAY"] = "DAY";
|
|
835
|
+
/** Hourly interval */
|
|
836
|
+
DateHistogramAggregationInterval["HOUR"] = "HOUR";
|
|
837
|
+
/** Minute interval */
|
|
838
|
+
DateHistogramAggregationInterval["MINUTE"] = "MINUTE";
|
|
839
|
+
/** Second interval */
|
|
840
|
+
DateHistogramAggregationInterval["SECOND"] = "SECOND";
|
|
841
|
+
})(DateHistogramAggregationInterval || (DateHistogramAggregationInterval = {}));
|
|
842
|
+
export var CommonAggregationType;
|
|
843
|
+
(function (CommonAggregationType) {
|
|
844
|
+
CommonAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
845
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
846
|
+
CommonAggregationType["VALUE"] = "VALUE";
|
|
847
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket. */
|
|
848
|
+
CommonAggregationType["RANGE"] = "RANGE";
|
|
849
|
+
/** A single-value metric aggregation. For example, min, max, sum, avg. */
|
|
850
|
+
CommonAggregationType["SCALAR"] = "SCALAR";
|
|
851
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
852
|
+
CommonAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
853
|
+
/** Multi-level aggregation, where each next aggregation is nested within previous one. */
|
|
854
|
+
CommonAggregationType["NESTED"] = "NESTED";
|
|
855
|
+
})(CommonAggregationType || (CommonAggregationType = {}));
|
|
856
|
+
export var SearchDetailsMode;
|
|
857
|
+
(function (SearchDetailsMode) {
|
|
858
|
+
/** Any of the search terms must be present. */
|
|
859
|
+
SearchDetailsMode["OR"] = "OR";
|
|
860
|
+
/** All search terms must be present. */
|
|
861
|
+
SearchDetailsMode["AND"] = "AND";
|
|
862
|
+
})(SearchDetailsMode || (SearchDetailsMode = {}));
|
|
863
|
+
export var VariantsOpsRequestedFields;
|
|
864
|
+
(function (VariantsOpsRequestedFields) {
|
|
865
|
+
/** Not implemented. */
|
|
866
|
+
VariantsOpsRequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
867
|
+
VariantsOpsRequestedFields["CURRENCY"] = "CURRENCY";
|
|
868
|
+
/** You can request merchant data only if you have the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope. */
|
|
869
|
+
VariantsOpsRequestedFields["MERCHANT_DATA"] = "MERCHANT_DATA";
|
|
870
|
+
VariantsOpsRequestedFields["SUBSCRIPTION_PRICES_INFO"] = "SUBSCRIPTION_PRICES_INFO";
|
|
871
|
+
VariantsOpsRequestedFields["VARIANT_OPTION_CHOICE_NAMES"] = "VARIANT_OPTION_CHOICE_NAMES";
|
|
872
|
+
VariantsOpsRequestedFields["THUMBNAIL"] = "THUMBNAIL";
|
|
873
|
+
})(VariantsOpsRequestedFields || (VariantsOpsRequestedFields = {}));
|
|
874
|
+
export var RoundingStrategy;
|
|
875
|
+
(function (RoundingStrategy) {
|
|
876
|
+
/** Undefined rounding strategy. */
|
|
877
|
+
RoundingStrategy["UNKNOWN_ROUNDING_STRATEGY"] = "UNKNOWN_ROUNDING_STRATEGY";
|
|
878
|
+
/**
|
|
879
|
+
* Calculated prices are saved without rounding to keep the maximum possible precision. It's a good idea to round numbers before displaying them.
|
|
880
|
+
* For example, input $3.5555 -> saved value $3.5555
|
|
881
|
+
*/
|
|
882
|
+
RoundingStrategy["NO_ROUNDING"] = "NO_ROUNDING";
|
|
883
|
+
/**
|
|
884
|
+
* Calculated prices are rounded according to currency precision.
|
|
885
|
+
* For example:, input $3.5555 -> saved value $3.56, input ¥3.5555 -> saved value ¥4
|
|
886
|
+
*/
|
|
887
|
+
RoundingStrategy["CURRENCY_PRECISION"] = "CURRENCY_PRECISION";
|
|
888
|
+
/**
|
|
889
|
+
* Calculated prices are rounded to nearest whole number.
|
|
890
|
+
* For example, input $3.5555 -> saved value $4
|
|
891
|
+
*/
|
|
892
|
+
RoundingStrategy["NEAREST_WHOLE_NUMBER"] = "NEAREST_WHOLE_NUMBER";
|
|
893
|
+
})(RoundingStrategy || (RoundingStrategy = {}));
|
|
894
|
+
/**
|
|
895
|
+
* Creates a new product.
|
|
896
|
+
*
|
|
897
|
+
* This endpoint also allows to add a ribbon, brand, info sections, options, and modifiers.
|
|
898
|
+
* @param product - Product to create.
|
|
899
|
+
*
|
|
900
|
+
* At least 1 variant must be provided and each variant must have relevant item in `choices` field for every item in `options`.
|
|
901
|
+
* If `options` is empty one default variant must be provided with empty `choices` list.
|
|
902
|
+
* @public
|
|
903
|
+
* @documentationMaturity preview
|
|
904
|
+
* @requiredField product
|
|
905
|
+
* @requiredField product.media.itemsInfo.items
|
|
906
|
+
* @requiredField product.modifiers
|
|
907
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
908
|
+
* @requiredField product.name
|
|
909
|
+
* @requiredField product.options
|
|
910
|
+
* @requiredField product.options.choicesSettings.choices
|
|
911
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
912
|
+
* @requiredField product.productType
|
|
913
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
914
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
915
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
916
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
917
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
918
|
+
* @requiredField product.variantsInfo
|
|
919
|
+
* @requiredField product.variantsInfo.variants
|
|
920
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
921
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
922
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
923
|
+
* @requiredField product.variantsInfo.variants.price
|
|
924
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
925
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
926
|
+
* @permissionScope Manage Stores - all permissions
|
|
927
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
928
|
+
* @permissionScope Manage Products
|
|
929
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
930
|
+
* @permissionScope Product write in v3 catalog
|
|
931
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
932
|
+
* @permissionScope Manage v3 catalog
|
|
933
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
934
|
+
* @applicableIdentity APP
|
|
935
|
+
* @returns Created product.
|
|
936
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.CreateProduct
|
|
937
|
+
*/
|
|
938
|
+
export async function createProduct(product, options) {
|
|
939
|
+
// @ts-ignore
|
|
940
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
941
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
942
|
+
product: product,
|
|
943
|
+
fields: options?.fields,
|
|
944
|
+
}), [
|
|
945
|
+
{
|
|
946
|
+
transformFn: transformSDKPageURLV2ToRESTPageURLV2,
|
|
947
|
+
paths: [{ path: 'product.url' }],
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
transformFn: transformSDKImageToRESTImage,
|
|
951
|
+
paths: [
|
|
952
|
+
{ path: 'product.media.main.image' },
|
|
953
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
954
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
955
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
956
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
957
|
+
{
|
|
958
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
959
|
+
},
|
|
960
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
961
|
+
],
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
965
|
+
paths: [
|
|
966
|
+
{ path: 'product.media.main.video' },
|
|
967
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
968
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
969
|
+
{
|
|
970
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
971
|
+
},
|
|
972
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
973
|
+
],
|
|
974
|
+
},
|
|
975
|
+
]);
|
|
976
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.createProduct(payload);
|
|
977
|
+
sideEffects?.onSiteCall?.();
|
|
978
|
+
try {
|
|
979
|
+
const result = await httpClient.request(reqOpts);
|
|
980
|
+
sideEffects?.onSuccess?.(result);
|
|
981
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
982
|
+
{
|
|
983
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
984
|
+
paths: [{ path: 'product.url' }],
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
transformFn: transformRESTImageToSDKImage,
|
|
988
|
+
paths: [
|
|
989
|
+
{ path: 'product.media.main.image' },
|
|
990
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
991
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
992
|
+
{
|
|
993
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
994
|
+
},
|
|
995
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
996
|
+
{
|
|
997
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
998
|
+
},
|
|
999
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1000
|
+
],
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1004
|
+
paths: [
|
|
1005
|
+
{ path: 'product.media.main.video' },
|
|
1006
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1007
|
+
{
|
|
1008
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1012
|
+
},
|
|
1013
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1014
|
+
],
|
|
1015
|
+
},
|
|
1016
|
+
]))?.product;
|
|
1017
|
+
}
|
|
1018
|
+
catch (err) {
|
|
1019
|
+
const transformedError = sdkTransformError(err, {
|
|
1020
|
+
spreadPathsToArguments: {},
|
|
1021
|
+
explicitPathsToArguments: { product: '$[0]', fields: '$[1].fields' },
|
|
1022
|
+
singleArgumentUnchanged: false,
|
|
1023
|
+
}, ['product', 'options']);
|
|
1024
|
+
sideEffects?.onError?.(err);
|
|
1025
|
+
throw transformedError;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Creates a new product, and can create the product's inventory in the variants' default locations.
|
|
1030
|
+
*
|
|
1031
|
+
* This endpoint also allows to add a ribbon, brand, info sections, options, and modifiers.
|
|
1032
|
+
* @param product - Product to create with inventory.
|
|
1033
|
+
*
|
|
1034
|
+
* At least one variant must be provided and each variant must have relevant item in `choices` field for every item in `options`.
|
|
1035
|
+
* If `options` is empty one default variant must be provided with empty `choices` list.
|
|
1036
|
+
* @public
|
|
1037
|
+
* @documentationMaturity preview
|
|
1038
|
+
* @requiredField product
|
|
1039
|
+
* @requiredField product.media.itemsInfo.items
|
|
1040
|
+
* @requiredField product.modifiers
|
|
1041
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
1042
|
+
* @requiredField product.name
|
|
1043
|
+
* @requiredField product.options
|
|
1044
|
+
* @requiredField product.options.choicesSettings.choices
|
|
1045
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
1046
|
+
* @requiredField product.productType
|
|
1047
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
1048
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
1049
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
1050
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
1051
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
1052
|
+
* @requiredField product.variantsInfo
|
|
1053
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1054
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1055
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1056
|
+
* @requiredField product.variantsInfo.variants.price
|
|
1057
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
1058
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
1059
|
+
* @permissionScope Manage Stores - all permissions
|
|
1060
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1061
|
+
* @permissionScope Manage Products
|
|
1062
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1063
|
+
* @permissionScope Product write in v3 catalog
|
|
1064
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1065
|
+
* @permissionScope Manage v3 catalog
|
|
1066
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1067
|
+
* @applicableIdentity APP
|
|
1068
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.CreateProductWithInventory
|
|
1069
|
+
*/
|
|
1070
|
+
export async function createProductWithInventory(product, options) {
|
|
1071
|
+
// @ts-ignore
|
|
1072
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1073
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1074
|
+
product: product,
|
|
1075
|
+
returnEntity: options?.returnEntity,
|
|
1076
|
+
fields: options?.fields,
|
|
1077
|
+
}), [
|
|
1078
|
+
{
|
|
1079
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1080
|
+
paths: [
|
|
1081
|
+
{ path: 'product.media.main.image' },
|
|
1082
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1083
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1084
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
1085
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1086
|
+
{
|
|
1087
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1088
|
+
},
|
|
1089
|
+
],
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1093
|
+
paths: [
|
|
1094
|
+
{ path: 'product.media.main.video' },
|
|
1095
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1096
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
1097
|
+
{
|
|
1098
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1099
|
+
},
|
|
1100
|
+
],
|
|
1101
|
+
},
|
|
1102
|
+
]);
|
|
1103
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.createProductWithInventory(payload);
|
|
1104
|
+
sideEffects?.onSiteCall?.();
|
|
1105
|
+
try {
|
|
1106
|
+
const result = await httpClient.request(reqOpts);
|
|
1107
|
+
sideEffects?.onSuccess?.(result);
|
|
1108
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1109
|
+
{
|
|
1110
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1111
|
+
paths: [{ path: 'product.url' }],
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1115
|
+
paths: [
|
|
1116
|
+
{ path: 'product.media.main.image' },
|
|
1117
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1118
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1119
|
+
{
|
|
1120
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1121
|
+
},
|
|
1122
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1123
|
+
{
|
|
1124
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1125
|
+
},
|
|
1126
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1127
|
+
],
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1131
|
+
paths: [
|
|
1132
|
+
{ path: 'product.media.main.video' },
|
|
1133
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1134
|
+
{
|
|
1135
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1139
|
+
},
|
|
1140
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1141
|
+
],
|
|
1142
|
+
},
|
|
1143
|
+
]));
|
|
1144
|
+
}
|
|
1145
|
+
catch (err) {
|
|
1146
|
+
const transformedError = sdkTransformError(err, {
|
|
1147
|
+
spreadPathsToArguments: {},
|
|
1148
|
+
explicitPathsToArguments: {
|
|
1149
|
+
product: '$[0]',
|
|
1150
|
+
returnEntity: '$[1].returnEntity',
|
|
1151
|
+
fields: '$[1].fields',
|
|
1152
|
+
},
|
|
1153
|
+
singleArgumentUnchanged: false,
|
|
1154
|
+
}, ['product', 'options']);
|
|
1155
|
+
sideEffects?.onError?.(err);
|
|
1156
|
+
throw transformedError;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Updates a product.
|
|
1161
|
+
*
|
|
1162
|
+
* Each time the product is updated, `revision` increments by 1.
|
|
1163
|
+
* The current `revision` must be passed when updating the product.
|
|
1164
|
+
* This ensures you're working with the latest product and prevents unintended overwrites.
|
|
1165
|
+
*
|
|
1166
|
+
* >**Notes:**
|
|
1167
|
+
* > + If `variantsInfo.variants` are passed, they will replace all existing variants.
|
|
1168
|
+
* > + To update existing `variantsInfo.variants`, make sure to provide `variantsInfo.variants.id`. If no ID is passed, the variant will be created with a new ID.
|
|
1169
|
+
* @param _id - Product ID.
|
|
1170
|
+
* @public
|
|
1171
|
+
* @documentationMaturity preview
|
|
1172
|
+
* @requiredField _id
|
|
1173
|
+
* @requiredField product
|
|
1174
|
+
* @requiredField product.media.itemsInfo.items
|
|
1175
|
+
* @requiredField product.modifiers
|
|
1176
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
1177
|
+
* @requiredField product.options
|
|
1178
|
+
* @requiredField product.options.choicesSettings.choices
|
|
1179
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
1180
|
+
* @requiredField product.revision
|
|
1181
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
1182
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
1183
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
1184
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
1185
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
1186
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1187
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1188
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1189
|
+
* @requiredField product.variantsInfo.variants.price
|
|
1190
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
1191
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1192
|
+
* @permissionScope Manage Stores - all permissions
|
|
1193
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1194
|
+
* @permissionScope Manage Products
|
|
1195
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1196
|
+
* @permissionScope Product write in v3 catalog
|
|
1197
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1198
|
+
* @permissionScope Manage v3 catalog
|
|
1199
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1200
|
+
* @applicableIdentity APP
|
|
1201
|
+
* @returns Updated product.
|
|
1202
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.UpdateProduct
|
|
1203
|
+
*/
|
|
1204
|
+
export async function updateProduct(_id, product, options) {
|
|
1205
|
+
// @ts-ignore
|
|
1206
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
1207
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1208
|
+
product: { ...product, id: _id },
|
|
1209
|
+
fields: options?.fields,
|
|
1210
|
+
}), [
|
|
1211
|
+
{
|
|
1212
|
+
transformFn: transformSDKPageURLV2ToRESTPageURLV2,
|
|
1213
|
+
paths: [{ path: 'product.url' }],
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1217
|
+
paths: [
|
|
1218
|
+
{ path: 'product.media.main.image' },
|
|
1219
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1220
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1221
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
1222
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1223
|
+
{
|
|
1224
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1225
|
+
},
|
|
1226
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1227
|
+
],
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1231
|
+
paths: [
|
|
1232
|
+
{ path: 'product.media.main.video' },
|
|
1233
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1234
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
1235
|
+
{
|
|
1236
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1237
|
+
},
|
|
1238
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1239
|
+
],
|
|
1240
|
+
},
|
|
1241
|
+
]);
|
|
1242
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.updateProduct(payload);
|
|
1243
|
+
sideEffects?.onSiteCall?.();
|
|
1244
|
+
try {
|
|
1245
|
+
const result = await httpClient.request(reqOpts);
|
|
1246
|
+
sideEffects?.onSuccess?.(result);
|
|
1247
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1248
|
+
{
|
|
1249
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1250
|
+
paths: [{ path: 'product.url' }],
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1254
|
+
paths: [
|
|
1255
|
+
{ path: 'product.media.main.image' },
|
|
1256
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1257
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1258
|
+
{
|
|
1259
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1260
|
+
},
|
|
1261
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1262
|
+
{
|
|
1263
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1264
|
+
},
|
|
1265
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1266
|
+
],
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1270
|
+
paths: [
|
|
1271
|
+
{ path: 'product.media.main.video' },
|
|
1272
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1273
|
+
{
|
|
1274
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1278
|
+
},
|
|
1279
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1280
|
+
],
|
|
1281
|
+
},
|
|
1282
|
+
]))?.product;
|
|
1283
|
+
}
|
|
1284
|
+
catch (err) {
|
|
1285
|
+
const transformedError = sdkTransformError(err, {
|
|
1286
|
+
spreadPathsToArguments: { product: '$[1]' },
|
|
1287
|
+
explicitPathsToArguments: {
|
|
1288
|
+
'product.id': '$[0]',
|
|
1289
|
+
fields: '$[2].fields',
|
|
1290
|
+
},
|
|
1291
|
+
singleArgumentUnchanged: false,
|
|
1292
|
+
}, ['_id', 'product', 'options']);
|
|
1293
|
+
sideEffects?.onError?.(err);
|
|
1294
|
+
throw transformedError;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Updates a new product, and can update the product's inventory.
|
|
1299
|
+
*
|
|
1300
|
+
* Each time the product is updated, `revision` increments by 1.
|
|
1301
|
+
* The current `revision` must be passed when updating the product.
|
|
1302
|
+
* This ensures you're working with the latest product and prevents unintended overwrites.
|
|
1303
|
+
*
|
|
1304
|
+
* >**Notes:**
|
|
1305
|
+
* > + Passing `variantsInfo.variants` will replace all existing variants.
|
|
1306
|
+
* > + To update existing `variantsInfo.variants`, pass `variantsInfo.variants.id`. If no ID is passed, the variant will be created with a new ID.
|
|
1307
|
+
* @param _id - Product ID.
|
|
1308
|
+
* @public
|
|
1309
|
+
* @documentationMaturity preview
|
|
1310
|
+
* @requiredField _id
|
|
1311
|
+
* @requiredField product
|
|
1312
|
+
* @requiredField product.media.itemsInfo.items
|
|
1313
|
+
* @requiredField product.modifiers
|
|
1314
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
1315
|
+
* @requiredField product.options
|
|
1316
|
+
* @requiredField product.options.choicesSettings.choices
|
|
1317
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
1318
|
+
* @requiredField product.revision
|
|
1319
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
1320
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
1321
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
1322
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
1323
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
1324
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1325
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1326
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1327
|
+
* @requiredField product.variantsInfo.variants.price
|
|
1328
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
1329
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1330
|
+
* @permissionScope Manage Stores - all permissions
|
|
1331
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1332
|
+
* @permissionScope Manage Products
|
|
1333
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1334
|
+
* @permissionScope Product write in v3 catalog
|
|
1335
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1336
|
+
* @permissionScope Manage v3 catalog
|
|
1337
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1338
|
+
* @applicableIdentity APP
|
|
1339
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.UpdateProductWithInventory
|
|
1340
|
+
*/
|
|
1341
|
+
export async function updateProductWithInventory(_id, product, options) {
|
|
1342
|
+
// @ts-ignore
|
|
1343
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
1344
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1345
|
+
product: { ...product, id: _id },
|
|
1346
|
+
returnEntity: options?.returnEntity,
|
|
1347
|
+
fields: options?.fields,
|
|
1348
|
+
}), [
|
|
1349
|
+
{
|
|
1350
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1351
|
+
paths: [
|
|
1352
|
+
{ path: 'product.media.main.image' },
|
|
1353
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1354
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1355
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
1356
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1357
|
+
{
|
|
1358
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1359
|
+
},
|
|
1360
|
+
],
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1364
|
+
paths: [
|
|
1365
|
+
{ path: 'product.media.main.video' },
|
|
1366
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1367
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
1368
|
+
{
|
|
1369
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1370
|
+
},
|
|
1371
|
+
],
|
|
1372
|
+
},
|
|
1373
|
+
]);
|
|
1374
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.updateProductWithInventory(payload);
|
|
1375
|
+
sideEffects?.onSiteCall?.();
|
|
1376
|
+
try {
|
|
1377
|
+
const result = await httpClient.request(reqOpts);
|
|
1378
|
+
sideEffects?.onSuccess?.(result);
|
|
1379
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1380
|
+
{
|
|
1381
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1382
|
+
paths: [{ path: 'product.url' }],
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1386
|
+
paths: [
|
|
1387
|
+
{ path: 'product.media.main.image' },
|
|
1388
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1389
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1390
|
+
{
|
|
1391
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1392
|
+
},
|
|
1393
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1394
|
+
{
|
|
1395
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1396
|
+
},
|
|
1397
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1398
|
+
],
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1402
|
+
paths: [
|
|
1403
|
+
{ path: 'product.media.main.video' },
|
|
1404
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1405
|
+
{
|
|
1406
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1410
|
+
},
|
|
1411
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1412
|
+
],
|
|
1413
|
+
},
|
|
1414
|
+
]));
|
|
1415
|
+
}
|
|
1416
|
+
catch (err) {
|
|
1417
|
+
const transformedError = sdkTransformError(err, {
|
|
1418
|
+
spreadPathsToArguments: { product: '$[1]' },
|
|
1419
|
+
explicitPathsToArguments: {
|
|
1420
|
+
'product.id': '$[0]',
|
|
1421
|
+
returnEntity: '$[2].returnEntity',
|
|
1422
|
+
fields: '$[2].fields',
|
|
1423
|
+
},
|
|
1424
|
+
singleArgumentUnchanged: false,
|
|
1425
|
+
}, ['_id', 'product', 'options']);
|
|
1426
|
+
sideEffects?.onError?.(err);
|
|
1427
|
+
throw transformedError;
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Creates up to 100 products.
|
|
1432
|
+
*
|
|
1433
|
+
* >**Note:**
|
|
1434
|
+
* > The following limits apply to the total number of creatable entities in a single request.
|
|
1435
|
+
* > For example, you can create 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1436
|
+
* > Alternatively, you can create 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1437
|
+
* > + `options`: 100
|
|
1438
|
+
* > + `modifiers`: 100
|
|
1439
|
+
* > + `infoSections`: 100
|
|
1440
|
+
* > + `variantsInfo.variants`: 1000
|
|
1441
|
+
* @param products - List of products to create.
|
|
1442
|
+
* @public
|
|
1443
|
+
* @documentationMaturity preview
|
|
1444
|
+
* @requiredField products
|
|
1445
|
+
* @requiredField products.media.itemsInfo.items
|
|
1446
|
+
* @requiredField products.modifiers
|
|
1447
|
+
* @requiredField products.modifiers.choicesSettings.choices
|
|
1448
|
+
* @requiredField products.name
|
|
1449
|
+
* @requiredField products.options
|
|
1450
|
+
* @requiredField products.options.choicesSettings.choices
|
|
1451
|
+
* @requiredField products.physicalProperties.pricePerUnit.measurementUnit
|
|
1452
|
+
* @requiredField products.productType
|
|
1453
|
+
* @requiredField products.subscriptionDetails.subscriptions
|
|
1454
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount
|
|
1455
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount.type
|
|
1456
|
+
* @requiredField products.subscriptionDetails.subscriptions.frequency
|
|
1457
|
+
* @requiredField products.subscriptionDetails.subscriptions.title
|
|
1458
|
+
* @requiredField products.variantsInfo
|
|
1459
|
+
* @requiredField products.variantsInfo.variants
|
|
1460
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile
|
|
1461
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1462
|
+
* @requiredField products.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1463
|
+
* @requiredField products.variantsInfo.variants.price
|
|
1464
|
+
* @requiredField products.variantsInfo.variants.price.actualPrice
|
|
1465
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
1466
|
+
* @permissionScope Manage Stores - all permissions
|
|
1467
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1468
|
+
* @permissionScope Manage Products
|
|
1469
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1470
|
+
* @permissionScope Product write in v3 catalog
|
|
1471
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1472
|
+
* @permissionScope Manage v3 catalog
|
|
1473
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1474
|
+
* @applicableIdentity APP
|
|
1475
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkCreateProducts
|
|
1476
|
+
*/
|
|
1477
|
+
export async function bulkCreateProducts(products, options) {
|
|
1478
|
+
// @ts-ignore
|
|
1479
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1480
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1481
|
+
products: products,
|
|
1482
|
+
returnEntity: options?.returnEntity,
|
|
1483
|
+
fields: options?.fields,
|
|
1484
|
+
}), [
|
|
1485
|
+
{
|
|
1486
|
+
transformFn: transformSDKPageURLV2ToRESTPageURLV2,
|
|
1487
|
+
paths: [{ path: 'products.url' }],
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1491
|
+
paths: [
|
|
1492
|
+
{ path: 'products.media.main.image' },
|
|
1493
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
1494
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
1495
|
+
{
|
|
1496
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
1497
|
+
},
|
|
1498
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
1499
|
+
{
|
|
1500
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1501
|
+
},
|
|
1502
|
+
{ path: 'products.variantsInfo.variants.media.image' },
|
|
1503
|
+
],
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1507
|
+
paths: [
|
|
1508
|
+
{ path: 'products.media.main.video' },
|
|
1509
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
1510
|
+
{
|
|
1511
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1515
|
+
},
|
|
1516
|
+
{ path: 'products.variantsInfo.variants.media.video' },
|
|
1517
|
+
],
|
|
1518
|
+
},
|
|
1519
|
+
]);
|
|
1520
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkCreateProducts(payload);
|
|
1521
|
+
sideEffects?.onSiteCall?.();
|
|
1522
|
+
try {
|
|
1523
|
+
const result = await httpClient.request(reqOpts);
|
|
1524
|
+
sideEffects?.onSuccess?.(result);
|
|
1525
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1526
|
+
{
|
|
1527
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1528
|
+
paths: [{ path: 'results.item.url' }],
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1532
|
+
paths: [
|
|
1533
|
+
{ path: 'results.item.media.main.image' },
|
|
1534
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
1535
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
1536
|
+
{
|
|
1537
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1538
|
+
},
|
|
1539
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
1540
|
+
{
|
|
1541
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1542
|
+
},
|
|
1543
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
1544
|
+
],
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1548
|
+
paths: [
|
|
1549
|
+
{ path: 'results.item.media.main.video' },
|
|
1550
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
1551
|
+
{
|
|
1552
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1556
|
+
},
|
|
1557
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
1558
|
+
],
|
|
1559
|
+
},
|
|
1560
|
+
]));
|
|
1561
|
+
}
|
|
1562
|
+
catch (err) {
|
|
1563
|
+
const transformedError = sdkTransformError(err, {
|
|
1564
|
+
spreadPathsToArguments: {},
|
|
1565
|
+
explicitPathsToArguments: {
|
|
1566
|
+
products: '$[0]',
|
|
1567
|
+
returnEntity: '$[1].returnEntity',
|
|
1568
|
+
fields: '$[1].fields',
|
|
1569
|
+
},
|
|
1570
|
+
singleArgumentUnchanged: false,
|
|
1571
|
+
}, ['products', 'options']);
|
|
1572
|
+
sideEffects?.onError?.(err);
|
|
1573
|
+
throw transformedError;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Creates up to 100 products, and can create the products' inventories in the variants' default locations.
|
|
1578
|
+
*
|
|
1579
|
+
* >**Note:**
|
|
1580
|
+
* > The following limits apply to the total number of creatable entities in a single request.
|
|
1581
|
+
* > For example, you can create 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1582
|
+
* > Alternatively, you can create 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1583
|
+
* > + `options`: 100
|
|
1584
|
+
* > + `modifiers`: 100
|
|
1585
|
+
* > + `infoSections`: 100
|
|
1586
|
+
* > + `variantsInfo.variants`: 1000
|
|
1587
|
+
* @param products - List of products to create with inventory.
|
|
1588
|
+
* @public
|
|
1589
|
+
* @documentationMaturity preview
|
|
1590
|
+
* @requiredField products
|
|
1591
|
+
* @requiredField products.media.itemsInfo.items
|
|
1592
|
+
* @requiredField products.modifiers
|
|
1593
|
+
* @requiredField products.modifiers.choicesSettings.choices
|
|
1594
|
+
* @requiredField products.name
|
|
1595
|
+
* @requiredField products.options
|
|
1596
|
+
* @requiredField products.options.choicesSettings.choices
|
|
1597
|
+
* @requiredField products.physicalProperties.pricePerUnit.measurementUnit
|
|
1598
|
+
* @requiredField products.productType
|
|
1599
|
+
* @requiredField products.subscriptionDetails.subscriptions
|
|
1600
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount
|
|
1601
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount.type
|
|
1602
|
+
* @requiredField products.subscriptionDetails.subscriptions.frequency
|
|
1603
|
+
* @requiredField products.subscriptionDetails.subscriptions.title
|
|
1604
|
+
* @requiredField products.variantsInfo
|
|
1605
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile
|
|
1606
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1607
|
+
* @requiredField products.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1608
|
+
* @requiredField products.variantsInfo.variants.price
|
|
1609
|
+
* @requiredField products.variantsInfo.variants.price.actualPrice
|
|
1610
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
1611
|
+
* @permissionId WIX_STORES.INVENTORY_CREATE
|
|
1612
|
+
* @permissionScope Manage Stores - all permissions
|
|
1613
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1614
|
+
* @permissionScope Manage Products
|
|
1615
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1616
|
+
* @permissionScope Product write in v3 catalog
|
|
1617
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1618
|
+
* @permissionScope Manage v3 catalog
|
|
1619
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1620
|
+
* @permissionScope Manage Stores - all permissions
|
|
1621
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1622
|
+
* @permissionScope Inventory write in v3 catalog
|
|
1623
|
+
* @permissionScopeId SCOPE.STORES.INVENTORY_ITEM_WRITE
|
|
1624
|
+
* @permissionScope Manage Products
|
|
1625
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1626
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1627
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1628
|
+
* @permissionScope Manage v3 catalog
|
|
1629
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1630
|
+
* @applicableIdentity APP
|
|
1631
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkCreateProductsWithInventory
|
|
1632
|
+
*/
|
|
1633
|
+
export async function bulkCreateProductsWithInventory(products, options) {
|
|
1634
|
+
// @ts-ignore
|
|
1635
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1636
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1637
|
+
products: products,
|
|
1638
|
+
returnEntity: options?.returnEntity,
|
|
1639
|
+
fields: options?.fields,
|
|
1640
|
+
}), [
|
|
1641
|
+
{
|
|
1642
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1643
|
+
paths: [
|
|
1644
|
+
{ path: 'products.media.main.image' },
|
|
1645
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
1646
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
1647
|
+
{
|
|
1648
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
1649
|
+
},
|
|
1650
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
1651
|
+
{
|
|
1652
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1653
|
+
},
|
|
1654
|
+
],
|
|
1655
|
+
},
|
|
1656
|
+
{
|
|
1657
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1658
|
+
paths: [
|
|
1659
|
+
{ path: 'products.media.main.video' },
|
|
1660
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
1661
|
+
{
|
|
1662
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
1663
|
+
},
|
|
1664
|
+
{
|
|
1665
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1666
|
+
},
|
|
1667
|
+
],
|
|
1668
|
+
},
|
|
1669
|
+
]);
|
|
1670
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkCreateProductsWithInventory(payload);
|
|
1671
|
+
sideEffects?.onSiteCall?.();
|
|
1672
|
+
try {
|
|
1673
|
+
const result = await httpClient.request(reqOpts);
|
|
1674
|
+
sideEffects?.onSuccess?.(result);
|
|
1675
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1676
|
+
{
|
|
1677
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1678
|
+
paths: [{ path: 'productResults.results.item.url' }],
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1682
|
+
paths: [
|
|
1683
|
+
{ path: 'productResults.results.item.media.main.image' },
|
|
1684
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.image' },
|
|
1685
|
+
{
|
|
1686
|
+
path: 'productResults.results.item.options.choicesSettings.choices.image',
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.image',
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
path: 'productResults.results.item.variantsInfo.variants.media.image',
|
|
1699
|
+
},
|
|
1700
|
+
],
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1704
|
+
paths: [
|
|
1705
|
+
{ path: 'productResults.results.item.media.main.video' },
|
|
1706
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.video' },
|
|
1707
|
+
{
|
|
1708
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
path: 'productResults.results.item.variantsInfo.variants.media.video',
|
|
1715
|
+
},
|
|
1716
|
+
],
|
|
1717
|
+
},
|
|
1718
|
+
]));
|
|
1719
|
+
}
|
|
1720
|
+
catch (err) {
|
|
1721
|
+
const transformedError = sdkTransformError(err, {
|
|
1722
|
+
spreadPathsToArguments: {},
|
|
1723
|
+
explicitPathsToArguments: {
|
|
1724
|
+
products: '$[0]',
|
|
1725
|
+
returnEntity: '$[1].returnEntity',
|
|
1726
|
+
fields: '$[1].fields',
|
|
1727
|
+
},
|
|
1728
|
+
singleArgumentUnchanged: false,
|
|
1729
|
+
}, ['products', 'options']);
|
|
1730
|
+
sideEffects?.onError?.(err);
|
|
1731
|
+
throw transformedError;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Updates up to 100 products.
|
|
1736
|
+
*
|
|
1737
|
+
* >**Note:**
|
|
1738
|
+
* > The following limits apply to the total number of updatable entities in a single request.
|
|
1739
|
+
* > For example, you can update 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1740
|
+
* > Alternatively, you can update 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1741
|
+
* > + `options`: 100
|
|
1742
|
+
* > + `modifiers`: 100
|
|
1743
|
+
* > + `infoSections`: 100
|
|
1744
|
+
* > + `variantsInfo.variants`: 1000
|
|
1745
|
+
* @param products - List of products to update.
|
|
1746
|
+
* @public
|
|
1747
|
+
* @documentationMaturity preview
|
|
1748
|
+
* @requiredField products
|
|
1749
|
+
* @requiredField products.product
|
|
1750
|
+
* @requiredField products.product._id
|
|
1751
|
+
* @requiredField products.product.media.itemsInfo.items
|
|
1752
|
+
* @requiredField products.product.modifiers
|
|
1753
|
+
* @requiredField products.product.modifiers.choicesSettings.choices
|
|
1754
|
+
* @requiredField products.product.options
|
|
1755
|
+
* @requiredField products.product.options.choicesSettings.choices
|
|
1756
|
+
* @requiredField products.product.physicalProperties.pricePerUnit.measurementUnit
|
|
1757
|
+
* @requiredField products.product.revision
|
|
1758
|
+
* @requiredField products.product.subscriptionDetails.subscriptions
|
|
1759
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount
|
|
1760
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount.type
|
|
1761
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.frequency
|
|
1762
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.title
|
|
1763
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1764
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1765
|
+
* @requiredField products.product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1766
|
+
* @requiredField products.product.variantsInfo.variants.price
|
|
1767
|
+
* @requiredField products.product.variantsInfo.variants.price.actualPrice
|
|
1768
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1769
|
+
* @permissionScope Manage Stores - all permissions
|
|
1770
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1771
|
+
* @permissionScope Manage Products
|
|
1772
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1773
|
+
* @permissionScope Product write in v3 catalog
|
|
1774
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1775
|
+
* @permissionScope Manage v3 catalog
|
|
1776
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1777
|
+
* @applicableIdentity APP
|
|
1778
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProducts
|
|
1779
|
+
*/
|
|
1780
|
+
export async function bulkUpdateProducts(products, options) {
|
|
1781
|
+
// @ts-ignore
|
|
1782
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1783
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1784
|
+
products: products,
|
|
1785
|
+
returnEntity: options?.returnEntity,
|
|
1786
|
+
fields: options?.fields,
|
|
1787
|
+
}), [
|
|
1788
|
+
{
|
|
1789
|
+
transformFn: transformSDKPageURLV2ToRESTPageURLV2,
|
|
1790
|
+
paths: [{ path: 'products.product.url' }],
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1794
|
+
paths: [
|
|
1795
|
+
{ path: 'products.product.media.main.image' },
|
|
1796
|
+
{ path: 'products.product.media.itemsInfo.items.image' },
|
|
1797
|
+
{ path: 'products.product.options.choicesSettings.choices.image' },
|
|
1798
|
+
{
|
|
1799
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.image',
|
|
1800
|
+
},
|
|
1801
|
+
{ path: 'products.product.modifiers.choicesSettings.choices.image' },
|
|
1802
|
+
{
|
|
1803
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1804
|
+
},
|
|
1805
|
+
{ path: 'products.product.variantsInfo.variants.media.image' },
|
|
1806
|
+
],
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1810
|
+
paths: [
|
|
1811
|
+
{ path: 'products.product.media.main.video' },
|
|
1812
|
+
{ path: 'products.product.media.itemsInfo.items.video' },
|
|
1813
|
+
{
|
|
1814
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.video',
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1818
|
+
},
|
|
1819
|
+
{ path: 'products.product.variantsInfo.variants.media.video' },
|
|
1820
|
+
],
|
|
1821
|
+
},
|
|
1822
|
+
]);
|
|
1823
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProducts(payload);
|
|
1824
|
+
sideEffects?.onSiteCall?.();
|
|
1825
|
+
try {
|
|
1826
|
+
const result = await httpClient.request(reqOpts);
|
|
1827
|
+
sideEffects?.onSuccess?.(result);
|
|
1828
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1829
|
+
{
|
|
1830
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1831
|
+
paths: [{ path: 'results.item.url' }],
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1835
|
+
paths: [
|
|
1836
|
+
{ path: 'results.item.media.main.image' },
|
|
1837
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
1838
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
1839
|
+
{
|
|
1840
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1841
|
+
},
|
|
1842
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
1843
|
+
{
|
|
1844
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1845
|
+
},
|
|
1846
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
1847
|
+
],
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1851
|
+
paths: [
|
|
1852
|
+
{ path: 'results.item.media.main.video' },
|
|
1853
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
1854
|
+
{
|
|
1855
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
1856
|
+
},
|
|
1857
|
+
{
|
|
1858
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1859
|
+
},
|
|
1860
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
1861
|
+
],
|
|
1862
|
+
},
|
|
1863
|
+
]));
|
|
1864
|
+
}
|
|
1865
|
+
catch (err) {
|
|
1866
|
+
const transformedError = sdkTransformError(err, {
|
|
1867
|
+
spreadPathsToArguments: {},
|
|
1868
|
+
explicitPathsToArguments: {
|
|
1869
|
+
products: '$[0]',
|
|
1870
|
+
returnEntity: '$[1].returnEntity',
|
|
1871
|
+
fields: '$[1].fields',
|
|
1872
|
+
},
|
|
1873
|
+
singleArgumentUnchanged: false,
|
|
1874
|
+
}, ['products', 'options']);
|
|
1875
|
+
sideEffects?.onError?.(err);
|
|
1876
|
+
throw transformedError;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Updates up to 100 products, and can update the products' inventories in the variants' default locations.
|
|
1881
|
+
*
|
|
1882
|
+
* >**Note:**
|
|
1883
|
+
* > The following limits apply to the total number of updatable entities in a single request.
|
|
1884
|
+
* > For example, you can update 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1885
|
+
* > Alternatively, you can update 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1886
|
+
* > + `options`: 100
|
|
1887
|
+
* > + `modifiers`: 100
|
|
1888
|
+
* > + `infoSections`: 100
|
|
1889
|
+
* > + `variantsInfo.variants`: 1000
|
|
1890
|
+
* @param products - List of products to update.
|
|
1891
|
+
* @public
|
|
1892
|
+
* @documentationMaturity preview
|
|
1893
|
+
* @requiredField products
|
|
1894
|
+
* @requiredField products.product
|
|
1895
|
+
* @requiredField products.product._id
|
|
1896
|
+
* @requiredField products.product.media.itemsInfo.items
|
|
1897
|
+
* @requiredField products.product.modifiers
|
|
1898
|
+
* @requiredField products.product.modifiers.choicesSettings.choices
|
|
1899
|
+
* @requiredField products.product.options
|
|
1900
|
+
* @requiredField products.product.options.choicesSettings.choices
|
|
1901
|
+
* @requiredField products.product.physicalProperties.pricePerUnit.measurementUnit
|
|
1902
|
+
* @requiredField products.product.revision
|
|
1903
|
+
* @requiredField products.product.subscriptionDetails.subscriptions
|
|
1904
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount
|
|
1905
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount.type
|
|
1906
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.frequency
|
|
1907
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.title
|
|
1908
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1909
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1910
|
+
* @requiredField products.product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1911
|
+
* @requiredField products.product.variantsInfo.variants.price
|
|
1912
|
+
* @requiredField products.product.variantsInfo.variants.price.actualPrice
|
|
1913
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1914
|
+
* @permissionId WIX_STORES.INVENTORY_UPDATE
|
|
1915
|
+
* @permissionScope Manage Stores - all permissions
|
|
1916
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1917
|
+
* @permissionScope Manage Products
|
|
1918
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1919
|
+
* @permissionScope Product write in v3 catalog
|
|
1920
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1921
|
+
* @permissionScope Manage v3 catalog
|
|
1922
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1923
|
+
* @permissionScope Manage Stores - all permissions
|
|
1924
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1925
|
+
* @permissionScope Inventory write in v3 catalog
|
|
1926
|
+
* @permissionScopeId SCOPE.STORES.INVENTORY_ITEM_WRITE
|
|
1927
|
+
* @permissionScope Manage Products
|
|
1928
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1929
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1930
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1931
|
+
* @permissionScope Manage v3 catalog
|
|
1932
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1933
|
+
* @applicableIdentity APP
|
|
1934
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProductsWithInventory
|
|
1935
|
+
*/
|
|
1936
|
+
export async function bulkUpdateProductsWithInventory(products, options) {
|
|
1937
|
+
// @ts-ignore
|
|
1938
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1939
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
1940
|
+
products: products,
|
|
1941
|
+
returnEntity: options?.returnEntity,
|
|
1942
|
+
fields: options?.fields,
|
|
1943
|
+
}), [
|
|
1944
|
+
{
|
|
1945
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1946
|
+
paths: [
|
|
1947
|
+
{ path: 'products.product.media.main.image' },
|
|
1948
|
+
{ path: 'products.product.media.itemsInfo.items.image' },
|
|
1949
|
+
{ path: 'products.product.options.choicesSettings.choices.image' },
|
|
1950
|
+
{
|
|
1951
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.image',
|
|
1952
|
+
},
|
|
1953
|
+
{ path: 'products.product.modifiers.choicesSettings.choices.image' },
|
|
1954
|
+
{
|
|
1955
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1956
|
+
},
|
|
1957
|
+
],
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
1961
|
+
paths: [
|
|
1962
|
+
{ path: 'products.product.media.main.video' },
|
|
1963
|
+
{ path: 'products.product.media.itemsInfo.items.video' },
|
|
1964
|
+
{
|
|
1965
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.video',
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1969
|
+
},
|
|
1970
|
+
],
|
|
1971
|
+
},
|
|
1972
|
+
]);
|
|
1973
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProductsWithInventory(payload);
|
|
1974
|
+
sideEffects?.onSiteCall?.();
|
|
1975
|
+
try {
|
|
1976
|
+
const result = await httpClient.request(reqOpts);
|
|
1977
|
+
sideEffects?.onSuccess?.(result);
|
|
1978
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
1979
|
+
{
|
|
1980
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1981
|
+
paths: [{ path: 'productResults.results.item.url' }],
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1985
|
+
paths: [
|
|
1986
|
+
{ path: 'productResults.results.item.media.main.image' },
|
|
1987
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.image' },
|
|
1988
|
+
{
|
|
1989
|
+
path: 'productResults.results.item.options.choicesSettings.choices.image',
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.image',
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
path: 'productResults.results.item.variantsInfo.variants.media.image',
|
|
2002
|
+
},
|
|
2003
|
+
],
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
2007
|
+
paths: [
|
|
2008
|
+
{ path: 'productResults.results.item.media.main.video' },
|
|
2009
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.video' },
|
|
2010
|
+
{
|
|
2011
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
path: 'productResults.results.item.variantsInfo.variants.media.video',
|
|
2018
|
+
},
|
|
2019
|
+
],
|
|
2020
|
+
},
|
|
2021
|
+
]));
|
|
2022
|
+
}
|
|
2023
|
+
catch (err) {
|
|
2024
|
+
const transformedError = sdkTransformError(err, {
|
|
2025
|
+
spreadPathsToArguments: {},
|
|
2026
|
+
explicitPathsToArguments: {
|
|
2027
|
+
products: '$[0]',
|
|
2028
|
+
returnEntity: '$[1].returnEntity',
|
|
2029
|
+
fields: '$[1].fields',
|
|
2030
|
+
},
|
|
2031
|
+
singleArgumentUnchanged: false,
|
|
2032
|
+
}, ['products', 'options']);
|
|
2033
|
+
sideEffects?.onError?.(err);
|
|
2034
|
+
throw transformedError;
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
/**
|
|
2038
|
+
* Updates multiple products, given the provided filter.
|
|
2039
|
+
*
|
|
2040
|
+
* To update `infoSections`, `brand` or `ribbon` fields, you must also pass their existing `id`.
|
|
2041
|
+
*
|
|
2042
|
+
* > **Note:**
|
|
2043
|
+
* > The following fields cannot be updated with this endpoint:
|
|
2044
|
+
* > + `slug`
|
|
2045
|
+
* > + `options`
|
|
2046
|
+
* > + `modifiers`
|
|
2047
|
+
* > + `variantsInfo`
|
|
2048
|
+
* >
|
|
2049
|
+
* > To update these fields, use [Bulk Update Products](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/products-v3/bulk-update-products).
|
|
2050
|
+
* @public
|
|
2051
|
+
* @documentationMaturity preview
|
|
2052
|
+
* @requiredField options.product
|
|
2053
|
+
* @requiredField options.product.media.itemsInfo.items
|
|
2054
|
+
* @requiredField options.product.subscriptionDetails.subscriptions
|
|
2055
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.discount
|
|
2056
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.discount.type
|
|
2057
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.frequency
|
|
2058
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.title
|
|
2059
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2060
|
+
* @permissionScope Manage Stores - all permissions
|
|
2061
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2062
|
+
* @permissionScope Manage Products
|
|
2063
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2064
|
+
* @permissionScope Product write in v3 catalog
|
|
2065
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2066
|
+
* @permissionScope Manage v3 catalog
|
|
2067
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2068
|
+
* @applicableIdentity APP
|
|
2069
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProductsByFilter
|
|
2070
|
+
*/
|
|
2071
|
+
export async function bulkUpdateProductsByFilter(options) {
|
|
2072
|
+
// @ts-ignore
|
|
2073
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2074
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
2075
|
+
filter: options?.filter,
|
|
2076
|
+
product: options?.product,
|
|
2077
|
+
search: options?.search,
|
|
2078
|
+
}), [
|
|
2079
|
+
{
|
|
2080
|
+
transformFn: transformSDKPageURLV2ToRESTPageURLV2,
|
|
2081
|
+
paths: [{ path: 'product.url' }],
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
transformFn: transformSDKImageToRESTImage,
|
|
2085
|
+
paths: [
|
|
2086
|
+
{ path: 'product.media.main.image' },
|
|
2087
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2088
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2089
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
2090
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2091
|
+
{
|
|
2092
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2093
|
+
},
|
|
2094
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2095
|
+
],
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
2099
|
+
paths: [
|
|
2100
|
+
{ path: 'product.media.main.video' },
|
|
2101
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2102
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
2103
|
+
{
|
|
2104
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2105
|
+
},
|
|
2106
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2107
|
+
],
|
|
2108
|
+
},
|
|
2109
|
+
]);
|
|
2110
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProductsByFilter(payload);
|
|
2111
|
+
sideEffects?.onSiteCall?.();
|
|
2112
|
+
try {
|
|
2113
|
+
const result = await httpClient.request(reqOpts);
|
|
2114
|
+
sideEffects?.onSuccess?.(result);
|
|
2115
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
2116
|
+
}
|
|
2117
|
+
catch (err) {
|
|
2118
|
+
const transformedError = sdkTransformError(err, {
|
|
2119
|
+
spreadPathsToArguments: {},
|
|
2120
|
+
explicitPathsToArguments: {
|
|
2121
|
+
filter: '$[0].filter',
|
|
2122
|
+
product: '$[0].product',
|
|
2123
|
+
search: '$[0].search',
|
|
2124
|
+
},
|
|
2125
|
+
singleArgumentUnchanged: false,
|
|
2126
|
+
}, ['options']);
|
|
2127
|
+
sideEffects?.onError?.(err);
|
|
2128
|
+
throw transformedError;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Updates a product's extended fields.
|
|
2133
|
+
*
|
|
2134
|
+
* [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must first be configured in the app dashboard.
|
|
2135
|
+
* @param productId - Product ID.
|
|
2136
|
+
* @param namespace - App namespace.
|
|
2137
|
+
* @public
|
|
2138
|
+
* @documentationMaturity preview
|
|
2139
|
+
* @requiredField namespace
|
|
2140
|
+
* @requiredField options.namespaceData
|
|
2141
|
+
* @requiredField productId
|
|
2142
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2143
|
+
* @permissionScope Manage Stores - all permissions
|
|
2144
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2145
|
+
* @permissionScope Manage Products
|
|
2146
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2147
|
+
* @permissionScope Product write in v3 catalog
|
|
2148
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2149
|
+
* @permissionScope Manage v3 catalog
|
|
2150
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2151
|
+
* @applicableIdentity APP
|
|
2152
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.UpdateExtendedFields
|
|
2153
|
+
*/
|
|
2154
|
+
export async function updateExtendedFields(productId, namespace, options) {
|
|
2155
|
+
// @ts-ignore
|
|
2156
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
2157
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2158
|
+
productId: productId,
|
|
2159
|
+
namespace: namespace,
|
|
2160
|
+
namespaceData: options?.namespaceData,
|
|
2161
|
+
fields: options?.fields,
|
|
2162
|
+
});
|
|
2163
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.updateExtendedFields(payload);
|
|
2164
|
+
sideEffects?.onSiteCall?.();
|
|
2165
|
+
try {
|
|
2166
|
+
const result = await httpClient.request(reqOpts);
|
|
2167
|
+
sideEffects?.onSuccess?.(result);
|
|
2168
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
2169
|
+
{
|
|
2170
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
2171
|
+
paths: [{ path: 'product.url' }],
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
transformFn: transformRESTImageToSDKImage,
|
|
2175
|
+
paths: [
|
|
2176
|
+
{ path: 'product.media.main.image' },
|
|
2177
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2178
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2179
|
+
{
|
|
2180
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
2181
|
+
},
|
|
2182
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2183
|
+
{
|
|
2184
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2185
|
+
},
|
|
2186
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2187
|
+
],
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
2191
|
+
paths: [
|
|
2192
|
+
{ path: 'product.media.main.video' },
|
|
2193
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2194
|
+
{
|
|
2195
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
2196
|
+
},
|
|
2197
|
+
{
|
|
2198
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2199
|
+
},
|
|
2200
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2201
|
+
],
|
|
2202
|
+
},
|
|
2203
|
+
]));
|
|
2204
|
+
}
|
|
2205
|
+
catch (err) {
|
|
2206
|
+
const transformedError = sdkTransformError(err, {
|
|
2207
|
+
spreadPathsToArguments: {},
|
|
2208
|
+
explicitPathsToArguments: {
|
|
2209
|
+
productId: '$[0]',
|
|
2210
|
+
namespace: '$[1]',
|
|
2211
|
+
namespaceData: '$[2].namespaceData',
|
|
2212
|
+
fields: '$[2].fields',
|
|
2213
|
+
},
|
|
2214
|
+
singleArgumentUnchanged: false,
|
|
2215
|
+
}, ['productId', 'namespace', 'options']);
|
|
2216
|
+
sideEffects?.onError?.(err);
|
|
2217
|
+
throw transformedError;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Deletes a product and all its variants.
|
|
2222
|
+
* @param productId - Product ID.
|
|
2223
|
+
* @public
|
|
2224
|
+
* @documentationMaturity preview
|
|
2225
|
+
* @requiredField productId
|
|
2226
|
+
* @permissionId WIX_STORES.PRODUCT_DELETE
|
|
2227
|
+
* @permissionScope Manage Stores - all permissions
|
|
2228
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2229
|
+
* @permissionScope Manage Products
|
|
2230
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2231
|
+
* @permissionScope Product write in v3 catalog
|
|
2232
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2233
|
+
* @permissionScope Manage v3 catalog
|
|
2234
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2235
|
+
* @applicableIdentity APP
|
|
2236
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.DeleteProduct
|
|
2237
|
+
*/
|
|
2238
|
+
export async function deleteProduct(productId) {
|
|
2239
|
+
// @ts-ignore
|
|
2240
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2241
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2242
|
+
productId: productId,
|
|
2243
|
+
});
|
|
2244
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.deleteProduct(payload);
|
|
2245
|
+
sideEffects?.onSiteCall?.();
|
|
2246
|
+
try {
|
|
2247
|
+
const result = await httpClient.request(reqOpts);
|
|
2248
|
+
sideEffects?.onSuccess?.(result);
|
|
2249
|
+
}
|
|
2250
|
+
catch (err) {
|
|
2251
|
+
const transformedError = sdkTransformError(err, {
|
|
2252
|
+
spreadPathsToArguments: {},
|
|
2253
|
+
explicitPathsToArguments: { productId: '$[0]' },
|
|
2254
|
+
singleArgumentUnchanged: false,
|
|
2255
|
+
}, ['productId']);
|
|
2256
|
+
sideEffects?.onError?.(err);
|
|
2257
|
+
throw transformedError;
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
/**
|
|
2261
|
+
* Deletes multiple products.
|
|
2262
|
+
* @param productIds - IDs of products to delete.
|
|
2263
|
+
* @public
|
|
2264
|
+
* @documentationMaturity preview
|
|
2265
|
+
* @requiredField productIds
|
|
2266
|
+
* @permissionId WIX_STORES.PRODUCT_DELETE
|
|
2267
|
+
* @permissionScope Manage Stores - all permissions
|
|
2268
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2269
|
+
* @permissionScope Manage Products
|
|
2270
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2271
|
+
* @permissionScope Product write in v3 catalog
|
|
2272
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2273
|
+
* @permissionScope Manage v3 catalog
|
|
2274
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2275
|
+
* @applicableIdentity APP
|
|
2276
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkDeleteProducts
|
|
2277
|
+
*/
|
|
2278
|
+
export async function bulkDeleteProducts(productIds) {
|
|
2279
|
+
// @ts-ignore
|
|
2280
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2281
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2282
|
+
productIds: productIds,
|
|
2283
|
+
});
|
|
2284
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkDeleteProducts(payload);
|
|
2285
|
+
sideEffects?.onSiteCall?.();
|
|
2286
|
+
try {
|
|
2287
|
+
const result = await httpClient.request(reqOpts);
|
|
2288
|
+
sideEffects?.onSuccess?.(result);
|
|
2289
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
2290
|
+
}
|
|
2291
|
+
catch (err) {
|
|
2292
|
+
const transformedError = sdkTransformError(err, {
|
|
2293
|
+
spreadPathsToArguments: {},
|
|
2294
|
+
explicitPathsToArguments: { productIds: '$[0]' },
|
|
2295
|
+
singleArgumentUnchanged: false,
|
|
2296
|
+
}, ['productIds']);
|
|
2297
|
+
sideEffects?.onError?.(err);
|
|
2298
|
+
throw transformedError;
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Delete multiple products, given the provided filter.
|
|
2303
|
+
* @param filter - Filter object.
|
|
2304
|
+
* @public
|
|
2305
|
+
* @documentationMaturity preview
|
|
2306
|
+
* @requiredField filter
|
|
2307
|
+
* @permissionId WIX_STORES.PRODUCT_DELETE
|
|
2308
|
+
* @permissionScope Manage Stores - all permissions
|
|
2309
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2310
|
+
* @permissionScope Manage Products
|
|
2311
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2312
|
+
* @permissionScope Product write in v3 catalog
|
|
2313
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2314
|
+
* @permissionScope Manage v3 catalog
|
|
2315
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2316
|
+
* @applicableIdentity APP
|
|
2317
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkDeleteProductsByFilter
|
|
2318
|
+
*/
|
|
2319
|
+
export async function bulkDeleteProductsByFilter(filter, options) {
|
|
2320
|
+
// @ts-ignore
|
|
2321
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2322
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2323
|
+
filter: filter,
|
|
2324
|
+
search: options?.search,
|
|
2325
|
+
});
|
|
2326
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkDeleteProductsByFilter(payload);
|
|
2327
|
+
sideEffects?.onSiteCall?.();
|
|
2328
|
+
try {
|
|
2329
|
+
const result = await httpClient.request(reqOpts);
|
|
2330
|
+
sideEffects?.onSuccess?.(result);
|
|
2331
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
2332
|
+
}
|
|
2333
|
+
catch (err) {
|
|
2334
|
+
const transformedError = sdkTransformError(err, {
|
|
2335
|
+
spreadPathsToArguments: {},
|
|
2336
|
+
explicitPathsToArguments: { filter: '$[0]', search: '$[1].search' },
|
|
2337
|
+
singleArgumentUnchanged: false,
|
|
2338
|
+
}, ['filter', 'options']);
|
|
2339
|
+
sideEffects?.onError?.(err);
|
|
2340
|
+
throw transformedError;
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* Retrieves a product.
|
|
2345
|
+
*
|
|
2346
|
+
* > **Note:**
|
|
2347
|
+
* > To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2348
|
+
* @param productId - Product ID.
|
|
2349
|
+
* @public
|
|
2350
|
+
* @documentationMaturity preview
|
|
2351
|
+
* @requiredField productId
|
|
2352
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2353
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2354
|
+
* @permissionScope Manage Stores - all permissions
|
|
2355
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2356
|
+
* @permissionScope Read products in v3 catalog
|
|
2357
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2358
|
+
* @permissionScope Read v3 catalog
|
|
2359
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2360
|
+
* @permissionScope Manage Products
|
|
2361
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2362
|
+
* @permissionScope Read Stores - all read permissions
|
|
2363
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2364
|
+
* @permissionScope Read Products
|
|
2365
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2366
|
+
* @permissionScope Product v3 read admin
|
|
2367
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2368
|
+
* @permissionScope Manage v3 catalog
|
|
2369
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2370
|
+
* @permissionScope Manage Orders
|
|
2371
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2372
|
+
* @permissionScope Manage Stores - all permissions
|
|
2373
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2374
|
+
* @permissionScope Manage Products
|
|
2375
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2376
|
+
* @permissionScope Read Stores - all read permissions
|
|
2377
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2378
|
+
* @permissionScope Read Products
|
|
2379
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2380
|
+
* @permissionScope Product v3 read admin
|
|
2381
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2382
|
+
* @applicableIdentity APP
|
|
2383
|
+
* @applicableIdentity VISITOR
|
|
2384
|
+
* @returns Product.
|
|
2385
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.GetProduct
|
|
2386
|
+
*/
|
|
2387
|
+
export async function getProduct(productId, options) {
|
|
2388
|
+
// @ts-ignore
|
|
2389
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2390
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2391
|
+
productId: productId,
|
|
2392
|
+
fields: options?.fields,
|
|
2393
|
+
});
|
|
2394
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.getProduct(payload);
|
|
2395
|
+
sideEffects?.onSiteCall?.();
|
|
2396
|
+
try {
|
|
2397
|
+
const result = await httpClient.request(reqOpts);
|
|
2398
|
+
sideEffects?.onSuccess?.(result);
|
|
2399
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
2400
|
+
{
|
|
2401
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
2402
|
+
paths: [{ path: 'product.url' }],
|
|
2403
|
+
},
|
|
2404
|
+
{
|
|
2405
|
+
transformFn: transformRESTImageToSDKImage,
|
|
2406
|
+
paths: [
|
|
2407
|
+
{ path: 'product.media.main.image' },
|
|
2408
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2409
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2410
|
+
{
|
|
2411
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
2412
|
+
},
|
|
2413
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2414
|
+
{
|
|
2415
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2416
|
+
},
|
|
2417
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2418
|
+
],
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
2422
|
+
paths: [
|
|
2423
|
+
{ path: 'product.media.main.video' },
|
|
2424
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2425
|
+
{
|
|
2426
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2430
|
+
},
|
|
2431
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2432
|
+
],
|
|
2433
|
+
},
|
|
2434
|
+
]))?.product;
|
|
2435
|
+
}
|
|
2436
|
+
catch (err) {
|
|
2437
|
+
const transformedError = sdkTransformError(err, {
|
|
2438
|
+
spreadPathsToArguments: {},
|
|
2439
|
+
explicitPathsToArguments: { productId: '$[0]', fields: '$[1].fields' },
|
|
2440
|
+
singleArgumentUnchanged: false,
|
|
2441
|
+
}, ['productId', 'options']);
|
|
2442
|
+
sideEffects?.onError?.(err);
|
|
2443
|
+
throw transformedError;
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
* Retrieves a product by slug.
|
|
2448
|
+
*
|
|
2449
|
+
* > **Note:**
|
|
2450
|
+
* > To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2451
|
+
* @param slug - Product slug.
|
|
2452
|
+
* @public
|
|
2453
|
+
* @documentationMaturity preview
|
|
2454
|
+
* @requiredField slug
|
|
2455
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2456
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2457
|
+
* @permissionScope Manage Stores - all permissions
|
|
2458
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2459
|
+
* @permissionScope Read products in v3 catalog
|
|
2460
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2461
|
+
* @permissionScope Read v3 catalog
|
|
2462
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2463
|
+
* @permissionScope Manage Products
|
|
2464
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2465
|
+
* @permissionScope Read Stores - all read permissions
|
|
2466
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2467
|
+
* @permissionScope Read Products
|
|
2468
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2469
|
+
* @permissionScope Product v3 read admin
|
|
2470
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2471
|
+
* @permissionScope Manage v3 catalog
|
|
2472
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2473
|
+
* @permissionScope Manage Orders
|
|
2474
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2475
|
+
* @permissionScope Manage Stores - all permissions
|
|
2476
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2477
|
+
* @permissionScope Manage Products
|
|
2478
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2479
|
+
* @permissionScope Read Stores - all read permissions
|
|
2480
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2481
|
+
* @permissionScope Read Products
|
|
2482
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2483
|
+
* @permissionScope Product v3 read admin
|
|
2484
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2485
|
+
* @applicableIdentity APP
|
|
2486
|
+
* @applicableIdentity VISITOR
|
|
2487
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.GetProductBySlug
|
|
2488
|
+
*/
|
|
2489
|
+
export async function getProductBySlug(slug, options) {
|
|
2490
|
+
// @ts-ignore
|
|
2491
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2492
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2493
|
+
slug: slug,
|
|
2494
|
+
fields: options?.fields,
|
|
2495
|
+
});
|
|
2496
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.getProductBySlug(payload);
|
|
2497
|
+
sideEffects?.onSiteCall?.();
|
|
2498
|
+
try {
|
|
2499
|
+
const result = await httpClient.request(reqOpts);
|
|
2500
|
+
sideEffects?.onSuccess?.(result);
|
|
2501
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
2502
|
+
{
|
|
2503
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
2504
|
+
paths: [{ path: 'product.url' }],
|
|
2505
|
+
},
|
|
2506
|
+
{
|
|
2507
|
+
transformFn: transformRESTImageToSDKImage,
|
|
2508
|
+
paths: [
|
|
2509
|
+
{ path: 'product.media.main.image' },
|
|
2510
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2511
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2512
|
+
{
|
|
2513
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
2514
|
+
},
|
|
2515
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2516
|
+
{
|
|
2517
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2518
|
+
},
|
|
2519
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2520
|
+
],
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
2524
|
+
paths: [
|
|
2525
|
+
{ path: 'product.media.main.video' },
|
|
2526
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2527
|
+
{
|
|
2528
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
2529
|
+
},
|
|
2530
|
+
{
|
|
2531
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2532
|
+
},
|
|
2533
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2534
|
+
],
|
|
2535
|
+
},
|
|
2536
|
+
]));
|
|
2537
|
+
}
|
|
2538
|
+
catch (err) {
|
|
2539
|
+
const transformedError = sdkTransformError(err, {
|
|
2540
|
+
spreadPathsToArguments: {},
|
|
2541
|
+
explicitPathsToArguments: { slug: '$[0]', fields: '$[1].fields' },
|
|
2542
|
+
singleArgumentUnchanged: false,
|
|
2543
|
+
}, ['slug', 'options']);
|
|
2544
|
+
sideEffects?.onError?.(err);
|
|
2545
|
+
throw transformedError;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Retrieves a list of up to 100 products, given the provided filtering, search expression, sorting, and cursor paging.
|
|
2550
|
+
* Pass supported values to the `fields` array in the request to include those fields in the response.
|
|
2551
|
+
*
|
|
2552
|
+
* To learn about working with _Search_ endpoints, see
|
|
2553
|
+
* [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
|
|
2554
|
+
* and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
|
|
2555
|
+
*
|
|
2556
|
+
* > **Notes:**
|
|
2557
|
+
* > + This method does not return `variantsInfo`. To retrieve product variants, use the Get Product method.
|
|
2558
|
+
* > + To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2559
|
+
* @public
|
|
2560
|
+
* @documentationMaturity preview
|
|
2561
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2562
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2563
|
+
* @permissionScope Manage Stores - all permissions
|
|
2564
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2565
|
+
* @permissionScope Read products in v3 catalog
|
|
2566
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2567
|
+
* @permissionScope Read v3 catalog
|
|
2568
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2569
|
+
* @permissionScope Manage Products
|
|
2570
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2571
|
+
* @permissionScope Read Stores - all read permissions
|
|
2572
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2573
|
+
* @permissionScope Read Products
|
|
2574
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2575
|
+
* @permissionScope Product v3 read admin
|
|
2576
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2577
|
+
* @permissionScope Manage v3 catalog
|
|
2578
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2579
|
+
* @permissionScope Manage Orders
|
|
2580
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2581
|
+
* @permissionScope Manage Stores - all permissions
|
|
2582
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2583
|
+
* @permissionScope Manage Products
|
|
2584
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2585
|
+
* @permissionScope Read Stores - all read permissions
|
|
2586
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2587
|
+
* @permissionScope Read Products
|
|
2588
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2589
|
+
* @permissionScope Product v3 read admin
|
|
2590
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2591
|
+
* @applicableIdentity APP
|
|
2592
|
+
* @applicableIdentity VISITOR
|
|
2593
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.SearchProducts
|
|
2594
|
+
*/
|
|
2595
|
+
export async function searchProducts(options) {
|
|
2596
|
+
// @ts-ignore
|
|
2597
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2598
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2599
|
+
search: options?.search,
|
|
2600
|
+
fields: options?.fields,
|
|
2601
|
+
});
|
|
2602
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.searchProducts(payload);
|
|
2603
|
+
sideEffects?.onSiteCall?.();
|
|
2604
|
+
try {
|
|
2605
|
+
const result = await httpClient.request(reqOpts);
|
|
2606
|
+
sideEffects?.onSuccess?.(result);
|
|
2607
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
2608
|
+
{
|
|
2609
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
2610
|
+
paths: [{ path: 'products.url' }],
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
transformFn: transformRESTImageToSDKImage,
|
|
2614
|
+
paths: [
|
|
2615
|
+
{ path: 'products.media.main.image' },
|
|
2616
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
2617
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
2618
|
+
{
|
|
2619
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
2620
|
+
},
|
|
2621
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
2622
|
+
{
|
|
2623
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2624
|
+
},
|
|
2625
|
+
{ path: 'products.variantsInfo.variants.media.image' },
|
|
2626
|
+
],
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
2630
|
+
paths: [
|
|
2631
|
+
{ path: 'products.media.main.video' },
|
|
2632
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
2633
|
+
{
|
|
2634
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2638
|
+
},
|
|
2639
|
+
{ path: 'products.variantsInfo.variants.media.video' },
|
|
2640
|
+
],
|
|
2641
|
+
},
|
|
2642
|
+
]));
|
|
2643
|
+
}
|
|
2644
|
+
catch (err) {
|
|
2645
|
+
const transformedError = sdkTransformError(err, {
|
|
2646
|
+
spreadPathsToArguments: {},
|
|
2647
|
+
explicitPathsToArguments: {
|
|
2648
|
+
search: '$[0].search',
|
|
2649
|
+
fields: '$[0].fields',
|
|
2650
|
+
},
|
|
2651
|
+
singleArgumentUnchanged: false,
|
|
2652
|
+
}, ['options']);
|
|
2653
|
+
sideEffects?.onError?.(err);
|
|
2654
|
+
throw transformedError;
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Retrieves a list of up to 100 products, given the provided filtering, sorting, and cursor paging.
|
|
2659
|
+
* Pass supported values to the `fields` array in the request to include those fields in the response.
|
|
2660
|
+
*
|
|
2661
|
+
* To learn about working with _Query_ endpoints, see
|
|
2662
|
+
* [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
|
|
2663
|
+
* and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
|
|
2664
|
+
*
|
|
2665
|
+
* > **Notes:**
|
|
2666
|
+
* > + This method does not return `variantsInfo`. To retrieve product variants, use the Get Product method.
|
|
2667
|
+
* > + To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2668
|
+
* @public
|
|
2669
|
+
* @documentationMaturity preview
|
|
2670
|
+
* @permissionScope Manage Stores - all permissions
|
|
2671
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2672
|
+
* @permissionScope Read products in v3 catalog
|
|
2673
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2674
|
+
* @permissionScope Read v3 catalog
|
|
2675
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2676
|
+
* @permissionScope Manage Products
|
|
2677
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2678
|
+
* @permissionScope Read Stores - all read permissions
|
|
2679
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2680
|
+
* @permissionScope Read Products
|
|
2681
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2682
|
+
* @permissionScope Product v3 read admin
|
|
2683
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2684
|
+
* @permissionScope Manage v3 catalog
|
|
2685
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2686
|
+
* @permissionScope Manage Orders
|
|
2687
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2688
|
+
* @permissionScope Manage Stores - all permissions
|
|
2689
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2690
|
+
* @permissionScope Manage Products
|
|
2691
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2692
|
+
* @permissionScope Read Stores - all read permissions
|
|
2693
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2694
|
+
* @permissionScope Read Products
|
|
2695
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2696
|
+
* @permissionScope Product v3 read admin
|
|
2697
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2698
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2699
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2700
|
+
* @applicableIdentity APP
|
|
2701
|
+
* @applicableIdentity VISITOR
|
|
2702
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.QueryProducts
|
|
2703
|
+
*/
|
|
2704
|
+
export function queryProducts(options) {
|
|
2705
|
+
// @ts-ignore
|
|
2706
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2707
|
+
return queryBuilder({
|
|
2708
|
+
func: async (payload) => {
|
|
2709
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.queryProducts({
|
|
2710
|
+
...payload,
|
|
2711
|
+
...(options ?? {}),
|
|
2712
|
+
});
|
|
2713
|
+
sideEffects?.onSiteCall?.();
|
|
2714
|
+
try {
|
|
2715
|
+
const result = await httpClient.request(reqOpts);
|
|
2716
|
+
sideEffects?.onSuccess?.(result);
|
|
2717
|
+
return result;
|
|
2718
|
+
}
|
|
2719
|
+
catch (err) {
|
|
2720
|
+
sideEffects?.onError?.(err);
|
|
2721
|
+
throw err;
|
|
2722
|
+
}
|
|
2723
|
+
},
|
|
2724
|
+
requestTransformer: (query) => {
|
|
2725
|
+
const args = [query, options];
|
|
2726
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
2727
|
+
...args?.[1],
|
|
2728
|
+
query: args?.[0],
|
|
2729
|
+
});
|
|
2730
|
+
},
|
|
2731
|
+
responseTransformer: ({ data }) => {
|
|
2732
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(transformPaths(data, [
|
|
2733
|
+
{
|
|
2734
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
2735
|
+
paths: [{ path: 'products.url' }],
|
|
2736
|
+
},
|
|
2737
|
+
{
|
|
2738
|
+
transformFn: transformRESTImageToSDKImage,
|
|
2739
|
+
paths: [
|
|
2740
|
+
{ path: 'products.media.main.image' },
|
|
2741
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
2742
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
2743
|
+
{
|
|
2744
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
2745
|
+
},
|
|
2746
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
2747
|
+
{
|
|
2748
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2749
|
+
},
|
|
2750
|
+
{ path: 'products.variantsInfo.variants.media.image' },
|
|
2751
|
+
],
|
|
2752
|
+
},
|
|
2753
|
+
{
|
|
2754
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
2755
|
+
paths: [
|
|
2756
|
+
{ path: 'products.media.main.video' },
|
|
2757
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
2758
|
+
{
|
|
2759
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2763
|
+
},
|
|
2764
|
+
{ path: 'products.variantsInfo.variants.media.video' },
|
|
2765
|
+
],
|
|
2766
|
+
},
|
|
2767
|
+
]));
|
|
2768
|
+
return {
|
|
2769
|
+
items: transformedData?.products,
|
|
2770
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
2771
|
+
};
|
|
2772
|
+
},
|
|
2773
|
+
errorTransformer: (err) => {
|
|
2774
|
+
const transformedError = sdkTransformError(err, {
|
|
2775
|
+
spreadPathsToArguments: {},
|
|
2776
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
2777
|
+
singleArgumentUnchanged: false,
|
|
2778
|
+
});
|
|
2779
|
+
throw transformedError;
|
|
2780
|
+
},
|
|
2781
|
+
pagingMethod: 'CURSOR',
|
|
2782
|
+
transformationPaths: {},
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* Counts the number of products that match the provided filtering.
|
|
2787
|
+
* @public
|
|
2788
|
+
* @documentationMaturity preview
|
|
2789
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2790
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2791
|
+
* @permissionScope Manage Stores - all permissions
|
|
2792
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2793
|
+
* @permissionScope Read products in v3 catalog
|
|
2794
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2795
|
+
* @permissionScope Read v3 catalog
|
|
2796
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2797
|
+
* @permissionScope Manage Products
|
|
2798
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2799
|
+
* @permissionScope Read Stores - all read permissions
|
|
2800
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2801
|
+
* @permissionScope Read Products
|
|
2802
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2803
|
+
* @permissionScope Product v3 read admin
|
|
2804
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2805
|
+
* @permissionScope Manage v3 catalog
|
|
2806
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2807
|
+
* @permissionScope Manage Orders
|
|
2808
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2809
|
+
* @permissionScope Manage Stores - all permissions
|
|
2810
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2811
|
+
* @permissionScope Manage Products
|
|
2812
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2813
|
+
* @permissionScope Read Stores - all read permissions
|
|
2814
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2815
|
+
* @permissionScope Read Products
|
|
2816
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2817
|
+
* @permissionScope Product v3 read admin
|
|
2818
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2819
|
+
* @applicableIdentity APP
|
|
2820
|
+
* @applicableIdentity VISITOR
|
|
2821
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.CountProducts
|
|
2822
|
+
*/
|
|
2823
|
+
export async function countProducts(options) {
|
|
2824
|
+
// @ts-ignore
|
|
2825
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2826
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2827
|
+
filter: options?.filter,
|
|
2828
|
+
search: options?.search,
|
|
2829
|
+
returnNonVisibleProducts: options?.returnNonVisibleProducts,
|
|
2830
|
+
});
|
|
2831
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.countProducts(payload);
|
|
2832
|
+
sideEffects?.onSiteCall?.();
|
|
2833
|
+
try {
|
|
2834
|
+
const result = await httpClient.request(reqOpts);
|
|
2835
|
+
sideEffects?.onSuccess?.(result);
|
|
2836
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
2837
|
+
}
|
|
2838
|
+
catch (err) {
|
|
2839
|
+
const transformedError = sdkTransformError(err, {
|
|
2840
|
+
spreadPathsToArguments: {},
|
|
2841
|
+
explicitPathsToArguments: {
|
|
2842
|
+
filter: '$[0].filter',
|
|
2843
|
+
search: '$[0].search',
|
|
2844
|
+
returnNonVisibleProducts: '$[0].returnNonVisibleProducts',
|
|
2845
|
+
},
|
|
2846
|
+
singleArgumentUnchanged: false,
|
|
2847
|
+
}, ['options']);
|
|
2848
|
+
sideEffects?.onError?.(err);
|
|
2849
|
+
throw transformedError;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* Updates a variant of multiple products, given the provided filter and search expression.
|
|
2854
|
+
*
|
|
2855
|
+
*
|
|
2856
|
+
* Only the following variant fields can be updated:
|
|
2857
|
+
* + `visible`
|
|
2858
|
+
* + `price`
|
|
2859
|
+
* + `revenueDetails.cost`
|
|
2860
|
+
* + `physicalOptions`
|
|
2861
|
+
* @param filter - Filter object.
|
|
2862
|
+
* @public
|
|
2863
|
+
* @documentationMaturity preview
|
|
2864
|
+
* @requiredField filter
|
|
2865
|
+
* @requiredField options.variant
|
|
2866
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2867
|
+
* @permissionScope Manage Stores - all permissions
|
|
2868
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2869
|
+
* @permissionScope Manage Products
|
|
2870
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2871
|
+
* @permissionScope Product write in v3 catalog
|
|
2872
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2873
|
+
* @permissionScope Manage v3 catalog
|
|
2874
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2875
|
+
* @applicableIdentity APP
|
|
2876
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProductVariantsByFilter
|
|
2877
|
+
*/
|
|
2878
|
+
export async function bulkUpdateProductVariantsByFilter(filter, options) {
|
|
2879
|
+
// @ts-ignore
|
|
2880
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2881
|
+
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
|
2882
|
+
filter: filter,
|
|
2883
|
+
variant: options?.variant,
|
|
2884
|
+
search: options?.search,
|
|
2885
|
+
}), [
|
|
2886
|
+
{
|
|
2887
|
+
transformFn: transformSDKImageToRESTImage,
|
|
2888
|
+
paths: [{ path: 'variant.media.image' }],
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
|
2892
|
+
paths: [{ path: 'variant.media.video' }],
|
|
2893
|
+
},
|
|
2894
|
+
]);
|
|
2895
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProductVariantsByFilter(payload);
|
|
2896
|
+
sideEffects?.onSiteCall?.();
|
|
2897
|
+
try {
|
|
2898
|
+
const result = await httpClient.request(reqOpts);
|
|
2899
|
+
sideEffects?.onSuccess?.(result);
|
|
2900
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
2901
|
+
}
|
|
2902
|
+
catch (err) {
|
|
2903
|
+
const transformedError = sdkTransformError(err, {
|
|
2904
|
+
spreadPathsToArguments: {},
|
|
2905
|
+
explicitPathsToArguments: {
|
|
2906
|
+
filter: '$[0]',
|
|
2907
|
+
variant: '$[1].variant',
|
|
2908
|
+
search: '$[1].search',
|
|
2909
|
+
},
|
|
2910
|
+
singleArgumentUnchanged: false,
|
|
2911
|
+
}, ['filter', 'options']);
|
|
2912
|
+
sideEffects?.onError?.(err);
|
|
2913
|
+
throw transformedError;
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
/**
|
|
2917
|
+
* Adjusts the price and cost of multiple variants, given the provided filter and search expression.
|
|
2918
|
+
*
|
|
2919
|
+
*
|
|
2920
|
+
* Only the following variant fields can be increased/decreased by amount or percentage:
|
|
2921
|
+
* + `basePrice`
|
|
2922
|
+
* + `salePrice`
|
|
2923
|
+
* + `cost`
|
|
2924
|
+
* + `salePriceFromBasePrice`
|
|
2925
|
+
* @param filter - Filter object.
|
|
2926
|
+
* @public
|
|
2927
|
+
* @documentationMaturity preview
|
|
2928
|
+
* @requiredField filter
|
|
2929
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2930
|
+
* @permissionScope Manage Stores - all permissions
|
|
2931
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2932
|
+
* @permissionScope Manage Products
|
|
2933
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2934
|
+
* @permissionScope Product write in v3 catalog
|
|
2935
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2936
|
+
* @permissionScope Manage v3 catalog
|
|
2937
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2938
|
+
* @applicableIdentity APP
|
|
2939
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAdjustProductVariantsByFilter
|
|
2940
|
+
*/
|
|
2941
|
+
export async function bulkAdjustProductVariantsByFilter(filter, options) {
|
|
2942
|
+
// @ts-ignore
|
|
2943
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2944
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
2945
|
+
filter: filter,
|
|
2946
|
+
basePrice: options?.basePrice,
|
|
2947
|
+
salePrice: options?.salePrice,
|
|
2948
|
+
cost: options?.cost,
|
|
2949
|
+
salePriceFromBasePrice: options?.salePriceFromBasePrice,
|
|
2950
|
+
rounding: options?.rounding,
|
|
2951
|
+
search: options?.search,
|
|
2952
|
+
actualPrice: options?.actualPrice,
|
|
2953
|
+
compareAtPrice: options?.compareAtPrice,
|
|
2954
|
+
compareAtPriceDiscount: options?.compareAtPriceDiscount,
|
|
2955
|
+
});
|
|
2956
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAdjustProductVariantsByFilter(payload);
|
|
2957
|
+
sideEffects?.onSiteCall?.();
|
|
2958
|
+
try {
|
|
2959
|
+
const result = await httpClient.request(reqOpts);
|
|
2960
|
+
sideEffects?.onSuccess?.(result);
|
|
2961
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
2962
|
+
}
|
|
2963
|
+
catch (err) {
|
|
2964
|
+
const transformedError = sdkTransformError(err, {
|
|
2965
|
+
spreadPathsToArguments: {},
|
|
2966
|
+
explicitPathsToArguments: {
|
|
2967
|
+
filter: '$[0]',
|
|
2968
|
+
basePrice: '$[1].basePrice',
|
|
2969
|
+
salePrice: '$[1].salePrice',
|
|
2970
|
+
cost: '$[1].cost',
|
|
2971
|
+
salePriceFromBasePrice: '$[1].salePriceFromBasePrice',
|
|
2972
|
+
rounding: '$[1].rounding',
|
|
2973
|
+
search: '$[1].search',
|
|
2974
|
+
actualPrice: '$[1].actualPrice',
|
|
2975
|
+
compareAtPrice: '$[1].compareAtPrice',
|
|
2976
|
+
compareAtPriceDiscount: '$[1].compareAtPriceDiscount',
|
|
2977
|
+
},
|
|
2978
|
+
singleArgumentUnchanged: false,
|
|
2979
|
+
}, ['filter', 'options']);
|
|
2980
|
+
sideEffects?.onError?.(err);
|
|
2981
|
+
throw transformedError;
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
/**
|
|
2985
|
+
* Adds info sections to multiple products, given the provided filter and search expression.
|
|
2986
|
+
* @param filter - Filter object.
|
|
2987
|
+
* @public
|
|
2988
|
+
* @documentationMaturity preview
|
|
2989
|
+
* @requiredField filter
|
|
2990
|
+
* @requiredField options.infoSectionIds
|
|
2991
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2992
|
+
* @permissionScope Manage Stores - all permissions
|
|
2993
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2994
|
+
* @permissionScope Manage Products
|
|
2995
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2996
|
+
* @permissionScope Product write in v3 catalog
|
|
2997
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2998
|
+
* @permissionScope Manage v3 catalog
|
|
2999
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3000
|
+
* @applicableIdentity APP
|
|
3001
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAddInfoSectionsToProductsByFilter
|
|
3002
|
+
*/
|
|
3003
|
+
export async function bulkAddInfoSectionsToProductsByFilter(filter, options) {
|
|
3004
|
+
// @ts-ignore
|
|
3005
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3006
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
3007
|
+
filter: filter,
|
|
3008
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3009
|
+
search: options?.search,
|
|
3010
|
+
});
|
|
3011
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAddInfoSectionsToProductsByFilter(payload);
|
|
3012
|
+
sideEffects?.onSiteCall?.();
|
|
3013
|
+
try {
|
|
3014
|
+
const result = await httpClient.request(reqOpts);
|
|
3015
|
+
sideEffects?.onSuccess?.(result);
|
|
3016
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
3017
|
+
}
|
|
3018
|
+
catch (err) {
|
|
3019
|
+
const transformedError = sdkTransformError(err, {
|
|
3020
|
+
spreadPathsToArguments: {},
|
|
3021
|
+
explicitPathsToArguments: {
|
|
3022
|
+
filter: '$[0]',
|
|
3023
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3024
|
+
search: '$[1].search',
|
|
3025
|
+
},
|
|
3026
|
+
singleArgumentUnchanged: false,
|
|
3027
|
+
}, ['filter', 'options']);
|
|
3028
|
+
sideEffects?.onError?.(err);
|
|
3029
|
+
throw transformedError;
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Adds info sections to multiple products.
|
|
3034
|
+
* @param products - List of product IDs and revisions.
|
|
3035
|
+
* @public
|
|
3036
|
+
* @documentationMaturity preview
|
|
3037
|
+
* @requiredField options.infoSectionIds
|
|
3038
|
+
* @requiredField products
|
|
3039
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3040
|
+
* @permissionScope Manage Stores - all permissions
|
|
3041
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3042
|
+
* @permissionScope Manage Products
|
|
3043
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3044
|
+
* @permissionScope Product write in v3 catalog
|
|
3045
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3046
|
+
* @permissionScope Manage v3 catalog
|
|
3047
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3048
|
+
* @applicableIdentity APP
|
|
3049
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAddInfoSectionsToProducts
|
|
3050
|
+
*/
|
|
3051
|
+
export async function bulkAddInfoSectionsToProducts(products, options) {
|
|
3052
|
+
// @ts-ignore
|
|
3053
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3054
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
3055
|
+
products: products,
|
|
3056
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3057
|
+
returnEntity: options?.returnEntity,
|
|
3058
|
+
fields: options?.fields,
|
|
3059
|
+
});
|
|
3060
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAddInfoSectionsToProducts(payload);
|
|
3061
|
+
sideEffects?.onSiteCall?.();
|
|
3062
|
+
try {
|
|
3063
|
+
const result = await httpClient.request(reqOpts);
|
|
3064
|
+
sideEffects?.onSuccess?.(result);
|
|
3065
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
3066
|
+
{
|
|
3067
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
3068
|
+
paths: [{ path: 'results.item.url' }],
|
|
3069
|
+
},
|
|
3070
|
+
{
|
|
3071
|
+
transformFn: transformRESTImageToSDKImage,
|
|
3072
|
+
paths: [
|
|
3073
|
+
{ path: 'results.item.media.main.image' },
|
|
3074
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
3075
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
3076
|
+
{
|
|
3077
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
3078
|
+
},
|
|
3079
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
3080
|
+
{
|
|
3081
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
3082
|
+
},
|
|
3083
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
3084
|
+
],
|
|
3085
|
+
},
|
|
3086
|
+
{
|
|
3087
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
3088
|
+
paths: [
|
|
3089
|
+
{ path: 'results.item.media.main.video' },
|
|
3090
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
3091
|
+
{
|
|
3092
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
3093
|
+
},
|
|
3094
|
+
{
|
|
3095
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
3096
|
+
},
|
|
3097
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
3098
|
+
],
|
|
3099
|
+
},
|
|
3100
|
+
]));
|
|
3101
|
+
}
|
|
3102
|
+
catch (err) {
|
|
3103
|
+
const transformedError = sdkTransformError(err, {
|
|
3104
|
+
spreadPathsToArguments: {},
|
|
3105
|
+
explicitPathsToArguments: {
|
|
3106
|
+
products: '$[0]',
|
|
3107
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3108
|
+
returnEntity: '$[1].returnEntity',
|
|
3109
|
+
fields: '$[1].fields',
|
|
3110
|
+
},
|
|
3111
|
+
singleArgumentUnchanged: false,
|
|
3112
|
+
}, ['products', 'options']);
|
|
3113
|
+
sideEffects?.onError?.(err);
|
|
3114
|
+
throw transformedError;
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
/**
|
|
3118
|
+
* Removes info sections from multiple products, given the provided filter and search expression.
|
|
3119
|
+
* @param filter - Filter object.
|
|
3120
|
+
* @public
|
|
3121
|
+
* @documentationMaturity preview
|
|
3122
|
+
* @requiredField filter
|
|
3123
|
+
* @requiredField options.infoSectionIds
|
|
3124
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3125
|
+
* @permissionScope Manage Stores - all permissions
|
|
3126
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3127
|
+
* @permissionScope Manage Products
|
|
3128
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3129
|
+
* @permissionScope Product write in v3 catalog
|
|
3130
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3131
|
+
* @permissionScope Manage v3 catalog
|
|
3132
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3133
|
+
* @applicableIdentity APP
|
|
3134
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkRemoveInfoSectionsFromProductsByFilter
|
|
3135
|
+
*/
|
|
3136
|
+
export async function bulkRemoveInfoSectionsFromProductsByFilter(filter, options) {
|
|
3137
|
+
// @ts-ignore
|
|
3138
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3139
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
3140
|
+
filter: filter,
|
|
3141
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3142
|
+
search: options?.search,
|
|
3143
|
+
});
|
|
3144
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkRemoveInfoSectionsFromProductsByFilter(payload);
|
|
3145
|
+
sideEffects?.onSiteCall?.();
|
|
3146
|
+
try {
|
|
3147
|
+
const result = await httpClient.request(reqOpts);
|
|
3148
|
+
sideEffects?.onSuccess?.(result);
|
|
3149
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
3150
|
+
}
|
|
3151
|
+
catch (err) {
|
|
3152
|
+
const transformedError = sdkTransformError(err, {
|
|
3153
|
+
spreadPathsToArguments: {},
|
|
3154
|
+
explicitPathsToArguments: {
|
|
3155
|
+
filter: '$[0]',
|
|
3156
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3157
|
+
search: '$[1].search',
|
|
3158
|
+
},
|
|
3159
|
+
singleArgumentUnchanged: false,
|
|
3160
|
+
}, ['filter', 'options']);
|
|
3161
|
+
sideEffects?.onError?.(err);
|
|
3162
|
+
throw transformedError;
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
/**
|
|
3166
|
+
* Removes info sections from multiple products.
|
|
3167
|
+
* @param products - List of product IDs and revisions.
|
|
3168
|
+
* @public
|
|
3169
|
+
* @documentationMaturity preview
|
|
3170
|
+
* @requiredField options.infoSectionIds
|
|
3171
|
+
* @requiredField products
|
|
3172
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3173
|
+
* @permissionScope Manage Stores - all permissions
|
|
3174
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3175
|
+
* @permissionScope Manage Products
|
|
3176
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3177
|
+
* @permissionScope Product write in v3 catalog
|
|
3178
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3179
|
+
* @permissionScope Manage v3 catalog
|
|
3180
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3181
|
+
* @applicableIdentity APP
|
|
3182
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkRemoveInfoSectionsFromProducts
|
|
3183
|
+
*/
|
|
3184
|
+
export async function bulkRemoveInfoSectionsFromProducts(products, options) {
|
|
3185
|
+
// @ts-ignore
|
|
3186
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3187
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
3188
|
+
products: products,
|
|
3189
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3190
|
+
returnEntity: options?.returnEntity,
|
|
3191
|
+
fields: options?.fields,
|
|
3192
|
+
});
|
|
3193
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkRemoveInfoSectionsFromProducts(payload);
|
|
3194
|
+
sideEffects?.onSiteCall?.();
|
|
3195
|
+
try {
|
|
3196
|
+
const result = await httpClient.request(reqOpts);
|
|
3197
|
+
sideEffects?.onSuccess?.(result);
|
|
3198
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
3199
|
+
{
|
|
3200
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
3201
|
+
paths: [{ path: 'results.item.url' }],
|
|
3202
|
+
},
|
|
3203
|
+
{
|
|
3204
|
+
transformFn: transformRESTImageToSDKImage,
|
|
3205
|
+
paths: [
|
|
3206
|
+
{ path: 'results.item.media.main.image' },
|
|
3207
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
3208
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
3209
|
+
{
|
|
3210
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
3211
|
+
},
|
|
3212
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
3213
|
+
{
|
|
3214
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
3215
|
+
},
|
|
3216
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
3217
|
+
],
|
|
3218
|
+
},
|
|
3219
|
+
{
|
|
3220
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
3221
|
+
paths: [
|
|
3222
|
+
{ path: 'results.item.media.main.video' },
|
|
3223
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
3224
|
+
{
|
|
3225
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
3226
|
+
},
|
|
3227
|
+
{
|
|
3228
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
3229
|
+
},
|
|
3230
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
3231
|
+
],
|
|
3232
|
+
},
|
|
3233
|
+
]));
|
|
3234
|
+
}
|
|
3235
|
+
catch (err) {
|
|
3236
|
+
const transformedError = sdkTransformError(err, {
|
|
3237
|
+
spreadPathsToArguments: {},
|
|
3238
|
+
explicitPathsToArguments: {
|
|
3239
|
+
products: '$[0]',
|
|
3240
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3241
|
+
returnEntity: '$[1].returnEntity',
|
|
3242
|
+
fields: '$[1].fields',
|
|
3243
|
+
},
|
|
3244
|
+
singleArgumentUnchanged: false,
|
|
3245
|
+
}, ['products', 'options']);
|
|
3246
|
+
sideEffects?.onError?.(err);
|
|
3247
|
+
throw transformedError;
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
/**
|
|
3251
|
+
* Adds multiple products, given the provided filter and search expression, to up to 5 categories.
|
|
3252
|
+
*
|
|
3253
|
+
* Learn more about the [Categories API](https://dev.wix.com/docs/rest/business-management/categories/introduction).
|
|
3254
|
+
* @public
|
|
3255
|
+
* @documentationMaturity preview
|
|
3256
|
+
* @requiredField options.categoryIds
|
|
3257
|
+
* @permissionId CATEGORIES.CATEGORY_ADD_ITEM
|
|
3258
|
+
* @permissionScope Manage Stores - all permissions
|
|
3259
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3260
|
+
* @permissionScope Category item write
|
|
3261
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_ITEM_WRITE
|
|
3262
|
+
* @permissionScope Manage Products
|
|
3263
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3264
|
+
* @permissionScope Manage v3 catalog
|
|
3265
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3266
|
+
* @permissionScope Category write
|
|
3267
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_WRITE
|
|
3268
|
+
* @applicableIdentity APP
|
|
3269
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAddProductsToCategoriesByFilter
|
|
3270
|
+
*/
|
|
3271
|
+
export async function bulkAddProductsToCategoriesByFilter(options) {
|
|
3272
|
+
// @ts-ignore
|
|
3273
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
3274
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
3275
|
+
filter: options?.filter,
|
|
3276
|
+
categoryIds: options?.categoryIds,
|
|
3277
|
+
search: options?.search,
|
|
3278
|
+
});
|
|
3279
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAddProductsToCategoriesByFilter(payload);
|
|
3280
|
+
sideEffects?.onSiteCall?.();
|
|
3281
|
+
try {
|
|
3282
|
+
const result = await httpClient.request(reqOpts);
|
|
3283
|
+
sideEffects?.onSuccess?.(result);
|
|
3284
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
3285
|
+
}
|
|
3286
|
+
catch (err) {
|
|
3287
|
+
const transformedError = sdkTransformError(err, {
|
|
3288
|
+
spreadPathsToArguments: {},
|
|
3289
|
+
explicitPathsToArguments: {
|
|
3290
|
+
filter: '$[0].filter',
|
|
3291
|
+
categoryIds: '$[0].categoryIds',
|
|
3292
|
+
search: '$[0].search',
|
|
3293
|
+
},
|
|
3294
|
+
singleArgumentUnchanged: false,
|
|
3295
|
+
}, ['options']);
|
|
3296
|
+
sideEffects?.onError?.(err);
|
|
3297
|
+
throw transformedError;
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
/**
|
|
3301
|
+
* Removes multiple products, given the provided filter and search expression, from up to 5 categories.
|
|
3302
|
+
*
|
|
3303
|
+
* Learn more about the [Categories API](https://dev.wix.com/docs/rest/business-management/categories/introduction).
|
|
3304
|
+
* @public
|
|
3305
|
+
* @documentationMaturity preview
|
|
3306
|
+
* @requiredField options.categoryIds
|
|
3307
|
+
* @permissionId CATEGORIES.CATEGORY_REMOVE_ITEM
|
|
3308
|
+
* @permissionScope Manage Stores - all permissions
|
|
3309
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3310
|
+
* @permissionScope Category item write
|
|
3311
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_ITEM_WRITE
|
|
3312
|
+
* @permissionScope Manage Products
|
|
3313
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3314
|
+
* @permissionScope Manage v3 catalog
|
|
3315
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3316
|
+
* @permissionScope Category write
|
|
3317
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_WRITE
|
|
3318
|
+
* @applicableIdentity APP
|
|
3319
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkRemoveProductsFromCategoriesByFilter
|
|
3320
|
+
*/
|
|
3321
|
+
export async function bulkRemoveProductsFromCategoriesByFilter(options) {
|
|
3322
|
+
// @ts-ignore
|
|
3323
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
3324
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
3325
|
+
filter: options?.filter,
|
|
3326
|
+
categoryIds: options?.categoryIds,
|
|
3327
|
+
search: options?.search,
|
|
3328
|
+
});
|
|
3329
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkRemoveProductsFromCategoriesByFilter(payload);
|
|
3330
|
+
sideEffects?.onSiteCall?.();
|
|
3331
|
+
try {
|
|
3332
|
+
const result = await httpClient.request(reqOpts);
|
|
3333
|
+
sideEffects?.onSuccess?.(result);
|
|
3334
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
3335
|
+
}
|
|
3336
|
+
catch (err) {
|
|
3337
|
+
const transformedError = sdkTransformError(err, {
|
|
3338
|
+
spreadPathsToArguments: {},
|
|
3339
|
+
explicitPathsToArguments: {
|
|
3340
|
+
filter: '$[0].filter',
|
|
3341
|
+
categoryIds: '$[0].categoryIds',
|
|
3342
|
+
search: '$[0].search',
|
|
3343
|
+
},
|
|
3344
|
+
singleArgumentUnchanged: false,
|
|
3345
|
+
}, ['options']);
|
|
3346
|
+
sideEffects?.onError?.(err);
|
|
3347
|
+
throw transformedError;
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
//# sourceMappingURL=stores-catalog-v3-product-products-v-3.universal.js.map
|