@wix/categories 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context.d.ts +1 -0
- package/build/cjs/context.js +28 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.js +5 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +5 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js +5 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/src/categories-v1-category.context.d.ts +20 -0
- package/build/cjs/src/categories-v1-category.context.js +203 -0
- package/build/cjs/src/categories-v1-category.context.js.map +1 -0
- package/build/cjs/src/categories-v1-category.http.js +664 -501
- package/build/cjs/src/categories-v1-category.http.js.map +1 -1
- package/build/cjs/src/categories-v1-category.meta.d.ts +1 -1
- package/build/cjs/src/categories-v1-category.meta.js +5 -1
- package/build/cjs/src/categories-v1-category.meta.js.map +1 -1
- package/build/cjs/src/categories-v1-category.public.d.ts +13 -12
- package/build/cjs/src/categories-v1-category.public.js +9 -1
- package/build/cjs/src/categories-v1-category.public.js.map +1 -1
- package/build/cjs/src/categories-v1-category.types.d.ts +168 -26
- package/build/cjs/src/categories-v1-category.types.js +69 -42
- package/build/cjs/src/categories-v1-category.types.js.map +1 -1
- package/build/cjs/src/categories-v1-category.universal.d.ts +327 -49
- package/build/cjs/src/categories-v1-category.universal.js +374 -155
- package/build/cjs/src/categories-v1-category.universal.js.map +1 -1
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +2 -0
- package/build/es/context.js.map +1 -0
- package/build/es/src/categories-v1-category.context.d.ts +20 -0
- package/build/es/src/categories-v1-category.context.js +182 -0
- package/build/es/src/categories-v1-category.context.js.map +1 -0
- package/build/es/src/categories-v1-category.http.js +664 -501
- package/build/es/src/categories-v1-category.http.js.map +1 -1
- package/build/es/src/categories-v1-category.meta.d.ts +1 -1
- package/build/es/src/categories-v1-category.public.d.ts +13 -12
- package/build/es/src/categories-v1-category.public.js +1 -0
- package/build/es/src/categories-v1-category.public.js.map +1 -1
- package/build/es/src/categories-v1-category.types.d.ts +168 -26
- package/build/es/src/categories-v1-category.types.js +29 -2
- package/build/es/src/categories-v1-category.types.js.map +1 -1
- package/build/es/src/categories-v1-category.universal.d.ts +327 -49
- package/build/es/src/categories-v1-category.universal.js +328 -113
- package/build/es/src/categories-v1-category.universal.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +12 -6
|
@@ -7,22 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { serializer
|
|
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';
|
|
11
13
|
import * as ambassadorWixCategoriesV1Category from './categories-v1-category.http';
|
|
12
14
|
// @ts-ignore
|
|
13
|
-
let __verbose = false;
|
|
14
|
-
function __log(...args) {
|
|
15
|
-
__verbose && console.log(...args);
|
|
16
|
-
}
|
|
17
|
-
function __inspect(obj) {
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
export const __debug = {
|
|
21
|
-
verboseLogging: {
|
|
22
|
-
on: () => (__verbose = true),
|
|
23
|
-
off: () => (__verbose = false),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
15
|
const _toVeloEntity = '$';
|
|
27
16
|
const _fromVeloEntity = '$';
|
|
28
17
|
export var NodeType;
|
|
@@ -324,61 +313,88 @@ export var SortOrder;
|
|
|
324
313
|
})(SortOrder || (SortOrder = {}));
|
|
325
314
|
export var SortType;
|
|
326
315
|
(function (SortType) {
|
|
316
|
+
/** Should sort by number of matches */
|
|
327
317
|
SortType["COUNT"] = "COUNT";
|
|
318
|
+
/** Should sort by value of the field alphabetically */
|
|
328
319
|
SortType["VALUE"] = "VALUE";
|
|
329
320
|
})(SortType || (SortType = {}));
|
|
330
321
|
export var SortDirection;
|
|
331
322
|
(function (SortDirection) {
|
|
323
|
+
/** Should sort in descending order */
|
|
332
324
|
SortDirection["DESC"] = "DESC";
|
|
325
|
+
/** Should sort in ascending order */
|
|
333
326
|
SortDirection["ASC"] = "ASC";
|
|
334
327
|
})(SortDirection || (SortDirection = {}));
|
|
335
328
|
export var MissingValues;
|
|
336
329
|
(function (MissingValues) {
|
|
330
|
+
/** Should missing values be excluded from the aggregation results */
|
|
337
331
|
MissingValues["EXCLUDE"] = "EXCLUDE";
|
|
332
|
+
/** Should missing values be included in the aggregation results */
|
|
338
333
|
MissingValues["INCLUDE"] = "INCLUDE";
|
|
339
334
|
})(MissingValues || (MissingValues = {}));
|
|
340
335
|
export var ScalarType;
|
|
341
336
|
(function (ScalarType) {
|
|
342
337
|
ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
338
|
+
/** Count of distinct values */
|
|
343
339
|
ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
340
|
+
/** Minimum value */
|
|
344
341
|
ScalarType["MIN"] = "MIN";
|
|
342
|
+
/** Maximum value */
|
|
345
343
|
ScalarType["MAX"] = "MAX";
|
|
344
|
+
/** Sum of values */
|
|
346
345
|
ScalarType["SUM"] = "SUM";
|
|
346
|
+
/** Average of values */
|
|
347
347
|
ScalarType["AVG"] = "AVG";
|
|
348
348
|
})(ScalarType || (ScalarType = {}));
|
|
349
349
|
export var NestedAggregationType;
|
|
350
350
|
(function (NestedAggregationType) {
|
|
351
351
|
NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
352
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
352
353
|
NestedAggregationType["VALUE"] = "VALUE";
|
|
354
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
353
355
|
NestedAggregationType["RANGE"] = "RANGE";
|
|
356
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
354
357
|
NestedAggregationType["SCALAR"] = "SCALAR";
|
|
358
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
355
359
|
NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
356
360
|
})(NestedAggregationType || (NestedAggregationType = {}));
|
|
357
361
|
export var Interval;
|
|
358
362
|
(function (Interval) {
|
|
359
363
|
Interval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
364
|
+
/** Yearly interval */
|
|
360
365
|
Interval["YEAR"] = "YEAR";
|
|
366
|
+
/** Monthly interval */
|
|
361
367
|
Interval["MONTH"] = "MONTH";
|
|
368
|
+
/** Weekly interval */
|
|
362
369
|
Interval["WEEK"] = "WEEK";
|
|
370
|
+
/** Daily interval */
|
|
363
371
|
Interval["DAY"] = "DAY";
|
|
372
|
+
/** Hourly interval */
|
|
364
373
|
Interval["HOUR"] = "HOUR";
|
|
374
|
+
/** Minute interval */
|
|
365
375
|
Interval["MINUTE"] = "MINUTE";
|
|
376
|
+
/** Second interval */
|
|
366
377
|
Interval["SECOND"] = "SECOND";
|
|
367
378
|
})(Interval || (Interval = {}));
|
|
368
379
|
export var AggregationType;
|
|
369
380
|
(function (AggregationType) {
|
|
370
381
|
AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
382
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
371
383
|
AggregationType["VALUE"] = "VALUE";
|
|
384
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
372
385
|
AggregationType["RANGE"] = "RANGE";
|
|
386
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
373
387
|
AggregationType["SCALAR"] = "SCALAR";
|
|
388
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
374
389
|
AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
390
|
+
/** Multi-level aggregation, where each next aggregation is nested within previous one */
|
|
375
391
|
AggregationType["NESTED"] = "NESTED";
|
|
376
392
|
})(AggregationType || (AggregationType = {}));
|
|
377
393
|
export var Mode;
|
|
378
394
|
(function (Mode) {
|
|
379
|
-
/**
|
|
395
|
+
/** Any of the search terms must be present */
|
|
380
396
|
Mode["OR"] = "OR";
|
|
381
|
-
/**
|
|
397
|
+
/** All search terms must be present */
|
|
382
398
|
Mode["AND"] = "AND";
|
|
383
399
|
})(Mode || (Mode = {}));
|
|
384
400
|
export var MoveCategoryRequestPosition;
|
|
@@ -440,6 +456,13 @@ const _updateCategoryRequest = { category: '_category' };
|
|
|
440
456
|
const _updateCategoryResponse = { category: '_category' };
|
|
441
457
|
const _updateCategoryVisibilityRequest = {};
|
|
442
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')();
|
|
443
466
|
/**
|
|
444
467
|
* Creates a new Category.
|
|
445
468
|
* @param category - Category to be created.
|
|
@@ -450,6 +473,11 @@ const _updateCategoryVisibilityResponse = { category: '_category' };
|
|
|
450
473
|
* @requiredField category.parentCategory._id
|
|
451
474
|
* @requiredField options.treeReference
|
|
452
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
|
|
453
481
|
* @returns The created Category.
|
|
454
482
|
*/
|
|
455
483
|
export function createCategory(category, options) {
|
|
@@ -483,7 +511,6 @@ export function createCategory(category, options) {
|
|
|
483
511
|
});
|
|
484
512
|
const payload = toAmbassadorRequest([category, options]);
|
|
485
513
|
const reqOpts = ambassadorWixCategoriesV1Category.createCategory(payload);
|
|
486
|
-
__log(`"CreateCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
487
514
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
488
515
|
try {
|
|
489
516
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -491,10 +518,15 @@ export function createCategory(category, options) {
|
|
|
491
518
|
return fromJSON(result.data);
|
|
492
519
|
}
|
|
493
520
|
catch (err) {
|
|
494
|
-
const transformedError =
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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']);
|
|
498
530
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
499
531
|
throw transformedError;
|
|
500
532
|
}
|
|
@@ -509,6 +541,17 @@ export function createCategory(category, options) {
|
|
|
509
541
|
* @requiredField categoryId
|
|
510
542
|
* @requiredField treeReference
|
|
511
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
|
|
512
555
|
* @applicableIdentity MEMBER
|
|
513
556
|
* @applicableIdentity VISITOR
|
|
514
557
|
* @returns The retrieved Category.
|
|
@@ -544,7 +587,6 @@ export function getCategory(categoryId, treeReference, options) {
|
|
|
544
587
|
});
|
|
545
588
|
const payload = toAmbassadorRequest([categoryId, treeReference, options]);
|
|
546
589
|
const reqOpts = ambassadorWixCategoriesV1Category.getCategory(payload);
|
|
547
|
-
__log(`"GetCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
548
590
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
549
591
|
try {
|
|
550
592
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -552,11 +594,15 @@ export function getCategory(categoryId, treeReference, options) {
|
|
|
552
594
|
return fromJSON(result.data);
|
|
553
595
|
}
|
|
554
596
|
catch (err) {
|
|
555
|
-
const transformedError =
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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']);
|
|
560
606
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
561
607
|
throw transformedError;
|
|
562
608
|
}
|
|
@@ -574,6 +620,11 @@ export function getCategory(categoryId, treeReference, options) {
|
|
|
574
620
|
* @requiredField category.revision
|
|
575
621
|
* @requiredField options.treeReference
|
|
576
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
|
|
577
628
|
* @returns The updated Category.
|
|
578
629
|
*/
|
|
579
630
|
export function updateCategory(_id, category, options) {
|
|
@@ -607,7 +658,6 @@ export function updateCategory(_id, category, options) {
|
|
|
607
658
|
});
|
|
608
659
|
const payload = toAmbassadorRequest([_id, category, options]);
|
|
609
660
|
const reqOpts = ambassadorWixCategoriesV1Category.updateCategory(payload);
|
|
610
|
-
__log(`"UpdateCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
611
661
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
612
662
|
try {
|
|
613
663
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -615,11 +665,15 @@ export function updateCategory(_id, category, options) {
|
|
|
615
665
|
return fromJSON(result.data);
|
|
616
666
|
}
|
|
617
667
|
catch (err) {
|
|
618
|
-
const transformedError =
|
|
619
|
-
'
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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']);
|
|
623
677
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
624
678
|
throw transformedError;
|
|
625
679
|
}
|
|
@@ -634,6 +688,11 @@ export function updateCategory(_id, category, options) {
|
|
|
634
688
|
* @requiredField categoryId
|
|
635
689
|
* @requiredField treeReference
|
|
636
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
|
|
637
696
|
*/
|
|
638
697
|
export function deleteCategory(categoryId, treeReference) {
|
|
639
698
|
var _a, _b, _c;
|
|
@@ -662,18 +721,17 @@ export function deleteCategory(categoryId, treeReference) {
|
|
|
662
721
|
});
|
|
663
722
|
const payload = toAmbassadorRequest([categoryId, treeReference]);
|
|
664
723
|
const reqOpts = ambassadorWixCategoriesV1Category.deleteCategory(payload);
|
|
665
|
-
__log(`"DeleteCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
666
724
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
667
725
|
try {
|
|
668
726
|
const result = yield httpClient.request(reqOpts);
|
|
669
727
|
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
670
|
-
return fromJSON(result.data);
|
|
671
728
|
}
|
|
672
729
|
catch (err) {
|
|
673
|
-
const transformedError =
|
|
674
|
-
|
|
675
|
-
'treeReference',
|
|
676
|
-
|
|
730
|
+
const transformedError = sdkTransformError(err, {
|
|
731
|
+
spreadPathsToArguments: {},
|
|
732
|
+
explicitPathsToArguments: { categoryId: '$[0]', treeReference: '$[1]' },
|
|
733
|
+
singleArgumentUnchanged: false,
|
|
734
|
+
}, ['categoryId', 'treeReference']);
|
|
677
735
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
678
736
|
throw transformedError;
|
|
679
737
|
}
|
|
@@ -685,6 +743,17 @@ export function deleteCategory(categoryId, treeReference) {
|
|
|
685
743
|
* @documentationMaturity preview
|
|
686
744
|
* @requiredField options.treeReference
|
|
687
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
|
|
688
757
|
* @applicableIdentity MEMBER
|
|
689
758
|
* @applicableIdentity VISITOR
|
|
690
759
|
*/
|
|
@@ -720,7 +789,6 @@ export function searchCategories(options) {
|
|
|
720
789
|
});
|
|
721
790
|
const payload = toAmbassadorRequest([options]);
|
|
722
791
|
const reqOpts = ambassadorWixCategoriesV1Category.searchCategories(payload);
|
|
723
|
-
__log(`"SearchCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
724
792
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
725
793
|
try {
|
|
726
794
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -728,9 +796,16 @@ export function searchCategories(options) {
|
|
|
728
796
|
return fromJSON(result.data);
|
|
729
797
|
}
|
|
730
798
|
catch (err) {
|
|
731
|
-
const transformedError =
|
|
732
|
-
|
|
733
|
-
|
|
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']);
|
|
734
809
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
735
810
|
throw transformedError;
|
|
736
811
|
}
|
|
@@ -742,6 +817,17 @@ export function searchCategories(options) {
|
|
|
742
817
|
* @documentationMaturity preview
|
|
743
818
|
* @requiredField options.treeReference
|
|
744
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
|
|
745
831
|
* @applicableIdentity MEMBER
|
|
746
832
|
* @applicableIdentity VISITOR
|
|
747
833
|
*/
|
|
@@ -777,7 +863,6 @@ export function countCategories(options) {
|
|
|
777
863
|
});
|
|
778
864
|
const payload = toAmbassadorRequest([options]);
|
|
779
865
|
const reqOpts = ambassadorWixCategoriesV1Category.countCategories(payload);
|
|
780
|
-
__log(`"CountCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
781
866
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
782
867
|
try {
|
|
783
868
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -785,9 +870,16 @@ export function countCategories(options) {
|
|
|
785
870
|
return fromJSON(result.data);
|
|
786
871
|
}
|
|
787
872
|
catch (err) {
|
|
788
|
-
const transformedError =
|
|
789
|
-
|
|
790
|
-
|
|
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']);
|
|
791
883
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
792
884
|
throw transformedError;
|
|
793
885
|
}
|
|
@@ -805,6 +897,11 @@ export function countCategories(options) {
|
|
|
805
897
|
* @requiredField options.position
|
|
806
898
|
* @requiredField treeReference
|
|
807
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
|
|
808
905
|
*/
|
|
809
906
|
export function moveCategory(categoryId, treeReference, options) {
|
|
810
907
|
var _a, _b, _c;
|
|
@@ -839,7 +936,6 @@ export function moveCategory(categoryId, treeReference, options) {
|
|
|
839
936
|
});
|
|
840
937
|
const payload = toAmbassadorRequest([categoryId, treeReference, options]);
|
|
841
938
|
const reqOpts = ambassadorWixCategoriesV1Category.moveCategory(payload);
|
|
842
|
-
__log(`"MoveCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
843
939
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
844
940
|
try {
|
|
845
941
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -847,11 +943,17 @@ export function moveCategory(categoryId, treeReference, options) {
|
|
|
847
943
|
return fromJSON(result.data);
|
|
848
944
|
}
|
|
849
945
|
catch (err) {
|
|
850
|
-
const transformedError =
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
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']);
|
|
855
957
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
856
958
|
throw transformedError;
|
|
857
959
|
}
|
|
@@ -870,6 +972,11 @@ export function moveCategory(categoryId, treeReference, options) {
|
|
|
870
972
|
* @requiredField categories.category.revision
|
|
871
973
|
* @requiredField options.treeReference
|
|
872
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
|
|
873
980
|
*/
|
|
874
981
|
export function bulkUpdateCategories(categories, options) {
|
|
875
982
|
var _a, _b, _c;
|
|
@@ -902,7 +1009,6 @@ export function bulkUpdateCategories(categories, options) {
|
|
|
902
1009
|
});
|
|
903
1010
|
const payload = toAmbassadorRequest([categories, options]);
|
|
904
1011
|
const reqOpts = ambassadorWixCategoriesV1Category.bulkUpdateCategories(payload);
|
|
905
|
-
__log(`"BulkUpdateCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
906
1012
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
907
1013
|
try {
|
|
908
1014
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -910,10 +1016,15 @@ export function bulkUpdateCategories(categories, options) {
|
|
|
910
1016
|
return fromJSON(result.data);
|
|
911
1017
|
}
|
|
912
1018
|
catch (err) {
|
|
913
|
-
const transformedError =
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
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']);
|
|
917
1028
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
918
1029
|
throw transformedError;
|
|
919
1030
|
}
|
|
@@ -929,6 +1040,11 @@ export function bulkUpdateCategories(categories, options) {
|
|
|
929
1040
|
* @requiredField options.treeReference
|
|
930
1041
|
* @requiredField options.treeReference.appNamespace
|
|
931
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
|
|
932
1048
|
*/
|
|
933
1049
|
export function updateCategoryVisibility(categoryId, options) {
|
|
934
1050
|
var _a, _b, _c;
|
|
@@ -963,7 +1079,6 @@ export function updateCategoryVisibility(categoryId, options) {
|
|
|
963
1079
|
});
|
|
964
1080
|
const payload = toAmbassadorRequest([categoryId, options]);
|
|
965
1081
|
const reqOpts = ambassadorWixCategoriesV1Category.updateCategoryVisibility(payload);
|
|
966
|
-
__log(`"UpdateCategoryVisibility" sending request with: ${__inspect(reqOpts)}`);
|
|
967
1082
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
968
1083
|
try {
|
|
969
1084
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -971,10 +1086,17 @@ export function updateCategoryVisibility(categoryId, options) {
|
|
|
971
1086
|
return fromJSON(result.data);
|
|
972
1087
|
}
|
|
973
1088
|
catch (err) {
|
|
974
|
-
const transformedError =
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
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']);
|
|
978
1100
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
979
1101
|
throw transformedError;
|
|
980
1102
|
}
|
|
@@ -993,6 +1115,11 @@ export function updateCategoryVisibility(categoryId, options) {
|
|
|
993
1115
|
* @requiredField options
|
|
994
1116
|
* @requiredField options.treeReference
|
|
995
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
|
|
996
1123
|
*/
|
|
997
1124
|
export function bulkAddItemsToCategory(categoryId, items, options) {
|
|
998
1125
|
var _a, _b, _c;
|
|
@@ -1025,7 +1152,6 @@ export function bulkAddItemsToCategory(categoryId, items, options) {
|
|
|
1025
1152
|
});
|
|
1026
1153
|
const payload = toAmbassadorRequest([categoryId, items, options]);
|
|
1027
1154
|
const reqOpts = ambassadorWixCategoriesV1Category.bulkAddItemsToCategory(payload);
|
|
1028
|
-
__log(`"BulkAddItemsToCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
1029
1155
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1030
1156
|
try {
|
|
1031
1157
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1033,11 +1159,15 @@ export function bulkAddItemsToCategory(categoryId, items, options) {
|
|
|
1033
1159
|
return fromJSON(result.data);
|
|
1034
1160
|
}
|
|
1035
1161
|
catch (err) {
|
|
1036
|
-
const transformedError =
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
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']);
|
|
1041
1171
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1042
1172
|
throw transformedError;
|
|
1043
1173
|
}
|
|
@@ -1055,6 +1185,11 @@ export function bulkAddItemsToCategory(categoryId, items, options) {
|
|
|
1055
1185
|
* @requiredField options.categoryIds
|
|
1056
1186
|
* @requiredField options.treeReference
|
|
1057
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
|
|
1058
1193
|
*/
|
|
1059
1194
|
export function bulkAddItemToCategories(itemReference, options) {
|
|
1060
1195
|
var _a, _b, _c;
|
|
@@ -1087,7 +1222,6 @@ export function bulkAddItemToCategories(itemReference, options) {
|
|
|
1087
1222
|
});
|
|
1088
1223
|
const payload = toAmbassadorRequest([itemReference, options]);
|
|
1089
1224
|
const reqOpts = ambassadorWixCategoriesV1Category.bulkAddItemToCategories(payload);
|
|
1090
|
-
__log(`"BulkAddItemToCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
1091
1225
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1092
1226
|
try {
|
|
1093
1227
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1095,10 +1229,15 @@ export function bulkAddItemToCategories(itemReference, options) {
|
|
|
1095
1229
|
return fromJSON(result.data);
|
|
1096
1230
|
}
|
|
1097
1231
|
catch (err) {
|
|
1098
|
-
const transformedError =
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
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']);
|
|
1102
1241
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1103
1242
|
throw transformedError;
|
|
1104
1243
|
}
|
|
@@ -1117,6 +1256,11 @@ export function bulkAddItemToCategories(itemReference, options) {
|
|
|
1117
1256
|
* @requiredField options
|
|
1118
1257
|
* @requiredField options.treeReference
|
|
1119
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
|
|
1120
1264
|
*/
|
|
1121
1265
|
export function bulkRemoveItemsFromCategory(categoryId, items, options) {
|
|
1122
1266
|
var _a, _b, _c;
|
|
@@ -1149,7 +1293,6 @@ export function bulkRemoveItemsFromCategory(categoryId, items, options) {
|
|
|
1149
1293
|
});
|
|
1150
1294
|
const payload = toAmbassadorRequest([categoryId, items, options]);
|
|
1151
1295
|
const reqOpts = ambassadorWixCategoriesV1Category.bulkRemoveItemsFromCategory(payload);
|
|
1152
|
-
__log(`"BulkRemoveItemsFromCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
1153
1296
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1154
1297
|
try {
|
|
1155
1298
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1157,11 +1300,15 @@ export function bulkRemoveItemsFromCategory(categoryId, items, options) {
|
|
|
1157
1300
|
return fromJSON(result.data);
|
|
1158
1301
|
}
|
|
1159
1302
|
catch (err) {
|
|
1160
|
-
const transformedError =
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
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']);
|
|
1165
1312
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1166
1313
|
throw transformedError;
|
|
1167
1314
|
}
|
|
@@ -1179,6 +1326,11 @@ export function bulkRemoveItemsFromCategory(categoryId, items, options) {
|
|
|
1179
1326
|
* @requiredField options.categoryIds
|
|
1180
1327
|
* @requiredField options.treeReference
|
|
1181
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
|
|
1182
1334
|
*/
|
|
1183
1335
|
export function bulkRemoveItemFromCategories(itemReference, options) {
|
|
1184
1336
|
var _a, _b, _c;
|
|
@@ -1211,7 +1363,6 @@ export function bulkRemoveItemFromCategories(itemReference, options) {
|
|
|
1211
1363
|
});
|
|
1212
1364
|
const payload = toAmbassadorRequest([itemReference, options]);
|
|
1213
1365
|
const reqOpts = ambassadorWixCategoriesV1Category.bulkRemoveItemFromCategories(payload);
|
|
1214
|
-
__log(`"BulkRemoveItemFromCategories" sending request with: ${__inspect(reqOpts)}`);
|
|
1215
1366
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1216
1367
|
try {
|
|
1217
1368
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1219,10 +1370,15 @@ export function bulkRemoveItemFromCategories(itemReference, options) {
|
|
|
1219
1370
|
return fromJSON(result.data);
|
|
1220
1371
|
}
|
|
1221
1372
|
catch (err) {
|
|
1222
|
-
const transformedError =
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
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']);
|
|
1226
1382
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1227
1383
|
throw transformedError;
|
|
1228
1384
|
}
|
|
@@ -1238,6 +1394,17 @@ export function bulkRemoveItemFromCategories(itemReference, options) {
|
|
|
1238
1394
|
* @requiredField categoryId
|
|
1239
1395
|
* @requiredField treeReference
|
|
1240
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
|
|
1241
1408
|
* @applicableIdentity MEMBER
|
|
1242
1409
|
* @applicableIdentity VISITOR
|
|
1243
1410
|
*/
|
|
@@ -1274,7 +1441,6 @@ export function listItemsInCategory(categoryId, treeReference, options) {
|
|
|
1274
1441
|
});
|
|
1275
1442
|
const payload = toAmbassadorRequest([categoryId, treeReference, options]);
|
|
1276
1443
|
const reqOpts = ambassadorWixCategoriesV1Category.listItemsInCategory(payload);
|
|
1277
|
-
__log(`"ListItemsInCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
1278
1444
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1279
1445
|
try {
|
|
1280
1446
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1282,11 +1448,17 @@ export function listItemsInCategory(categoryId, treeReference, options) {
|
|
|
1282
1448
|
return fromJSON(result.data);
|
|
1283
1449
|
}
|
|
1284
1450
|
catch (err) {
|
|
1285
|
-
const transformedError =
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
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']);
|
|
1290
1462
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1291
1463
|
throw transformedError;
|
|
1292
1464
|
}
|
|
@@ -1301,6 +1473,17 @@ export function listItemsInCategory(categoryId, treeReference, options) {
|
|
|
1301
1473
|
* @requiredField options
|
|
1302
1474
|
* @requiredField options.treeReference
|
|
1303
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
|
|
1304
1487
|
* @applicableIdentity MEMBER
|
|
1305
1488
|
* @applicableIdentity VISITOR
|
|
1306
1489
|
*/
|
|
@@ -1334,7 +1517,6 @@ export function listCategoriesForItem(itemReference, options) {
|
|
|
1334
1517
|
});
|
|
1335
1518
|
const payload = toAmbassadorRequest([itemReference, options]);
|
|
1336
1519
|
const reqOpts = ambassadorWixCategoriesV1Category.listCategoriesForItem(payload);
|
|
1337
|
-
__log(`"ListCategoriesForItem" sending request with: ${__inspect(reqOpts)}`);
|
|
1338
1520
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1339
1521
|
try {
|
|
1340
1522
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1342,10 +1524,14 @@ export function listCategoriesForItem(itemReference, options) {
|
|
|
1342
1524
|
return fromJSON(result.data);
|
|
1343
1525
|
}
|
|
1344
1526
|
catch (err) {
|
|
1345
|
-
const transformedError =
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1527
|
+
const transformedError = sdkTransformError(err, {
|
|
1528
|
+
spreadPathsToArguments: {},
|
|
1529
|
+
explicitPathsToArguments: {
|
|
1530
|
+
itemReference: '$[0]',
|
|
1531
|
+
treeReference: '$[1].treeReference',
|
|
1532
|
+
},
|
|
1533
|
+
singleArgumentUnchanged: false,
|
|
1534
|
+
}, ['itemReference', 'options']);
|
|
1349
1535
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1350
1536
|
throw transformedError;
|
|
1351
1537
|
}
|
|
@@ -1363,6 +1549,11 @@ export function listCategoriesForItem(itemReference, options) {
|
|
|
1363
1549
|
* @requiredField options.position
|
|
1364
1550
|
* @requiredField treeReference
|
|
1365
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
|
|
1366
1557
|
*/
|
|
1367
1558
|
export function moveItemInCategory(categoryId, treeReference, options) {
|
|
1368
1559
|
var _a, _b, _c;
|
|
@@ -1397,7 +1588,6 @@ export function moveItemInCategory(categoryId, treeReference, options) {
|
|
|
1397
1588
|
});
|
|
1398
1589
|
const payload = toAmbassadorRequest([categoryId, treeReference, options]);
|
|
1399
1590
|
const reqOpts = ambassadorWixCategoriesV1Category.moveItemInCategory(payload);
|
|
1400
|
-
__log(`"MoveItemInCategory" sending request with: ${__inspect(reqOpts)}`);
|
|
1401
1591
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1402
1592
|
try {
|
|
1403
1593
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1405,11 +1595,17 @@ export function moveItemInCategory(categoryId, treeReference, options) {
|
|
|
1405
1595
|
return fromJSON(result.data);
|
|
1406
1596
|
}
|
|
1407
1597
|
catch (err) {
|
|
1408
|
-
const transformedError =
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
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']);
|
|
1413
1609
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1414
1610
|
throw transformedError;
|
|
1415
1611
|
}
|
|
@@ -1425,6 +1621,11 @@ export function moveItemInCategory(categoryId, treeReference, options) {
|
|
|
1425
1621
|
* @requiredField categoryId
|
|
1426
1622
|
* @requiredField treeReference
|
|
1427
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
|
|
1428
1629
|
*/
|
|
1429
1630
|
export function setArrangedItems(categoryId, treeReference, options) {
|
|
1430
1631
|
var _a, _b, _c;
|
|
@@ -1457,7 +1658,6 @@ export function setArrangedItems(categoryId, treeReference, options) {
|
|
|
1457
1658
|
});
|
|
1458
1659
|
const payload = toAmbassadorRequest([categoryId, treeReference, options]);
|
|
1459
1660
|
const reqOpts = ambassadorWixCategoriesV1Category.setArrangedItems(payload);
|
|
1460
|
-
__log(`"SetArrangedItems" sending request with: ${__inspect(reqOpts)}`);
|
|
1461
1661
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1462
1662
|
try {
|
|
1463
1663
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1465,11 +1665,15 @@ export function setArrangedItems(categoryId, treeReference, options) {
|
|
|
1465
1665
|
return fromJSON(result.data);
|
|
1466
1666
|
}
|
|
1467
1667
|
catch (err) {
|
|
1468
|
-
const transformedError =
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
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']);
|
|
1473
1677
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1474
1678
|
throw transformedError;
|
|
1475
1679
|
}
|
|
@@ -1484,6 +1688,17 @@ export function setArrangedItems(categoryId, treeReference, options) {
|
|
|
1484
1688
|
* @requiredField categoryId
|
|
1485
1689
|
* @requiredField treeReference
|
|
1486
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
|
|
1487
1702
|
* @applicableIdentity MEMBER
|
|
1488
1703
|
* @applicableIdentity VISITOR
|
|
1489
1704
|
*/
|
|
@@ -1514,7 +1729,6 @@ export function getArrangedItems(categoryId, treeReference) {
|
|
|
1514
1729
|
});
|
|
1515
1730
|
const payload = toAmbassadorRequest([categoryId, treeReference]);
|
|
1516
1731
|
const reqOpts = ambassadorWixCategoriesV1Category.getArrangedItems(payload);
|
|
1517
|
-
__log(`"GetArrangedItems" sending request with: ${__inspect(reqOpts)}`);
|
|
1518
1732
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1519
1733
|
try {
|
|
1520
1734
|
const result = yield httpClient.request(reqOpts);
|
|
@@ -1522,10 +1736,11 @@ export function getArrangedItems(categoryId, treeReference) {
|
|
|
1522
1736
|
return fromJSON(result.data);
|
|
1523
1737
|
}
|
|
1524
1738
|
catch (err) {
|
|
1525
|
-
const transformedError =
|
|
1526
|
-
|
|
1527
|
-
'treeReference',
|
|
1528
|
-
|
|
1739
|
+
const transformedError = sdkTransformError(err, {
|
|
1740
|
+
spreadPathsToArguments: {},
|
|
1741
|
+
explicitPathsToArguments: { categoryId: '$[0]', treeReference: '$[1]' },
|
|
1742
|
+
singleArgumentUnchanged: false,
|
|
1743
|
+
}, ['categoryId', 'treeReference']);
|
|
1529
1744
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1530
1745
|
throw transformedError;
|
|
1531
1746
|
}
|