@wix/categories 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +24 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/categories-v1-category.http.d.ts +54 -0
  5. package/build/cjs/src/categories-v1-category.http.js +790 -0
  6. package/build/cjs/src/categories-v1-category.http.js.map +1 -0
  7. package/build/cjs/src/categories-v1-category.public.d.ts +24 -0
  8. package/build/cjs/src/categories-v1-category.public.js +141 -0
  9. package/build/cjs/src/categories-v1-category.public.js.map +1 -0
  10. package/build/cjs/src/categories-v1-category.types.d.ts +1969 -0
  11. package/build/cjs/src/categories-v1-category.types.js +316 -0
  12. package/build/cjs/src/categories-v1-category.types.js.map +1 -0
  13. package/build/cjs/src/categories-v1-category.universal.d.ts +2429 -0
  14. package/build/cjs/src/categories-v1-category.universal.js +1457 -0
  15. package/build/cjs/src/categories-v1-category.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +2 -0
  18. package/build/es/index.js.map +1 -0
  19. package/build/es/src/categories-v1-category.http.d.ts +54 -0
  20. package/build/es/src/categories-v1-category.http.js +770 -0
  21. package/build/es/src/categories-v1-category.http.js.map +1 -0
  22. package/build/es/src/categories-v1-category.public.d.ts +24 -0
  23. package/build/es/src/categories-v1-category.public.js +89 -0
  24. package/build/es/src/categories-v1-category.public.js.map +1 -0
  25. package/build/es/src/categories-v1-category.types.d.ts +1969 -0
  26. package/build/es/src/categories-v1-category.types.js +313 -0
  27. package/build/es/src/categories-v1-category.types.js.map +1 -0
  28. package/build/es/src/categories-v1-category.universal.d.ts +2429 -0
  29. package/build/es/src/categories-v1-category.universal.js +1418 -0
  30. package/build/es/src/categories-v1-category.universal.js.map +1 -0
  31. package/package.json +37 -0
@@ -0,0 +1,1457 @@
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.getArrangedItems = exports.setArrangedItems = exports.moveItemInCategory = exports.listCategoriesForItem = exports.listItemsInCategory = exports.removeItemFromCategories = exports.removeItemsFromCategory = exports.addItemToCategories = exports.addItemsToCategory = exports.updateCategoryVisibility = exports.bulkUpdateCategories = exports.placeCategoryInParentCategory = exports.queryCategories = exports.deleteCategory = exports.updateCategory = exports.getCategory = exports.createCategory = exports.Position = exports.PlaceCategoryInParentCategoryRequestPosition = 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
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixCategoriesV1Category = __importStar(require("./categories-v1-category.http"));
34
+ // @ts-ignore
35
+ const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
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 PlaceCategoryInParentCategoryRequestPosition;
349
+ (function (PlaceCategoryInParentCategoryRequestPosition) {
350
+ PlaceCategoryInParentCategoryRequestPosition["UNKNOWN_POSITION"] = "UNKNOWN_POSITION";
351
+ PlaceCategoryInParentCategoryRequestPosition["FIRST"] = "FIRST";
352
+ PlaceCategoryInParentCategoryRequestPosition["LAST"] = "LAST";
353
+ PlaceCategoryInParentCategoryRequestPosition["BEFORE"] = "BEFORE";
354
+ })(PlaceCategoryInParentCategoryRequestPosition = exports.PlaceCategoryInParentCategoryRequestPosition || (exports.PlaceCategoryInParentCategoryRequestPosition = {}));
355
+ var Position;
356
+ (function (Position) {
357
+ Position["UNKNOWN_POSITION"] = "UNKNOWN_POSITION";
358
+ Position["FIRST"] = "FIRST";
359
+ Position["LAST"] = "LAST";
360
+ Position["BEFORE"] = "BEFORE";
361
+ Position["NONE"] = "NONE";
362
+ })(Position = exports.Position || (exports.Position = {}));
363
+ const _addItemsToCategoryRequest = {};
364
+ const _addItemsToCategoryResponse = {};
365
+ const _addItemToCategoriesRequest = {};
366
+ const _addItemToCategoriesResponse = {};
367
+ const _bulkCategoriesResult = { category: '_category' };
368
+ const _bulkUpdateCategoriesRequest = { categories: '_maskedCategory' };
369
+ const _bulkUpdateCategoriesResponse = { results: '_bulkCategoriesResult' };
370
+ const _category = {
371
+ image: 'wix.common.Image',
372
+ richContentDescription: '_richContent',
373
+ };
374
+ const _createCategoryRequest = { category: '_category' };
375
+ const _createCategoryResponse = { category: '_category' };
376
+ const _deleteCategoryRequest = {};
377
+ const _deleteCategoryResponse = {};
378
+ const _getArrangedItemsRequest = {};
379
+ const _getArrangedItemsResponse = {};
380
+ const _getCategoryRequest = {};
381
+ const _getCategoryResponse = { category: '_category' };
382
+ const _listCategoriesForItemRequest = {};
383
+ const _listCategoriesForItemResponse = {};
384
+ const _listItemsInCategoryRequest = {};
385
+ const _listItemsInCategoryResponse = {};
386
+ const _maskedCategory = { category: '_category' };
387
+ const _moveItemInCategoryRequest = {};
388
+ const _moveItemInCategoryResponse = {};
389
+ const _node = { nodes: '_node' };
390
+ const _placeCategoryInParentCategoryRequest = {};
391
+ const _placeCategoryInParentCategoryResponse = {};
392
+ const _queryCategoriesRequest = {};
393
+ const _queryCategoriesResponse = { categories: '_category' };
394
+ const _removeItemFromCategoriesRequest = {};
395
+ const _removeItemFromCategoriesResponse = {};
396
+ const _removeItemsFromCategoryRequest = {};
397
+ const _removeItemsFromCategoryResponse = {};
398
+ const _richContent = { nodes: '_node' };
399
+ const _setArrangedItemsRequest = {};
400
+ const _setArrangedItemsResponse = {};
401
+ const _updateCategoryRequest = { category: '_category' };
402
+ const _updateCategoryResponse = { category: '_category' };
403
+ const _updateCategoryVisibilityRequest = {};
404
+ const _updateCategoryVisibilityResponse = { category: '_category' };
405
+ /**
406
+ * Creates a new Category.
407
+ * @param category - Category to be created.
408
+ * @public
409
+ * @documentationMaturity preview
410
+ * @requiredField category
411
+ * @requiredField category.name
412
+ * @requiredField category.parentCategory._id
413
+ * @requiredField options
414
+ * @requiredField options.treeReference
415
+ * @requiredField options.treeReference.appNamespace
416
+ * @returns The created Category.
417
+ */
418
+ function createCategory(category, options) {
419
+ var _a, _b, _c;
420
+ return __awaiter(this, arguments, void 0, function* () {
421
+ const requestTransformation = {
422
+ category: '$[0]',
423
+ treeReference: '$[1].treeReference',
424
+ fields: '$[1].fields',
425
+ };
426
+ const responseTransformation = '$.category';
427
+ // @ts-ignore
428
+ const { httpClient, sideEffects } = arguments[2];
429
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
430
+ rootSchema: _createCategoryRequest,
431
+ depSchemas: { _category, _node, _richContent },
432
+ fqdnTransformation: {
433
+ paths: [...['category']],
434
+ transformation: _fromVeloEntity,
435
+ },
436
+ customTransformation: requestTransformation,
437
+ });
438
+ const { fromJSON } = (0, velo_1.serializer)({
439
+ rootSchema: _createCategoryResponse,
440
+ depSchemas: { _category, _node, _richContent },
441
+ fqdnTransformation: {
442
+ paths: [...['category']],
443
+ transformation: _toVeloEntity,
444
+ },
445
+ customTransformation: responseTransformation,
446
+ });
447
+ const payload = toAmbassadorRequest([category, options]);
448
+ const reqOpts = ambassadorWixCategoriesV1Category.createCategory(payload);
449
+ __log(`"CreateCategory" sending request with: ${__inspect(reqOpts)}`);
450
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
451
+ try {
452
+ const result = yield httpClient.request(reqOpts);
453
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
454
+ return fromJSON(result.data);
455
+ }
456
+ catch (err) {
457
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
458
+ 'category',
459
+ 'options',
460
+ ]);
461
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
462
+ throw transformedError;
463
+ }
464
+ });
465
+ }
466
+ exports.createCategory = createCategory;
467
+ /**
468
+ * Retrieves a category with the provided ID.
469
+ * @param categoryId - Id of the Category to retrieve.
470
+ * @param treeReference - A reference to the tree that contains this category.
471
+ * @public
472
+ * @documentationMaturity preview
473
+ * @requiredField categoryId
474
+ * @requiredField treeReference
475
+ * @requiredField treeReference.appNamespace
476
+ * @applicableIdentity VISITOR
477
+ * @returns The retrieved Category.
478
+ */
479
+ function getCategory(categoryId, treeReference, options) {
480
+ var _a, _b, _c;
481
+ return __awaiter(this, arguments, void 0, function* () {
482
+ const requestTransformation = {
483
+ categoryId: '$[0]',
484
+ treeReference: '$[1]',
485
+ fields: '$[2].fields',
486
+ };
487
+ const responseTransformation = '$.category';
488
+ // @ts-ignore
489
+ const { httpClient, sideEffects } = arguments[3];
490
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
491
+ rootSchema: _getCategoryRequest,
492
+ depSchemas: {},
493
+ fqdnTransformation: {
494
+ paths: [],
495
+ transformation: _fromVeloEntity,
496
+ },
497
+ customTransformation: requestTransformation,
498
+ });
499
+ const { fromJSON } = (0, velo_1.serializer)({
500
+ rootSchema: _getCategoryResponse,
501
+ depSchemas: { _category, _node, _richContent },
502
+ fqdnTransformation: {
503
+ paths: [...['category']],
504
+ transformation: _toVeloEntity,
505
+ },
506
+ customTransformation: responseTransformation,
507
+ });
508
+ const payload = toAmbassadorRequest([categoryId, treeReference, options]);
509
+ const reqOpts = ambassadorWixCategoriesV1Category.getCategory(payload);
510
+ __log(`"GetCategory" sending request with: ${__inspect(reqOpts)}`);
511
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
512
+ try {
513
+ const result = yield httpClient.request(reqOpts);
514
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
515
+ return fromJSON(result.data);
516
+ }
517
+ catch (err) {
518
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
519
+ 'categoryId',
520
+ 'treeReference',
521
+ 'options',
522
+ ]);
523
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
524
+ throw transformedError;
525
+ }
526
+ });
527
+ }
528
+ exports.getCategory = getCategory;
529
+ /**
530
+ * Update a Category, supports partial update.
531
+ * Pass the latest `revision` for a successful update.
532
+ * Each time the category is updated, `revision` increments by 1.
533
+ * @param _id - Category ID.
534
+ * @public
535
+ * @documentationMaturity preview
536
+ * @requiredField _id
537
+ * @requiredField category
538
+ * @requiredField category.revision
539
+ * @requiredField options
540
+ * @requiredField options.treeReference
541
+ * @requiredField options.treeReference.appNamespace
542
+ * @returns The updated Category.
543
+ */
544
+ function updateCategory(_id, category, options) {
545
+ var _a, _b, _c;
546
+ return __awaiter(this, arguments, void 0, function* () {
547
+ const requestTransformation = {
548
+ category: { '*': '$[1]', id: '$[0]' },
549
+ treeReference: '$[2].treeReference',
550
+ fields: '$[2].fields',
551
+ };
552
+ const responseTransformation = '$.category';
553
+ // @ts-ignore
554
+ const { httpClient, sideEffects } = arguments[3];
555
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
556
+ rootSchema: _updateCategoryRequest,
557
+ depSchemas: { _category, _node, _richContent },
558
+ fqdnTransformation: {
559
+ paths: [...['category']],
560
+ transformation: _fromVeloEntity,
561
+ },
562
+ customTransformation: requestTransformation,
563
+ });
564
+ const { fromJSON } = (0, velo_1.serializer)({
565
+ rootSchema: _updateCategoryResponse,
566
+ depSchemas: { _category, _node, _richContent },
567
+ fqdnTransformation: {
568
+ paths: [...['category']],
569
+ transformation: _toVeloEntity,
570
+ },
571
+ customTransformation: responseTransformation,
572
+ });
573
+ const payload = toAmbassadorRequest([_id, category, options]);
574
+ const reqOpts = ambassadorWixCategoriesV1Category.updateCategory(payload);
575
+ __log(`"UpdateCategory" sending request with: ${__inspect(reqOpts)}`);
576
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
577
+ try {
578
+ const result = yield httpClient.request(reqOpts);
579
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
580
+ return fromJSON(result.data);
581
+ }
582
+ catch (err) {
583
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
584
+ '_id',
585
+ 'category',
586
+ 'options',
587
+ ]);
588
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
589
+ throw transformedError;
590
+ }
591
+ });
592
+ }
593
+ exports.updateCategory = updateCategory;
594
+ /**
595
+ * Deletes a Category.
596
+ * @param categoryId - Id of the Category to delete.
597
+ * @param treeReference - A reference to the tree that contains this category.
598
+ * @public
599
+ * @documentationMaturity preview
600
+ * @requiredField categoryId
601
+ * @requiredField treeReference
602
+ * @requiredField treeReference.appNamespace
603
+ */
604
+ function deleteCategory(categoryId, treeReference) {
605
+ var _a, _b, _c;
606
+ return __awaiter(this, arguments, void 0, function* () {
607
+ const requestTransformation = { categoryId: '$[0]', treeReference: '$[1]' };
608
+ const responseTransformation = '$';
609
+ // @ts-ignore
610
+ const { httpClient, sideEffects } = arguments[2];
611
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
612
+ rootSchema: _deleteCategoryRequest,
613
+ depSchemas: {},
614
+ fqdnTransformation: {
615
+ paths: [],
616
+ transformation: _fromVeloEntity,
617
+ },
618
+ customTransformation: requestTransformation,
619
+ });
620
+ const { fromJSON } = (0, velo_1.serializer)({
621
+ rootSchema: _deleteCategoryResponse,
622
+ depSchemas: {},
623
+ fqdnTransformation: {
624
+ paths: [],
625
+ transformation: _toVeloEntity,
626
+ },
627
+ customTransformation: responseTransformation,
628
+ });
629
+ const payload = toAmbassadorRequest([categoryId, treeReference]);
630
+ const reqOpts = ambassadorWixCategoriesV1Category.deleteCategory(payload);
631
+ __log(`"DeleteCategory" sending request with: ${__inspect(reqOpts)}`);
632
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
633
+ try {
634
+ const result = yield httpClient.request(reqOpts);
635
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
636
+ return fromJSON(result.data);
637
+ }
638
+ catch (err) {
639
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
640
+ 'categoryId',
641
+ 'treeReference',
642
+ ]);
643
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
644
+ throw transformedError;
645
+ }
646
+ });
647
+ }
648
+ exports.deleteCategory = deleteCategory;
649
+ /**
650
+ * Query Categories using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
651
+ * @public
652
+ * @documentationMaturity preview
653
+ * @applicableIdentity VISITOR
654
+ */
655
+ function queryCategories(options) {
656
+ const requestTransformation = { '*': '$[1]', query: '$[0]' };
657
+ const responseTransformation = {
658
+ items: '$.categories',
659
+ pagingMetadata: '$.metadata',
660
+ };
661
+ // @ts-ignore
662
+ const { httpClient, sideEffects } = arguments[1];
663
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
664
+ rootSchema: _queryCategoriesRequest,
665
+ depSchemas: {},
666
+ fqdnTransformation: {
667
+ paths: [],
668
+ transformation: _fromVeloEntity,
669
+ },
670
+ customTransformation: requestTransformation,
671
+ });
672
+ const { fromJSON } = (0, velo_1.serializer)({
673
+ rootSchema: _queryCategoriesResponse,
674
+ depSchemas: { _category, _node, _richContent },
675
+ fqdnTransformation: {
676
+ paths: [...['Array#categories']],
677
+ transformation: _toVeloEntity,
678
+ },
679
+ customTransformation: responseTransformation,
680
+ });
681
+ return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
682
+ func: (payload) => __awaiter(this, void 0, void 0, function* () {
683
+ var _a, _b, _c;
684
+ const reqOpts = ambassadorWixCategoriesV1Category.queryCategories(Object.assign(Object.assign({}, payload), options));
685
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
686
+ try {
687
+ const result = yield httpClient.request(reqOpts);
688
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
689
+ return result;
690
+ }
691
+ catch (err) {
692
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
693
+ throw err;
694
+ }
695
+ }),
696
+ requestTransformer: (...args) => toAmbassadorRequest(args),
697
+ responseTransformer: ({ data }) => fromJSON(data),
698
+ errorTransformer: (err) => {
699
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation);
700
+ throw transformedError;
701
+ },
702
+ pagingMethod: 'CURSOR',
703
+ transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
704
+ })({ cursorWithEmptyFilterAndSort: true });
705
+ }
706
+ exports.queryCategories = queryCategories;
707
+ /**
708
+ * Places category in parent category.
709
+ * This operation updates `parentCategory` (`id` and `index`) for category with `categoryId` in tree with `treeId`.
710
+ * This endpoint can be used to move category to different parent in the same tree or to change it's position in current parent.
711
+ * @param categoryId - ID of category to place.
712
+ * @param treeReference - A reference to the tree that contains this category.
713
+ * @public
714
+ * @documentationMaturity preview
715
+ * @requiredField categoryId
716
+ * @requiredField options
717
+ * @requiredField options.position
718
+ * @requiredField treeReference
719
+ * @requiredField treeReference.appNamespace
720
+ */
721
+ function placeCategoryInParentCategory(categoryId, treeReference, options) {
722
+ var _a, _b, _c;
723
+ return __awaiter(this, arguments, void 0, function* () {
724
+ const requestTransformation = {
725
+ categoryId: '$[0]',
726
+ treeReference: '$[1]',
727
+ parentCategoryId: '$[2].parentCategoryId',
728
+ position: '$[2].position',
729
+ moveBeforeCategoryId: '$[2].moveBeforeCategoryId',
730
+ };
731
+ const responseTransformation = '$';
732
+ // @ts-ignore
733
+ const { httpClient, sideEffects } = arguments[3];
734
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
735
+ rootSchema: _placeCategoryInParentCategoryRequest,
736
+ depSchemas: {},
737
+ fqdnTransformation: {
738
+ paths: [],
739
+ transformation: _fromVeloEntity,
740
+ },
741
+ customTransformation: requestTransformation,
742
+ });
743
+ const { fromJSON } = (0, velo_1.serializer)({
744
+ rootSchema: _placeCategoryInParentCategoryResponse,
745
+ depSchemas: {},
746
+ fqdnTransformation: {
747
+ paths: [],
748
+ transformation: _toVeloEntity,
749
+ },
750
+ customTransformation: responseTransformation,
751
+ });
752
+ const payload = toAmbassadorRequest([categoryId, treeReference, options]);
753
+ const reqOpts = ambassadorWixCategoriesV1Category.placeCategoryInParentCategory(payload);
754
+ __log(`"PlaceCategoryInParentCategory" sending request with: ${__inspect(reqOpts)}`);
755
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
756
+ try {
757
+ const result = yield httpClient.request(reqOpts);
758
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
759
+ return fromJSON(result.data);
760
+ }
761
+ catch (err) {
762
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
763
+ 'categoryId',
764
+ 'treeReference',
765
+ 'options',
766
+ ]);
767
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
768
+ throw transformedError;
769
+ }
770
+ });
771
+ }
772
+ exports.placeCategoryInParentCategory = placeCategoryInParentCategory;
773
+ /**
774
+ * Update multiple Categories, supports partial update.
775
+ * Pass the latest `revision` for a successful update.
776
+ * To update visibility, call the BulkUpdateCategoryVisibility endpoint.
777
+ * @param categories - List of categories to be updated.
778
+ * @public
779
+ * @documentationMaturity preview
780
+ * @requiredField categories
781
+ * @requiredField categories.category
782
+ * @requiredField categories.category._id
783
+ * @requiredField categories.category.revision
784
+ * @requiredField options
785
+ * @requiredField options.treeReference
786
+ * @requiredField options.treeReference.appNamespace
787
+ */
788
+ function bulkUpdateCategories(categories, options) {
789
+ var _a, _b, _c;
790
+ return __awaiter(this, arguments, void 0, function* () {
791
+ const requestTransformation = {
792
+ categories: '$[0]',
793
+ treeReference: '$[1].treeReference',
794
+ returnEntity: '$[1].returnEntity',
795
+ };
796
+ const responseTransformation = '$';
797
+ // @ts-ignore
798
+ const { httpClient, sideEffects } = arguments[2];
799
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
800
+ rootSchema: _bulkUpdateCategoriesRequest,
801
+ depSchemas: { _category, _maskedCategory, _node, _richContent },
802
+ fqdnTransformation: {
803
+ paths: [...['Array#categories.category']],
804
+ transformation: _fromVeloEntity,
805
+ },
806
+ customTransformation: requestTransformation,
807
+ });
808
+ const { fromJSON } = (0, velo_1.serializer)({
809
+ rootSchema: _bulkUpdateCategoriesResponse,
810
+ depSchemas: { _bulkCategoriesResult, _category, _node, _richContent },
811
+ fqdnTransformation: {
812
+ paths: [...['Array#results.category']],
813
+ transformation: _toVeloEntity,
814
+ },
815
+ customTransformation: responseTransformation,
816
+ });
817
+ const payload = toAmbassadorRequest([categories, options]);
818
+ const reqOpts = ambassadorWixCategoriesV1Category.bulkUpdateCategories(payload);
819
+ __log(`"BulkUpdateCategories" sending request with: ${__inspect(reqOpts)}`);
820
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
821
+ try {
822
+ const result = yield httpClient.request(reqOpts);
823
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
824
+ return fromJSON(result.data);
825
+ }
826
+ catch (err) {
827
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
828
+ 'categories',
829
+ 'options',
830
+ ]);
831
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
832
+ throw transformedError;
833
+ }
834
+ });
835
+ }
836
+ exports.bulkUpdateCategories = bulkUpdateCategories;
837
+ /**
838
+ * Update `visible` field. If visible is set to false, all subcategories will be set to `visible=false`
839
+ * @param categoryId - ID of category to be updated
840
+ * @public
841
+ * @documentationMaturity preview
842
+ * @requiredField categoryId
843
+ * @requiredField options
844
+ * @requiredField options.revision
845
+ * @requiredField options.treeReference
846
+ * @requiredField options.treeReference.appNamespace
847
+ * @requiredField options.visible
848
+ */
849
+ function updateCategoryVisibility(categoryId, options) {
850
+ var _a, _b, _c;
851
+ return __awaiter(this, arguments, void 0, function* () {
852
+ const requestTransformation = {
853
+ categoryId: '$[0]',
854
+ visible: '$[1].visible',
855
+ treeReference: '$[1].treeReference',
856
+ revision: '$[1].revision',
857
+ };
858
+ const responseTransformation = '$';
859
+ // @ts-ignore
860
+ const { httpClient, sideEffects } = arguments[2];
861
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
862
+ rootSchema: _updateCategoryVisibilityRequest,
863
+ depSchemas: {},
864
+ fqdnTransformation: {
865
+ paths: [],
866
+ transformation: _fromVeloEntity,
867
+ },
868
+ customTransformation: requestTransformation,
869
+ });
870
+ const { fromJSON } = (0, velo_1.serializer)({
871
+ rootSchema: _updateCategoryVisibilityResponse,
872
+ depSchemas: { _category, _node, _richContent },
873
+ fqdnTransformation: {
874
+ paths: [...['category']],
875
+ transformation: _toVeloEntity,
876
+ },
877
+ customTransformation: responseTransformation,
878
+ });
879
+ const payload = toAmbassadorRequest([categoryId, options]);
880
+ const reqOpts = ambassadorWixCategoriesV1Category.updateCategoryVisibility(payload);
881
+ __log(`"UpdateCategoryVisibility" sending request with: ${__inspect(reqOpts)}`);
882
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
883
+ try {
884
+ const result = yield httpClient.request(reqOpts);
885
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
886
+ return fromJSON(result.data);
887
+ }
888
+ catch (err) {
889
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
890
+ 'categoryId',
891
+ 'options',
892
+ ]);
893
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
894
+ throw transformedError;
895
+ }
896
+ });
897
+ }
898
+ exports.updateCategoryVisibility = updateCategoryVisibility;
899
+ /**
900
+ * Adds multiple items to single category, fires as many domain events as many items successfully added.
901
+ * @param categoryId - Category id.
902
+ * @param items - List of catalog items with reference info.
903
+ * @public
904
+ * @documentationMaturity preview
905
+ * @requiredField categoryId
906
+ * @requiredField items
907
+ * @requiredField items.appId
908
+ * @requiredField items.catalogItemId
909
+ * @requiredField options
910
+ * @requiredField options.treeReference
911
+ * @requiredField options.treeReference.appNamespace
912
+ */
913
+ function addItemsToCategory(categoryId, items, options) {
914
+ var _a, _b, _c;
915
+ return __awaiter(this, arguments, void 0, function* () {
916
+ const requestTransformation = {
917
+ categoryId: '$[0]',
918
+ items: '$[1]',
919
+ treeReference: '$[2].treeReference',
920
+ };
921
+ const responseTransformation = '$';
922
+ // @ts-ignore
923
+ const { httpClient, sideEffects } = arguments[3];
924
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
925
+ rootSchema: _addItemsToCategoryRequest,
926
+ depSchemas: {},
927
+ fqdnTransformation: {
928
+ paths: [],
929
+ transformation: _fromVeloEntity,
930
+ },
931
+ customTransformation: requestTransformation,
932
+ });
933
+ const { fromJSON } = (0, velo_1.serializer)({
934
+ rootSchema: _addItemsToCategoryResponse,
935
+ depSchemas: {},
936
+ fqdnTransformation: {
937
+ paths: [],
938
+ transformation: _toVeloEntity,
939
+ },
940
+ customTransformation: responseTransformation,
941
+ });
942
+ const payload = toAmbassadorRequest([categoryId, items, options]);
943
+ const reqOpts = ambassadorWixCategoriesV1Category.addItemsToCategory(payload);
944
+ __log(`"AddItemsToCategory" sending request with: ${__inspect(reqOpts)}`);
945
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
946
+ try {
947
+ const result = yield httpClient.request(reqOpts);
948
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
949
+ return fromJSON(result.data);
950
+ }
951
+ catch (err) {
952
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
953
+ 'categoryId',
954
+ 'items',
955
+ 'options',
956
+ ]);
957
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
958
+ throw transformedError;
959
+ }
960
+ });
961
+ }
962
+ exports.addItemsToCategory = addItemsToCategory;
963
+ /**
964
+ * Adds single item to multiple categories, fires as many domain events as many categories were successfully added.
965
+ * @param itemReference - Catalog item reference info
966
+ * @public
967
+ * @documentationMaturity preview
968
+ * @requiredField itemReference
969
+ * @requiredField itemReference.appId
970
+ * @requiredField itemReference.catalogItemId
971
+ * @requiredField options
972
+ * @requiredField options.categoryIds
973
+ * @requiredField options.treeReference
974
+ * @requiredField options.treeReference.appNamespace
975
+ */
976
+ function addItemToCategories(itemReference, options) {
977
+ var _a, _b, _c;
978
+ return __awaiter(this, arguments, void 0, function* () {
979
+ const requestTransformation = {
980
+ itemReference: '$[0]',
981
+ categoryIds: '$[1].categoryIds',
982
+ treeReference: '$[1].treeReference',
983
+ };
984
+ const responseTransformation = '$';
985
+ // @ts-ignore
986
+ const { httpClient, sideEffects } = arguments[2];
987
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
988
+ rootSchema: _addItemToCategoriesRequest,
989
+ depSchemas: {},
990
+ fqdnTransformation: {
991
+ paths: [],
992
+ transformation: _fromVeloEntity,
993
+ },
994
+ customTransformation: requestTransformation,
995
+ });
996
+ const { fromJSON } = (0, velo_1.serializer)({
997
+ rootSchema: _addItemToCategoriesResponse,
998
+ depSchemas: {},
999
+ fqdnTransformation: {
1000
+ paths: [],
1001
+ transformation: _toVeloEntity,
1002
+ },
1003
+ customTransformation: responseTransformation,
1004
+ });
1005
+ const payload = toAmbassadorRequest([itemReference, options]);
1006
+ const reqOpts = ambassadorWixCategoriesV1Category.addItemToCategories(payload);
1007
+ __log(`"AddItemToCategories" sending request with: ${__inspect(reqOpts)}`);
1008
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1009
+ try {
1010
+ const result = yield httpClient.request(reqOpts);
1011
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1012
+ return fromJSON(result.data);
1013
+ }
1014
+ catch (err) {
1015
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1016
+ 'itemReference',
1017
+ 'options',
1018
+ ]);
1019
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1020
+ throw transformedError;
1021
+ }
1022
+ });
1023
+ }
1024
+ exports.addItemToCategories = addItemToCategories;
1025
+ /**
1026
+ * Removed multiple items from single category, fires as many domain events as many items successfully removed.
1027
+ * @param categoryId - Category id
1028
+ * @param items - List of catalog items with reference info.
1029
+ * @public
1030
+ * @documentationMaturity preview
1031
+ * @requiredField categoryId
1032
+ * @requiredField items
1033
+ * @requiredField items.appId
1034
+ * @requiredField items.catalogItemId
1035
+ * @requiredField options
1036
+ * @requiredField options.treeReference
1037
+ * @requiredField options.treeReference.appNamespace
1038
+ */
1039
+ function removeItemsFromCategory(categoryId, items, options) {
1040
+ var _a, _b, _c;
1041
+ return __awaiter(this, arguments, void 0, function* () {
1042
+ const requestTransformation = {
1043
+ categoryId: '$[0]',
1044
+ items: '$[1]',
1045
+ treeReference: '$[2].treeReference',
1046
+ };
1047
+ const responseTransformation = '$';
1048
+ // @ts-ignore
1049
+ const { httpClient, sideEffects } = arguments[3];
1050
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1051
+ rootSchema: _removeItemsFromCategoryRequest,
1052
+ depSchemas: {},
1053
+ fqdnTransformation: {
1054
+ paths: [],
1055
+ transformation: _fromVeloEntity,
1056
+ },
1057
+ customTransformation: requestTransformation,
1058
+ });
1059
+ const { fromJSON } = (0, velo_1.serializer)({
1060
+ rootSchema: _removeItemsFromCategoryResponse,
1061
+ depSchemas: {},
1062
+ fqdnTransformation: {
1063
+ paths: [],
1064
+ transformation: _toVeloEntity,
1065
+ },
1066
+ customTransformation: responseTransformation,
1067
+ });
1068
+ const payload = toAmbassadorRequest([categoryId, items, options]);
1069
+ const reqOpts = ambassadorWixCategoriesV1Category.removeItemsFromCategory(payload);
1070
+ __log(`"RemoveItemsFromCategory" sending request with: ${__inspect(reqOpts)}`);
1071
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1072
+ try {
1073
+ const result = yield httpClient.request(reqOpts);
1074
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1075
+ return fromJSON(result.data);
1076
+ }
1077
+ catch (err) {
1078
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1079
+ 'categoryId',
1080
+ 'items',
1081
+ 'options',
1082
+ ]);
1083
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1084
+ throw transformedError;
1085
+ }
1086
+ });
1087
+ }
1088
+ exports.removeItemsFromCategory = removeItemsFromCategory;
1089
+ /**
1090
+ * Removes single item from multiple categories, fires as many domain events as many categories were successfully removed.
1091
+ * @param itemReference - Catalog item reference info
1092
+ * @public
1093
+ * @documentationMaturity preview
1094
+ * @requiredField itemReference
1095
+ * @requiredField itemReference.appId
1096
+ * @requiredField itemReference.catalogItemId
1097
+ * @requiredField options
1098
+ * @requiredField options.categoryIds
1099
+ * @requiredField options.treeReference
1100
+ * @requiredField options.treeReference.appNamespace
1101
+ */
1102
+ function removeItemFromCategories(itemReference, options) {
1103
+ var _a, _b, _c;
1104
+ return __awaiter(this, arguments, void 0, function* () {
1105
+ const requestTransformation = {
1106
+ itemReference: '$[0]',
1107
+ categoryIds: '$[1].categoryIds',
1108
+ treeReference: '$[1].treeReference',
1109
+ };
1110
+ const responseTransformation = '$';
1111
+ // @ts-ignore
1112
+ const { httpClient, sideEffects } = arguments[2];
1113
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1114
+ rootSchema: _removeItemFromCategoriesRequest,
1115
+ depSchemas: {},
1116
+ fqdnTransformation: {
1117
+ paths: [],
1118
+ transformation: _fromVeloEntity,
1119
+ },
1120
+ customTransformation: requestTransformation,
1121
+ });
1122
+ const { fromJSON } = (0, velo_1.serializer)({
1123
+ rootSchema: _removeItemFromCategoriesResponse,
1124
+ depSchemas: {},
1125
+ fqdnTransformation: {
1126
+ paths: [],
1127
+ transformation: _toVeloEntity,
1128
+ },
1129
+ customTransformation: responseTransformation,
1130
+ });
1131
+ const payload = toAmbassadorRequest([itemReference, options]);
1132
+ const reqOpts = ambassadorWixCategoriesV1Category.removeItemFromCategories(payload);
1133
+ __log(`"RemoveItemFromCategories" sending request with: ${__inspect(reqOpts)}`);
1134
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1135
+ try {
1136
+ const result = yield httpClient.request(reqOpts);
1137
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1138
+ return fromJSON(result.data);
1139
+ }
1140
+ catch (err) {
1141
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1142
+ 'itemReference',
1143
+ 'options',
1144
+ ]);
1145
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1146
+ throw transformedError;
1147
+ }
1148
+ });
1149
+ }
1150
+ exports.removeItemFromCategories = removeItemFromCategories;
1151
+ /**
1152
+ * Returns up to 100 items related to requested `category_id` sorted by time when item added to category, descending.
1153
+ * When items added to category in bulk they considered as added at exactly same time so order will be random but always the same.
1154
+ * @param categoryId - ID of category containing items.
1155
+ * @param treeReference - A reference to the tree that contains this category.
1156
+ * @public
1157
+ * @documentationMaturity preview
1158
+ * @requiredField categoryId
1159
+ * @requiredField treeReference
1160
+ * @requiredField treeReference.appNamespace
1161
+ * @applicableIdentity VISITOR
1162
+ */
1163
+ function listItemsInCategory(categoryId, treeReference, options) {
1164
+ var _a, _b, _c;
1165
+ return __awaiter(this, arguments, void 0, function* () {
1166
+ const requestTransformation = {
1167
+ categoryId: '$[0]',
1168
+ treeReference: '$[1]',
1169
+ useCategoryArrangement: '$[2].useCategoryArrangement',
1170
+ includeItemsFromSubcategories: '$[2].includeItemsFromSubcategories',
1171
+ paging: '$[2].paging',
1172
+ };
1173
+ const responseTransformation = '$';
1174
+ // @ts-ignore
1175
+ const { httpClient, sideEffects } = arguments[3];
1176
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1177
+ rootSchema: _listItemsInCategoryRequest,
1178
+ depSchemas: {},
1179
+ fqdnTransformation: {
1180
+ paths: [],
1181
+ transformation: _fromVeloEntity,
1182
+ },
1183
+ customTransformation: requestTransformation,
1184
+ });
1185
+ const { fromJSON } = (0, velo_1.serializer)({
1186
+ rootSchema: _listItemsInCategoryResponse,
1187
+ depSchemas: {},
1188
+ fqdnTransformation: {
1189
+ paths: [],
1190
+ transformation: _toVeloEntity,
1191
+ },
1192
+ customTransformation: responseTransformation,
1193
+ });
1194
+ const payload = toAmbassadorRequest([categoryId, treeReference, options]);
1195
+ const reqOpts = ambassadorWixCategoriesV1Category.listItemsInCategory(payload);
1196
+ __log(`"ListItemsInCategory" sending request with: ${__inspect(reqOpts)}`);
1197
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1198
+ try {
1199
+ const result = yield httpClient.request(reqOpts);
1200
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1201
+ return fromJSON(result.data);
1202
+ }
1203
+ catch (err) {
1204
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1205
+ 'categoryId',
1206
+ 'treeReference',
1207
+ 'options',
1208
+ ]);
1209
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1210
+ throw transformedError;
1211
+ }
1212
+ });
1213
+ }
1214
+ exports.listItemsInCategory = listItemsInCategory;
1215
+ /**
1216
+ * Returns all category IDs that contain the item and their parent category IDs.
1217
+ * @param itemReference - Catalog item reference info.
1218
+ * @public
1219
+ * @documentationMaturity preview
1220
+ * @requiredField itemReference
1221
+ * @requiredField options
1222
+ * @requiredField options.treeReference
1223
+ * @requiredField options.treeReference.appNamespace
1224
+ * @applicableIdentity VISITOR
1225
+ */
1226
+ function listCategoriesForItem(itemReference, options) {
1227
+ var _a, _b, _c;
1228
+ return __awaiter(this, arguments, void 0, function* () {
1229
+ const requestTransformation = {
1230
+ itemReference: '$[0]',
1231
+ treeReference: '$[1].treeReference',
1232
+ };
1233
+ const responseTransformation = '$';
1234
+ // @ts-ignore
1235
+ const { httpClient, sideEffects } = arguments[2];
1236
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1237
+ rootSchema: _listCategoriesForItemRequest,
1238
+ depSchemas: {},
1239
+ fqdnTransformation: {
1240
+ paths: [],
1241
+ transformation: _fromVeloEntity,
1242
+ },
1243
+ customTransformation: requestTransformation,
1244
+ });
1245
+ const { fromJSON } = (0, velo_1.serializer)({
1246
+ rootSchema: _listCategoriesForItemResponse,
1247
+ depSchemas: {},
1248
+ fqdnTransformation: {
1249
+ paths: [],
1250
+ transformation: _toVeloEntity,
1251
+ },
1252
+ customTransformation: responseTransformation,
1253
+ });
1254
+ const payload = toAmbassadorRequest([itemReference, options]);
1255
+ const reqOpts = ambassadorWixCategoriesV1Category.listCategoriesForItem(payload);
1256
+ __log(`"ListCategoriesForItem" sending request with: ${__inspect(reqOpts)}`);
1257
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1258
+ try {
1259
+ const result = yield httpClient.request(reqOpts);
1260
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1261
+ return fromJSON(result.data);
1262
+ }
1263
+ catch (err) {
1264
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1265
+ 'itemReference',
1266
+ 'options',
1267
+ ]);
1268
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1269
+ throw transformedError;
1270
+ }
1271
+ });
1272
+ }
1273
+ exports.listCategoriesForItem = listCategoriesForItem;
1274
+ /**
1275
+ * Changes position of `item` in category. Will be used when sort items by manual arrangement
1276
+ * @param categoryId - ID of category.
1277
+ * Item must be direct child of this category, otherwise error returned
1278
+ * @param treeReference - A reference to the tree that contains this category.
1279
+ * @public
1280
+ * @documentationMaturity preview
1281
+ * @requiredField categoryId
1282
+ * @requiredField options
1283
+ * @requiredField options.item
1284
+ * @requiredField options.position
1285
+ * @requiredField treeReference
1286
+ * @requiredField treeReference.appNamespace
1287
+ */
1288
+ function moveItemInCategory(categoryId, treeReference, options) {
1289
+ var _a, _b, _c;
1290
+ return __awaiter(this, arguments, void 0, function* () {
1291
+ const requestTransformation = {
1292
+ categoryId: '$[0]',
1293
+ treeReference: '$[1]',
1294
+ item: '$[2].item',
1295
+ position: '$[2].position',
1296
+ beforeItem: '$[2].beforeItem',
1297
+ };
1298
+ const responseTransformation = '$';
1299
+ // @ts-ignore
1300
+ const { httpClient, sideEffects } = arguments[3];
1301
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1302
+ rootSchema: _moveItemInCategoryRequest,
1303
+ depSchemas: {},
1304
+ fqdnTransformation: {
1305
+ paths: [],
1306
+ transformation: _fromVeloEntity,
1307
+ },
1308
+ customTransformation: requestTransformation,
1309
+ });
1310
+ const { fromJSON } = (0, velo_1.serializer)({
1311
+ rootSchema: _moveItemInCategoryResponse,
1312
+ depSchemas: {},
1313
+ fqdnTransformation: {
1314
+ paths: [],
1315
+ transformation: _toVeloEntity,
1316
+ },
1317
+ customTransformation: responseTransformation,
1318
+ });
1319
+ const payload = toAmbassadorRequest([categoryId, treeReference, options]);
1320
+ const reqOpts = ambassadorWixCategoriesV1Category.moveItemInCategory(payload);
1321
+ __log(`"MoveItemInCategory" sending request with: ${__inspect(reqOpts)}`);
1322
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1323
+ try {
1324
+ const result = yield httpClient.request(reqOpts);
1325
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1326
+ return fromJSON(result.data);
1327
+ }
1328
+ catch (err) {
1329
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1330
+ 'categoryId',
1331
+ 'treeReference',
1332
+ 'options',
1333
+ ]);
1334
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1335
+ throw transformedError;
1336
+ }
1337
+ });
1338
+ }
1339
+ exports.moveItemInCategory = moveItemInCategory;
1340
+ /**
1341
+ * Set arranged items in category. Will be used when sort items by manual arrangement.
1342
+ * Calling this endpoint overrides existing list of arranged items in category.
1343
+ * @param categoryId - ID of category.
1344
+ * @param treeReference - A reference to the tree that contains this category.
1345
+ * @public
1346
+ * @documentationMaturity preview
1347
+ * @requiredField categoryId
1348
+ * @requiredField treeReference
1349
+ * @requiredField treeReference.appNamespace
1350
+ */
1351
+ function setArrangedItems(categoryId, treeReference, options) {
1352
+ var _a, _b, _c;
1353
+ return __awaiter(this, arguments, void 0, function* () {
1354
+ const requestTransformation = {
1355
+ categoryId: '$[0]',
1356
+ treeReference: '$[1]',
1357
+ items: '$[2].items',
1358
+ };
1359
+ const responseTransformation = '$';
1360
+ // @ts-ignore
1361
+ const { httpClient, sideEffects } = arguments[3];
1362
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1363
+ rootSchema: _setArrangedItemsRequest,
1364
+ depSchemas: {},
1365
+ fqdnTransformation: {
1366
+ paths: [],
1367
+ transformation: _fromVeloEntity,
1368
+ },
1369
+ customTransformation: requestTransformation,
1370
+ });
1371
+ const { fromJSON } = (0, velo_1.serializer)({
1372
+ rootSchema: _setArrangedItemsResponse,
1373
+ depSchemas: {},
1374
+ fqdnTransformation: {
1375
+ paths: [],
1376
+ transformation: _toVeloEntity,
1377
+ },
1378
+ customTransformation: responseTransformation,
1379
+ });
1380
+ const payload = toAmbassadorRequest([categoryId, treeReference, options]);
1381
+ const reqOpts = ambassadorWixCategoriesV1Category.setArrangedItems(payload);
1382
+ __log(`"SetArrangedItems" sending request with: ${__inspect(reqOpts)}`);
1383
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1384
+ try {
1385
+ const result = yield httpClient.request(reqOpts);
1386
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1387
+ return fromJSON(result.data);
1388
+ }
1389
+ catch (err) {
1390
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1391
+ 'categoryId',
1392
+ 'treeReference',
1393
+ 'options',
1394
+ ]);
1395
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1396
+ throw transformedError;
1397
+ }
1398
+ });
1399
+ }
1400
+ exports.setArrangedItems = setArrangedItems;
1401
+ /**
1402
+ * Returns arranged items in category
1403
+ * @param categoryId - ID of category.
1404
+ * @param treeReference - A reference to the tree that contains this category.
1405
+ * @public
1406
+ * @documentationMaturity preview
1407
+ * @requiredField categoryId
1408
+ * @requiredField treeReference
1409
+ * @requiredField treeReference.appNamespace
1410
+ * @applicableIdentity VISITOR
1411
+ */
1412
+ function getArrangedItems(categoryId, treeReference) {
1413
+ var _a, _b, _c;
1414
+ return __awaiter(this, arguments, void 0, function* () {
1415
+ const requestTransformation = { categoryId: '$[0]', treeReference: '$[1]' };
1416
+ const responseTransformation = '$';
1417
+ // @ts-ignore
1418
+ const { httpClient, sideEffects } = arguments[2];
1419
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
1420
+ rootSchema: _getArrangedItemsRequest,
1421
+ depSchemas: {},
1422
+ fqdnTransformation: {
1423
+ paths: [],
1424
+ transformation: _fromVeloEntity,
1425
+ },
1426
+ customTransformation: requestTransformation,
1427
+ });
1428
+ const { fromJSON } = (0, velo_1.serializer)({
1429
+ rootSchema: _getArrangedItemsResponse,
1430
+ depSchemas: {},
1431
+ fqdnTransformation: {
1432
+ paths: [],
1433
+ transformation: _toVeloEntity,
1434
+ },
1435
+ customTransformation: responseTransformation,
1436
+ });
1437
+ const payload = toAmbassadorRequest([categoryId, treeReference]);
1438
+ const reqOpts = ambassadorWixCategoriesV1Category.getArrangedItems(payload);
1439
+ __log(`"GetArrangedItems" sending request with: ${__inspect(reqOpts)}`);
1440
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1441
+ try {
1442
+ const result = yield httpClient.request(reqOpts);
1443
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1444
+ return fromJSON(result.data);
1445
+ }
1446
+ catch (err) {
1447
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
1448
+ 'categoryId',
1449
+ 'treeReference',
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.getArrangedItems = getArrangedItems;
1457
+ //# sourceMappingURL=categories-v1-category.universal.js.map