@wix/stores 1.0.134 → 1.0.135
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 +5 -5
- package/build/cjs/context.js +5 -5
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +5 -6
- package/build/cjs/index.js +6 -7
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +5 -6
- package/build/cjs/meta.js +6 -7
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +5 -5
- package/build/es/context.js +5 -5
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +5 -6
- package/build/es/index.js +5 -6
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +5 -6
- package/build/es/meta.js +5 -6
- package/build/es/meta.js.map +1 -1
- package/package.json +15 -9
- package/build/cjs/index.typings.d.ts +0 -6
- package/build/cjs/index.typings.js +0 -33
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/platform-v1-wishlist.context.d.ts +0 -3
- package/build/cjs/src/platform-v1-wishlist.context.js +0 -22
- package/build/cjs/src/platform-v1-wishlist.context.js.map +0 -1
- package/build/cjs/src/platform-v1-wishlist.http.d.ts +0 -3
- package/build/cjs/src/platform-v1-wishlist.http.js +0 -91
- package/build/cjs/src/platform-v1-wishlist.http.js.map +0 -1
- package/build/cjs/src/platform-v1-wishlist.meta.d.ts +0 -13
- package/build/cjs/src/platform-v1-wishlist.meta.js +0 -47
- package/build/cjs/src/platform-v1-wishlist.meta.js.map +0 -1
- package/build/cjs/src/platform-v1-wishlist.public.d.ts +0 -15
- package/build/cjs/src/platform-v1-wishlist.public.js +0 -12
- package/build/cjs/src/platform-v1-wishlist.public.js.map +0 -1
- package/build/cjs/src/platform-v1-wishlist.types.d.ts +0 -104
- package/build/cjs/src/platform-v1-wishlist.types.js +0 -3
- package/build/cjs/src/platform-v1-wishlist.types.js.map +0 -1
- package/build/cjs/src/platform-v1-wishlist.universal.d.ts +0 -121
- package/build/cjs/src/platform-v1-wishlist.universal.js +0 -106
- package/build/cjs/src/platform-v1-wishlist.universal.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection.context.d.ts +0 -5
- package/build/cjs/src/stores-catalog-v1-collection.context.js +0 -56
- package/build/cjs/src/stores-catalog-v1-collection.context.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection.http.d.ts +0 -10
- package/build/cjs/src/stores-catalog-v1-collection.http.js +0 -110
- package/build/cjs/src/stores-catalog-v1-collection.http.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection.meta.d.ts +0 -19
- package/build/cjs/src/stores-catalog-v1-collection.meta.js +0 -85
- package/build/cjs/src/stores-catalog-v1-collection.meta.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection.public.d.ts +0 -59
- package/build/cjs/src/stores-catalog-v1-collection.public.js +0 -27
- package/build/cjs/src/stores-catalog-v1-collection.public.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection.types.d.ts +0 -414
- package/build/cjs/src/stores-catalog-v1-collection.types.js +0 -18
- package/build/cjs/src/stores-catalog-v1-collection.types.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection.universal.d.ts +0 -452
- package/build/cjs/src/stores-catalog-v1-collection.universal.js +0 -225
- package/build/cjs/src/stores-catalog-v1-collection.universal.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-product.context.d.ts +0 -35
- package/build/cjs/src/stores-catalog-v1-product.context.js +0 -566
- package/build/cjs/src/stores-catalog-v1-product.context.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-product.http.d.ts +0 -89
- package/build/cjs/src/stores-catalog-v1-product.http.js +0 -1716
- package/build/cjs/src/stores-catalog-v1-product.http.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-product.meta.d.ts +0 -95
- package/build/cjs/src/stores-catalog-v1-product.meta.js +0 -655
- package/build/cjs/src/stores-catalog-v1-product.meta.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-product.public.d.ts +0 -1216
- package/build/cjs/src/stores-catalog-v1-product.public.js +0 -221
- package/build/cjs/src/stores-catalog-v1-product.public.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-product.types.d.ts +0 -4235
- package/build/cjs/src/stores-catalog-v1-product.types.js +0 -78
- package/build/cjs/src/stores-catalog-v1-product.types.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-product.universal.d.ts +0 -5074
- package/build/cjs/src/stores-catalog-v1-product.universal.js +0 -2220
- package/build/cjs/src/stores-catalog-v1-product.universal.js.map +0 -1
- package/build/cjs/src/stores-v1-abandoned-cart.http.d.ts +0 -6
- package/build/cjs/src/stores-v1-abandoned-cart.http.js +0 -103
- package/build/cjs/src/stores-v1-abandoned-cart.http.js.map +0 -1
- package/build/cjs/src/stores-v1-abandoned-cart.meta.d.ts +0 -16
- package/build/cjs/src/stores-v1-abandoned-cart.meta.js +0 -66
- package/build/cjs/src/stores-v1-abandoned-cart.meta.js.map +0 -1
- package/build/cjs/src/stores-v1-abandoned-cart.public.d.ts +0 -19
- package/build/cjs/src/stores-v1-abandoned-cart.public.js +0 -22
- package/build/cjs/src/stores-v1-abandoned-cart.public.js.map +0 -1
- package/build/cjs/src/stores-v1-abandoned-cart.types.d.ts +0 -216
- package/build/cjs/src/stores-v1-abandoned-cart.types.js +0 -30
- package/build/cjs/src/stores-v1-abandoned-cart.types.js.map +0 -1
- package/build/cjs/src/stores-v1-abandoned-cart.universal.d.ts +0 -246
- package/build/cjs/src/stores-v1-abandoned-cart.universal.js +0 -189
- package/build/cjs/src/stores-v1-abandoned-cart.universal.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option.context.d.ts +0 -14
- package/build/cjs/src/stores-v1-subscription-option.context.js +0 -209
- package/build/cjs/src/stores-v1-subscription-option.context.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option.http.d.ts +0 -128
- package/build/cjs/src/stores-v1-subscription-option.http.js +0 -466
- package/build/cjs/src/stores-v1-subscription-option.http.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option.meta.d.ts +0 -40
- package/build/cjs/src/stores-v1-subscription-option.meta.js +0 -258
- package/build/cjs/src/stores-v1-subscription-option.meta.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option.public.d.ts +0 -46
- package/build/cjs/src/stores-v1-subscription-option.public.js +0 -81
- package/build/cjs/src/stores-v1-subscription-option.public.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option.types.d.ts +0 -351
- package/build/cjs/src/stores-v1-subscription-option.types.js +0 -20
- package/build/cjs/src/stores-v1-subscription-option.types.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option.universal.d.ts +0 -646
- package/build/cjs/src/stores-v1-subscription-option.universal.js +0 -893
- package/build/cjs/src/stores-v1-subscription-option.universal.js.map +0 -1
- package/build/cjs/src/stores-v2-inventory.context.d.ts +0 -7
- package/build/cjs/src/stores-v2-inventory.context.js +0 -90
- package/build/cjs/src/stores-v2-inventory.context.js.map +0 -1
- package/build/cjs/src/stores-v2-inventory.http.d.ts +0 -31
- package/build/cjs/src/stores-v2-inventory.http.js +0 -289
- package/build/cjs/src/stores-v2-inventory.http.js.map +0 -1
- package/build/cjs/src/stores-v2-inventory.meta.d.ts +0 -21
- package/build/cjs/src/stores-v2-inventory.meta.js +0 -125
- package/build/cjs/src/stores-v2-inventory.meta.js.map +0 -1
- package/build/cjs/src/stores-v2-inventory.public.d.ts +0 -13
- package/build/cjs/src/stores-v2-inventory.public.js +0 -41
- package/build/cjs/src/stores-v2-inventory.public.js.map +0 -1
- package/build/cjs/src/stores-v2-inventory.types.d.ts +0 -283
- package/build/cjs/src/stores-v2-inventory.types.js +0 -11
- package/build/cjs/src/stores-v2-inventory.types.js.map +0 -1
- package/build/cjs/src/stores-v2-inventory.universal.d.ts +0 -425
- package/build/cjs/src/stores-v2-inventory.universal.js +0 -382
- package/build/cjs/src/stores-v2-inventory.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -6
- package/build/es/index.typings.js +0 -7
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/platform-v1-wishlist.context.d.ts +0 -3
- package/build/es/src/platform-v1-wishlist.context.js +0 -18
- package/build/es/src/platform-v1-wishlist.context.js.map +0 -1
- package/build/es/src/platform-v1-wishlist.http.d.ts +0 -3
- package/build/es/src/platform-v1-wishlist.http.js +0 -87
- package/build/es/src/platform-v1-wishlist.http.js.map +0 -1
- package/build/es/src/platform-v1-wishlist.meta.d.ts +0 -13
- package/build/es/src/platform-v1-wishlist.meta.js +0 -20
- package/build/es/src/platform-v1-wishlist.meta.js.map +0 -1
- package/build/es/src/platform-v1-wishlist.public.d.ts +0 -15
- package/build/es/src/platform-v1-wishlist.public.js +0 -8
- package/build/es/src/platform-v1-wishlist.public.js.map +0 -1
- package/build/es/src/platform-v1-wishlist.types.d.ts +0 -104
- package/build/es/src/platform-v1-wishlist.types.js +0 -2
- package/build/es/src/platform-v1-wishlist.types.js.map +0 -1
- package/build/es/src/platform-v1-wishlist.universal.d.ts +0 -121
- package/build/es/src/platform-v1-wishlist.universal.js +0 -79
- package/build/es/src/platform-v1-wishlist.universal.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection.context.d.ts +0 -5
- package/build/es/src/stores-catalog-v1-collection.context.js +0 -50
- package/build/es/src/stores-catalog-v1-collection.context.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection.http.d.ts +0 -10
- package/build/es/src/stores-catalog-v1-collection.http.js +0 -104
- package/build/es/src/stores-catalog-v1-collection.http.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection.meta.d.ts +0 -19
- package/build/es/src/stores-catalog-v1-collection.meta.js +0 -56
- package/build/es/src/stores-catalog-v1-collection.meta.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection.public.d.ts +0 -59
- package/build/es/src/stores-catalog-v1-collection.public.js +0 -19
- package/build/es/src/stores-catalog-v1-collection.public.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection.types.d.ts +0 -414
- package/build/es/src/stores-catalog-v1-collection.types.js +0 -15
- package/build/es/src/stores-catalog-v1-collection.types.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection.universal.d.ts +0 -452
- package/build/es/src/stores-catalog-v1-collection.universal.js +0 -196
- package/build/es/src/stores-catalog-v1-collection.universal.js.map +0 -1
- package/build/es/src/stores-catalog-v1-product.context.d.ts +0 -35
- package/build/es/src/stores-catalog-v1-product.context.js +0 -530
- package/build/es/src/stores-catalog-v1-product.context.js.map +0 -1
- package/build/es/src/stores-catalog-v1-product.http.d.ts +0 -89
- package/build/es/src/stores-catalog-v1-product.http.js +0 -1680
- package/build/es/src/stores-catalog-v1-product.http.js.map +0 -1
- package/build/es/src/stores-catalog-v1-product.meta.d.ts +0 -95
- package/build/es/src/stores-catalog-v1-product.meta.js +0 -596
- package/build/es/src/stores-catalog-v1-product.meta.js.map +0 -1
- package/build/es/src/stores-catalog-v1-product.public.d.ts +0 -1216
- package/build/es/src/stores-catalog-v1-product.public.js +0 -170
- package/build/es/src/stores-catalog-v1-product.public.js.map +0 -1
- package/build/es/src/stores-catalog-v1-product.types.d.ts +0 -4235
- package/build/es/src/stores-catalog-v1-product.types.js +0 -75
- package/build/es/src/stores-catalog-v1-product.types.js.map +0 -1
- package/build/es/src/stores-catalog-v1-product.universal.d.ts +0 -5074
- package/build/es/src/stores-catalog-v1-product.universal.js +0 -2161
- package/build/es/src/stores-catalog-v1-product.universal.js.map +0 -1
- package/build/es/src/stores-v1-abandoned-cart.http.d.ts +0 -6
- package/build/es/src/stores-v1-abandoned-cart.http.js +0 -98
- package/build/es/src/stores-v1-abandoned-cart.http.js.map +0 -1
- package/build/es/src/stores-v1-abandoned-cart.meta.d.ts +0 -16
- package/build/es/src/stores-v1-abandoned-cart.meta.js +0 -38
- package/build/es/src/stores-v1-abandoned-cart.meta.js.map +0 -1
- package/build/es/src/stores-v1-abandoned-cart.public.d.ts +0 -19
- package/build/es/src/stores-v1-abandoned-cart.public.js +0 -14
- package/build/es/src/stores-v1-abandoned-cart.public.js.map +0 -1
- package/build/es/src/stores-v1-abandoned-cart.types.d.ts +0 -216
- package/build/es/src/stores-v1-abandoned-cart.types.js +0 -27
- package/build/es/src/stores-v1-abandoned-cart.types.js.map +0 -1
- package/build/es/src/stores-v1-abandoned-cart.universal.d.ts +0 -246
- package/build/es/src/stores-v1-abandoned-cart.universal.js +0 -161
- package/build/es/src/stores-v1-abandoned-cart.universal.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option.context.d.ts +0 -14
- package/build/es/src/stores-v1-subscription-option.context.js +0 -194
- package/build/es/src/stores-v1-subscription-option.context.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option.http.d.ts +0 -128
- package/build/es/src/stores-v1-subscription-option.http.js +0 -451
- package/build/es/src/stores-v1-subscription-option.http.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option.meta.d.ts +0 -40
- package/build/es/src/stores-v1-subscription-option.meta.js +0 -220
- package/build/es/src/stores-v1-subscription-option.meta.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option.public.d.ts +0 -46
- package/build/es/src/stores-v1-subscription-option.public.js +0 -64
- package/build/es/src/stores-v1-subscription-option.public.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option.types.d.ts +0 -351
- package/build/es/src/stores-v1-subscription-option.types.js +0 -17
- package/build/es/src/stores-v1-subscription-option.types.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option.universal.d.ts +0 -646
- package/build/es/src/stores-v1-subscription-option.universal.js +0 -855
- package/build/es/src/stores-v1-subscription-option.universal.js.map +0 -1
- package/build/es/src/stores-v2-inventory.context.d.ts +0 -7
- package/build/es/src/stores-v2-inventory.context.js +0 -82
- package/build/es/src/stores-v2-inventory.context.js.map +0 -1
- package/build/es/src/stores-v2-inventory.http.d.ts +0 -31
- package/build/es/src/stores-v2-inventory.http.js +0 -281
- package/build/es/src/stores-v2-inventory.http.js.map +0 -1
- package/build/es/src/stores-v2-inventory.meta.d.ts +0 -21
- package/build/es/src/stores-v2-inventory.meta.js +0 -94
- package/build/es/src/stores-v2-inventory.meta.js.map +0 -1
- package/build/es/src/stores-v2-inventory.public.d.ts +0 -13
- package/build/es/src/stores-v2-inventory.public.js +0 -30
- package/build/es/src/stores-v2-inventory.public.js.map +0 -1
- package/build/es/src/stores-v2-inventory.types.d.ts +0 -283
- package/build/es/src/stores-v2-inventory.types.js +0 -8
- package/build/es/src/stores-v2-inventory.types.js.map +0 -1
- package/build/es/src/stores-v2-inventory.universal.d.ts +0 -425
- package/build/es/src/stores-v2-inventory.universal.js +0 -351
- package/build/es/src/stores-v2-inventory.universal.js.map +0 -1
|
@@ -1,2161 +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, transformError, resolveQueryFieldsTransformationPaths, } 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 ambassadorWixStoresCatalogV1Product from './stores-catalog-v1-product.http';
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
|
|
16
|
-
const _toVeloEntity = '$';
|
|
17
|
-
const _fromVeloEntity = '$';
|
|
18
|
-
export var ProductType;
|
|
19
|
-
(function (ProductType) {
|
|
20
|
-
ProductType["unspecified_product_type"] = "unspecified_product_type";
|
|
21
|
-
ProductType["physical"] = "physical";
|
|
22
|
-
ProductType["digital"] = "digital";
|
|
23
|
-
})(ProductType || (ProductType = {}));
|
|
24
|
-
export var InventoryStatus;
|
|
25
|
-
(function (InventoryStatus) {
|
|
26
|
-
InventoryStatus["IN_STOCK"] = "IN_STOCK";
|
|
27
|
-
InventoryStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
28
|
-
InventoryStatus["PARTIALLY_OUT_OF_STOCK"] = "PARTIALLY_OUT_OF_STOCK";
|
|
29
|
-
})(InventoryStatus || (InventoryStatus = {}));
|
|
30
|
-
export var MeasurementUnit;
|
|
31
|
-
(function (MeasurementUnit) {
|
|
32
|
-
MeasurementUnit["UNSPECIFIED"] = "UNSPECIFIED";
|
|
33
|
-
MeasurementUnit["ML"] = "ML";
|
|
34
|
-
MeasurementUnit["CL"] = "CL";
|
|
35
|
-
MeasurementUnit["L"] = "L";
|
|
36
|
-
MeasurementUnit["CBM"] = "CBM";
|
|
37
|
-
MeasurementUnit["MG"] = "MG";
|
|
38
|
-
MeasurementUnit["G"] = "G";
|
|
39
|
-
MeasurementUnit["KG"] = "KG";
|
|
40
|
-
MeasurementUnit["MM"] = "MM";
|
|
41
|
-
MeasurementUnit["CM"] = "CM";
|
|
42
|
-
MeasurementUnit["M"] = "M";
|
|
43
|
-
MeasurementUnit["SQM"] = "SQM";
|
|
44
|
-
MeasurementUnit["OZ"] = "OZ";
|
|
45
|
-
MeasurementUnit["LB"] = "LB";
|
|
46
|
-
MeasurementUnit["FLOZ"] = "FLOZ";
|
|
47
|
-
MeasurementUnit["PT"] = "PT";
|
|
48
|
-
MeasurementUnit["QT"] = "QT";
|
|
49
|
-
MeasurementUnit["GAL"] = "GAL";
|
|
50
|
-
MeasurementUnit["IN"] = "IN";
|
|
51
|
-
MeasurementUnit["FT"] = "FT";
|
|
52
|
-
MeasurementUnit["YD"] = "YD";
|
|
53
|
-
MeasurementUnit["SQFT"] = "SQFT";
|
|
54
|
-
})(MeasurementUnit || (MeasurementUnit = {}));
|
|
55
|
-
export var MediaItemType;
|
|
56
|
-
(function (MediaItemType) {
|
|
57
|
-
MediaItemType["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
58
|
-
MediaItemType["image"] = "image";
|
|
59
|
-
MediaItemType["video"] = "video";
|
|
60
|
-
MediaItemType["audio"] = "audio";
|
|
61
|
-
MediaItemType["document"] = "document";
|
|
62
|
-
MediaItemType["zip"] = "zip";
|
|
63
|
-
})(MediaItemType || (MediaItemType = {}));
|
|
64
|
-
export var OptionType;
|
|
65
|
-
(function (OptionType) {
|
|
66
|
-
OptionType["unspecified_option_type"] = "unspecified_option_type";
|
|
67
|
-
OptionType["drop_down"] = "drop_down";
|
|
68
|
-
OptionType["color"] = "color";
|
|
69
|
-
})(OptionType || (OptionType = {}));
|
|
70
|
-
export var DiscountType;
|
|
71
|
-
(function (DiscountType) {
|
|
72
|
-
DiscountType["UNDEFINED"] = "UNDEFINED";
|
|
73
|
-
/** No discount */
|
|
74
|
-
DiscountType["NONE"] = "NONE";
|
|
75
|
-
DiscountType["AMOUNT"] = "AMOUNT";
|
|
76
|
-
DiscountType["PERCENT"] = "PERCENT";
|
|
77
|
-
})(DiscountType || (DiscountType = {}));
|
|
78
|
-
export var FileType;
|
|
79
|
-
(function (FileType) {
|
|
80
|
-
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
81
|
-
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
82
|
-
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
83
|
-
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
84
|
-
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
85
|
-
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
86
|
-
})(FileType || (FileType = {}));
|
|
87
|
-
export var SortOrder;
|
|
88
|
-
(function (SortOrder) {
|
|
89
|
-
SortOrder["ASC"] = "ASC";
|
|
90
|
-
SortOrder["DESC"] = "DESC";
|
|
91
|
-
})(SortOrder || (SortOrder = {}));
|
|
92
|
-
const _addProductMediaRequest = {};
|
|
93
|
-
const _addProductMediaResponse = {};
|
|
94
|
-
const _addProductMediaToChoicesRequest = {};
|
|
95
|
-
const _addProductMediaToChoicesResponse = {};
|
|
96
|
-
const _addProductsToCollectionRequest = {};
|
|
97
|
-
const _addProductsToCollectionResponse = {};
|
|
98
|
-
const _bulkAdjustProductPropertiesRequest = {};
|
|
99
|
-
const _bulkAdjustProductPropertiesResponse = {};
|
|
100
|
-
const _bulkUpdateProductsRequest = {};
|
|
101
|
-
const _bulkUpdateProductsResponse = {};
|
|
102
|
-
const _createCollectionRequest = {};
|
|
103
|
-
const _createCollectionResponse = {};
|
|
104
|
-
const _createProductPlatformizedRequest = {};
|
|
105
|
-
const _createProductPlatformizedResponse = {};
|
|
106
|
-
const _createProductRequest = {};
|
|
107
|
-
const _createProductResponse = {};
|
|
108
|
-
const _deleteCollectionRequest = {};
|
|
109
|
-
const _deleteCollectionResponse = {};
|
|
110
|
-
const _deleteProductOptionsRequest = {};
|
|
111
|
-
const _deleteProductOptionsResponse = {};
|
|
112
|
-
const _deleteProductPlatformizedRequest = {};
|
|
113
|
-
const _deleteProductPlatformizedResponse = {};
|
|
114
|
-
const _deleteProductRequest = {};
|
|
115
|
-
const _deleteProductResponse = {};
|
|
116
|
-
const _getCollectionBySlugRequest = {};
|
|
117
|
-
const _getCollectionBySlugResponse = {};
|
|
118
|
-
const _getProductPlatformizedRequest = {};
|
|
119
|
-
const _getProductPlatformizedResponse = {};
|
|
120
|
-
const _getProductRequest = {};
|
|
121
|
-
const _getProductResponse = {};
|
|
122
|
-
const _getStoreVariantRequest = {};
|
|
123
|
-
const _getStoreVariantResponse = { variant: '_storeVariant' };
|
|
124
|
-
const _platformMedia = {
|
|
125
|
-
image: 'wix.common.Image',
|
|
126
|
-
video: 'wix.common.VideoV2',
|
|
127
|
-
};
|
|
128
|
-
const _productOptionsAvailabilityRequest = {};
|
|
129
|
-
const _productOptionsAvailabilityResponse = {};
|
|
130
|
-
const _queryProductsPlatformizedRequest = {};
|
|
131
|
-
const _queryProductsPlatformizedResponse = {};
|
|
132
|
-
const _queryProductVariantsRequest = {};
|
|
133
|
-
const _queryProductVariantsResponse = {};
|
|
134
|
-
const _queryStoreVariantsRequest = {};
|
|
135
|
-
const _queryStoreVariantsResponse = { variants: '_storeVariant' };
|
|
136
|
-
const _removeProductBrandRequest = {};
|
|
137
|
-
const _removeProductBrandResponse = {};
|
|
138
|
-
const _removeProductMediaFromChoicesRequest = {};
|
|
139
|
-
const _removeProductMediaFromChoicesResponse = {};
|
|
140
|
-
const _removeProductMediaRequest = {};
|
|
141
|
-
const _removeProductMediaResponse = {};
|
|
142
|
-
const _removeProductRibbonRequest = {};
|
|
143
|
-
const _removeProductRibbonResponse = {};
|
|
144
|
-
const _removeProductsFromCollectionRequest = {};
|
|
145
|
-
const _removeProductsFromCollectionResponse = {};
|
|
146
|
-
const _resetAllVariantDataRequest = {};
|
|
147
|
-
const _resetAllVariantDataResponse = {};
|
|
148
|
-
const _storeVariant = { media: '_platformMedia' };
|
|
149
|
-
const _updateCollectionRequest = {};
|
|
150
|
-
const _updateCollectionResponse = {};
|
|
151
|
-
const _updateProductPlatformizedRequest = {};
|
|
152
|
-
const _updateProductPlatformizedResponse = {};
|
|
153
|
-
const _updateProductRequest = {};
|
|
154
|
-
const _updateProductResponse = {};
|
|
155
|
-
const _updateVariantsRequest = {};
|
|
156
|
-
const _updateVariantsResponse = {};
|
|
157
|
-
const _v1CreateProductPlatformizedRequest = {};
|
|
158
|
-
const _v1CreateProductPlatformizedResponse = {};
|
|
159
|
-
const _v1DeleteProductPlatformizedRequest = {};
|
|
160
|
-
const _v1DeleteProductPlatformizedResponse = {};
|
|
161
|
-
const _v1UpdateProductPlatformizedRequest = {};
|
|
162
|
-
const _v1UpdateProductPlatformizedResponse = {};
|
|
163
|
-
const _collectionChanged = {};
|
|
164
|
-
const _collectionCreated = {};
|
|
165
|
-
const _collectionDeleted = {};
|
|
166
|
-
const _costAndProfitData = {
|
|
167
|
-
itemCost: 'google.protobuf.DoubleValue',
|
|
168
|
-
profit: 'DOUBLE',
|
|
169
|
-
profitMargin: 'DOUBLE',
|
|
170
|
-
};
|
|
171
|
-
const _priceData = {
|
|
172
|
-
price: 'google.protobuf.DoubleValue',
|
|
173
|
-
discountedPrice: 'DOUBLE',
|
|
174
|
-
pricePerUnit: 'google.protobuf.DoubleValue',
|
|
175
|
-
};
|
|
176
|
-
const _productChanged = {};
|
|
177
|
-
const _productCreated = {
|
|
178
|
-
price: '_priceData',
|
|
179
|
-
costAndProfitData: '_costAndProfitData',
|
|
180
|
-
};
|
|
181
|
-
const _productDeleted = {};
|
|
182
|
-
const _variantsChanged = {};
|
|
183
|
-
export const onProductCreated = EventDefinition('com.wix.ecommerce.catalog.api.v1.ProductCreated', false, {
|
|
184
|
-
rootSchema: _productCreated,
|
|
185
|
-
depSchemas: { _costAndProfitData, _priceData },
|
|
186
|
-
})();
|
|
187
|
-
export const onProductChanged = EventDefinition('com.wix.ecommerce.catalog.api.v1.ProductChanged', false, {
|
|
188
|
-
rootSchema: _productChanged,
|
|
189
|
-
depSchemas: {},
|
|
190
|
-
})();
|
|
191
|
-
export const onProductDeleted = EventDefinition('com.wix.ecommerce.catalog.api.v1.ProductDeleted', false, {
|
|
192
|
-
rootSchema: _productDeleted,
|
|
193
|
-
depSchemas: {},
|
|
194
|
-
})();
|
|
195
|
-
export const onProductCollectionCreated = EventDefinition('com.wix.ecommerce.catalog.api.v1.CollectionCreated', false, {
|
|
196
|
-
rootSchema: _collectionCreated,
|
|
197
|
-
depSchemas: {},
|
|
198
|
-
})();
|
|
199
|
-
export const onProductCollectionChanged = EventDefinition('com.wix.ecommerce.catalog.api.v1.CollectionChanged', false, {
|
|
200
|
-
rootSchema: _collectionChanged,
|
|
201
|
-
depSchemas: {},
|
|
202
|
-
})();
|
|
203
|
-
export const onProductCollectionDeleted = EventDefinition('com.wix.ecommerce.catalog.api.v1.CollectionDeleted', false, {
|
|
204
|
-
rootSchema: _collectionDeleted,
|
|
205
|
-
depSchemas: {},
|
|
206
|
-
})();
|
|
207
|
-
export const onProductVariantsChanged = EventDefinition('com.wix.ecommerce.catalog.api.v1.VariantsChanged', false, {
|
|
208
|
-
rootSchema: _variantsChanged,
|
|
209
|
-
depSchemas: {},
|
|
210
|
-
})();
|
|
211
|
-
/**
|
|
212
|
-
* Creates a new product.
|
|
213
|
-
* @param product - Product information.
|
|
214
|
-
* @public
|
|
215
|
-
* @requiredField product
|
|
216
|
-
* @requiredField product.costAndProfitData.itemCost
|
|
217
|
-
* @requiredField product.name
|
|
218
|
-
* @requiredField product.priceData
|
|
219
|
-
* @requiredField product.priceData.price
|
|
220
|
-
* @permissionScope Manage Stores - all permissions
|
|
221
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
222
|
-
* @permissionScope Manage Products
|
|
223
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
224
|
-
* @applicableIdentity APP
|
|
225
|
-
*/
|
|
226
|
-
export function createProduct(product) {
|
|
227
|
-
var _a, _b, _c;
|
|
228
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
229
|
-
const requestTransformation = { product: '$[0]' };
|
|
230
|
-
const responseTransformation = '$';
|
|
231
|
-
// @ts-ignore
|
|
232
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
233
|
-
const { toAmbassadorRequest } = serializer({
|
|
234
|
-
rootSchema: _createProductRequest,
|
|
235
|
-
depSchemas: {},
|
|
236
|
-
fqdnTransformation: {
|
|
237
|
-
paths: [...['product']],
|
|
238
|
-
transformation: _fromVeloEntity,
|
|
239
|
-
},
|
|
240
|
-
customTransformation: requestTransformation,
|
|
241
|
-
});
|
|
242
|
-
const { fromJSON } = serializer({
|
|
243
|
-
rootSchema: _createProductResponse,
|
|
244
|
-
depSchemas: {},
|
|
245
|
-
fqdnTransformation: {
|
|
246
|
-
paths: [...['product']],
|
|
247
|
-
transformation: _toVeloEntity,
|
|
248
|
-
},
|
|
249
|
-
customTransformation: responseTransformation,
|
|
250
|
-
});
|
|
251
|
-
const payload = toAmbassadorRequest([product]);
|
|
252
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.createProduct(payload);
|
|
253
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
254
|
-
try {
|
|
255
|
-
const result = yield httpClient.request(reqOpts);
|
|
256
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
257
|
-
return fromJSON(result.data);
|
|
258
|
-
}
|
|
259
|
-
catch (err) {
|
|
260
|
-
const transformedError = sdkTransformError(err, {
|
|
261
|
-
spreadPathsToArguments: {},
|
|
262
|
-
explicitPathsToArguments: { product: '$[0]' },
|
|
263
|
-
singleArgumentUnchanged: false,
|
|
264
|
-
}, ['product']);
|
|
265
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
266
|
-
throw transformedError;
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Creates a new product.
|
|
272
|
-
* @param product - Product information.
|
|
273
|
-
* @public
|
|
274
|
-
* @documentationMaturity preview
|
|
275
|
-
* @requiredField product
|
|
276
|
-
* @requiredField product.costAndProfitData.itemCost
|
|
277
|
-
* @requiredField product.name
|
|
278
|
-
* @requiredField product.priceData
|
|
279
|
-
* @requiredField product.priceData.price
|
|
280
|
-
* @permissionScope Manage Stores - all permissions
|
|
281
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
282
|
-
* @permissionScope Manage Products
|
|
283
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
284
|
-
* @applicableIdentity APP
|
|
285
|
-
*/
|
|
286
|
-
export function createProductPlatformized(product) {
|
|
287
|
-
var _a, _b, _c;
|
|
288
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
289
|
-
const requestTransformation = { product: '$[0]' };
|
|
290
|
-
const responseTransformation = '$.product';
|
|
291
|
-
// @ts-ignore
|
|
292
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
293
|
-
const { toAmbassadorRequest } = serializer({
|
|
294
|
-
rootSchema: _createProductPlatformizedRequest,
|
|
295
|
-
depSchemas: {},
|
|
296
|
-
fqdnTransformation: {
|
|
297
|
-
paths: [...['product']],
|
|
298
|
-
transformation: _fromVeloEntity,
|
|
299
|
-
},
|
|
300
|
-
customTransformation: requestTransformation,
|
|
301
|
-
});
|
|
302
|
-
const { fromJSON } = serializer({
|
|
303
|
-
rootSchema: _createProductPlatformizedResponse,
|
|
304
|
-
depSchemas: {},
|
|
305
|
-
fqdnTransformation: {
|
|
306
|
-
paths: [...['product']],
|
|
307
|
-
transformation: _toVeloEntity,
|
|
308
|
-
},
|
|
309
|
-
customTransformation: responseTransformation,
|
|
310
|
-
});
|
|
311
|
-
const payload = toAmbassadorRequest([product]);
|
|
312
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.createProductPlatformized(payload);
|
|
313
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
314
|
-
try {
|
|
315
|
-
const result = yield httpClient.request(reqOpts);
|
|
316
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
317
|
-
return fromJSON(result.data);
|
|
318
|
-
}
|
|
319
|
-
catch (err) {
|
|
320
|
-
const transformedError = sdkTransformError(err, {
|
|
321
|
-
spreadPathsToArguments: {},
|
|
322
|
-
explicitPathsToArguments: { product: '$[0]' },
|
|
323
|
-
singleArgumentUnchanged: false,
|
|
324
|
-
}, ['product']);
|
|
325
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
326
|
-
throw transformedError;
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Updates specified fields in a product.
|
|
332
|
-
* @param _id - Product ID (generated automatically by the catalog).
|
|
333
|
-
* @public
|
|
334
|
-
* @requiredField _id
|
|
335
|
-
* @requiredField product
|
|
336
|
-
* @param product - Product info to update.
|
|
337
|
-
* @permissionScope Manage Stores - all permissions
|
|
338
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
339
|
-
* @permissionScope Manage Products
|
|
340
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
341
|
-
* @applicableIdentity APP
|
|
342
|
-
*/
|
|
343
|
-
export function updateProduct(_id, product) {
|
|
344
|
-
var _a, _b, _c;
|
|
345
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
346
|
-
const requestTransformation = { product: { '*': '$[1]', id: '$[0]' } };
|
|
347
|
-
const responseTransformation = '$';
|
|
348
|
-
// @ts-ignore
|
|
349
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
350
|
-
const { toAmbassadorRequest } = serializer({
|
|
351
|
-
rootSchema: _updateProductRequest,
|
|
352
|
-
depSchemas: {},
|
|
353
|
-
fqdnTransformation: {
|
|
354
|
-
paths: [...['product']],
|
|
355
|
-
transformation: _fromVeloEntity,
|
|
356
|
-
},
|
|
357
|
-
customTransformation: requestTransformation,
|
|
358
|
-
});
|
|
359
|
-
const { fromJSON } = serializer({
|
|
360
|
-
rootSchema: _updateProductResponse,
|
|
361
|
-
depSchemas: {},
|
|
362
|
-
fqdnTransformation: {
|
|
363
|
-
paths: [...['product']],
|
|
364
|
-
transformation: _toVeloEntity,
|
|
365
|
-
},
|
|
366
|
-
customTransformation: responseTransformation,
|
|
367
|
-
});
|
|
368
|
-
const payload = toAmbassadorRequest([_id, product]);
|
|
369
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.updateProduct(payload);
|
|
370
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
371
|
-
try {
|
|
372
|
-
const result = yield httpClient.request(reqOpts);
|
|
373
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
374
|
-
return fromJSON(result.data);
|
|
375
|
-
}
|
|
376
|
-
catch (err) {
|
|
377
|
-
const transformedError = sdkTransformError(err, {
|
|
378
|
-
spreadPathsToArguments: { product: '$[1]' },
|
|
379
|
-
explicitPathsToArguments: { 'product.id': '$[0]' },
|
|
380
|
-
singleArgumentUnchanged: false,
|
|
381
|
-
}, ['_id', 'product']);
|
|
382
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
383
|
-
throw transformedError;
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Updates specified fields in a product.
|
|
389
|
-
* @param _id - Product ID (generated automatically by the catalog).
|
|
390
|
-
* @public
|
|
391
|
-
* @documentationMaturity preview
|
|
392
|
-
* @requiredField _id
|
|
393
|
-
* @requiredField product
|
|
394
|
-
* @permissionScope Manage Stores - all permissions
|
|
395
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
396
|
-
* @permissionScope Manage Products
|
|
397
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
398
|
-
* @applicableIdentity APP
|
|
399
|
-
*/
|
|
400
|
-
export function updateProductPlatformized(_id, product) {
|
|
401
|
-
var _a, _b, _c;
|
|
402
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
403
|
-
const requestTransformation = { product: { '*': '$[1]', id: '$[0]' } };
|
|
404
|
-
const responseTransformation = '$.product';
|
|
405
|
-
// @ts-ignore
|
|
406
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
407
|
-
const { toAmbassadorRequest } = serializer({
|
|
408
|
-
rootSchema: _updateProductPlatformizedRequest,
|
|
409
|
-
depSchemas: {},
|
|
410
|
-
fqdnTransformation: {
|
|
411
|
-
paths: [...['product']],
|
|
412
|
-
transformation: _fromVeloEntity,
|
|
413
|
-
},
|
|
414
|
-
customTransformation: requestTransformation,
|
|
415
|
-
});
|
|
416
|
-
const { fromJSON } = serializer({
|
|
417
|
-
rootSchema: _updateProductPlatformizedResponse,
|
|
418
|
-
depSchemas: {},
|
|
419
|
-
fqdnTransformation: {
|
|
420
|
-
paths: [...['product']],
|
|
421
|
-
transformation: _toVeloEntity,
|
|
422
|
-
},
|
|
423
|
-
customTransformation: responseTransformation,
|
|
424
|
-
});
|
|
425
|
-
const payload = toAmbassadorRequest([_id, product]);
|
|
426
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.updateProductPlatformized(payload);
|
|
427
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
428
|
-
try {
|
|
429
|
-
const result = yield httpClient.request(reqOpts);
|
|
430
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
431
|
-
return fromJSON(result.data);
|
|
432
|
-
}
|
|
433
|
-
catch (err) {
|
|
434
|
-
const transformedError = sdkTransformError(err, {
|
|
435
|
-
spreadPathsToArguments: { product: '$[1]' },
|
|
436
|
-
explicitPathsToArguments: { 'product.id': '$[0]' },
|
|
437
|
-
singleArgumentUnchanged: false,
|
|
438
|
-
}, ['_id', 'product']);
|
|
439
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
440
|
-
throw transformedError;
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Deletes a product.
|
|
446
|
-
* @param _id - ID of the product to delete.
|
|
447
|
-
* @public
|
|
448
|
-
* @requiredField _id
|
|
449
|
-
* @permissionScope Manage Stores - all permissions
|
|
450
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
451
|
-
* @permissionScope Manage Products
|
|
452
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
453
|
-
* @applicableIdentity APP
|
|
454
|
-
*/
|
|
455
|
-
export function deleteProduct(_id) {
|
|
456
|
-
var _a, _b, _c;
|
|
457
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
458
|
-
const requestTransformation = { id: '$[0]' };
|
|
459
|
-
const responseTransformation = '$';
|
|
460
|
-
// @ts-ignore
|
|
461
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
462
|
-
const { toAmbassadorRequest } = serializer({
|
|
463
|
-
rootSchema: _deleteProductRequest,
|
|
464
|
-
depSchemas: {},
|
|
465
|
-
fqdnTransformation: {
|
|
466
|
-
paths: [],
|
|
467
|
-
transformation: _fromVeloEntity,
|
|
468
|
-
},
|
|
469
|
-
customTransformation: requestTransformation,
|
|
470
|
-
});
|
|
471
|
-
const { fromJSON } = serializer({
|
|
472
|
-
rootSchema: _deleteProductResponse,
|
|
473
|
-
depSchemas: {},
|
|
474
|
-
fqdnTransformation: {
|
|
475
|
-
paths: [],
|
|
476
|
-
transformation: _toVeloEntity,
|
|
477
|
-
},
|
|
478
|
-
customTransformation: responseTransformation,
|
|
479
|
-
});
|
|
480
|
-
const payload = toAmbassadorRequest([_id]);
|
|
481
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.deleteProduct(payload);
|
|
482
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
483
|
-
try {
|
|
484
|
-
const result = yield httpClient.request(reqOpts);
|
|
485
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
486
|
-
}
|
|
487
|
-
catch (err) {
|
|
488
|
-
const transformedError = sdkTransformError(err, {
|
|
489
|
-
spreadPathsToArguments: {},
|
|
490
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
491
|
-
singleArgumentUnchanged: false,
|
|
492
|
-
}, ['_id']);
|
|
493
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
494
|
-
throw transformedError;
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Deletes a product.
|
|
500
|
-
* @param _id - ID of the product to delete.
|
|
501
|
-
* @public
|
|
502
|
-
* @documentationMaturity preview
|
|
503
|
-
* @requiredField _id
|
|
504
|
-
* @permissionScope Manage Stores - all permissions
|
|
505
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
506
|
-
* @permissionScope Manage Products
|
|
507
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
508
|
-
* @applicableIdentity APP
|
|
509
|
-
*/
|
|
510
|
-
export function deleteProductPlatformized(_id) {
|
|
511
|
-
var _a, _b, _c;
|
|
512
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
513
|
-
const requestTransformation = { id: '$[0]' };
|
|
514
|
-
const responseTransformation = '$';
|
|
515
|
-
// @ts-ignore
|
|
516
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
517
|
-
const { toAmbassadorRequest } = serializer({
|
|
518
|
-
rootSchema: _deleteProductPlatformizedRequest,
|
|
519
|
-
depSchemas: {},
|
|
520
|
-
fqdnTransformation: {
|
|
521
|
-
paths: [],
|
|
522
|
-
transformation: _fromVeloEntity,
|
|
523
|
-
},
|
|
524
|
-
customTransformation: requestTransformation,
|
|
525
|
-
});
|
|
526
|
-
const { fromJSON } = serializer({
|
|
527
|
-
rootSchema: _deleteProductPlatformizedResponse,
|
|
528
|
-
depSchemas: {},
|
|
529
|
-
fqdnTransformation: {
|
|
530
|
-
paths: [],
|
|
531
|
-
transformation: _toVeloEntity,
|
|
532
|
-
},
|
|
533
|
-
customTransformation: responseTransformation,
|
|
534
|
-
});
|
|
535
|
-
const payload = toAmbassadorRequest([_id]);
|
|
536
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.deleteProductPlatformized(payload);
|
|
537
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
538
|
-
try {
|
|
539
|
-
const result = yield httpClient.request(reqOpts);
|
|
540
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
541
|
-
}
|
|
542
|
-
catch (err) {
|
|
543
|
-
const transformedError = sdkTransformError(err, {
|
|
544
|
-
spreadPathsToArguments: {},
|
|
545
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
546
|
-
singleArgumentUnchanged: false,
|
|
547
|
-
}, ['_id']);
|
|
548
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
549
|
-
throw transformedError;
|
|
550
|
-
}
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Updates variants of a specified product.
|
|
555
|
-
* @param _id - ID of the product with managed variants.
|
|
556
|
-
* @param variants - Variant info to update.
|
|
557
|
-
* @public
|
|
558
|
-
* @documentationMaturity preview
|
|
559
|
-
* @requiredField _id
|
|
560
|
-
* @requiredField variants
|
|
561
|
-
* @permissionScope Manage Stores - all permissions
|
|
562
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
563
|
-
* @permissionScope Manage Products
|
|
564
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
565
|
-
* @applicableIdentity APP
|
|
566
|
-
*/
|
|
567
|
-
export function updateProductVariants(_id, variants) {
|
|
568
|
-
var _a, _b, _c;
|
|
569
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
570
|
-
const requestTransformation = { id: '$[0]', variants: '$[1]' };
|
|
571
|
-
const responseTransformation = '$';
|
|
572
|
-
// @ts-ignore
|
|
573
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
574
|
-
const { toAmbassadorRequest } = serializer({
|
|
575
|
-
rootSchema: _updateVariantsRequest,
|
|
576
|
-
depSchemas: {},
|
|
577
|
-
fqdnTransformation: {
|
|
578
|
-
paths: [],
|
|
579
|
-
transformation: _fromVeloEntity,
|
|
580
|
-
},
|
|
581
|
-
customTransformation: requestTransformation,
|
|
582
|
-
});
|
|
583
|
-
const { fromJSON } = serializer({
|
|
584
|
-
rootSchema: _updateVariantsResponse,
|
|
585
|
-
depSchemas: {},
|
|
586
|
-
fqdnTransformation: {
|
|
587
|
-
paths: [],
|
|
588
|
-
transformation: _toVeloEntity,
|
|
589
|
-
},
|
|
590
|
-
customTransformation: responseTransformation,
|
|
591
|
-
});
|
|
592
|
-
const payload = toAmbassadorRequest([_id, variants]);
|
|
593
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.updateVariants(payload);
|
|
594
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
595
|
-
try {
|
|
596
|
-
const result = yield httpClient.request(reqOpts);
|
|
597
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
598
|
-
return fromJSON(result.data);
|
|
599
|
-
}
|
|
600
|
-
catch (err) {
|
|
601
|
-
const transformedError = sdkTransformError(err, {
|
|
602
|
-
spreadPathsToArguments: {},
|
|
603
|
-
explicitPathsToArguments: { id: '$[0]', variants: '$[1]' },
|
|
604
|
-
singleArgumentUnchanged: false,
|
|
605
|
-
}, ['_id', 'variants']);
|
|
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
|
-
* Resets the data (such as the price and the weight) of all variants for a given product to their default values.
|
|
613
|
-
* @param _id - Product ID.
|
|
614
|
-
* @public
|
|
615
|
-
* @documentationMaturity preview
|
|
616
|
-
* @requiredField _id
|
|
617
|
-
* @permissionScope Manage Stores - all permissions
|
|
618
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
619
|
-
* @permissionScope Manage Products
|
|
620
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
621
|
-
* @applicableIdentity APP
|
|
622
|
-
*/
|
|
623
|
-
export function resetAllProductVariantData(_id) {
|
|
624
|
-
var _a, _b, _c;
|
|
625
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
626
|
-
const requestTransformation = { id: '$[0]' };
|
|
627
|
-
const responseTransformation = '$';
|
|
628
|
-
// @ts-ignore
|
|
629
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
630
|
-
const { toAmbassadorRequest } = serializer({
|
|
631
|
-
rootSchema: _resetAllVariantDataRequest,
|
|
632
|
-
depSchemas: {},
|
|
633
|
-
fqdnTransformation: {
|
|
634
|
-
paths: [],
|
|
635
|
-
transformation: _fromVeloEntity,
|
|
636
|
-
},
|
|
637
|
-
customTransformation: requestTransformation,
|
|
638
|
-
});
|
|
639
|
-
const { fromJSON } = serializer({
|
|
640
|
-
rootSchema: _resetAllVariantDataResponse,
|
|
641
|
-
depSchemas: {},
|
|
642
|
-
fqdnTransformation: {
|
|
643
|
-
paths: [],
|
|
644
|
-
transformation: _toVeloEntity,
|
|
645
|
-
},
|
|
646
|
-
customTransformation: responseTransformation,
|
|
647
|
-
});
|
|
648
|
-
const payload = toAmbassadorRequest([_id]);
|
|
649
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.resetAllVariantData(payload);
|
|
650
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
651
|
-
try {
|
|
652
|
-
const result = yield httpClient.request(reqOpts);
|
|
653
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
654
|
-
}
|
|
655
|
-
catch (err) {
|
|
656
|
-
const transformedError = sdkTransformError(err, {
|
|
657
|
-
spreadPathsToArguments: {},
|
|
658
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
659
|
-
singleArgumentUnchanged: false,
|
|
660
|
-
}, ['_id']);
|
|
661
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
662
|
-
throw transformedError;
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Adds products to a specified collection.
|
|
668
|
-
* @param _id - Collection ID.
|
|
669
|
-
* @param productIds - IDs of the products to add to the collection, separated by commas.
|
|
670
|
-
* @public
|
|
671
|
-
* @requiredField _id
|
|
672
|
-
* @requiredField productIds
|
|
673
|
-
* @permissionScope Manage Stores - all permissions
|
|
674
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
675
|
-
* @permissionScope Manage Products
|
|
676
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
677
|
-
* @applicableIdentity APP
|
|
678
|
-
*/
|
|
679
|
-
export function addProductsToCollection(_id, productIds) {
|
|
680
|
-
var _a, _b, _c;
|
|
681
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
682
|
-
const requestTransformation = { id: '$[0]', productIds: '$[1]' };
|
|
683
|
-
const responseTransformation = '$';
|
|
684
|
-
// @ts-ignore
|
|
685
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
686
|
-
const { toAmbassadorRequest } = serializer({
|
|
687
|
-
rootSchema: _addProductsToCollectionRequest,
|
|
688
|
-
depSchemas: {},
|
|
689
|
-
fqdnTransformation: {
|
|
690
|
-
paths: [],
|
|
691
|
-
transformation: _fromVeloEntity,
|
|
692
|
-
},
|
|
693
|
-
customTransformation: requestTransformation,
|
|
694
|
-
});
|
|
695
|
-
const { fromJSON } = serializer({
|
|
696
|
-
rootSchema: _addProductsToCollectionResponse,
|
|
697
|
-
depSchemas: {},
|
|
698
|
-
fqdnTransformation: {
|
|
699
|
-
paths: [],
|
|
700
|
-
transformation: _toVeloEntity,
|
|
701
|
-
},
|
|
702
|
-
customTransformation: responseTransformation,
|
|
703
|
-
});
|
|
704
|
-
const payload = toAmbassadorRequest([_id, productIds]);
|
|
705
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.addProductsToCollection(payload);
|
|
706
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
707
|
-
try {
|
|
708
|
-
const result = yield httpClient.request(reqOpts);
|
|
709
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
710
|
-
}
|
|
711
|
-
catch (err) {
|
|
712
|
-
const transformedError = sdkTransformError(err, {
|
|
713
|
-
spreadPathsToArguments: {},
|
|
714
|
-
explicitPathsToArguments: { id: '$[0]', productIds: '$[1]' },
|
|
715
|
-
singleArgumentUnchanged: false,
|
|
716
|
-
}, ['_id', 'productIds']);
|
|
717
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
718
|
-
throw transformedError;
|
|
719
|
-
}
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Deletes products from a specified collection.
|
|
724
|
-
* @param _id - ID of the collection from which to remove products.
|
|
725
|
-
* @param productIds - IDs of the products to remove from the collection.
|
|
726
|
-
* @public
|
|
727
|
-
* @requiredField _id
|
|
728
|
-
* @requiredField productIds
|
|
729
|
-
* @permissionScope Manage Stores - all permissions
|
|
730
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
731
|
-
* @permissionScope Manage Products
|
|
732
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
733
|
-
* @applicableIdentity APP
|
|
734
|
-
*/
|
|
735
|
-
export function removeProductsFromCollection(_id, productIds) {
|
|
736
|
-
var _a, _b, _c;
|
|
737
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
738
|
-
const requestTransformation = { id: '$[0]', productIds: '$[1]' };
|
|
739
|
-
const responseTransformation = '$';
|
|
740
|
-
// @ts-ignore
|
|
741
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
742
|
-
const { toAmbassadorRequest } = serializer({
|
|
743
|
-
rootSchema: _removeProductsFromCollectionRequest,
|
|
744
|
-
depSchemas: {},
|
|
745
|
-
fqdnTransformation: {
|
|
746
|
-
paths: [],
|
|
747
|
-
transformation: _fromVeloEntity,
|
|
748
|
-
},
|
|
749
|
-
customTransformation: requestTransformation,
|
|
750
|
-
});
|
|
751
|
-
const { fromJSON } = serializer({
|
|
752
|
-
rootSchema: _removeProductsFromCollectionResponse,
|
|
753
|
-
depSchemas: {},
|
|
754
|
-
fqdnTransformation: {
|
|
755
|
-
paths: [],
|
|
756
|
-
transformation: _toVeloEntity,
|
|
757
|
-
},
|
|
758
|
-
customTransformation: responseTransformation,
|
|
759
|
-
});
|
|
760
|
-
const payload = toAmbassadorRequest([_id, productIds]);
|
|
761
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.removeProductsFromCollection(payload);
|
|
762
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
763
|
-
try {
|
|
764
|
-
const result = yield httpClient.request(reqOpts);
|
|
765
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
766
|
-
}
|
|
767
|
-
catch (err) {
|
|
768
|
-
const transformedError = sdkTransformError(err, {
|
|
769
|
-
spreadPathsToArguments: {},
|
|
770
|
-
explicitPathsToArguments: { id: '$[0]', productIds: '$[1]' },
|
|
771
|
-
singleArgumentUnchanged: false,
|
|
772
|
-
}, ['_id', 'productIds']);
|
|
773
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
774
|
-
throw transformedError;
|
|
775
|
-
}
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* Adds media items to a specified product, either via URL or existing media ID.
|
|
780
|
-
*
|
|
781
|
-
* > **NOTE:** The URL is not validated and no event is triggered to indicate if the media was added successfully.
|
|
782
|
-
* @param _id - Product ID.
|
|
783
|
-
* @param media - Sources of media items already uploaded to the Wix site.
|
|
784
|
-
* @public
|
|
785
|
-
* @requiredField _id
|
|
786
|
-
* @requiredField media
|
|
787
|
-
* @permissionScope Manage Stores - all permissions
|
|
788
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
789
|
-
* @permissionScope Manage Products
|
|
790
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
791
|
-
* @applicableIdentity APP
|
|
792
|
-
*/
|
|
793
|
-
export function addProductMedia(_id, media) {
|
|
794
|
-
var _a, _b, _c;
|
|
795
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
796
|
-
const requestTransformation = { id: '$[0]', media: '$[1]' };
|
|
797
|
-
const responseTransformation = '$';
|
|
798
|
-
// @ts-ignore
|
|
799
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
800
|
-
const { toAmbassadorRequest } = serializer({
|
|
801
|
-
rootSchema: _addProductMediaRequest,
|
|
802
|
-
depSchemas: {},
|
|
803
|
-
fqdnTransformation: {
|
|
804
|
-
paths: [],
|
|
805
|
-
transformation: _fromVeloEntity,
|
|
806
|
-
},
|
|
807
|
-
customTransformation: requestTransformation,
|
|
808
|
-
});
|
|
809
|
-
const { fromJSON } = serializer({
|
|
810
|
-
rootSchema: _addProductMediaResponse,
|
|
811
|
-
depSchemas: {},
|
|
812
|
-
fqdnTransformation: {
|
|
813
|
-
paths: [],
|
|
814
|
-
transformation: _toVeloEntity,
|
|
815
|
-
},
|
|
816
|
-
customTransformation: responseTransformation,
|
|
817
|
-
});
|
|
818
|
-
const payload = toAmbassadorRequest([_id, media]);
|
|
819
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.addProductMedia(payload);
|
|
820
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
821
|
-
try {
|
|
822
|
-
const result = yield httpClient.request(reqOpts);
|
|
823
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
824
|
-
}
|
|
825
|
-
catch (err) {
|
|
826
|
-
const transformedError = sdkTransformError(err, {
|
|
827
|
-
spreadPathsToArguments: {},
|
|
828
|
-
explicitPathsToArguments: { id: '$[0]', media: '$[1]' },
|
|
829
|
-
singleArgumentUnchanged: false,
|
|
830
|
-
}, ['_id', 'media']);
|
|
831
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
832
|
-
throw transformedError;
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
}
|
|
836
|
-
/**
|
|
837
|
-
* Removes specified media items from a product.
|
|
838
|
-
* Pass an empty array to remove all media items.
|
|
839
|
-
* @param _id - Product ID.
|
|
840
|
-
* @param mediaIds - List of media IDs to remove. Pass an empty array to delete all media items for the product.
|
|
841
|
-
* @public
|
|
842
|
-
* @requiredField _id
|
|
843
|
-
* @requiredField mediaIds
|
|
844
|
-
* @permissionScope Manage Stores - all permissions
|
|
845
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
846
|
-
* @permissionScope Manage Products
|
|
847
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
848
|
-
* @applicableIdentity APP
|
|
849
|
-
*/
|
|
850
|
-
export function removeProductMedia(_id, mediaIds) {
|
|
851
|
-
var _a, _b, _c;
|
|
852
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
853
|
-
const requestTransformation = { id: '$[0]', mediaIds: '$[1]' };
|
|
854
|
-
const responseTransformation = '$';
|
|
855
|
-
// @ts-ignore
|
|
856
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
857
|
-
const { toAmbassadorRequest } = serializer({
|
|
858
|
-
rootSchema: _removeProductMediaRequest,
|
|
859
|
-
depSchemas: {},
|
|
860
|
-
fqdnTransformation: {
|
|
861
|
-
paths: [],
|
|
862
|
-
transformation: _fromVeloEntity,
|
|
863
|
-
},
|
|
864
|
-
customTransformation: requestTransformation,
|
|
865
|
-
});
|
|
866
|
-
const { fromJSON } = serializer({
|
|
867
|
-
rootSchema: _removeProductMediaResponse,
|
|
868
|
-
depSchemas: {},
|
|
869
|
-
fqdnTransformation: {
|
|
870
|
-
paths: [],
|
|
871
|
-
transformation: _toVeloEntity,
|
|
872
|
-
},
|
|
873
|
-
customTransformation: responseTransformation,
|
|
874
|
-
});
|
|
875
|
-
const payload = toAmbassadorRequest([_id, mediaIds]);
|
|
876
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.removeProductMedia(payload);
|
|
877
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
878
|
-
try {
|
|
879
|
-
const result = yield httpClient.request(reqOpts);
|
|
880
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
881
|
-
}
|
|
882
|
-
catch (err) {
|
|
883
|
-
const transformedError = sdkTransformError(err, {
|
|
884
|
-
spreadPathsToArguments: {},
|
|
885
|
-
explicitPathsToArguments: { id: '$[0]', mediaIds: '$[1]' },
|
|
886
|
-
singleArgumentUnchanged: false,
|
|
887
|
-
}, ['_id', 'mediaIds']);
|
|
888
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
889
|
-
throw transformedError;
|
|
890
|
-
}
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
/**
|
|
894
|
-
* Links media items that are already associated with a specific product to a choice within the same product.
|
|
895
|
-
*
|
|
896
|
-
* Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).
|
|
897
|
-
*
|
|
898
|
-
* To remove all existing media items, call the [Remove Product Media From Choices](https://dev.wix.com/api/rest/wix-stores/catalog/products/remove-product-media-from-choices) endpoint.
|
|
899
|
-
* @param _id - Product ID.
|
|
900
|
-
* @param media - Product media items and the choices to add the media to.
|
|
901
|
-
* @public
|
|
902
|
-
* @requiredField _id
|
|
903
|
-
* @requiredField media
|
|
904
|
-
* @requiredField media.choice
|
|
905
|
-
* @requiredField media.option
|
|
906
|
-
* @permissionScope Manage Stores - all permissions
|
|
907
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
908
|
-
* @permissionScope Manage Products
|
|
909
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
910
|
-
* @applicableIdentity APP
|
|
911
|
-
*/
|
|
912
|
-
export function addProductMediaToChoices(_id, media) {
|
|
913
|
-
var _a, _b, _c;
|
|
914
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
915
|
-
const requestTransformation = { id: '$[0]', media: '$[1]' };
|
|
916
|
-
const responseTransformation = '$';
|
|
917
|
-
// @ts-ignore
|
|
918
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
919
|
-
const { toAmbassadorRequest } = serializer({
|
|
920
|
-
rootSchema: _addProductMediaToChoicesRequest,
|
|
921
|
-
depSchemas: {},
|
|
922
|
-
fqdnTransformation: {
|
|
923
|
-
paths: [],
|
|
924
|
-
transformation: _fromVeloEntity,
|
|
925
|
-
},
|
|
926
|
-
customTransformation: requestTransformation,
|
|
927
|
-
});
|
|
928
|
-
const { fromJSON } = serializer({
|
|
929
|
-
rootSchema: _addProductMediaToChoicesResponse,
|
|
930
|
-
depSchemas: {},
|
|
931
|
-
fqdnTransformation: {
|
|
932
|
-
paths: [],
|
|
933
|
-
transformation: _toVeloEntity,
|
|
934
|
-
},
|
|
935
|
-
customTransformation: responseTransformation,
|
|
936
|
-
});
|
|
937
|
-
const payload = toAmbassadorRequest([_id, media]);
|
|
938
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.addProductMediaToChoices(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
|
-
}
|
|
944
|
-
catch (err) {
|
|
945
|
-
const transformedError = sdkTransformError(err, {
|
|
946
|
-
spreadPathsToArguments: {},
|
|
947
|
-
explicitPathsToArguments: { id: '$[0]', media: '$[1]' },
|
|
948
|
-
singleArgumentUnchanged: false,
|
|
949
|
-
}, ['_id', 'media']);
|
|
950
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
951
|
-
throw transformedError;
|
|
952
|
-
}
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
/**
|
|
956
|
-
* Removes media items from all or some of a product's choices.
|
|
957
|
-
* (Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).)
|
|
958
|
-
* @param _id - Product ID from whose choices to remove media items.
|
|
959
|
-
* @param media - Media to remove from choices. If an empty array is passed, all media will be removed from all choices for the given product.
|
|
960
|
-
* @public
|
|
961
|
-
* @requiredField _id
|
|
962
|
-
* @requiredField media
|
|
963
|
-
* @permissionScope Manage Stores - all permissions
|
|
964
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
965
|
-
* @permissionScope Manage Products
|
|
966
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
967
|
-
* @applicableIdentity APP
|
|
968
|
-
*/
|
|
969
|
-
export function removeProductMediaFromChoices(_id, media) {
|
|
970
|
-
var _a, _b, _c;
|
|
971
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
972
|
-
const requestTransformation = { id: '$[0]', media: '$[1]' };
|
|
973
|
-
const responseTransformation = '$';
|
|
974
|
-
// @ts-ignore
|
|
975
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
976
|
-
const { toAmbassadorRequest } = serializer({
|
|
977
|
-
rootSchema: _removeProductMediaFromChoicesRequest,
|
|
978
|
-
depSchemas: {},
|
|
979
|
-
fqdnTransformation: {
|
|
980
|
-
paths: [],
|
|
981
|
-
transformation: _fromVeloEntity,
|
|
982
|
-
},
|
|
983
|
-
customTransformation: requestTransformation,
|
|
984
|
-
});
|
|
985
|
-
const { fromJSON } = serializer({
|
|
986
|
-
rootSchema: _removeProductMediaFromChoicesResponse,
|
|
987
|
-
depSchemas: {},
|
|
988
|
-
fqdnTransformation: {
|
|
989
|
-
paths: [],
|
|
990
|
-
transformation: _toVeloEntity,
|
|
991
|
-
},
|
|
992
|
-
customTransformation: responseTransformation,
|
|
993
|
-
});
|
|
994
|
-
const payload = toAmbassadorRequest([_id, media]);
|
|
995
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.removeProductMediaFromChoices(payload);
|
|
996
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
997
|
-
try {
|
|
998
|
-
const result = yield httpClient.request(reqOpts);
|
|
999
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1000
|
-
}
|
|
1001
|
-
catch (err) {
|
|
1002
|
-
const transformedError = sdkTransformError(err, {
|
|
1003
|
-
spreadPathsToArguments: {},
|
|
1004
|
-
explicitPathsToArguments: { id: '$[0]', media: '$[1]' },
|
|
1005
|
-
singleArgumentUnchanged: false,
|
|
1006
|
-
}, ['_id', 'media']);
|
|
1007
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1008
|
-
throw transformedError;
|
|
1009
|
-
}
|
|
1010
|
-
});
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Delete all options from a specific product. Only available when [variant management](https://support.wix.com/en/article/wix-stores-adding-and-customizing-product-options#setting-different-prices-for-variants) is disabled.
|
|
1014
|
-
* @param _id - ID of the product with options to delete.
|
|
1015
|
-
* @public
|
|
1016
|
-
* @requiredField _id
|
|
1017
|
-
* @permissionScope Manage Stores - all permissions
|
|
1018
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1019
|
-
* @permissionScope Manage Products
|
|
1020
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1021
|
-
* @applicableIdentity APP
|
|
1022
|
-
*/
|
|
1023
|
-
export function deleteProductOptions(_id) {
|
|
1024
|
-
var _a, _b, _c;
|
|
1025
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1026
|
-
const requestTransformation = { id: '$[0]' };
|
|
1027
|
-
const responseTransformation = '$';
|
|
1028
|
-
// @ts-ignore
|
|
1029
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1030
|
-
const { toAmbassadorRequest } = serializer({
|
|
1031
|
-
rootSchema: _deleteProductOptionsRequest,
|
|
1032
|
-
depSchemas: {},
|
|
1033
|
-
fqdnTransformation: {
|
|
1034
|
-
paths: [],
|
|
1035
|
-
transformation: _fromVeloEntity,
|
|
1036
|
-
},
|
|
1037
|
-
customTransformation: requestTransformation,
|
|
1038
|
-
});
|
|
1039
|
-
const { fromJSON } = serializer({
|
|
1040
|
-
rootSchema: _deleteProductOptionsResponse,
|
|
1041
|
-
depSchemas: {},
|
|
1042
|
-
fqdnTransformation: {
|
|
1043
|
-
paths: [],
|
|
1044
|
-
transformation: _toVeloEntity,
|
|
1045
|
-
},
|
|
1046
|
-
customTransformation: responseTransformation,
|
|
1047
|
-
});
|
|
1048
|
-
const payload = toAmbassadorRequest([_id]);
|
|
1049
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.deleteProductOptions(payload);
|
|
1050
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1051
|
-
try {
|
|
1052
|
-
const result = yield httpClient.request(reqOpts);
|
|
1053
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1054
|
-
}
|
|
1055
|
-
catch (err) {
|
|
1056
|
-
const transformedError = sdkTransformError(err, {
|
|
1057
|
-
spreadPathsToArguments: {},
|
|
1058
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1059
|
-
singleArgumentUnchanged: false,
|
|
1060
|
-
}, ['_id']);
|
|
1061
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1062
|
-
throw transformedError;
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
/**
|
|
1067
|
-
* Deletes a product's brand.
|
|
1068
|
-
* @param _id - Product ID.
|
|
1069
|
-
* @public
|
|
1070
|
-
* @documentationMaturity preview
|
|
1071
|
-
* @requiredField _id
|
|
1072
|
-
* @permissionScope Manage Stores - all permissions
|
|
1073
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1074
|
-
* @permissionScope Manage Products
|
|
1075
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1076
|
-
* @applicableIdentity APP
|
|
1077
|
-
*/
|
|
1078
|
-
export function removeBrand(_id) {
|
|
1079
|
-
var _a, _b, _c;
|
|
1080
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1081
|
-
const requestTransformation = { id: '$[0]' };
|
|
1082
|
-
const responseTransformation = '$';
|
|
1083
|
-
// @ts-ignore
|
|
1084
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1085
|
-
const { toAmbassadorRequest } = serializer({
|
|
1086
|
-
rootSchema: _removeProductBrandRequest,
|
|
1087
|
-
depSchemas: {},
|
|
1088
|
-
fqdnTransformation: {
|
|
1089
|
-
paths: [],
|
|
1090
|
-
transformation: _fromVeloEntity,
|
|
1091
|
-
},
|
|
1092
|
-
customTransformation: requestTransformation,
|
|
1093
|
-
});
|
|
1094
|
-
const { fromJSON } = serializer({
|
|
1095
|
-
rootSchema: _removeProductBrandResponse,
|
|
1096
|
-
depSchemas: {},
|
|
1097
|
-
fqdnTransformation: {
|
|
1098
|
-
paths: [],
|
|
1099
|
-
transformation: _toVeloEntity,
|
|
1100
|
-
},
|
|
1101
|
-
customTransformation: responseTransformation,
|
|
1102
|
-
});
|
|
1103
|
-
const payload = toAmbassadorRequest([_id]);
|
|
1104
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.removeBrand(payload);
|
|
1105
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1106
|
-
try {
|
|
1107
|
-
const result = yield httpClient.request(reqOpts);
|
|
1108
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1109
|
-
}
|
|
1110
|
-
catch (err) {
|
|
1111
|
-
const transformedError = sdkTransformError(err, {
|
|
1112
|
-
spreadPathsToArguments: {},
|
|
1113
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1114
|
-
singleArgumentUnchanged: false,
|
|
1115
|
-
}, ['_id']);
|
|
1116
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1117
|
-
throw transformedError;
|
|
1118
|
-
}
|
|
1119
|
-
});
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* Creates a new collection.
|
|
1123
|
-
* @param collection - Collection info.
|
|
1124
|
-
* @public
|
|
1125
|
-
* @documentationMaturity preview
|
|
1126
|
-
* @requiredField collection
|
|
1127
|
-
* @requiredField collection.name
|
|
1128
|
-
* @permissionScope Manage Stores - all permissions
|
|
1129
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1130
|
-
* @permissionScope Manage Products
|
|
1131
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1132
|
-
* @applicableIdentity APP
|
|
1133
|
-
*/
|
|
1134
|
-
export function createCollection(collection) {
|
|
1135
|
-
var _a, _b, _c;
|
|
1136
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1137
|
-
const requestTransformation = { collection: '$[0]' };
|
|
1138
|
-
const responseTransformation = '$';
|
|
1139
|
-
// @ts-ignore
|
|
1140
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1141
|
-
const { toAmbassadorRequest } = serializer({
|
|
1142
|
-
rootSchema: _createCollectionRequest,
|
|
1143
|
-
depSchemas: {},
|
|
1144
|
-
fqdnTransformation: {
|
|
1145
|
-
paths: [],
|
|
1146
|
-
transformation: _fromVeloEntity,
|
|
1147
|
-
},
|
|
1148
|
-
customTransformation: requestTransformation,
|
|
1149
|
-
});
|
|
1150
|
-
const { fromJSON } = serializer({
|
|
1151
|
-
rootSchema: _createCollectionResponse,
|
|
1152
|
-
depSchemas: {},
|
|
1153
|
-
fqdnTransformation: {
|
|
1154
|
-
paths: [],
|
|
1155
|
-
transformation: _toVeloEntity,
|
|
1156
|
-
},
|
|
1157
|
-
customTransformation: responseTransformation,
|
|
1158
|
-
});
|
|
1159
|
-
const payload = toAmbassadorRequest([collection]);
|
|
1160
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.createCollection(payload);
|
|
1161
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1162
|
-
try {
|
|
1163
|
-
const result = yield httpClient.request(reqOpts);
|
|
1164
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1165
|
-
return fromJSON(result.data);
|
|
1166
|
-
}
|
|
1167
|
-
catch (err) {
|
|
1168
|
-
const transformedError = sdkTransformError(err, {
|
|
1169
|
-
spreadPathsToArguments: {},
|
|
1170
|
-
explicitPathsToArguments: { collection: '$[0]' },
|
|
1171
|
-
singleArgumentUnchanged: false,
|
|
1172
|
-
}, ['collection']);
|
|
1173
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1174
|
-
throw transformedError;
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
}
|
|
1178
|
-
/**
|
|
1179
|
-
* Updates specified properties of a collection. To add products to a collection, call the [addProductsToCollection](#addproductstocollection) function.
|
|
1180
|
-
* @param _id - Collection ID (generated automatically by the catalog).
|
|
1181
|
-
* @public
|
|
1182
|
-
* @requiredField _id
|
|
1183
|
-
* @requiredField collection
|
|
1184
|
-
* @param collection - Collection info to update.
|
|
1185
|
-
* @permissionScope Manage Stores - all permissions
|
|
1186
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1187
|
-
* @permissionScope Manage Products
|
|
1188
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1189
|
-
* @applicableIdentity APP
|
|
1190
|
-
*/
|
|
1191
|
-
export function updateCollection(_id, collection) {
|
|
1192
|
-
var _a, _b, _c;
|
|
1193
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1194
|
-
const requestTransformation = { collection: { '*': '$[1]', id: '$[0]' } };
|
|
1195
|
-
const responseTransformation = '$';
|
|
1196
|
-
// @ts-ignore
|
|
1197
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1198
|
-
const { toAmbassadorRequest } = serializer({
|
|
1199
|
-
rootSchema: _updateCollectionRequest,
|
|
1200
|
-
depSchemas: {},
|
|
1201
|
-
fqdnTransformation: {
|
|
1202
|
-
paths: [],
|
|
1203
|
-
transformation: _fromVeloEntity,
|
|
1204
|
-
},
|
|
1205
|
-
customTransformation: requestTransformation,
|
|
1206
|
-
});
|
|
1207
|
-
const { fromJSON } = serializer({
|
|
1208
|
-
rootSchema: _updateCollectionResponse,
|
|
1209
|
-
depSchemas: {},
|
|
1210
|
-
fqdnTransformation: {
|
|
1211
|
-
paths: [],
|
|
1212
|
-
transformation: _toVeloEntity,
|
|
1213
|
-
},
|
|
1214
|
-
customTransformation: responseTransformation,
|
|
1215
|
-
});
|
|
1216
|
-
const payload = toAmbassadorRequest([_id, collection]);
|
|
1217
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.updateCollection(payload);
|
|
1218
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1219
|
-
try {
|
|
1220
|
-
const result = yield httpClient.request(reqOpts);
|
|
1221
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1222
|
-
return fromJSON(result.data);
|
|
1223
|
-
}
|
|
1224
|
-
catch (err) {
|
|
1225
|
-
const transformedError = sdkTransformError(err, {
|
|
1226
|
-
spreadPathsToArguments: { collection: '$[1]' },
|
|
1227
|
-
explicitPathsToArguments: { 'collection.id': '$[0]' },
|
|
1228
|
-
singleArgumentUnchanged: false,
|
|
1229
|
-
}, ['_id', 'collection']);
|
|
1230
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1231
|
-
throw transformedError;
|
|
1232
|
-
}
|
|
1233
|
-
});
|
|
1234
|
-
}
|
|
1235
|
-
/**
|
|
1236
|
-
* Deletes a collection.
|
|
1237
|
-
* @public
|
|
1238
|
-
* @requiredField _id
|
|
1239
|
-
* @param _id - ID of the collection to delete.
|
|
1240
|
-
* @permissionScope Manage Stores - all permissions
|
|
1241
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1242
|
-
* @permissionScope Manage Products
|
|
1243
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1244
|
-
* @applicableIdentity APP
|
|
1245
|
-
*/
|
|
1246
|
-
export function deleteCollection(_id) {
|
|
1247
|
-
var _a, _b, _c;
|
|
1248
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1249
|
-
const requestTransformation = { id: '$[0]' };
|
|
1250
|
-
const responseTransformation = '$';
|
|
1251
|
-
// @ts-ignore
|
|
1252
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1253
|
-
const { toAmbassadorRequest } = serializer({
|
|
1254
|
-
rootSchema: _deleteCollectionRequest,
|
|
1255
|
-
depSchemas: {},
|
|
1256
|
-
fqdnTransformation: {
|
|
1257
|
-
paths: [],
|
|
1258
|
-
transformation: _fromVeloEntity,
|
|
1259
|
-
},
|
|
1260
|
-
customTransformation: requestTransformation,
|
|
1261
|
-
});
|
|
1262
|
-
const { fromJSON } = serializer({
|
|
1263
|
-
rootSchema: _deleteCollectionResponse,
|
|
1264
|
-
depSchemas: {},
|
|
1265
|
-
fqdnTransformation: {
|
|
1266
|
-
paths: [],
|
|
1267
|
-
transformation: _toVeloEntity,
|
|
1268
|
-
},
|
|
1269
|
-
customTransformation: responseTransformation,
|
|
1270
|
-
});
|
|
1271
|
-
const payload = toAmbassadorRequest([_id]);
|
|
1272
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.deleteCollection(payload);
|
|
1273
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1274
|
-
try {
|
|
1275
|
-
const result = yield httpClient.request(reqOpts);
|
|
1276
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1277
|
-
}
|
|
1278
|
-
catch (err) {
|
|
1279
|
-
const transformedError = sdkTransformError(err, {
|
|
1280
|
-
spreadPathsToArguments: {},
|
|
1281
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1282
|
-
singleArgumentUnchanged: false,
|
|
1283
|
-
}, ['_id']);
|
|
1284
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1285
|
-
throw transformedError;
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
/**
|
|
1290
|
-
* Deletes a product's ribbon.
|
|
1291
|
-
* @param _id - Product ID.
|
|
1292
|
-
* @public
|
|
1293
|
-
* @documentationMaturity preview
|
|
1294
|
-
* @requiredField _id
|
|
1295
|
-
* @permissionScope Manage Stores - all permissions
|
|
1296
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1297
|
-
* @permissionScope Manage Products
|
|
1298
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1299
|
-
* @applicableIdentity APP
|
|
1300
|
-
*/
|
|
1301
|
-
export function removeRibbon(_id) {
|
|
1302
|
-
var _a, _b, _c;
|
|
1303
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1304
|
-
const requestTransformation = { id: '$[0]' };
|
|
1305
|
-
const responseTransformation = '$';
|
|
1306
|
-
// @ts-ignore
|
|
1307
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1308
|
-
const { toAmbassadorRequest } = serializer({
|
|
1309
|
-
rootSchema: _removeProductRibbonRequest,
|
|
1310
|
-
depSchemas: {},
|
|
1311
|
-
fqdnTransformation: {
|
|
1312
|
-
paths: [],
|
|
1313
|
-
transformation: _fromVeloEntity,
|
|
1314
|
-
},
|
|
1315
|
-
customTransformation: requestTransformation,
|
|
1316
|
-
});
|
|
1317
|
-
const { fromJSON } = serializer({
|
|
1318
|
-
rootSchema: _removeProductRibbonResponse,
|
|
1319
|
-
depSchemas: {},
|
|
1320
|
-
fqdnTransformation: {
|
|
1321
|
-
paths: [],
|
|
1322
|
-
transformation: _toVeloEntity,
|
|
1323
|
-
},
|
|
1324
|
-
customTransformation: responseTransformation,
|
|
1325
|
-
});
|
|
1326
|
-
const payload = toAmbassadorRequest([_id]);
|
|
1327
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.removeRibbon(payload);
|
|
1328
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1329
|
-
try {
|
|
1330
|
-
const result = yield httpClient.request(reqOpts);
|
|
1331
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1332
|
-
}
|
|
1333
|
-
catch (err) {
|
|
1334
|
-
const transformedError = sdkTransformError(err, {
|
|
1335
|
-
spreadPathsToArguments: {},
|
|
1336
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1337
|
-
singleArgumentUnchanged: false,
|
|
1338
|
-
}, ['_id']);
|
|
1339
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1340
|
-
throw transformedError;
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
* Updates a specified property for up to 100 products at a time.
|
|
1346
|
-
* @param ids - Product IDs.
|
|
1347
|
-
* @param set - Field to update.
|
|
1348
|
-
* @public
|
|
1349
|
-
* @documentationMaturity preview
|
|
1350
|
-
* @requiredField ids
|
|
1351
|
-
* @requiredField set
|
|
1352
|
-
* @permissionScope Manage Stores - all permissions
|
|
1353
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1354
|
-
* @permissionScope Manage Products
|
|
1355
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1356
|
-
* @applicableIdentity APP
|
|
1357
|
-
*/
|
|
1358
|
-
export function bulkUpdateProductsProperty(ids, set) {
|
|
1359
|
-
var _a, _b, _c;
|
|
1360
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1361
|
-
const requestTransformation = { ids: '$[0]', set: '$[1]' };
|
|
1362
|
-
const responseTransformation = '$';
|
|
1363
|
-
// @ts-ignore
|
|
1364
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1365
|
-
const { toAmbassadorRequest } = serializer({
|
|
1366
|
-
rootSchema: _bulkUpdateProductsRequest,
|
|
1367
|
-
depSchemas: {},
|
|
1368
|
-
fqdnTransformation: {
|
|
1369
|
-
paths: [],
|
|
1370
|
-
transformation: _fromVeloEntity,
|
|
1371
|
-
},
|
|
1372
|
-
customTransformation: requestTransformation,
|
|
1373
|
-
});
|
|
1374
|
-
const { fromJSON } = serializer({
|
|
1375
|
-
rootSchema: _bulkUpdateProductsResponse,
|
|
1376
|
-
depSchemas: {},
|
|
1377
|
-
fqdnTransformation: {
|
|
1378
|
-
paths: [],
|
|
1379
|
-
transformation: _toVeloEntity,
|
|
1380
|
-
},
|
|
1381
|
-
customTransformation: responseTransformation,
|
|
1382
|
-
});
|
|
1383
|
-
const payload = toAmbassadorRequest([ids, set]);
|
|
1384
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.bulkUpdateProducts(payload);
|
|
1385
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1386
|
-
try {
|
|
1387
|
-
const result = yield httpClient.request(reqOpts);
|
|
1388
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1389
|
-
return fromJSON(result.data);
|
|
1390
|
-
}
|
|
1391
|
-
catch (err) {
|
|
1392
|
-
const transformedError = sdkTransformError(err, {
|
|
1393
|
-
spreadPathsToArguments: {},
|
|
1394
|
-
explicitPathsToArguments: { ids: '$[0]', set: '$[1]' },
|
|
1395
|
-
singleArgumentUnchanged: false,
|
|
1396
|
-
}, ['ids', 'set']);
|
|
1397
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1398
|
-
throw transformedError;
|
|
1399
|
-
}
|
|
1400
|
-
});
|
|
1401
|
-
}
|
|
1402
|
-
/**
|
|
1403
|
-
* Adjusts a specified numerical property for up to 100 products at a time.
|
|
1404
|
-
* The property can be increased or decreased either by percentage or amount.
|
|
1405
|
-
* @param adjust - Numerical property to adjust.
|
|
1406
|
-
* @param ids - Product IDs.
|
|
1407
|
-
* @public
|
|
1408
|
-
* @documentationMaturity preview
|
|
1409
|
-
* @requiredField adjust
|
|
1410
|
-
* @requiredField ids
|
|
1411
|
-
* @permissionScope Manage Stores - all permissions
|
|
1412
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1413
|
-
* @permissionScope Manage Products
|
|
1414
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1415
|
-
* @applicableIdentity APP
|
|
1416
|
-
*/
|
|
1417
|
-
export function bulkAdjustProductProperty(adjust, ids) {
|
|
1418
|
-
var _a, _b, _c;
|
|
1419
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1420
|
-
const requestTransformation = { adjust: '$[0]', ids: '$[1]' };
|
|
1421
|
-
const responseTransformation = '$';
|
|
1422
|
-
// @ts-ignore
|
|
1423
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1424
|
-
const { toAmbassadorRequest } = serializer({
|
|
1425
|
-
rootSchema: _bulkAdjustProductPropertiesRequest,
|
|
1426
|
-
depSchemas: {},
|
|
1427
|
-
fqdnTransformation: {
|
|
1428
|
-
paths: [],
|
|
1429
|
-
transformation: _fromVeloEntity,
|
|
1430
|
-
},
|
|
1431
|
-
customTransformation: requestTransformation,
|
|
1432
|
-
});
|
|
1433
|
-
const { fromJSON } = serializer({
|
|
1434
|
-
rootSchema: _bulkAdjustProductPropertiesResponse,
|
|
1435
|
-
depSchemas: {},
|
|
1436
|
-
fqdnTransformation: {
|
|
1437
|
-
paths: [],
|
|
1438
|
-
transformation: _toVeloEntity,
|
|
1439
|
-
},
|
|
1440
|
-
customTransformation: responseTransformation,
|
|
1441
|
-
});
|
|
1442
|
-
const payload = toAmbassadorRequest([adjust, ids]);
|
|
1443
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.bulkAdjustProductProperties(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: { adjust: '$[0]', ids: '$[1]' },
|
|
1454
|
-
singleArgumentUnchanged: false,
|
|
1455
|
-
}, ['adjust', 'ids']);
|
|
1456
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1457
|
-
throw transformedError;
|
|
1458
|
-
}
|
|
1459
|
-
});
|
|
1460
|
-
}
|
|
1461
|
-
/**
|
|
1462
|
-
* Creates a new product.
|
|
1463
|
-
* @param product - Product information.
|
|
1464
|
-
* @public
|
|
1465
|
-
* @documentationMaturity preview
|
|
1466
|
-
* @requiredField product
|
|
1467
|
-
* @requiredField product.costAndProfitData.itemCost
|
|
1468
|
-
* @requiredField product.name
|
|
1469
|
-
* @requiredField product.priceData
|
|
1470
|
-
* @requiredField product.priceData.price
|
|
1471
|
-
*/
|
|
1472
|
-
export function writeProxyCreateProductPlatformized(product) {
|
|
1473
|
-
var _a, _b, _c;
|
|
1474
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1475
|
-
const requestTransformation = { product: '$[0]' };
|
|
1476
|
-
const responseTransformation = '$.product';
|
|
1477
|
-
// @ts-ignore
|
|
1478
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1479
|
-
const { toAmbassadorRequest } = serializer({
|
|
1480
|
-
rootSchema: _v1CreateProductPlatformizedRequest,
|
|
1481
|
-
depSchemas: {},
|
|
1482
|
-
fqdnTransformation: {
|
|
1483
|
-
paths: [...['product']],
|
|
1484
|
-
transformation: _fromVeloEntity,
|
|
1485
|
-
},
|
|
1486
|
-
customTransformation: requestTransformation,
|
|
1487
|
-
});
|
|
1488
|
-
const { fromJSON } = serializer({
|
|
1489
|
-
rootSchema: _v1CreateProductPlatformizedResponse,
|
|
1490
|
-
depSchemas: {},
|
|
1491
|
-
fqdnTransformation: {
|
|
1492
|
-
paths: [...['product']],
|
|
1493
|
-
transformation: _toVeloEntity,
|
|
1494
|
-
},
|
|
1495
|
-
customTransformation: responseTransformation,
|
|
1496
|
-
});
|
|
1497
|
-
const payload = toAmbassadorRequest([product]);
|
|
1498
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.writeProxyCreateProductPlatformized(payload);
|
|
1499
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1500
|
-
try {
|
|
1501
|
-
const result = yield httpClient.request(reqOpts);
|
|
1502
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1503
|
-
return fromJSON(result.data);
|
|
1504
|
-
}
|
|
1505
|
-
catch (err) {
|
|
1506
|
-
const transformedError = sdkTransformError(err, {
|
|
1507
|
-
spreadPathsToArguments: {},
|
|
1508
|
-
explicitPathsToArguments: { product: '$[0]' },
|
|
1509
|
-
singleArgumentUnchanged: false,
|
|
1510
|
-
}, ['product']);
|
|
1511
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1512
|
-
throw transformedError;
|
|
1513
|
-
}
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
/**
|
|
1517
|
-
* Updates specified fields in a product.
|
|
1518
|
-
* @param _id - Product ID (generated automatically by the catalog).
|
|
1519
|
-
* @public
|
|
1520
|
-
* @documentationMaturity preview
|
|
1521
|
-
* @requiredField _id
|
|
1522
|
-
* @requiredField product
|
|
1523
|
-
*/
|
|
1524
|
-
export function writeProxyUpdateProductPlatformized(_id, product) {
|
|
1525
|
-
var _a, _b, _c;
|
|
1526
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1527
|
-
const requestTransformation = { product: { '*': '$[1]', id: '$[0]' } };
|
|
1528
|
-
const responseTransformation = '$.product';
|
|
1529
|
-
// @ts-ignore
|
|
1530
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1531
|
-
const { toAmbassadorRequest } = serializer({
|
|
1532
|
-
rootSchema: _v1UpdateProductPlatformizedRequest,
|
|
1533
|
-
depSchemas: {},
|
|
1534
|
-
fqdnTransformation: {
|
|
1535
|
-
paths: [...['product']],
|
|
1536
|
-
transformation: _fromVeloEntity,
|
|
1537
|
-
},
|
|
1538
|
-
customTransformation: requestTransformation,
|
|
1539
|
-
});
|
|
1540
|
-
const { fromJSON } = serializer({
|
|
1541
|
-
rootSchema: _v1UpdateProductPlatformizedResponse,
|
|
1542
|
-
depSchemas: {},
|
|
1543
|
-
fqdnTransformation: {
|
|
1544
|
-
paths: [...['product']],
|
|
1545
|
-
transformation: _toVeloEntity,
|
|
1546
|
-
},
|
|
1547
|
-
customTransformation: responseTransformation,
|
|
1548
|
-
});
|
|
1549
|
-
const payload = toAmbassadorRequest([_id, product]);
|
|
1550
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.writeProxyUpdateProductPlatformized(payload);
|
|
1551
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1552
|
-
try {
|
|
1553
|
-
const result = yield httpClient.request(reqOpts);
|
|
1554
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1555
|
-
return fromJSON(result.data);
|
|
1556
|
-
}
|
|
1557
|
-
catch (err) {
|
|
1558
|
-
const transformedError = sdkTransformError(err, {
|
|
1559
|
-
spreadPathsToArguments: { product: '$[1]' },
|
|
1560
|
-
explicitPathsToArguments: { 'product.id': '$[0]' },
|
|
1561
|
-
singleArgumentUnchanged: false,
|
|
1562
|
-
}, ['_id', 'product']);
|
|
1563
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1564
|
-
throw transformedError;
|
|
1565
|
-
}
|
|
1566
|
-
});
|
|
1567
|
-
}
|
|
1568
|
-
/**
|
|
1569
|
-
* Deletes a product.
|
|
1570
|
-
* @param _id - ID of the product to delete.
|
|
1571
|
-
* @public
|
|
1572
|
-
* @documentationMaturity preview
|
|
1573
|
-
* @requiredField _id
|
|
1574
|
-
*/
|
|
1575
|
-
export function writeProxyDeleteProductPlatformized(_id) {
|
|
1576
|
-
var _a, _b, _c;
|
|
1577
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1578
|
-
const requestTransformation = { id: '$[0]' };
|
|
1579
|
-
const responseTransformation = '$';
|
|
1580
|
-
// @ts-ignore
|
|
1581
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1582
|
-
const { toAmbassadorRequest } = serializer({
|
|
1583
|
-
rootSchema: _v1DeleteProductPlatformizedRequest,
|
|
1584
|
-
depSchemas: {},
|
|
1585
|
-
fqdnTransformation: {
|
|
1586
|
-
paths: [],
|
|
1587
|
-
transformation: _fromVeloEntity,
|
|
1588
|
-
},
|
|
1589
|
-
customTransformation: requestTransformation,
|
|
1590
|
-
});
|
|
1591
|
-
const { fromJSON } = serializer({
|
|
1592
|
-
rootSchema: _v1DeleteProductPlatformizedResponse,
|
|
1593
|
-
depSchemas: {},
|
|
1594
|
-
fqdnTransformation: {
|
|
1595
|
-
paths: [],
|
|
1596
|
-
transformation: _toVeloEntity,
|
|
1597
|
-
},
|
|
1598
|
-
customTransformation: responseTransformation,
|
|
1599
|
-
});
|
|
1600
|
-
const payload = toAmbassadorRequest([_id]);
|
|
1601
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.writeProxyDeleteProductPlatformized(payload);
|
|
1602
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1603
|
-
try {
|
|
1604
|
-
const result = yield httpClient.request(reqOpts);
|
|
1605
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1606
|
-
}
|
|
1607
|
-
catch (err) {
|
|
1608
|
-
const transformedError = sdkTransformError(err, {
|
|
1609
|
-
spreadPathsToArguments: {},
|
|
1610
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1611
|
-
singleArgumentUnchanged: false,
|
|
1612
|
-
}, ['_id']);
|
|
1613
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1614
|
-
throw transformedError;
|
|
1615
|
-
}
|
|
1616
|
-
});
|
|
1617
|
-
}
|
|
1618
|
-
/**
|
|
1619
|
-
* Returns a list of up to 100 products, given the provided paging, sorting and filtering.
|
|
1620
|
-
* @public
|
|
1621
|
-
* @documentationMaturity preview
|
|
1622
|
-
* @permissionScope Manage Stores - all permissions
|
|
1623
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1624
|
-
* @permissionScope Manage Products
|
|
1625
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1626
|
-
* @permissionScope Read Stores - all read permissions
|
|
1627
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1628
|
-
* @permissionScope Read Products
|
|
1629
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
1630
|
-
* @permissionScope Manage Orders
|
|
1631
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1632
|
-
* @applicableIdentity APP
|
|
1633
|
-
* @applicableIdentity MEMBER
|
|
1634
|
-
* @applicableIdentity VISITOR
|
|
1635
|
-
*/
|
|
1636
|
-
export function queryProducts() {
|
|
1637
|
-
const requestTransformation = { '*': '$[1]', query: '$[0]' };
|
|
1638
|
-
const responseTransformation = {
|
|
1639
|
-
items: '$.products',
|
|
1640
|
-
pagingMetadata: '$.metadata',
|
|
1641
|
-
};
|
|
1642
|
-
// @ts-ignore
|
|
1643
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
1644
|
-
const { toAmbassadorRequest } = serializer({
|
|
1645
|
-
rootSchema: _queryProductsPlatformizedRequest,
|
|
1646
|
-
depSchemas: {},
|
|
1647
|
-
fqdnTransformation: {
|
|
1648
|
-
paths: [],
|
|
1649
|
-
transformation: _fromVeloEntity,
|
|
1650
|
-
},
|
|
1651
|
-
customTransformation: requestTransformation,
|
|
1652
|
-
});
|
|
1653
|
-
const { fromJSON } = serializer({
|
|
1654
|
-
rootSchema: _queryProductsPlatformizedResponse,
|
|
1655
|
-
depSchemas: {},
|
|
1656
|
-
fqdnTransformation: {
|
|
1657
|
-
paths: [...['Array#products']],
|
|
1658
|
-
transformation: _toVeloEntity,
|
|
1659
|
-
},
|
|
1660
|
-
customTransformation: responseTransformation,
|
|
1661
|
-
});
|
|
1662
|
-
return wrapWithQueryBuilder({
|
|
1663
|
-
func: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
1664
|
-
var _a, _b, _c;
|
|
1665
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.queryProductsPlatformized(payload);
|
|
1666
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1667
|
-
try {
|
|
1668
|
-
const result = yield httpClient.request(reqOpts);
|
|
1669
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1670
|
-
return result;
|
|
1671
|
-
}
|
|
1672
|
-
catch (err) {
|
|
1673
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1674
|
-
throw err;
|
|
1675
|
-
}
|
|
1676
|
-
}),
|
|
1677
|
-
requestTransformer: (...args) => toAmbassadorRequest(args),
|
|
1678
|
-
responseTransformer: ({ data }) => fromJSON(data),
|
|
1679
|
-
errorTransformer: (err) => {
|
|
1680
|
-
const transformedError = transformError(err, requestTransformation);
|
|
1681
|
-
throw transformedError;
|
|
1682
|
-
},
|
|
1683
|
-
pagingMethod: 'OFFSET',
|
|
1684
|
-
transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
|
|
1685
|
-
})({ cursorWithEmptyFilterAndSort: true });
|
|
1686
|
-
}
|
|
1687
|
-
/**
|
|
1688
|
-
* Retrieves a product with the provided ID.
|
|
1689
|
-
* @param _id - Requested product ID.
|
|
1690
|
-
* @public
|
|
1691
|
-
* @documentationMaturity preview
|
|
1692
|
-
* @requiredField _id
|
|
1693
|
-
* @permissionScope Manage Stores - all permissions
|
|
1694
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1695
|
-
* @permissionScope Manage Products
|
|
1696
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1697
|
-
* @permissionScope Read Stores - all read permissions
|
|
1698
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1699
|
-
* @permissionScope Read Products
|
|
1700
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
1701
|
-
* @permissionScope Manage Orders
|
|
1702
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1703
|
-
* @applicableIdentity APP
|
|
1704
|
-
* @applicableIdentity MEMBER
|
|
1705
|
-
* @applicableIdentity VISITOR
|
|
1706
|
-
*/
|
|
1707
|
-
export function getProduct(_id, options) {
|
|
1708
|
-
var _a, _b, _c;
|
|
1709
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1710
|
-
const requestTransformation = {
|
|
1711
|
-
id: '$[0]',
|
|
1712
|
-
includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
|
|
1713
|
-
};
|
|
1714
|
-
const responseTransformation = '$';
|
|
1715
|
-
// @ts-ignore
|
|
1716
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1717
|
-
const { toAmbassadorRequest } = serializer({
|
|
1718
|
-
rootSchema: _getProductRequest,
|
|
1719
|
-
depSchemas: {},
|
|
1720
|
-
fqdnTransformation: {
|
|
1721
|
-
paths: [],
|
|
1722
|
-
transformation: _fromVeloEntity,
|
|
1723
|
-
},
|
|
1724
|
-
customTransformation: requestTransformation,
|
|
1725
|
-
});
|
|
1726
|
-
const { fromJSON } = serializer({
|
|
1727
|
-
rootSchema: _getProductResponse,
|
|
1728
|
-
depSchemas: {},
|
|
1729
|
-
fqdnTransformation: {
|
|
1730
|
-
paths: [...['product']],
|
|
1731
|
-
transformation: _toVeloEntity,
|
|
1732
|
-
},
|
|
1733
|
-
customTransformation: responseTransformation,
|
|
1734
|
-
});
|
|
1735
|
-
const payload = toAmbassadorRequest([_id, options]);
|
|
1736
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.getProduct(payload);
|
|
1737
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1738
|
-
try {
|
|
1739
|
-
const result = yield httpClient.request(reqOpts);
|
|
1740
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1741
|
-
return fromJSON(result.data);
|
|
1742
|
-
}
|
|
1743
|
-
catch (err) {
|
|
1744
|
-
const transformedError = sdkTransformError(err, {
|
|
1745
|
-
spreadPathsToArguments: {},
|
|
1746
|
-
explicitPathsToArguments: {
|
|
1747
|
-
id: '$[0]',
|
|
1748
|
-
includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
|
|
1749
|
-
},
|
|
1750
|
-
singleArgumentUnchanged: false,
|
|
1751
|
-
}, ['_id', 'options']);
|
|
1752
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1753
|
-
throw transformedError;
|
|
1754
|
-
}
|
|
1755
|
-
});
|
|
1756
|
-
}
|
|
1757
|
-
/**
|
|
1758
|
-
* Retrieves a product with the provided ID.
|
|
1759
|
-
* @param _id - Requested product ID.
|
|
1760
|
-
* @public
|
|
1761
|
-
* @documentationMaturity preview
|
|
1762
|
-
* @requiredField _id
|
|
1763
|
-
* @permissionScope Manage Stores - all permissions
|
|
1764
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1765
|
-
* @permissionScope Manage Products
|
|
1766
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1767
|
-
* @permissionScope Read Stores - all read permissions
|
|
1768
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1769
|
-
* @permissionScope Read Products
|
|
1770
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
1771
|
-
* @permissionScope Manage Orders
|
|
1772
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1773
|
-
* @applicableIdentity APP
|
|
1774
|
-
* @applicableIdentity MEMBER
|
|
1775
|
-
* @applicableIdentity VISITOR
|
|
1776
|
-
* @returns Requested product data.
|
|
1777
|
-
*/
|
|
1778
|
-
export function getProductPlatformized(_id, options) {
|
|
1779
|
-
var _a, _b, _c;
|
|
1780
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1781
|
-
const requestTransformation = {
|
|
1782
|
-
id: '$[0]',
|
|
1783
|
-
includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
|
|
1784
|
-
};
|
|
1785
|
-
const responseTransformation = '$.product';
|
|
1786
|
-
// @ts-ignore
|
|
1787
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1788
|
-
const { toAmbassadorRequest } = serializer({
|
|
1789
|
-
rootSchema: _getProductPlatformizedRequest,
|
|
1790
|
-
depSchemas: {},
|
|
1791
|
-
fqdnTransformation: {
|
|
1792
|
-
paths: [],
|
|
1793
|
-
transformation: _fromVeloEntity,
|
|
1794
|
-
},
|
|
1795
|
-
customTransformation: requestTransformation,
|
|
1796
|
-
});
|
|
1797
|
-
const { fromJSON } = serializer({
|
|
1798
|
-
rootSchema: _getProductPlatformizedResponse,
|
|
1799
|
-
depSchemas: {},
|
|
1800
|
-
fqdnTransformation: {
|
|
1801
|
-
paths: [...['product']],
|
|
1802
|
-
transformation: _toVeloEntity,
|
|
1803
|
-
},
|
|
1804
|
-
customTransformation: responseTransformation,
|
|
1805
|
-
});
|
|
1806
|
-
const payload = toAmbassadorRequest([_id, options]);
|
|
1807
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.getProductPlatformized(payload);
|
|
1808
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1809
|
-
try {
|
|
1810
|
-
const result = yield httpClient.request(reqOpts);
|
|
1811
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1812
|
-
return fromJSON(result.data);
|
|
1813
|
-
}
|
|
1814
|
-
catch (err) {
|
|
1815
|
-
const transformedError = sdkTransformError(err, {
|
|
1816
|
-
spreadPathsToArguments: {},
|
|
1817
|
-
explicitPathsToArguments: {
|
|
1818
|
-
id: '$[0]',
|
|
1819
|
-
includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
|
|
1820
|
-
},
|
|
1821
|
-
singleArgumentUnchanged: false,
|
|
1822
|
-
}, ['_id', 'options']);
|
|
1823
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1824
|
-
throw transformedError;
|
|
1825
|
-
}
|
|
1826
|
-
});
|
|
1827
|
-
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Retrieves a collection with the provided slug.
|
|
1830
|
-
* @param slug - Slug of the collection to retrieve.
|
|
1831
|
-
* @public
|
|
1832
|
-
* @requiredField slug
|
|
1833
|
-
* @permissionScope Manage Stores - all permissions
|
|
1834
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1835
|
-
* @permissionScope Manage Products
|
|
1836
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1837
|
-
* @permissionScope Read Stores - all read permissions
|
|
1838
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1839
|
-
* @permissionScope Read Products
|
|
1840
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
1841
|
-
* @permissionScope Manage Orders
|
|
1842
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1843
|
-
* @applicableIdentity APP
|
|
1844
|
-
* @applicableIdentity MEMBER
|
|
1845
|
-
* @applicableIdentity VISITOR
|
|
1846
|
-
*/
|
|
1847
|
-
export function getCollectionBySlug(slug) {
|
|
1848
|
-
var _a, _b, _c;
|
|
1849
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1850
|
-
const requestTransformation = { slug: '$[0]' };
|
|
1851
|
-
const responseTransformation = '$';
|
|
1852
|
-
// @ts-ignore
|
|
1853
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1854
|
-
const { toAmbassadorRequest } = serializer({
|
|
1855
|
-
rootSchema: _getCollectionBySlugRequest,
|
|
1856
|
-
depSchemas: {},
|
|
1857
|
-
fqdnTransformation: {
|
|
1858
|
-
paths: [],
|
|
1859
|
-
transformation: _fromVeloEntity,
|
|
1860
|
-
},
|
|
1861
|
-
customTransformation: requestTransformation,
|
|
1862
|
-
});
|
|
1863
|
-
const { fromJSON } = serializer({
|
|
1864
|
-
rootSchema: _getCollectionBySlugResponse,
|
|
1865
|
-
depSchemas: {},
|
|
1866
|
-
fqdnTransformation: {
|
|
1867
|
-
paths: [],
|
|
1868
|
-
transformation: _toVeloEntity,
|
|
1869
|
-
},
|
|
1870
|
-
customTransformation: responseTransformation,
|
|
1871
|
-
});
|
|
1872
|
-
const payload = toAmbassadorRequest([slug]);
|
|
1873
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.getCollectionBySlug(payload);
|
|
1874
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1875
|
-
try {
|
|
1876
|
-
const result = yield httpClient.request(reqOpts);
|
|
1877
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1878
|
-
return fromJSON(result.data);
|
|
1879
|
-
}
|
|
1880
|
-
catch (err) {
|
|
1881
|
-
const transformedError = sdkTransformError(err, {
|
|
1882
|
-
spreadPathsToArguments: {},
|
|
1883
|
-
explicitPathsToArguments: { slug: '$[0]' },
|
|
1884
|
-
singleArgumentUnchanged: false,
|
|
1885
|
-
}, ['slug']);
|
|
1886
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1887
|
-
throw transformedError;
|
|
1888
|
-
}
|
|
1889
|
-
});
|
|
1890
|
-
}
|
|
1891
|
-
/**
|
|
1892
|
-
* Gets the availability of relevant product variants based on the product ID and selections provided. See [Use Cases](https://dev.wix.com/api/rest/wix-stores/catalog/use-cases) for an example.
|
|
1893
|
-
* @param _id - Requested product ID.
|
|
1894
|
-
* @param options - Array containing the selected options. For example, `["color": "Blue", "size": "Large"]`.
|
|
1895
|
-
* @public
|
|
1896
|
-
* @requiredField _id
|
|
1897
|
-
* @requiredField options
|
|
1898
|
-
* @permissionScope Manage Stores - all permissions
|
|
1899
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1900
|
-
* @permissionScope Manage Products
|
|
1901
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1902
|
-
* @permissionScope Read Stores - all read permissions
|
|
1903
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1904
|
-
* @permissionScope Read Products
|
|
1905
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
1906
|
-
* @permissionScope Manage Orders
|
|
1907
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1908
|
-
* @applicableIdentity APP
|
|
1909
|
-
* @applicableIdentity MEMBER
|
|
1910
|
-
* @applicableIdentity VISITOR
|
|
1911
|
-
*/
|
|
1912
|
-
export function getProductOptionsAvailability(_id, options) {
|
|
1913
|
-
var _a, _b, _c;
|
|
1914
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1915
|
-
const requestTransformation = { id: '$[0]', options: '$[1]' };
|
|
1916
|
-
const responseTransformation = '$';
|
|
1917
|
-
// @ts-ignore
|
|
1918
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1919
|
-
const { toAmbassadorRequest } = serializer({
|
|
1920
|
-
rootSchema: _productOptionsAvailabilityRequest,
|
|
1921
|
-
depSchemas: {},
|
|
1922
|
-
fqdnTransformation: {
|
|
1923
|
-
paths: [],
|
|
1924
|
-
transformation: _fromVeloEntity,
|
|
1925
|
-
},
|
|
1926
|
-
customTransformation: requestTransformation,
|
|
1927
|
-
});
|
|
1928
|
-
const { fromJSON } = serializer({
|
|
1929
|
-
rootSchema: _productOptionsAvailabilityResponse,
|
|
1930
|
-
depSchemas: {},
|
|
1931
|
-
fqdnTransformation: {
|
|
1932
|
-
paths: [],
|
|
1933
|
-
transformation: _toVeloEntity,
|
|
1934
|
-
},
|
|
1935
|
-
customTransformation: responseTransformation,
|
|
1936
|
-
});
|
|
1937
|
-
const payload = toAmbassadorRequest([_id, options]);
|
|
1938
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.productOptionsAvailability(payload);
|
|
1939
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
1940
|
-
try {
|
|
1941
|
-
const result = yield httpClient.request(reqOpts);
|
|
1942
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
1943
|
-
return fromJSON(result.data);
|
|
1944
|
-
}
|
|
1945
|
-
catch (err) {
|
|
1946
|
-
const transformedError = sdkTransformError(err, {
|
|
1947
|
-
spreadPathsToArguments: {},
|
|
1948
|
-
explicitPathsToArguments: { id: '$[0]', options: '$[1]' },
|
|
1949
|
-
singleArgumentUnchanged: false,
|
|
1950
|
-
}, ['_id', 'options']);
|
|
1951
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
1952
|
-
throw transformedError;
|
|
1953
|
-
}
|
|
1954
|
-
});
|
|
1955
|
-
}
|
|
1956
|
-
/**
|
|
1957
|
-
* Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs.
|
|
1958
|
-
* See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.
|
|
1959
|
-
* @param _id - Requested product ID.
|
|
1960
|
-
* @public
|
|
1961
|
-
* @documentationMaturity preview
|
|
1962
|
-
* @requiredField _id
|
|
1963
|
-
* @permissionScope Manage Stores - all permissions
|
|
1964
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1965
|
-
* @permissionScope Manage Products
|
|
1966
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1967
|
-
* @permissionScope Read Stores - all read permissions
|
|
1968
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1969
|
-
* @permissionScope Read Products
|
|
1970
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
1971
|
-
* @permissionScope Manage Orders
|
|
1972
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1973
|
-
* @applicableIdentity APP
|
|
1974
|
-
* @applicableIdentity MEMBER
|
|
1975
|
-
* @applicableIdentity VISITOR
|
|
1976
|
-
*/
|
|
1977
|
-
export function queryProductVariants(_id, options) {
|
|
1978
|
-
var _a, _b, _c;
|
|
1979
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
1980
|
-
const requestTransformation = {
|
|
1981
|
-
id: '$[0]',
|
|
1982
|
-
choices: '$[1].choices',
|
|
1983
|
-
variantIds: '$[1].variantIds',
|
|
1984
|
-
paging: '$[1].paging',
|
|
1985
|
-
includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
|
|
1986
|
-
};
|
|
1987
|
-
const responseTransformation = '$';
|
|
1988
|
-
// @ts-ignore
|
|
1989
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1990
|
-
const { toAmbassadorRequest } = serializer({
|
|
1991
|
-
rootSchema: _queryProductVariantsRequest,
|
|
1992
|
-
depSchemas: {},
|
|
1993
|
-
fqdnTransformation: {
|
|
1994
|
-
paths: [],
|
|
1995
|
-
transformation: _fromVeloEntity,
|
|
1996
|
-
},
|
|
1997
|
-
customTransformation: requestTransformation,
|
|
1998
|
-
});
|
|
1999
|
-
const { fromJSON } = serializer({
|
|
2000
|
-
rootSchema: _queryProductVariantsResponse,
|
|
2001
|
-
depSchemas: {},
|
|
2002
|
-
fqdnTransformation: {
|
|
2003
|
-
paths: [],
|
|
2004
|
-
transformation: _toVeloEntity,
|
|
2005
|
-
},
|
|
2006
|
-
customTransformation: responseTransformation,
|
|
2007
|
-
});
|
|
2008
|
-
const payload = toAmbassadorRequest([_id, options]);
|
|
2009
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.queryProductVariants(payload);
|
|
2010
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
2011
|
-
try {
|
|
2012
|
-
const result = yield httpClient.request(reqOpts);
|
|
2013
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
2014
|
-
return fromJSON(result.data);
|
|
2015
|
-
}
|
|
2016
|
-
catch (err) {
|
|
2017
|
-
const transformedError = sdkTransformError(err, {
|
|
2018
|
-
spreadPathsToArguments: {},
|
|
2019
|
-
explicitPathsToArguments: {
|
|
2020
|
-
id: '$[0]',
|
|
2021
|
-
choices: '$[1].choices',
|
|
2022
|
-
variantIds: '$[1].variantIds',
|
|
2023
|
-
paging: '$[1].paging',
|
|
2024
|
-
includeMerchantSpecificData: '$[1].includeMerchantSpecificData',
|
|
2025
|
-
},
|
|
2026
|
-
singleArgumentUnchanged: false,
|
|
2027
|
-
}, ['_id', 'options']);
|
|
2028
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
2029
|
-
throw transformedError;
|
|
2030
|
-
}
|
|
2031
|
-
});
|
|
2032
|
-
}
|
|
2033
|
-
/**
|
|
2034
|
-
* Retrieves up to 100 store variants, given the provided paging, filtering, and sorting.
|
|
2035
|
-
* @param query - Query options.
|
|
2036
|
-
* @public
|
|
2037
|
-
* @documentationMaturity preview
|
|
2038
|
-
* @requiredField query
|
|
2039
|
-
* @permissionScope Manage Stores - all permissions
|
|
2040
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2041
|
-
* @permissionScope Manage Products
|
|
2042
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2043
|
-
* @permissionScope Read Stores - all read permissions
|
|
2044
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2045
|
-
* @permissionScope Read Products
|
|
2046
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2047
|
-
* @permissionScope Manage Orders
|
|
2048
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2049
|
-
* @applicableIdentity APP
|
|
2050
|
-
* @applicableIdentity MEMBER
|
|
2051
|
-
* @applicableIdentity VISITOR
|
|
2052
|
-
*/
|
|
2053
|
-
export function queryStoreVariants(query) {
|
|
2054
|
-
var _a, _b, _c;
|
|
2055
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
2056
|
-
const requestTransformation = { query: '$[0]' };
|
|
2057
|
-
const responseTransformation = '$';
|
|
2058
|
-
// @ts-ignore
|
|
2059
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
2060
|
-
const { toAmbassadorRequest } = serializer({
|
|
2061
|
-
rootSchema: _queryStoreVariantsRequest,
|
|
2062
|
-
depSchemas: {},
|
|
2063
|
-
fqdnTransformation: {
|
|
2064
|
-
paths: [],
|
|
2065
|
-
transformation: _fromVeloEntity,
|
|
2066
|
-
},
|
|
2067
|
-
customTransformation: requestTransformation,
|
|
2068
|
-
});
|
|
2069
|
-
const { fromJSON } = serializer({
|
|
2070
|
-
rootSchema: _queryStoreVariantsResponse,
|
|
2071
|
-
depSchemas: { _platformMedia, _storeVariant },
|
|
2072
|
-
fqdnTransformation: {
|
|
2073
|
-
paths: [],
|
|
2074
|
-
transformation: _toVeloEntity,
|
|
2075
|
-
},
|
|
2076
|
-
customTransformation: responseTransformation,
|
|
2077
|
-
});
|
|
2078
|
-
const payload = toAmbassadorRequest([query]);
|
|
2079
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.queryStoreVariants(payload);
|
|
2080
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
2081
|
-
try {
|
|
2082
|
-
const result = yield httpClient.request(reqOpts);
|
|
2083
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
2084
|
-
return fromJSON(result.data);
|
|
2085
|
-
}
|
|
2086
|
-
catch (err) {
|
|
2087
|
-
const transformedError = sdkTransformError(err, {
|
|
2088
|
-
spreadPathsToArguments: {},
|
|
2089
|
-
explicitPathsToArguments: { query: '$[0]' },
|
|
2090
|
-
singleArgumentUnchanged: false,
|
|
2091
|
-
}, ['query']);
|
|
2092
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
2093
|
-
throw transformedError;
|
|
2094
|
-
}
|
|
2095
|
-
});
|
|
2096
|
-
}
|
|
2097
|
-
/**
|
|
2098
|
-
* Retrieves a store variant with the provided ID.
|
|
2099
|
-
* @param _id - Store variant ID. Comprised of the `productId` and the `variantId`, separated by a hyphen. For example, `{productId}-{variantId}`.
|
|
2100
|
-
* @public
|
|
2101
|
-
* @documentationMaturity preview
|
|
2102
|
-
* @requiredField _id
|
|
2103
|
-
* @permissionScope Manage Stores - all permissions
|
|
2104
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2105
|
-
* @permissionScope Manage Products
|
|
2106
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2107
|
-
* @permissionScope Read Stores - all read permissions
|
|
2108
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2109
|
-
* @permissionScope Read Products
|
|
2110
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2111
|
-
* @permissionScope Manage Orders
|
|
2112
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2113
|
-
* @applicableIdentity APP
|
|
2114
|
-
* @applicableIdentity MEMBER
|
|
2115
|
-
* @applicableIdentity VISITOR
|
|
2116
|
-
*/
|
|
2117
|
-
export function getStoreVariant(_id) {
|
|
2118
|
-
var _a, _b, _c;
|
|
2119
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
2120
|
-
const requestTransformation = { id: '$[0]' };
|
|
2121
|
-
const responseTransformation = '$';
|
|
2122
|
-
// @ts-ignore
|
|
2123
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
2124
|
-
const { toAmbassadorRequest } = serializer({
|
|
2125
|
-
rootSchema: _getStoreVariantRequest,
|
|
2126
|
-
depSchemas: {},
|
|
2127
|
-
fqdnTransformation: {
|
|
2128
|
-
paths: [],
|
|
2129
|
-
transformation: _fromVeloEntity,
|
|
2130
|
-
},
|
|
2131
|
-
customTransformation: requestTransformation,
|
|
2132
|
-
});
|
|
2133
|
-
const { fromJSON } = serializer({
|
|
2134
|
-
rootSchema: _getStoreVariantResponse,
|
|
2135
|
-
depSchemas: { _platformMedia, _storeVariant },
|
|
2136
|
-
fqdnTransformation: {
|
|
2137
|
-
paths: [],
|
|
2138
|
-
transformation: _toVeloEntity,
|
|
2139
|
-
},
|
|
2140
|
-
customTransformation: responseTransformation,
|
|
2141
|
-
});
|
|
2142
|
-
const payload = toAmbassadorRequest([_id]);
|
|
2143
|
-
const reqOpts = ambassadorWixStoresCatalogV1Product.getStoreVariant(payload);
|
|
2144
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
2145
|
-
try {
|
|
2146
|
-
const result = yield httpClient.request(reqOpts);
|
|
2147
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
2148
|
-
return fromJSON(result.data);
|
|
2149
|
-
}
|
|
2150
|
-
catch (err) {
|
|
2151
|
-
const transformedError = sdkTransformError(err, {
|
|
2152
|
-
spreadPathsToArguments: {},
|
|
2153
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
2154
|
-
singleArgumentUnchanged: false,
|
|
2155
|
-
}, ['_id']);
|
|
2156
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
2157
|
-
throw transformedError;
|
|
2158
|
-
}
|
|
2159
|
-
});
|
|
2160
|
-
}
|
|
2161
|
-
//# sourceMappingURL=stores-catalog-v1-product.universal.js.map
|