@wix/categories 1.0.23 → 1.0.25

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