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