@wix/categories 1.0.24 → 1.0.26

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.
Files changed (61) hide show
  1. package/build/cjs/context.d.ts +1 -1
  2. package/build/cjs/context.js +1 -1
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +1 -1
  5. package/build/cjs/index.js +1 -1
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -1
  8. package/build/cjs/meta.js +1 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +1 -1
  11. package/build/es/context.js +1 -1
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +1 -1
  14. package/build/es/index.js +1 -1
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +1 -1
  17. package/build/es/meta.js +1 -1
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +11 -9
  20. package/build/cjs/index.typings.d.ts +0 -1
  21. package/build/cjs/index.typings.js +0 -28
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/categories-v1-category.context.d.ts +0 -20
  24. package/build/cjs/src/categories-v1-category.context.js +0 -203
  25. package/build/cjs/src/categories-v1-category.context.js.map +0 -1
  26. package/build/cjs/src/categories-v1-category.http.d.ts +0 -56
  27. package/build/cjs/src/categories-v1-category.http.js +0 -1029
  28. package/build/cjs/src/categories-v1-category.http.js.map +0 -1
  29. package/build/cjs/src/categories-v1-category.meta.d.ts +0 -50
  30. package/build/cjs/src/categories-v1-category.meta.js +0 -370
  31. package/build/cjs/src/categories-v1-category.meta.js.map +0 -1
  32. package/build/cjs/src/categories-v1-category.public.d.ts +0 -1454
  33. package/build/cjs/src/categories-v1-category.public.js +0 -164
  34. package/build/cjs/src/categories-v1-category.public.js.map +0 -1
  35. package/build/cjs/src/categories-v1-category.types.d.ts +0 -5763
  36. package/build/cjs/src/categories-v1-category.types.js +0 -402
  37. package/build/cjs/src/categories-v1-category.types.js.map +0 -1
  38. package/build/cjs/src/categories-v1-category.universal.d.ts +0 -6181
  39. package/build/cjs/src/categories-v1-category.universal.js +0 -1794
  40. package/build/cjs/src/categories-v1-category.universal.js.map +0 -1
  41. package/build/es/index.typings.d.ts +0 -1
  42. package/build/es/index.typings.js +0 -2
  43. package/build/es/index.typings.js.map +0 -1
  44. package/build/es/src/categories-v1-category.context.d.ts +0 -20
  45. package/build/es/src/categories-v1-category.context.js +0 -182
  46. package/build/es/src/categories-v1-category.context.js.map +0 -1
  47. package/build/es/src/categories-v1-category.http.d.ts +0 -56
  48. package/build/es/src/categories-v1-category.http.js +0 -1008
  49. package/build/es/src/categories-v1-category.http.js.map +0 -1
  50. package/build/es/src/categories-v1-category.meta.d.ts +0 -50
  51. package/build/es/src/categories-v1-category.meta.js +0 -326
  52. package/build/es/src/categories-v1-category.meta.js.map +0 -1
  53. package/build/es/src/categories-v1-category.public.d.ts +0 -1454
  54. package/build/es/src/categories-v1-category.public.js +0 -95
  55. package/build/es/src/categories-v1-category.public.js.map +0 -1
  56. package/build/es/src/categories-v1-category.types.d.ts +0 -5763
  57. package/build/es/src/categories-v1-category.types.js +0 -399
  58. package/build/es/src/categories-v1-category.types.js.map +0 -1
  59. package/build/es/src/categories-v1-category.universal.d.ts +0 -6181
  60. package/build/es/src/categories-v1-category.universal.js +0 -1749
  61. package/build/es/src/categories-v1-category.universal.js.map +0 -1
@@ -1,1794 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.updateCategory = exports.getCategory = exports.createCategory = exports.onCategoryItemsArrangedInCategory = exports.onCategoryItemRemovedFromCategory = exports.onCategoryItemAddedToCategory = exports.onCategoryMoved = exports.onCategoryDeleted = exports.onCategoryUpdated = exports.onCategoryCreated = exports.Position = exports.MoveCategoryRequestPosition = exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.RequestedFields = exports.NullValue = exports.VerticalAlignment = exports.Direction = exports.InitialExpandedItems = exports.AppType = exports.FontType = exports.DecorationType = exports.BackgroundType = exports.PollLayoutDirection = exports.PollLayoutType = exports.VoteRole = exports.ViewRole = exports.MapType = exports.Source = exports.ThumbnailsAlignment = exports.Crop = exports.Orientation = exports.LayoutType = exports.ViewMode = exports.Alignment = exports.Width = exports.LineStyle = exports.TextAlignment = exports.Target = exports.Type = exports.PluginContainerDataAlignment = exports.WidthType = exports.NodeType = void 0;
36
- exports.getArrangedItems = exports.setArrangedItems = exports.moveItemInCategory = exports.listCategoriesForItem = exports.listItemsInCategory = exports.bulkRemoveItemFromCategories = exports.bulkRemoveItemsFromCategory = exports.bulkAddItemToCategories = exports.bulkAddItemsToCategory = exports.updateCategoryVisibility = exports.bulkUpdateCategories = exports.moveCategory = exports.countCategories = exports.searchCategories = exports.deleteCategory = void 0;
37
- const velo_1 = require("@wix/metro-runtime/velo");
38
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
39
- const sdk_types_1 = require("@wix/sdk-types");
40
- const ambassadorWixCategoriesV1Category = __importStar(require("./categories-v1-category.http"));
41
- // @ts-ignore
42
- const _toVeloEntity = '$';
43
- const _fromVeloEntity = '$';
44
- var NodeType;
45
- (function (NodeType) {
46
- NodeType["PARAGRAPH"] = "PARAGRAPH";
47
- NodeType["TEXT"] = "TEXT";
48
- NodeType["HEADING"] = "HEADING";
49
- NodeType["BULLETED_LIST"] = "BULLETED_LIST";
50
- NodeType["ORDERED_LIST"] = "ORDERED_LIST";
51
- NodeType["LIST_ITEM"] = "LIST_ITEM";
52
- NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
53
- NodeType["CODE_BLOCK"] = "CODE_BLOCK";
54
- NodeType["VIDEO"] = "VIDEO";
55
- NodeType["DIVIDER"] = "DIVIDER";
56
- NodeType["FILE"] = "FILE";
57
- NodeType["GALLERY"] = "GALLERY";
58
- NodeType["GIF"] = "GIF";
59
- NodeType["HTML"] = "HTML";
60
- NodeType["IMAGE"] = "IMAGE";
61
- NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
62
- NodeType["MAP"] = "MAP";
63
- NodeType["POLL"] = "POLL";
64
- NodeType["APP_EMBED"] = "APP_EMBED";
65
- NodeType["BUTTON"] = "BUTTON";
66
- NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
67
- NodeType["TABLE"] = "TABLE";
68
- NodeType["EMBED"] = "EMBED";
69
- NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
70
- NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
71
- NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
72
- NodeType["TABLE_CELL"] = "TABLE_CELL";
73
- NodeType["TABLE_ROW"] = "TABLE_ROW";
74
- NodeType["EXTERNAL"] = "EXTERNAL";
75
- NodeType["AUDIO"] = "AUDIO";
76
- })(NodeType || (exports.NodeType = NodeType = {}));
77
- var WidthType;
78
- (function (WidthType) {
79
- /** Width matches the content width */
80
- WidthType["CONTENT"] = "CONTENT";
81
- /** Small Width */
82
- WidthType["SMALL"] = "SMALL";
83
- /** Width will match the original asset width */
84
- WidthType["ORIGINAL"] = "ORIGINAL";
85
- /** coast-to-coast display */
86
- WidthType["FULL_WIDTH"] = "FULL_WIDTH";
87
- })(WidthType || (exports.WidthType = WidthType = {}));
88
- var PluginContainerDataAlignment;
89
- (function (PluginContainerDataAlignment) {
90
- /** Center Alignment */
91
- PluginContainerDataAlignment["CENTER"] = "CENTER";
92
- /** Left Alignment */
93
- PluginContainerDataAlignment["LEFT"] = "LEFT";
94
- /** Right Alignment */
95
- PluginContainerDataAlignment["RIGHT"] = "RIGHT";
96
- })(PluginContainerDataAlignment || (exports.PluginContainerDataAlignment = PluginContainerDataAlignment = {}));
97
- var Type;
98
- (function (Type) {
99
- /** Regular link button */
100
- Type["LINK"] = "LINK";
101
- /** Triggers custom action that is defined in plugin configuration by the consumer */
102
- Type["ACTION"] = "ACTION";
103
- })(Type || (exports.Type = Type = {}));
104
- var Target;
105
- (function (Target) {
106
- /** Opens the linked document in the same frame as it was clicked (this is default) */
107
- Target["SELF"] = "SELF";
108
- /** Opens the linked document in a new window or tab */
109
- Target["BLANK"] = "BLANK";
110
- /** Opens the linked document in the parent frame */
111
- Target["PARENT"] = "PARENT";
112
- /** Opens the linked document in the full body of the window */
113
- Target["TOP"] = "TOP";
114
- })(Target || (exports.Target = Target = {}));
115
- var TextAlignment;
116
- (function (TextAlignment) {
117
- /** browser default, eqivalent to `initial` */
118
- TextAlignment["AUTO"] = "AUTO";
119
- /** Left align */
120
- TextAlignment["LEFT"] = "LEFT";
121
- /** Right align */
122
- TextAlignment["RIGHT"] = "RIGHT";
123
- /** Center align */
124
- TextAlignment["CENTER"] = "CENTER";
125
- /** 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. */
126
- TextAlignment["JUSTIFY"] = "JUSTIFY";
127
- })(TextAlignment || (exports.TextAlignment = TextAlignment = {}));
128
- var LineStyle;
129
- (function (LineStyle) {
130
- /** Single Line */
131
- LineStyle["SINGLE"] = "SINGLE";
132
- /** Double Line */
133
- LineStyle["DOUBLE"] = "DOUBLE";
134
- /** Dashed Line */
135
- LineStyle["DASHED"] = "DASHED";
136
- /** Dotted Line */
137
- LineStyle["DOTTED"] = "DOTTED";
138
- })(LineStyle || (exports.LineStyle = LineStyle = {}));
139
- var Width;
140
- (function (Width) {
141
- /** Large line */
142
- Width["LARGE"] = "LARGE";
143
- /** Medium line */
144
- Width["MEDIUM"] = "MEDIUM";
145
- /** Small line */
146
- Width["SMALL"] = "SMALL";
147
- })(Width || (exports.Width = Width = {}));
148
- var Alignment;
149
- (function (Alignment) {
150
- /** Center alignment */
151
- Alignment["CENTER"] = "CENTER";
152
- /** Left alignment */
153
- Alignment["LEFT"] = "LEFT";
154
- /** Right alignment */
155
- Alignment["RIGHT"] = "RIGHT";
156
- })(Alignment || (exports.Alignment = Alignment = {}));
157
- var ViewMode;
158
- (function (ViewMode) {
159
- /** No PDF view */
160
- ViewMode["NONE"] = "NONE";
161
- /** Full PDF view */
162
- ViewMode["FULL"] = "FULL";
163
- /** Mini PDF view */
164
- ViewMode["MINI"] = "MINI";
165
- })(ViewMode || (exports.ViewMode = ViewMode = {}));
166
- var LayoutType;
167
- (function (LayoutType) {
168
- /** Collage type */
169
- LayoutType["COLLAGE"] = "COLLAGE";
170
- /** Masonry type */
171
- LayoutType["MASONRY"] = "MASONRY";
172
- /** Grid type */
173
- LayoutType["GRID"] = "GRID";
174
- /** Thumbnail type */
175
- LayoutType["THUMBNAIL"] = "THUMBNAIL";
176
- /** Slider type */
177
- LayoutType["SLIDER"] = "SLIDER";
178
- /** Slideshow type */
179
- LayoutType["SLIDESHOW"] = "SLIDESHOW";
180
- /** Panorama type */
181
- LayoutType["PANORAMA"] = "PANORAMA";
182
- /** Column type */
183
- LayoutType["COLUMN"] = "COLUMN";
184
- /** Magic type */
185
- LayoutType["MAGIC"] = "MAGIC";
186
- /** Fullsize images type */
187
- LayoutType["FULLSIZE"] = "FULLSIZE";
188
- })(LayoutType || (exports.LayoutType = LayoutType = {}));
189
- var Orientation;
190
- (function (Orientation) {
191
- /** Rows Orientation */
192
- Orientation["ROWS"] = "ROWS";
193
- /** Columns Orientation */
194
- Orientation["COLUMNS"] = "COLUMNS";
195
- })(Orientation || (exports.Orientation = Orientation = {}));
196
- var Crop;
197
- (function (Crop) {
198
- /** Crop to fill */
199
- Crop["FILL"] = "FILL";
200
- /** Crop to fit */
201
- Crop["FIT"] = "FIT";
202
- })(Crop || (exports.Crop = Crop = {}));
203
- var ThumbnailsAlignment;
204
- (function (ThumbnailsAlignment) {
205
- /** Top alignment */
206
- ThumbnailsAlignment["TOP"] = "TOP";
207
- /** Right alignment */
208
- ThumbnailsAlignment["RIGHT"] = "RIGHT";
209
- /** Bottom alignment */
210
- ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
211
- /** Left alignment */
212
- ThumbnailsAlignment["LEFT"] = "LEFT";
213
- /** No thumbnail */
214
- ThumbnailsAlignment["NONE"] = "NONE";
215
- })(ThumbnailsAlignment || (exports.ThumbnailsAlignment = ThumbnailsAlignment = {}));
216
- var Source;
217
- (function (Source) {
218
- Source["HTML"] = "HTML";
219
- Source["ADSENSE"] = "ADSENSE";
220
- })(Source || (exports.Source = Source = {}));
221
- var MapType;
222
- (function (MapType) {
223
- /** Roadmap map type */
224
- MapType["ROADMAP"] = "ROADMAP";
225
- /** Satellite map type */
226
- MapType["SATELITE"] = "SATELITE";
227
- /** Hybrid map type */
228
- MapType["HYBRID"] = "HYBRID";
229
- /** Terrain map type */
230
- MapType["TERRAIN"] = "TERRAIN";
231
- })(MapType || (exports.MapType = MapType = {}));
232
- var ViewRole;
233
- (function (ViewRole) {
234
- /** Only Poll creator can view the results */
235
- ViewRole["CREATOR"] = "CREATOR";
236
- /** Anyone who voted can see the results */
237
- ViewRole["VOTERS"] = "VOTERS";
238
- /** Anyone can see the results, even if one didn't vote */
239
- ViewRole["EVERYONE"] = "EVERYONE";
240
- })(ViewRole || (exports.ViewRole = ViewRole = {}));
241
- var VoteRole;
242
- (function (VoteRole) {
243
- /** Logged in member */
244
- VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
245
- /** Anyone */
246
- VoteRole["ALL"] = "ALL";
247
- })(VoteRole || (exports.VoteRole = VoteRole = {}));
248
- var PollLayoutType;
249
- (function (PollLayoutType) {
250
- /** List */
251
- PollLayoutType["LIST"] = "LIST";
252
- /** Grid */
253
- PollLayoutType["GRID"] = "GRID";
254
- })(PollLayoutType || (exports.PollLayoutType = PollLayoutType = {}));
255
- var PollLayoutDirection;
256
- (function (PollLayoutDirection) {
257
- /** Left-to-right */
258
- PollLayoutDirection["LTR"] = "LTR";
259
- /** Right-to-left */
260
- PollLayoutDirection["RTL"] = "RTL";
261
- })(PollLayoutDirection || (exports.PollLayoutDirection = PollLayoutDirection = {}));
262
- var BackgroundType;
263
- (function (BackgroundType) {
264
- /** Color background type */
265
- BackgroundType["COLOR"] = "COLOR";
266
- /** Image background type */
267
- BackgroundType["IMAGE"] = "IMAGE";
268
- /** Gradiant background type */
269
- BackgroundType["GRADIENT"] = "GRADIENT";
270
- })(BackgroundType || (exports.BackgroundType = BackgroundType = {}));
271
- var DecorationType;
272
- (function (DecorationType) {
273
- DecorationType["BOLD"] = "BOLD";
274
- DecorationType["ITALIC"] = "ITALIC";
275
- DecorationType["UNDERLINE"] = "UNDERLINE";
276
- DecorationType["SPOILER"] = "SPOILER";
277
- DecorationType["ANCHOR"] = "ANCHOR";
278
- DecorationType["MENTION"] = "MENTION";
279
- DecorationType["LINK"] = "LINK";
280
- DecorationType["COLOR"] = "COLOR";
281
- DecorationType["FONT_SIZE"] = "FONT_SIZE";
282
- DecorationType["EXTERNAL"] = "EXTERNAL";
283
- })(DecorationType || (exports.DecorationType = DecorationType = {}));
284
- var FontType;
285
- (function (FontType) {
286
- FontType["PX"] = "PX";
287
- FontType["EM"] = "EM";
288
- })(FontType || (exports.FontType = FontType = {}));
289
- var AppType;
290
- (function (AppType) {
291
- AppType["PRODUCT"] = "PRODUCT";
292
- AppType["EVENT"] = "EVENT";
293
- AppType["BOOKING"] = "BOOKING";
294
- })(AppType || (exports.AppType = AppType = {}));
295
- var InitialExpandedItems;
296
- (function (InitialExpandedItems) {
297
- /** First item will be expended initally */
298
- InitialExpandedItems["FIRST"] = "FIRST";
299
- /** All items will expended initally */
300
- InitialExpandedItems["ALL"] = "ALL";
301
- /** All items collapsed initally */
302
- InitialExpandedItems["NONE"] = "NONE";
303
- })(InitialExpandedItems || (exports.InitialExpandedItems = InitialExpandedItems = {}));
304
- var Direction;
305
- (function (Direction) {
306
- /** Left-to-right */
307
- Direction["LTR"] = "LTR";
308
- /** Right-to-left */
309
- Direction["RTL"] = "RTL";
310
- })(Direction || (exports.Direction = Direction = {}));
311
- var VerticalAlignment;
312
- (function (VerticalAlignment) {
313
- /** Top alignment */
314
- VerticalAlignment["TOP"] = "TOP";
315
- /** Middle alignment */
316
- VerticalAlignment["MIDDLE"] = "MIDDLE";
317
- /** Bottom alignment */
318
- VerticalAlignment["BOTTOM"] = "BOTTOM";
319
- })(VerticalAlignment || (exports.VerticalAlignment = VerticalAlignment = {}));
320
- /**
321
- * `NullValue` is a singleton enumeration to represent the null value for the
322
- * `Value` type union.
323
- *
324
- * The JSON representation for `NullValue` is JSON `null`.
325
- */
326
- var NullValue;
327
- (function (NullValue) {
328
- /** Null value. */
329
- NullValue["NULL_VALUE"] = "NULL_VALUE";
330
- })(NullValue || (exports.NullValue = NullValue = {}));
331
- var RequestedFields;
332
- (function (RequestedFields) {
333
- RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
334
- RequestedFields["BREADCRUMBS"] = "BREADCRUMBS";
335
- })(RequestedFields || (exports.RequestedFields = RequestedFields = {}));
336
- var SortOrder;
337
- (function (SortOrder) {
338
- SortOrder["ASC"] = "ASC";
339
- SortOrder["DESC"] = "DESC";
340
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
341
- var SortType;
342
- (function (SortType) {
343
- /** Should sort by number of matches */
344
- SortType["COUNT"] = "COUNT";
345
- /** Should sort by value of the field alphabetically */
346
- SortType["VALUE"] = "VALUE";
347
- })(SortType || (exports.SortType = SortType = {}));
348
- var SortDirection;
349
- (function (SortDirection) {
350
- /** Should sort in descending order */
351
- SortDirection["DESC"] = "DESC";
352
- /** Should sort in ascending order */
353
- SortDirection["ASC"] = "ASC";
354
- })(SortDirection || (exports.SortDirection = SortDirection = {}));
355
- var MissingValues;
356
- (function (MissingValues) {
357
- /** Should missing values be excluded from the aggregation results */
358
- MissingValues["EXCLUDE"] = "EXCLUDE";
359
- /** Should missing values be included in the aggregation results */
360
- MissingValues["INCLUDE"] = "INCLUDE";
361
- })(MissingValues || (exports.MissingValues = MissingValues = {}));
362
- var ScalarType;
363
- (function (ScalarType) {
364
- ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
365
- /** Count of distinct values */
366
- ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
367
- /** Minimum value */
368
- ScalarType["MIN"] = "MIN";
369
- /** Maximum value */
370
- ScalarType["MAX"] = "MAX";
371
- /** Sum of values */
372
- ScalarType["SUM"] = "SUM";
373
- /** Average of values */
374
- ScalarType["AVG"] = "AVG";
375
- })(ScalarType || (exports.ScalarType = ScalarType = {}));
376
- var NestedAggregationType;
377
- (function (NestedAggregationType) {
378
- NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
379
- /** An aggregation where result buckets are dynamically built - one per unique value */
380
- NestedAggregationType["VALUE"] = "VALUE";
381
- /** An aggregation, where user can define set of ranges - each representing a bucket */
382
- NestedAggregationType["RANGE"] = "RANGE";
383
- /** A single-value metric aggregation - e.g. min, max, sum, avg */
384
- NestedAggregationType["SCALAR"] = "SCALAR";
385
- /** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
386
- NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
387
- })(NestedAggregationType || (exports.NestedAggregationType = NestedAggregationType = {}));
388
- var Interval;
389
- (function (Interval) {
390
- Interval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
391
- /** Yearly interval */
392
- Interval["YEAR"] = "YEAR";
393
- /** Monthly interval */
394
- Interval["MONTH"] = "MONTH";
395
- /** Weekly interval */
396
- Interval["WEEK"] = "WEEK";
397
- /** Daily interval */
398
- Interval["DAY"] = "DAY";
399
- /** Hourly interval */
400
- Interval["HOUR"] = "HOUR";
401
- /** Minute interval */
402
- Interval["MINUTE"] = "MINUTE";
403
- /** Second interval */
404
- Interval["SECOND"] = "SECOND";
405
- })(Interval || (exports.Interval = Interval = {}));
406
- var AggregationType;
407
- (function (AggregationType) {
408
- AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
409
- /** An aggregation where result buckets are dynamically built - one per unique value */
410
- AggregationType["VALUE"] = "VALUE";
411
- /** An aggregation, where user can define set of ranges - each representing a bucket */
412
- AggregationType["RANGE"] = "RANGE";
413
- /** A single-value metric aggregation - e.g. min, max, sum, avg */
414
- AggregationType["SCALAR"] = "SCALAR";
415
- /** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
416
- AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
417
- /** Multi-level aggregation, where each next aggregation is nested within previous one */
418
- AggregationType["NESTED"] = "NESTED";
419
- })(AggregationType || (exports.AggregationType = AggregationType = {}));
420
- var Mode;
421
- (function (Mode) {
422
- /** Any of the search terms must be present */
423
- Mode["OR"] = "OR";
424
- /** All search terms must be present */
425
- Mode["AND"] = "AND";
426
- })(Mode || (exports.Mode = Mode = {}));
427
- var MoveCategoryRequestPosition;
428
- (function (MoveCategoryRequestPosition) {
429
- MoveCategoryRequestPosition["UNKNOWN_POSITION"] = "UNKNOWN_POSITION";
430
- MoveCategoryRequestPosition["FIRST"] = "FIRST";
431
- MoveCategoryRequestPosition["LAST"] = "LAST";
432
- MoveCategoryRequestPosition["BEFORE"] = "BEFORE";
433
- })(MoveCategoryRequestPosition || (exports.MoveCategoryRequestPosition = MoveCategoryRequestPosition = {}));
434
- var Position;
435
- (function (Position) {
436
- Position["UNKNOWN_POSITION"] = "UNKNOWN_POSITION";
437
- Position["FIRST"] = "FIRST";
438
- Position["LAST"] = "LAST";
439
- Position["BEFORE"] = "BEFORE";
440
- Position["NONE"] = "NONE";
441
- })(Position || (exports.Position = Position = {}));
442
- const _bulkAddItemsToCategoryRequest = {};
443
- const _bulkAddItemsToCategoryResponse = {};
444
- const _bulkAddItemToCategoriesRequest = {};
445
- const _bulkAddItemToCategoriesResponse = {};
446
- const _bulkCategoriesResult = { category: '_category' };
447
- const _bulkRemoveItemFromCategoriesRequest = {};
448
- const _bulkRemoveItemFromCategoriesResponse = {};
449
- const _bulkRemoveItemsFromCategoryRequest = {};
450
- const _bulkRemoveItemsFromCategoryResponse = {};
451
- const _bulkUpdateCategoriesRequest = { categories: '_maskedCategory' };
452
- const _bulkUpdateCategoriesResponse = { results: '_bulkCategoriesResult' };
453
- const _category = {
454
- image: 'wix.common.Image',
455
- richContentDescription: '_richContent',
456
- };
457
- const _countCategoriesRequest = {};
458
- const _countCategoriesResponse = {};
459
- const _createCategoryRequest = { category: '_category' };
460
- const _createCategoryResponse = { category: '_category' };
461
- const _deleteCategoryRequest = {};
462
- const _deleteCategoryResponse = {};
463
- const _getArrangedItemsRequest = {};
464
- const _getArrangedItemsResponse = {};
465
- const _getCategoryRequest = {};
466
- const _getCategoryResponse = { category: '_category' };
467
- const _listCategoriesForItemRequest = {};
468
- const _listCategoriesForItemResponse = {};
469
- const _listItemsInCategoryRequest = {};
470
- const _listItemsInCategoryResponse = {};
471
- const _maskedCategory = { category: '_category' };
472
- const _moveCategoryRequest = {};
473
- const _moveCategoryResponse = {};
474
- const _moveItemInCategoryRequest = {};
475
- const _moveItemInCategoryResponse = {};
476
- const _node = { nodes: '_node' };
477
- const _richContent = { nodes: '_node' };
478
- const _searchCategoriesRequest = {};
479
- const _searchCategoriesResponse = { categories: '_category' };
480
- const _setArrangedItemsRequest = {};
481
- const _setArrangedItemsResponse = {};
482
- const _updateCategoryRequest = { category: '_category' };
483
- const _updateCategoryResponse = { category: '_category' };
484
- const _updateCategoryVisibilityRequest = {};
485
- const _updateCategoryVisibilityResponse = { category: '_category' };
486
- exports.onCategoryCreated = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_created')();
487
- exports.onCategoryUpdated = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_updated')();
488
- exports.onCategoryDeleted = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_deleted')();
489
- exports.onCategoryMoved = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_category_moved')();
490
- exports.onCategoryItemAddedToCategory = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_item_added_to_category')();
491
- exports.onCategoryItemRemovedFromCategory = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_item_removed_from_category')();
492
- exports.onCategoryItemsArrangedInCategory = (0, sdk_types_1.EventDefinition)('wix.categories.v1.category_items_arranged_in_category')();
493
- /**
494
- * Creates a new Category.
495
- * @param category - Category to be created.
496
- * @public
497
- * @documentationMaturity preview
498
- * @requiredField category
499
- * @requiredField category.name
500
- * @requiredField category.parentCategory._id
501
- * @requiredField options.treeReference
502
- * @requiredField options.treeReference.appNamespace
503
- * @permissionScope Manage Stores - all permissions
504
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
505
- * @permissionScope Manage Products
506
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
507
- * @applicableIdentity APP
508
- * @returns The created Category.
509
- */
510
- function createCategory(category, options) {
511
- var _a, _b, _c;
512
- return __awaiter(this, arguments, void 0, function* () {
513
- const requestTransformation = {
514
- category: '$[0]',
515
- treeReference: '$[1].treeReference',
516
- fields: '$[1].fields',
517
- };
518
- const responseTransformation = '$.category';
519
- // @ts-ignore
520
- const { httpClient, sideEffects } = arguments[2];
521
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
522
- rootSchema: _createCategoryRequest,
523
- depSchemas: { _category, _node, _richContent },
524
- fqdnTransformation: {
525
- paths: [...['category']],
526
- transformation: _fromVeloEntity,
527
- },
528
- customTransformation: requestTransformation,
529
- });
530
- const { fromJSON } = (0, velo_1.serializer)({
531
- rootSchema: _createCategoryResponse,
532
- depSchemas: { _category, _node, _richContent },
533
- fqdnTransformation: {
534
- paths: [...['category']],
535
- transformation: _toVeloEntity,
536
- },
537
- customTransformation: responseTransformation,
538
- });
539
- const payload = toAmbassadorRequest([category, options]);
540
- const reqOpts = ambassadorWixCategoriesV1Category.createCategory(payload);
541
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
542
- try {
543
- const result = yield httpClient.request(reqOpts);
544
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
545
- return fromJSON(result.data);
546
- }
547
- catch (err) {
548
- const transformedError = (0, transform_error_1.transformError)(err, {
549
- spreadPathsToArguments: {},
550
- explicitPathsToArguments: {
551
- category: '$[0]',
552
- treeReference: '$[1].treeReference',
553
- fields: '$[1].fields',
554
- },
555
- singleArgumentUnchanged: false,
556
- }, ['category', 'options']);
557
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
558
- throw transformedError;
559
- }
560
- });
561
- }
562
- exports.createCategory = createCategory;
563
- /**
564
- * Retrieves a category with the provided ID.
565
- * @param categoryId - Id of the Category to retrieve.
566
- * @param treeReference - A reference to the tree that contains this category.
567
- * @public
568
- * @documentationMaturity preview
569
- * @requiredField categoryId
570
- * @requiredField treeReference
571
- * @requiredField treeReference.appNamespace
572
- * @permissionScope Manage Stores - all permissions
573
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
574
- * @permissionScope Manage Products
575
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
576
- * @permissionScope Read Stores - all read permissions
577
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
578
- * @permissionScope Read Products
579
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
580
- * @permissionScope Manage Orders
581
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
582
- * @applicableIdentity APP
583
- * @applicableIdentity MEMBER
584
- * @applicableIdentity VISITOR
585
- * @returns The retrieved Category.
586
- */
587
- function getCategory(categoryId, treeReference, options) {
588
- var _a, _b, _c;
589
- return __awaiter(this, arguments, void 0, function* () {
590
- const requestTransformation = {
591
- categoryId: '$[0]',
592
- treeReference: '$[1]',
593
- fields: '$[2].fields',
594
- };
595
- const responseTransformation = '$.category';
596
- // @ts-ignore
597
- const { httpClient, sideEffects } = arguments[3];
598
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
599
- rootSchema: _getCategoryRequest,
600
- depSchemas: {},
601
- fqdnTransformation: {
602
- paths: [],
603
- transformation: _fromVeloEntity,
604
- },
605
- customTransformation: requestTransformation,
606
- });
607
- const { fromJSON } = (0, velo_1.serializer)({
608
- rootSchema: _getCategoryResponse,
609
- depSchemas: { _category, _node, _richContent },
610
- fqdnTransformation: {
611
- paths: [...['category']],
612
- transformation: _toVeloEntity,
613
- },
614
- customTransformation: responseTransformation,
615
- });
616
- const payload = toAmbassadorRequest([categoryId, treeReference, options]);
617
- const reqOpts = ambassadorWixCategoriesV1Category.getCategory(payload);
618
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
619
- try {
620
- const result = yield httpClient.request(reqOpts);
621
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
622
- return fromJSON(result.data);
623
- }
624
- catch (err) {
625
- const transformedError = (0, transform_error_1.transformError)(err, {
626
- spreadPathsToArguments: {},
627
- explicitPathsToArguments: {
628
- categoryId: '$[0]',
629
- treeReference: '$[1]',
630
- fields: '$[2].fields',
631
- },
632
- singleArgumentUnchanged: false,
633
- }, ['categoryId', 'treeReference', 'options']);
634
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
635
- throw transformedError;
636
- }
637
- });
638
- }
639
- exports.getCategory = getCategory;
640
- /**
641
- * Update a Category, supports partial update.
642
- * Pass the latest `revision` for a successful update.
643
- * Each time the category is updated, `revision` increments by 1.
644
- * @param _id - Category ID.
645
- * @public
646
- * @documentationMaturity preview
647
- * @requiredField _id
648
- * @requiredField category
649
- * @requiredField category.revision
650
- * @requiredField options.treeReference
651
- * @requiredField options.treeReference.appNamespace
652
- * @permissionScope Manage Stores - all permissions
653
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
654
- * @permissionScope Manage Products
655
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
656
- * @applicableIdentity APP
657
- * @returns The updated Category.
658
- */
659
- function updateCategory(_id, category, options) {
660
- var _a, _b, _c;
661
- return __awaiter(this, arguments, void 0, function* () {
662
- const requestTransformation = {
663
- category: { '*': '$[1]', id: '$[0]' },
664
- treeReference: '$[2].treeReference',
665
- fields: '$[2].fields',
666
- };
667
- const responseTransformation = '$.category';
668
- // @ts-ignore
669
- const { httpClient, sideEffects } = arguments[3];
670
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
671
- rootSchema: _updateCategoryRequest,
672
- depSchemas: { _category, _node, _richContent },
673
- fqdnTransformation: {
674
- paths: [...['category']],
675
- transformation: _fromVeloEntity,
676
- },
677
- customTransformation: requestTransformation,
678
- });
679
- const { fromJSON } = (0, velo_1.serializer)({
680
- rootSchema: _updateCategoryResponse,
681
- depSchemas: { _category, _node, _richContent },
682
- fqdnTransformation: {
683
- paths: [...['category']],
684
- transformation: _toVeloEntity,
685
- },
686
- customTransformation: responseTransformation,
687
- });
688
- const payload = toAmbassadorRequest([_id, category, options]);
689
- const reqOpts = ambassadorWixCategoriesV1Category.updateCategory(payload);
690
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
691
- try {
692
- const result = yield httpClient.request(reqOpts);
693
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
694
- return fromJSON(result.data);
695
- }
696
- catch (err) {
697
- const transformedError = (0, transform_error_1.transformError)(err, {
698
- spreadPathsToArguments: { category: '$[1]' },
699
- explicitPathsToArguments: {
700
- 'category.id': '$[0]',
701
- treeReference: '$[2].treeReference',
702
- fields: '$[2].fields',
703
- },
704
- singleArgumentUnchanged: false,
705
- }, ['_id', 'category', 'options']);
706
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
707
- throw transformedError;
708
- }
709
- });
710
- }
711
- exports.updateCategory = updateCategory;
712
- /**
713
- * Deletes a Category.
714
- * @param categoryId - Id of the Category to delete.
715
- * @param treeReference - A reference to the tree that contains this category.
716
- * @public
717
- * @documentationMaturity preview
718
- * @requiredField categoryId
719
- * @requiredField treeReference
720
- * @requiredField treeReference.appNamespace
721
- * @permissionScope Manage Stores - all permissions
722
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
723
- * @permissionScope Manage Products
724
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
725
- * @applicableIdentity APP
726
- */
727
- function deleteCategory(categoryId, treeReference) {
728
- var _a, _b, _c;
729
- return __awaiter(this, arguments, void 0, function* () {
730
- const requestTransformation = { categoryId: '$[0]', treeReference: '$[1]' };
731
- const responseTransformation = '$';
732
- // @ts-ignore
733
- const { httpClient, sideEffects } = arguments[2];
734
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
735
- rootSchema: _deleteCategoryRequest,
736
- depSchemas: {},
737
- fqdnTransformation: {
738
- paths: [],
739
- transformation: _fromVeloEntity,
740
- },
741
- customTransformation: requestTransformation,
742
- });
743
- const { fromJSON } = (0, velo_1.serializer)({
744
- rootSchema: _deleteCategoryResponse,
745
- depSchemas: {},
746
- fqdnTransformation: {
747
- paths: [],
748
- transformation: _toVeloEntity,
749
- },
750
- customTransformation: responseTransformation,
751
- });
752
- const payload = toAmbassadorRequest([categoryId, treeReference]);
753
- const reqOpts = ambassadorWixCategoriesV1Category.deleteCategory(payload);
754
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
755
- try {
756
- const result = yield httpClient.request(reqOpts);
757
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
758
- }
759
- catch (err) {
760
- const transformedError = (0, transform_error_1.transformError)(err, {
761
- spreadPathsToArguments: {},
762
- explicitPathsToArguments: { categoryId: '$[0]', treeReference: '$[1]' },
763
- singleArgumentUnchanged: false,
764
- }, ['categoryId', 'treeReference']);
765
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
766
- throw transformedError;
767
- }
768
- });
769
- }
770
- exports.deleteCategory = deleteCategory;
771
- /**
772
- * Search Categories using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
773
- * @public
774
- * @documentationMaturity preview
775
- * @requiredField options.treeReference
776
- * @requiredField options.treeReference.appNamespace
777
- * @permissionScope Manage Stores - all permissions
778
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
779
- * @permissionScope Manage Products
780
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
781
- * @permissionScope Read Stores - all read permissions
782
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
783
- * @permissionScope Read Products
784
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
785
- * @permissionScope Manage Orders
786
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
787
- * @applicableIdentity APP
788
- * @applicableIdentity MEMBER
789
- * @applicableIdentity VISITOR
790
- */
791
- function searchCategories(options) {
792
- var _a, _b, _c;
793
- return __awaiter(this, arguments, void 0, function* () {
794
- const requestTransformation = {
795
- search: '$[0].search',
796
- treeReference: '$[0].treeReference',
797
- includeHidden: '$[0].includeHidden',
798
- fields: '$[0].fields',
799
- };
800
- const responseTransformation = '$';
801
- // @ts-ignore
802
- const { httpClient, sideEffects } = arguments[1];
803
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
804
- rootSchema: _searchCategoriesRequest,
805
- depSchemas: {},
806
- fqdnTransformation: {
807
- paths: [],
808
- transformation: _fromVeloEntity,
809
- },
810
- customTransformation: requestTransformation,
811
- });
812
- const { fromJSON } = (0, velo_1.serializer)({
813
- rootSchema: _searchCategoriesResponse,
814
- depSchemas: { _category, _node, _richContent },
815
- fqdnTransformation: {
816
- paths: [...['Array#categories']],
817
- transformation: _toVeloEntity,
818
- },
819
- customTransformation: responseTransformation,
820
- });
821
- const payload = toAmbassadorRequest([options]);
822
- const reqOpts = ambassadorWixCategoriesV1Category.searchCategories(payload);
823
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
824
- try {
825
- const result = yield httpClient.request(reqOpts);
826
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
827
- return fromJSON(result.data);
828
- }
829
- catch (err) {
830
- const transformedError = (0, transform_error_1.transformError)(err, {
831
- spreadPathsToArguments: {},
832
- explicitPathsToArguments: {
833
- search: '$[0].search',
834
- treeReference: '$[0].treeReference',
835
- includeHidden: '$[0].includeHidden',
836
- fields: '$[0].fields',
837
- },
838
- singleArgumentUnchanged: false,
839
- }, ['options']);
840
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
841
- throw transformedError;
842
- }
843
- });
844
- }
845
- exports.searchCategories = searchCategories;
846
- /**
847
- * Returns total count of categories satisfying filter and/or search
848
- * @public
849
- * @documentationMaturity preview
850
- * @requiredField options.treeReference
851
- * @requiredField options.treeReference.appNamespace
852
- * @permissionScope Manage Stores - all permissions
853
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
854
- * @permissionScope Manage Products
855
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
856
- * @permissionScope Read Stores - all read permissions
857
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
858
- * @permissionScope Read Products
859
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
860
- * @permissionScope Manage Orders
861
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
862
- * @applicableIdentity APP
863
- * @applicableIdentity MEMBER
864
- * @applicableIdentity VISITOR
865
- */
866
- function countCategories(options) {
867
- var _a, _b, _c;
868
- return __awaiter(this, arguments, void 0, function* () {
869
- const requestTransformation = {
870
- filter: '$[0].filter',
871
- search: '$[0].search',
872
- treeReference: '$[0].treeReference',
873
- includeHidden: '$[0].includeHidden',
874
- };
875
- const responseTransformation = '$';
876
- // @ts-ignore
877
- const { httpClient, sideEffects } = arguments[1];
878
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
879
- rootSchema: _countCategoriesRequest,
880
- depSchemas: {},
881
- fqdnTransformation: {
882
- paths: [],
883
- transformation: _fromVeloEntity,
884
- },
885
- customTransformation: requestTransformation,
886
- });
887
- const { fromJSON } = (0, velo_1.serializer)({
888
- rootSchema: _countCategoriesResponse,
889
- depSchemas: {},
890
- fqdnTransformation: {
891
- paths: [],
892
- transformation: _toVeloEntity,
893
- },
894
- customTransformation: responseTransformation,
895
- });
896
- const payload = toAmbassadorRequest([options]);
897
- const reqOpts = ambassadorWixCategoriesV1Category.countCategories(payload);
898
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
899
- try {
900
- const result = yield httpClient.request(reqOpts);
901
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
902
- return fromJSON(result.data);
903
- }
904
- catch (err) {
905
- const transformedError = (0, transform_error_1.transformError)(err, {
906
- spreadPathsToArguments: {},
907
- explicitPathsToArguments: {
908
- filter: '$[0].filter',
909
- search: '$[0].search',
910
- treeReference: '$[0].treeReference',
911
- includeHidden: '$[0].includeHidden',
912
- },
913
- singleArgumentUnchanged: false,
914
- }, ['options']);
915
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
916
- throw transformedError;
917
- }
918
- });
919
- }
920
- exports.countCategories = countCategories;
921
- /**
922
- * Moves a category.
923
- * This operation updates `parentCategory` (`id` and `index`) for category with `categoryId`.
924
- * This endpoint can be used to move category to different parent in the same tree or to change it's position in current parent.
925
- * @param categoryId - ID of category to place.
926
- * @param treeReference - A reference to the tree that contains this category.
927
- * @public
928
- * @documentationMaturity preview
929
- * @requiredField categoryId
930
- * @requiredField options.position
931
- * @requiredField treeReference
932
- * @requiredField treeReference.appNamespace
933
- * @permissionScope Manage Stores - all permissions
934
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
935
- * @permissionScope Manage Products
936
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
937
- * @applicableIdentity APP
938
- */
939
- function moveCategory(categoryId, treeReference, options) {
940
- var _a, _b, _c;
941
- return __awaiter(this, arguments, void 0, function* () {
942
- const requestTransformation = {
943
- categoryId: '$[0]',
944
- treeReference: '$[1]',
945
- parentCategoryId: '$[2].parentCategoryId',
946
- position: '$[2].position',
947
- moveBeforeCategoryId: '$[2].moveBeforeCategoryId',
948
- };
949
- const responseTransformation = '$';
950
- // @ts-ignore
951
- const { httpClient, sideEffects } = arguments[3];
952
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
953
- rootSchema: _moveCategoryRequest,
954
- depSchemas: {},
955
- fqdnTransformation: {
956
- paths: [],
957
- transformation: _fromVeloEntity,
958
- },
959
- customTransformation: requestTransformation,
960
- });
961
- const { fromJSON } = (0, velo_1.serializer)({
962
- rootSchema: _moveCategoryResponse,
963
- depSchemas: {},
964
- fqdnTransformation: {
965
- paths: [],
966
- transformation: _toVeloEntity,
967
- },
968
- customTransformation: responseTransformation,
969
- });
970
- const payload = toAmbassadorRequest([categoryId, treeReference, options]);
971
- const reqOpts = ambassadorWixCategoriesV1Category.moveCategory(payload);
972
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
973
- try {
974
- const result = yield httpClient.request(reqOpts);
975
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
976
- return fromJSON(result.data);
977
- }
978
- catch (err) {
979
- const transformedError = (0, transform_error_1.transformError)(err, {
980
- spreadPathsToArguments: {},
981
- explicitPathsToArguments: {
982
- categoryId: '$[0]',
983
- treeReference: '$[1]',
984
- parentCategoryId: '$[2].parentCategoryId',
985
- position: '$[2].position',
986
- moveBeforeCategoryId: '$[2].moveBeforeCategoryId',
987
- },
988
- singleArgumentUnchanged: false,
989
- }, ['categoryId', 'treeReference', 'options']);
990
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
991
- throw transformedError;
992
- }
993
- });
994
- }
995
- exports.moveCategory = moveCategory;
996
- /**
997
- * Update multiple Categories, supports partial update.
998
- * Pass the latest `revision` for a successful update.
999
- * To update visibility, call the BulkUpdateCategoryVisibility endpoint.
1000
- * @param categories - List of categories to be updated.
1001
- * @public
1002
- * @documentationMaturity preview
1003
- * @requiredField categories
1004
- * @requiredField categories.category
1005
- * @requiredField categories.category._id
1006
- * @requiredField categories.category.revision
1007
- * @requiredField options.treeReference
1008
- * @requiredField options.treeReference.appNamespace
1009
- * @permissionScope Manage Stores - all permissions
1010
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1011
- * @permissionScope Manage Products
1012
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1013
- * @applicableIdentity APP
1014
- */
1015
- function bulkUpdateCategories(categories, options) {
1016
- var _a, _b, _c;
1017
- return __awaiter(this, arguments, void 0, function* () {
1018
- const requestTransformation = {
1019
- categories: '$[0]',
1020
- treeReference: '$[1].treeReference',
1021
- returnEntity: '$[1].returnEntity',
1022
- };
1023
- const responseTransformation = '$';
1024
- // @ts-ignore
1025
- const { httpClient, sideEffects } = arguments[2];
1026
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1027
- rootSchema: _bulkUpdateCategoriesRequest,
1028
- depSchemas: { _category, _maskedCategory, _node, _richContent },
1029
- fqdnTransformation: {
1030
- paths: [...['Array#categories.category']],
1031
- transformation: _fromVeloEntity,
1032
- },
1033
- customTransformation: requestTransformation,
1034
- });
1035
- const { fromJSON } = (0, velo_1.serializer)({
1036
- rootSchema: _bulkUpdateCategoriesResponse,
1037
- depSchemas: { _bulkCategoriesResult, _category, _node, _richContent },
1038
- fqdnTransformation: {
1039
- paths: [...['Array#results.category']],
1040
- transformation: _toVeloEntity,
1041
- },
1042
- customTransformation: responseTransformation,
1043
- });
1044
- const payload = toAmbassadorRequest([categories, options]);
1045
- const reqOpts = ambassadorWixCategoriesV1Category.bulkUpdateCategories(payload);
1046
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1047
- try {
1048
- const result = yield httpClient.request(reqOpts);
1049
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1050
- return fromJSON(result.data);
1051
- }
1052
- catch (err) {
1053
- const transformedError = (0, transform_error_1.transformError)(err, {
1054
- spreadPathsToArguments: {},
1055
- explicitPathsToArguments: {
1056
- categories: '$[0]',
1057
- treeReference: '$[1].treeReference',
1058
- returnEntity: '$[1].returnEntity',
1059
- },
1060
- singleArgumentUnchanged: false,
1061
- }, ['categories', 'options']);
1062
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1063
- throw transformedError;
1064
- }
1065
- });
1066
- }
1067
- exports.bulkUpdateCategories = bulkUpdateCategories;
1068
- /**
1069
- * Update `visible` field. If visible is set to false, all subcategories will be set to `visible=false`
1070
- * @param categoryId - ID of category to be updated
1071
- * @public
1072
- * @documentationMaturity preview
1073
- * @requiredField categoryId
1074
- * @requiredField options.revision
1075
- * @requiredField options.treeReference
1076
- * @requiredField options.treeReference.appNamespace
1077
- * @requiredField options.visible
1078
- * @permissionScope Manage Stores - all permissions
1079
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1080
- * @permissionScope Manage Products
1081
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1082
- * @applicableIdentity APP
1083
- */
1084
- function updateCategoryVisibility(categoryId, options) {
1085
- var _a, _b, _c;
1086
- return __awaiter(this, arguments, void 0, function* () {
1087
- const requestTransformation = {
1088
- categoryId: '$[0]',
1089
- visible: '$[1].visible',
1090
- treeReference: '$[1].treeReference',
1091
- revision: '$[1].revision',
1092
- fields: '$[1].fields',
1093
- };
1094
- const responseTransformation = '$';
1095
- // @ts-ignore
1096
- const { httpClient, sideEffects } = arguments[2];
1097
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1098
- rootSchema: _updateCategoryVisibilityRequest,
1099
- depSchemas: {},
1100
- fqdnTransformation: {
1101
- paths: [],
1102
- transformation: _fromVeloEntity,
1103
- },
1104
- customTransformation: requestTransformation,
1105
- });
1106
- const { fromJSON } = (0, velo_1.serializer)({
1107
- rootSchema: _updateCategoryVisibilityResponse,
1108
- depSchemas: { _category, _node, _richContent },
1109
- fqdnTransformation: {
1110
- paths: [...['category']],
1111
- transformation: _toVeloEntity,
1112
- },
1113
- customTransformation: responseTransformation,
1114
- });
1115
- const payload = toAmbassadorRequest([categoryId, options]);
1116
- const reqOpts = ambassadorWixCategoriesV1Category.updateCategoryVisibility(payload);
1117
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1118
- try {
1119
- const result = yield httpClient.request(reqOpts);
1120
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1121
- return fromJSON(result.data);
1122
- }
1123
- catch (err) {
1124
- const transformedError = (0, transform_error_1.transformError)(err, {
1125
- spreadPathsToArguments: {},
1126
- explicitPathsToArguments: {
1127
- categoryId: '$[0]',
1128
- visible: '$[1].visible',
1129
- treeReference: '$[1].treeReference',
1130
- revision: '$[1].revision',
1131
- fields: '$[1].fields',
1132
- },
1133
- singleArgumentUnchanged: false,
1134
- }, ['categoryId', 'options']);
1135
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1136
- throw transformedError;
1137
- }
1138
- });
1139
- }
1140
- exports.updateCategoryVisibility = updateCategoryVisibility;
1141
- /**
1142
- * Adds multiple items to single category, fires as many domain events as many items successfully added.
1143
- * @param categoryId - Category id.
1144
- * @param items - List of catalog items with reference info.
1145
- * @public
1146
- * @documentationMaturity preview
1147
- * @requiredField categoryId
1148
- * @requiredField items
1149
- * @requiredField items.appId
1150
- * @requiredField items.catalogItemId
1151
- * @requiredField options
1152
- * @requiredField options.treeReference
1153
- * @requiredField options.treeReference.appNamespace
1154
- * @permissionScope Manage Stores - all permissions
1155
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1156
- * @permissionScope Manage Products
1157
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1158
- * @applicableIdentity APP
1159
- */
1160
- function bulkAddItemsToCategory(categoryId, items, options) {
1161
- var _a, _b, _c;
1162
- return __awaiter(this, arguments, void 0, function* () {
1163
- const requestTransformation = {
1164
- categoryId: '$[0]',
1165
- items: '$[1]',
1166
- treeReference: '$[2].treeReference',
1167
- };
1168
- const responseTransformation = '$';
1169
- // @ts-ignore
1170
- const { httpClient, sideEffects } = arguments[3];
1171
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1172
- rootSchema: _bulkAddItemsToCategoryRequest,
1173
- depSchemas: {},
1174
- fqdnTransformation: {
1175
- paths: [],
1176
- transformation: _fromVeloEntity,
1177
- },
1178
- customTransformation: requestTransformation,
1179
- });
1180
- const { fromJSON } = (0, velo_1.serializer)({
1181
- rootSchema: _bulkAddItemsToCategoryResponse,
1182
- depSchemas: {},
1183
- fqdnTransformation: {
1184
- paths: [],
1185
- transformation: _toVeloEntity,
1186
- },
1187
- customTransformation: responseTransformation,
1188
- });
1189
- const payload = toAmbassadorRequest([categoryId, items, options]);
1190
- const reqOpts = ambassadorWixCategoriesV1Category.bulkAddItemsToCategory(payload);
1191
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1192
- try {
1193
- const result = yield httpClient.request(reqOpts);
1194
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1195
- return fromJSON(result.data);
1196
- }
1197
- catch (err) {
1198
- const transformedError = (0, transform_error_1.transformError)(err, {
1199
- spreadPathsToArguments: {},
1200
- explicitPathsToArguments: {
1201
- categoryId: '$[0]',
1202
- items: '$[1]',
1203
- treeReference: '$[2].treeReference',
1204
- },
1205
- singleArgumentUnchanged: false,
1206
- }, ['categoryId', 'items', 'options']);
1207
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1208
- throw transformedError;
1209
- }
1210
- });
1211
- }
1212
- exports.bulkAddItemsToCategory = bulkAddItemsToCategory;
1213
- /**
1214
- * Adds single item to multiple categories, fires as many domain events as many categories were successfully added.
1215
- * @param itemReference - Catalog item reference info
1216
- * @public
1217
- * @documentationMaturity preview
1218
- * @requiredField itemReference
1219
- * @requiredField itemReference.appId
1220
- * @requiredField itemReference.catalogItemId
1221
- * @requiredField options
1222
- * @requiredField options.categoryIds
1223
- * @requiredField options.treeReference
1224
- * @requiredField options.treeReference.appNamespace
1225
- * @permissionScope Manage Stores - all permissions
1226
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1227
- * @permissionScope Manage Products
1228
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1229
- * @applicableIdentity APP
1230
- */
1231
- function bulkAddItemToCategories(itemReference, options) {
1232
- var _a, _b, _c;
1233
- return __awaiter(this, arguments, void 0, function* () {
1234
- const requestTransformation = {
1235
- itemReference: '$[0]',
1236
- categoryIds: '$[1].categoryIds',
1237
- treeReference: '$[1].treeReference',
1238
- };
1239
- const responseTransformation = '$';
1240
- // @ts-ignore
1241
- const { httpClient, sideEffects } = arguments[2];
1242
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1243
- rootSchema: _bulkAddItemToCategoriesRequest,
1244
- depSchemas: {},
1245
- fqdnTransformation: {
1246
- paths: [],
1247
- transformation: _fromVeloEntity,
1248
- },
1249
- customTransformation: requestTransformation,
1250
- });
1251
- const { fromJSON } = (0, velo_1.serializer)({
1252
- rootSchema: _bulkAddItemToCategoriesResponse,
1253
- depSchemas: {},
1254
- fqdnTransformation: {
1255
- paths: [],
1256
- transformation: _toVeloEntity,
1257
- },
1258
- customTransformation: responseTransformation,
1259
- });
1260
- const payload = toAmbassadorRequest([itemReference, options]);
1261
- const reqOpts = ambassadorWixCategoriesV1Category.bulkAddItemToCategories(payload);
1262
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1263
- try {
1264
- const result = yield httpClient.request(reqOpts);
1265
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1266
- return fromJSON(result.data);
1267
- }
1268
- catch (err) {
1269
- const transformedError = (0, transform_error_1.transformError)(err, {
1270
- spreadPathsToArguments: {},
1271
- explicitPathsToArguments: {
1272
- itemReference: '$[0]',
1273
- categoryIds: '$[1].categoryIds',
1274
- treeReference: '$[1].treeReference',
1275
- },
1276
- singleArgumentUnchanged: false,
1277
- }, ['itemReference', 'options']);
1278
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1279
- throw transformedError;
1280
- }
1281
- });
1282
- }
1283
- exports.bulkAddItemToCategories = bulkAddItemToCategories;
1284
- /**
1285
- * Removed multiple items from single category, fires as many domain events as many items successfully removed.
1286
- * @param categoryId - Category id
1287
- * @param items - List of catalog items with reference info.
1288
- * @public
1289
- * @documentationMaturity preview
1290
- * @requiredField categoryId
1291
- * @requiredField items
1292
- * @requiredField items.appId
1293
- * @requiredField items.catalogItemId
1294
- * @requiredField options
1295
- * @requiredField options.treeReference
1296
- * @requiredField options.treeReference.appNamespace
1297
- * @permissionScope Manage Stores - all permissions
1298
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1299
- * @permissionScope Manage Products
1300
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1301
- * @applicableIdentity APP
1302
- */
1303
- function bulkRemoveItemsFromCategory(categoryId, items, options) {
1304
- var _a, _b, _c;
1305
- return __awaiter(this, arguments, void 0, function* () {
1306
- const requestTransformation = {
1307
- categoryId: '$[0]',
1308
- items: '$[1]',
1309
- treeReference: '$[2].treeReference',
1310
- };
1311
- const responseTransformation = '$';
1312
- // @ts-ignore
1313
- const { httpClient, sideEffects } = arguments[3];
1314
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1315
- rootSchema: _bulkRemoveItemsFromCategoryRequest,
1316
- depSchemas: {},
1317
- fqdnTransformation: {
1318
- paths: [],
1319
- transformation: _fromVeloEntity,
1320
- },
1321
- customTransformation: requestTransformation,
1322
- });
1323
- const { fromJSON } = (0, velo_1.serializer)({
1324
- rootSchema: _bulkRemoveItemsFromCategoryResponse,
1325
- depSchemas: {},
1326
- fqdnTransformation: {
1327
- paths: [],
1328
- transformation: _toVeloEntity,
1329
- },
1330
- customTransformation: responseTransformation,
1331
- });
1332
- const payload = toAmbassadorRequest([categoryId, items, options]);
1333
- const reqOpts = ambassadorWixCategoriesV1Category.bulkRemoveItemsFromCategory(payload);
1334
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1335
- try {
1336
- const result = yield httpClient.request(reqOpts);
1337
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1338
- return fromJSON(result.data);
1339
- }
1340
- catch (err) {
1341
- const transformedError = (0, transform_error_1.transformError)(err, {
1342
- spreadPathsToArguments: {},
1343
- explicitPathsToArguments: {
1344
- categoryId: '$[0]',
1345
- items: '$[1]',
1346
- treeReference: '$[2].treeReference',
1347
- },
1348
- singleArgumentUnchanged: false,
1349
- }, ['categoryId', 'items', 'options']);
1350
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1351
- throw transformedError;
1352
- }
1353
- });
1354
- }
1355
- exports.bulkRemoveItemsFromCategory = bulkRemoveItemsFromCategory;
1356
- /**
1357
- * Removes single item from multiple categories, fires as many domain events as many categories were successfully removed.
1358
- * @param itemReference - Catalog item reference info
1359
- * @public
1360
- * @documentationMaturity preview
1361
- * @requiredField itemReference
1362
- * @requiredField itemReference.appId
1363
- * @requiredField itemReference.catalogItemId
1364
- * @requiredField options
1365
- * @requiredField options.categoryIds
1366
- * @requiredField options.treeReference
1367
- * @requiredField options.treeReference.appNamespace
1368
- * @permissionScope Manage Stores - all permissions
1369
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1370
- * @permissionScope Manage Products
1371
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1372
- * @applicableIdentity APP
1373
- */
1374
- function bulkRemoveItemFromCategories(itemReference, options) {
1375
- var _a, _b, _c;
1376
- return __awaiter(this, arguments, void 0, function* () {
1377
- const requestTransformation = {
1378
- itemReference: '$[0]',
1379
- categoryIds: '$[1].categoryIds',
1380
- treeReference: '$[1].treeReference',
1381
- };
1382
- const responseTransformation = '$';
1383
- // @ts-ignore
1384
- const { httpClient, sideEffects } = arguments[2];
1385
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1386
- rootSchema: _bulkRemoveItemFromCategoriesRequest,
1387
- depSchemas: {},
1388
- fqdnTransformation: {
1389
- paths: [],
1390
- transformation: _fromVeloEntity,
1391
- },
1392
- customTransformation: requestTransformation,
1393
- });
1394
- const { fromJSON } = (0, velo_1.serializer)({
1395
- rootSchema: _bulkRemoveItemFromCategoriesResponse,
1396
- depSchemas: {},
1397
- fqdnTransformation: {
1398
- paths: [],
1399
- transformation: _toVeloEntity,
1400
- },
1401
- customTransformation: responseTransformation,
1402
- });
1403
- const payload = toAmbassadorRequest([itemReference, options]);
1404
- const reqOpts = ambassadorWixCategoriesV1Category.bulkRemoveItemFromCategories(payload);
1405
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1406
- try {
1407
- const result = yield httpClient.request(reqOpts);
1408
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1409
- return fromJSON(result.data);
1410
- }
1411
- catch (err) {
1412
- const transformedError = (0, transform_error_1.transformError)(err, {
1413
- spreadPathsToArguments: {},
1414
- explicitPathsToArguments: {
1415
- itemReference: '$[0]',
1416
- categoryIds: '$[1].categoryIds',
1417
- treeReference: '$[1].treeReference',
1418
- },
1419
- singleArgumentUnchanged: false,
1420
- }, ['itemReference', 'options']);
1421
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1422
- throw transformedError;
1423
- }
1424
- });
1425
- }
1426
- exports.bulkRemoveItemFromCategories = bulkRemoveItemFromCategories;
1427
- /**
1428
- * Returns up to 100 items related to requested `category_id` sorted by time when item added to category, descending.
1429
- * When items added to category in bulk they considered as added at exactly same time so order will be random but always the same.
1430
- * @param categoryId - ID of category containing items.
1431
- * @param treeReference - A reference to the tree that contains this category.
1432
- * @public
1433
- * @documentationMaturity preview
1434
- * @requiredField categoryId
1435
- * @requiredField treeReference
1436
- * @requiredField treeReference.appNamespace
1437
- * @permissionScope Manage Stores - all permissions
1438
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1439
- * @permissionScope Manage Products
1440
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1441
- * @permissionScope Read Stores - all read permissions
1442
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1443
- * @permissionScope Read Products
1444
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1445
- * @permissionScope Manage Orders
1446
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1447
- * @applicableIdentity APP
1448
- * @applicableIdentity MEMBER
1449
- * @applicableIdentity VISITOR
1450
- */
1451
- function listItemsInCategory(categoryId, treeReference, options) {
1452
- var _a, _b, _c;
1453
- return __awaiter(this, arguments, void 0, function* () {
1454
- const requestTransformation = {
1455
- categoryId: '$[0]',
1456
- treeReference: '$[1]',
1457
- useCategoryArrangement: '$[2].useCategoryArrangement',
1458
- includeItemsFromSubcategories: '$[2].includeItemsFromSubcategories',
1459
- cursorPaging: '$[2].cursorPaging',
1460
- };
1461
- const responseTransformation = '$';
1462
- // @ts-ignore
1463
- const { httpClient, sideEffects } = arguments[3];
1464
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1465
- rootSchema: _listItemsInCategoryRequest,
1466
- depSchemas: {},
1467
- fqdnTransformation: {
1468
- paths: [],
1469
- transformation: _fromVeloEntity,
1470
- },
1471
- customTransformation: requestTransformation,
1472
- });
1473
- const { fromJSON } = (0, velo_1.serializer)({
1474
- rootSchema: _listItemsInCategoryResponse,
1475
- depSchemas: {},
1476
- fqdnTransformation: {
1477
- paths: [],
1478
- transformation: _toVeloEntity,
1479
- },
1480
- customTransformation: responseTransformation,
1481
- });
1482
- const payload = toAmbassadorRequest([categoryId, treeReference, options]);
1483
- const reqOpts = ambassadorWixCategoriesV1Category.listItemsInCategory(payload);
1484
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1485
- try {
1486
- const result = yield httpClient.request(reqOpts);
1487
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1488
- return fromJSON(result.data);
1489
- }
1490
- catch (err) {
1491
- const transformedError = (0, transform_error_1.transformError)(err, {
1492
- spreadPathsToArguments: {},
1493
- explicitPathsToArguments: {
1494
- categoryId: '$[0]',
1495
- treeReference: '$[1]',
1496
- useCategoryArrangement: '$[2].useCategoryArrangement',
1497
- includeItemsFromSubcategories: '$[2].includeItemsFromSubcategories',
1498
- cursorPaging: '$[2].cursorPaging',
1499
- },
1500
- singleArgumentUnchanged: false,
1501
- }, ['categoryId', 'treeReference', 'options']);
1502
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1503
- throw transformedError;
1504
- }
1505
- });
1506
- }
1507
- exports.listItemsInCategory = listItemsInCategory;
1508
- /**
1509
- * Returns all category IDs that contain the item and their parent category IDs.
1510
- * @param itemReference - Catalog item reference info.
1511
- * @public
1512
- * @documentationMaturity preview
1513
- * @requiredField itemReference
1514
- * @requiredField options
1515
- * @requiredField options.treeReference
1516
- * @requiredField options.treeReference.appNamespace
1517
- * @permissionScope Manage Stores - all permissions
1518
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1519
- * @permissionScope Manage Products
1520
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1521
- * @permissionScope Read Stores - all read permissions
1522
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1523
- * @permissionScope Read Products
1524
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1525
- * @permissionScope Manage Orders
1526
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1527
- * @applicableIdentity APP
1528
- * @applicableIdentity MEMBER
1529
- * @applicableIdentity VISITOR
1530
- */
1531
- function listCategoriesForItem(itemReference, options) {
1532
- var _a, _b, _c;
1533
- return __awaiter(this, arguments, void 0, function* () {
1534
- const requestTransformation = {
1535
- itemReference: '$[0]',
1536
- treeReference: '$[1].treeReference',
1537
- };
1538
- const responseTransformation = '$';
1539
- // @ts-ignore
1540
- const { httpClient, sideEffects } = arguments[2];
1541
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1542
- rootSchema: _listCategoriesForItemRequest,
1543
- depSchemas: {},
1544
- fqdnTransformation: {
1545
- paths: [],
1546
- transformation: _fromVeloEntity,
1547
- },
1548
- customTransformation: requestTransformation,
1549
- });
1550
- const { fromJSON } = (0, velo_1.serializer)({
1551
- rootSchema: _listCategoriesForItemResponse,
1552
- depSchemas: {},
1553
- fqdnTransformation: {
1554
- paths: [],
1555
- transformation: _toVeloEntity,
1556
- },
1557
- customTransformation: responseTransformation,
1558
- });
1559
- const payload = toAmbassadorRequest([itemReference, options]);
1560
- const reqOpts = ambassadorWixCategoriesV1Category.listCategoriesForItem(payload);
1561
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1562
- try {
1563
- const result = yield httpClient.request(reqOpts);
1564
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1565
- return fromJSON(result.data);
1566
- }
1567
- catch (err) {
1568
- const transformedError = (0, transform_error_1.transformError)(err, {
1569
- spreadPathsToArguments: {},
1570
- explicitPathsToArguments: {
1571
- itemReference: '$[0]',
1572
- treeReference: '$[1].treeReference',
1573
- },
1574
- singleArgumentUnchanged: false,
1575
- }, ['itemReference', 'options']);
1576
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1577
- throw transformedError;
1578
- }
1579
- });
1580
- }
1581
- exports.listCategoriesForItem = listCategoriesForItem;
1582
- /**
1583
- * Changes position of `item` in category. Will be used when sort items by manual arrangement
1584
- * @param categoryId - ID of category.
1585
- * Item must be direct child of this category, otherwise error returned
1586
- * @param treeReference - A reference to the tree that contains this category.
1587
- * @public
1588
- * @documentationMaturity preview
1589
- * @requiredField categoryId
1590
- * @requiredField options.item
1591
- * @requiredField options.position
1592
- * @requiredField treeReference
1593
- * @requiredField treeReference.appNamespace
1594
- * @permissionScope Manage Stores - all permissions
1595
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1596
- * @permissionScope Manage Products
1597
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1598
- * @applicableIdentity APP
1599
- */
1600
- function moveItemInCategory(categoryId, treeReference, options) {
1601
- var _a, _b, _c;
1602
- return __awaiter(this, arguments, void 0, function* () {
1603
- const requestTransformation = {
1604
- categoryId: '$[0]',
1605
- treeReference: '$[1]',
1606
- item: '$[2].item',
1607
- position: '$[2].position',
1608
- beforeItem: '$[2].beforeItem',
1609
- };
1610
- const responseTransformation = '$';
1611
- // @ts-ignore
1612
- const { httpClient, sideEffects } = arguments[3];
1613
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1614
- rootSchema: _moveItemInCategoryRequest,
1615
- depSchemas: {},
1616
- fqdnTransformation: {
1617
- paths: [],
1618
- transformation: _fromVeloEntity,
1619
- },
1620
- customTransformation: requestTransformation,
1621
- });
1622
- const { fromJSON } = (0, velo_1.serializer)({
1623
- rootSchema: _moveItemInCategoryResponse,
1624
- depSchemas: {},
1625
- fqdnTransformation: {
1626
- paths: [],
1627
- transformation: _toVeloEntity,
1628
- },
1629
- customTransformation: responseTransformation,
1630
- });
1631
- const payload = toAmbassadorRequest([categoryId, treeReference, options]);
1632
- const reqOpts = ambassadorWixCategoriesV1Category.moveItemInCategory(payload);
1633
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1634
- try {
1635
- const result = yield httpClient.request(reqOpts);
1636
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1637
- return fromJSON(result.data);
1638
- }
1639
- catch (err) {
1640
- const transformedError = (0, transform_error_1.transformError)(err, {
1641
- spreadPathsToArguments: {},
1642
- explicitPathsToArguments: {
1643
- categoryId: '$[0]',
1644
- treeReference: '$[1]',
1645
- item: '$[2].item',
1646
- position: '$[2].position',
1647
- beforeItem: '$[2].beforeItem',
1648
- },
1649
- singleArgumentUnchanged: false,
1650
- }, ['categoryId', 'treeReference', 'options']);
1651
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1652
- throw transformedError;
1653
- }
1654
- });
1655
- }
1656
- exports.moveItemInCategory = moveItemInCategory;
1657
- /**
1658
- * Set arranged items in category. Will be used when sort items by manual arrangement.
1659
- * Calling this endpoint overrides existing list of arranged items in category.
1660
- * @param categoryId - ID of category.
1661
- * @param treeReference - A reference to the tree that contains this category.
1662
- * @public
1663
- * @documentationMaturity preview
1664
- * @requiredField categoryId
1665
- * @requiredField treeReference
1666
- * @requiredField treeReference.appNamespace
1667
- * @permissionScope Manage Stores - all permissions
1668
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1669
- * @permissionScope Manage Products
1670
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1671
- * @applicableIdentity APP
1672
- */
1673
- function setArrangedItems(categoryId, treeReference, options) {
1674
- var _a, _b, _c;
1675
- return __awaiter(this, arguments, void 0, function* () {
1676
- const requestTransformation = {
1677
- categoryId: '$[0]',
1678
- treeReference: '$[1]',
1679
- items: '$[2].items',
1680
- };
1681
- const responseTransformation = '$';
1682
- // @ts-ignore
1683
- const { httpClient, sideEffects } = arguments[3];
1684
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1685
- rootSchema: _setArrangedItemsRequest,
1686
- depSchemas: {},
1687
- fqdnTransformation: {
1688
- paths: [],
1689
- transformation: _fromVeloEntity,
1690
- },
1691
- customTransformation: requestTransformation,
1692
- });
1693
- const { fromJSON } = (0, velo_1.serializer)({
1694
- rootSchema: _setArrangedItemsResponse,
1695
- depSchemas: {},
1696
- fqdnTransformation: {
1697
- paths: [],
1698
- transformation: _toVeloEntity,
1699
- },
1700
- customTransformation: responseTransformation,
1701
- });
1702
- const payload = toAmbassadorRequest([categoryId, treeReference, options]);
1703
- const reqOpts = ambassadorWixCategoriesV1Category.setArrangedItems(payload);
1704
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1705
- try {
1706
- const result = yield httpClient.request(reqOpts);
1707
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1708
- return fromJSON(result.data);
1709
- }
1710
- catch (err) {
1711
- const transformedError = (0, transform_error_1.transformError)(err, {
1712
- spreadPathsToArguments: {},
1713
- explicitPathsToArguments: {
1714
- categoryId: '$[0]',
1715
- treeReference: '$[1]',
1716
- items: '$[2].items',
1717
- },
1718
- singleArgumentUnchanged: false,
1719
- }, ['categoryId', 'treeReference', 'options']);
1720
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1721
- throw transformedError;
1722
- }
1723
- });
1724
- }
1725
- exports.setArrangedItems = setArrangedItems;
1726
- /**
1727
- * Returns arranged items in category
1728
- * @param categoryId - ID of category.
1729
- * @param treeReference - A reference to the tree that contains this category.
1730
- * @public
1731
- * @documentationMaturity preview
1732
- * @requiredField categoryId
1733
- * @requiredField treeReference
1734
- * @requiredField treeReference.appNamespace
1735
- * @permissionScope Manage Stores - all permissions
1736
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
1737
- * @permissionScope Manage Products
1738
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
1739
- * @permissionScope Read Stores - all read permissions
1740
- * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
1741
- * @permissionScope Read Products
1742
- * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
1743
- * @permissionScope Manage Orders
1744
- * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
1745
- * @applicableIdentity APP
1746
- * @applicableIdentity MEMBER
1747
- * @applicableIdentity VISITOR
1748
- */
1749
- function getArrangedItems(categoryId, treeReference) {
1750
- var _a, _b, _c;
1751
- return __awaiter(this, arguments, void 0, function* () {
1752
- const requestTransformation = { categoryId: '$[0]', treeReference: '$[1]' };
1753
- const responseTransformation = '$';
1754
- // @ts-ignore
1755
- const { httpClient, sideEffects } = arguments[2];
1756
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1757
- rootSchema: _getArrangedItemsRequest,
1758
- depSchemas: {},
1759
- fqdnTransformation: {
1760
- paths: [],
1761
- transformation: _fromVeloEntity,
1762
- },
1763
- customTransformation: requestTransformation,
1764
- });
1765
- const { fromJSON } = (0, velo_1.serializer)({
1766
- rootSchema: _getArrangedItemsResponse,
1767
- depSchemas: {},
1768
- fqdnTransformation: {
1769
- paths: [],
1770
- transformation: _toVeloEntity,
1771
- },
1772
- customTransformation: responseTransformation,
1773
- });
1774
- const payload = toAmbassadorRequest([categoryId, treeReference]);
1775
- const reqOpts = ambassadorWixCategoriesV1Category.getArrangedItems(payload);
1776
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1777
- try {
1778
- const result = yield httpClient.request(reqOpts);
1779
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1780
- return fromJSON(result.data);
1781
- }
1782
- catch (err) {
1783
- const transformedError = (0, transform_error_1.transformError)(err, {
1784
- spreadPathsToArguments: {},
1785
- explicitPathsToArguments: { categoryId: '$[0]', treeReference: '$[1]' },
1786
- singleArgumentUnchanged: false,
1787
- }, ['categoryId', 'treeReference']);
1788
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1789
- throw transformedError;
1790
- }
1791
- });
1792
- }
1793
- exports.getArrangedItems = getArrangedItems;
1794
- //# sourceMappingURL=categories-v1-category.universal.js.map