@wix/auto_sdk_stores_products-v-3 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.context.js +127 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.http.js +5527 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.meta.js +522 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.public.js +690 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.types.js +886 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8300 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.universal.js +3404 -0
- package/build/cjs/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.context.js +40 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.http.js +5498 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.meta.js +470 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.public.js +577 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.types.js +882 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8300 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.universal.js +3350 -0
- package/build/es/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.context.js +127 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.http.js +5527 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.meta.js +522 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.public.js +690 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.types.js +886 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8320 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.universal.js +3404 -0
- package/build/internal/cjs/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.context.d.ts +40 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.context.js +40 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.context.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.http.d.ts +200 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.http.js +5498 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.http.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.meta.d.ts +50 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.meta.js +470 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.meta.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.public.d.ts +332 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.public.js +577 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.public.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.types.d.ts +6737 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.types.js +882 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.types.js.map +1 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.universal.d.ts +8320 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.universal.js +3350 -0
- package/build/internal/es/src/stores-catalog-v3-product-products-v-3.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,3404 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SingleEntityOpsRequestedFields = exports.WebhookIdentityType = exports.State = exports.Enum = exports.V3ProductType = exports.SecuredMediaFileType = exports.ProductMediaMediaType = exports.CommonSortOrder = exports.DiscountType = exports.SubscriptionFrequency = exports.FileType = exports.WeightUnit = exports.MeasurementUnit = exports.ProductType = exports.ProductPreorderAvailability = exports.PreorderStatus = exports.InventoryAvailabilityStatus = exports.ModifierRenderType = exports.ChoiceType = exports.ProductOptionRenderType = exports.MediaType = exports.NullValue = exports.VerticalAlignment = exports.Direction = exports.InitialExpandedItems = exports.AppType = exports.FontType = exports.DecorationType = exports.BackgroundType = exports.PollLayoutDirection = exports.PollLayoutType = exports.VoteRole = exports.ViewRole = exports.MapType = exports.Source = exports.GIFType = exports.ThumbnailsAlignment = exports.Crop = exports.Orientation = exports.LayoutType = exports.ViewMode = exports.Alignment = exports.Width = exports.LineStyle = exports.TextAlignment = exports.Target = exports.Type = exports.PluginContainerDataAlignment = exports.WidthType = exports.NodeType = void 0;
|
|
27
|
+
exports.countProducts = exports.queryProducts = exports.searchProducts = exports.getProductBySlug = exports.getProduct = exports.bulkDeleteProductsByFilter = exports.bulkDeleteProducts = exports.deleteProduct = exports.updateExtendedFields = exports.bulkUpdateProductsByFilter = exports.bulkUpdateProductsWithInventory = exports.bulkUpdateProducts = exports.bulkCreateProductsWithInventory = exports.bulkCreateProducts = exports.updateProductWithInventory = exports.updateProduct = exports.createProductWithInventory = exports.createProduct = exports.RoundingStrategy = exports.VariantsOpsRequestedFields = exports.SearchDetailsMode = exports.CommonAggregationType = exports.DateHistogramAggregationInterval = exports.NestedAggregationNestedAggregationType = exports.CommonScalarType = exports.ValueAggregationMissingValues = exports.ValueAggregationSortDirection = exports.ValueAggregationSortType = exports.WixCommonSortOrder = exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.BulkAdjustProductVariantsByFilterRequestRoundingStrategy = exports.WixCommonAggregationType = exports.AggregationDateHistogramAggregationInterval = exports.AggregationNestedAggregationNestedAggregationType = exports.WixCommonScalarType = exports.AggregationValueAggregationMissingValues = exports.AggregationValueAggregationSortDirection = exports.AggregationValueAggregationSortType = exports.UpstreamWixCommonSortOrder = exports.CommonSearchDetailsMode = exports.RequestedFields = exports.AvailabilityStatus = void 0;
|
|
28
|
+
exports.bulkRemoveProductsFromCategoriesByFilter = exports.bulkAddProductsToCategoriesByFilter = exports.bulkRemoveInfoSectionsFromProducts = exports.bulkRemoveInfoSectionsFromProductsByFilter = exports.bulkAddInfoSectionsToProducts = exports.bulkAddInfoSectionsToProductsByFilter = exports.bulkAdjustProductVariantsByFilter = exports.bulkUpdateProductVariantsByFilter = void 0;
|
|
29
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
30
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
31
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
32
|
+
const ambassadorWixStoresCatalogV3Product = __importStar(require("./stores-catalog-v3-product-products-v-3.http.js"));
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
35
|
+
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
36
|
+
const video_v2_1 = require("@wix/sdk-runtime/transformations/video-v2");
|
|
37
|
+
const video_v2_2 = require("@wix/sdk-runtime/transformations/video-v2");
|
|
38
|
+
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
39
|
+
const page_url_v2_2 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
40
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
41
|
+
var NodeType;
|
|
42
|
+
(function (NodeType) {
|
|
43
|
+
NodeType["PARAGRAPH"] = "PARAGRAPH";
|
|
44
|
+
NodeType["TEXT"] = "TEXT";
|
|
45
|
+
NodeType["HEADING"] = "HEADING";
|
|
46
|
+
NodeType["BULLETED_LIST"] = "BULLETED_LIST";
|
|
47
|
+
NodeType["ORDERED_LIST"] = "ORDERED_LIST";
|
|
48
|
+
NodeType["LIST_ITEM"] = "LIST_ITEM";
|
|
49
|
+
NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
|
|
50
|
+
NodeType["CODE_BLOCK"] = "CODE_BLOCK";
|
|
51
|
+
NodeType["VIDEO"] = "VIDEO";
|
|
52
|
+
NodeType["DIVIDER"] = "DIVIDER";
|
|
53
|
+
NodeType["FILE"] = "FILE";
|
|
54
|
+
NodeType["GALLERY"] = "GALLERY";
|
|
55
|
+
NodeType["GIF"] = "GIF";
|
|
56
|
+
NodeType["HTML"] = "HTML";
|
|
57
|
+
NodeType["IMAGE"] = "IMAGE";
|
|
58
|
+
NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
|
|
59
|
+
/** @deprecated */
|
|
60
|
+
NodeType["MAP"] = "MAP";
|
|
61
|
+
NodeType["POLL"] = "POLL";
|
|
62
|
+
NodeType["APP_EMBED"] = "APP_EMBED";
|
|
63
|
+
NodeType["BUTTON"] = "BUTTON";
|
|
64
|
+
NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
|
|
65
|
+
NodeType["TABLE"] = "TABLE";
|
|
66
|
+
NodeType["EMBED"] = "EMBED";
|
|
67
|
+
NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
|
|
68
|
+
NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
|
|
69
|
+
NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
|
|
70
|
+
NodeType["TABLE_CELL"] = "TABLE_CELL";
|
|
71
|
+
NodeType["TABLE_ROW"] = "TABLE_ROW";
|
|
72
|
+
NodeType["EXTERNAL"] = "EXTERNAL";
|
|
73
|
+
NodeType["AUDIO"] = "AUDIO";
|
|
74
|
+
NodeType["CAPTION"] = "CAPTION";
|
|
75
|
+
NodeType["LAYOUT"] = "LAYOUT";
|
|
76
|
+
NodeType["LAYOUT_CELL"] = "LAYOUT_CELL";
|
|
77
|
+
})(NodeType || (exports.NodeType = NodeType = {}));
|
|
78
|
+
var WidthType;
|
|
79
|
+
(function (WidthType) {
|
|
80
|
+
/** Width matches the content width */
|
|
81
|
+
WidthType["CONTENT"] = "CONTENT";
|
|
82
|
+
/** Small Width */
|
|
83
|
+
WidthType["SMALL"] = "SMALL";
|
|
84
|
+
/** Width will match the original asset width */
|
|
85
|
+
WidthType["ORIGINAL"] = "ORIGINAL";
|
|
86
|
+
/** coast-to-coast display */
|
|
87
|
+
WidthType["FULL_WIDTH"] = "FULL_WIDTH";
|
|
88
|
+
})(WidthType || (exports.WidthType = WidthType = {}));
|
|
89
|
+
var PluginContainerDataAlignment;
|
|
90
|
+
(function (PluginContainerDataAlignment) {
|
|
91
|
+
/** Center Alignment */
|
|
92
|
+
PluginContainerDataAlignment["CENTER"] = "CENTER";
|
|
93
|
+
/** Left Alignment */
|
|
94
|
+
PluginContainerDataAlignment["LEFT"] = "LEFT";
|
|
95
|
+
/** Right Alignment */
|
|
96
|
+
PluginContainerDataAlignment["RIGHT"] = "RIGHT";
|
|
97
|
+
})(PluginContainerDataAlignment || (exports.PluginContainerDataAlignment = PluginContainerDataAlignment = {}));
|
|
98
|
+
var Type;
|
|
99
|
+
(function (Type) {
|
|
100
|
+
/** Regular link button */
|
|
101
|
+
Type["LINK"] = "LINK";
|
|
102
|
+
/** Triggers custom action that is defined in plugin configuration by the consumer */
|
|
103
|
+
Type["ACTION"] = "ACTION";
|
|
104
|
+
})(Type || (exports.Type = Type = {}));
|
|
105
|
+
var Target;
|
|
106
|
+
(function (Target) {
|
|
107
|
+
/** Opens the linked document in the same frame as it was clicked (this is default) */
|
|
108
|
+
Target["SELF"] = "SELF";
|
|
109
|
+
/** Opens the linked document in a new window or tab */
|
|
110
|
+
Target["BLANK"] = "BLANK";
|
|
111
|
+
/** Opens the linked document in the parent frame */
|
|
112
|
+
Target["PARENT"] = "PARENT";
|
|
113
|
+
/** Opens the linked document in the full body of the window */
|
|
114
|
+
Target["TOP"] = "TOP";
|
|
115
|
+
})(Target || (exports.Target = Target = {}));
|
|
116
|
+
var TextAlignment;
|
|
117
|
+
(function (TextAlignment) {
|
|
118
|
+
/** browser default, eqivalent to `initial` */
|
|
119
|
+
TextAlignment["AUTO"] = "AUTO";
|
|
120
|
+
/** Left align */
|
|
121
|
+
TextAlignment["LEFT"] = "LEFT";
|
|
122
|
+
/** Right align */
|
|
123
|
+
TextAlignment["RIGHT"] = "RIGHT";
|
|
124
|
+
/** Center align */
|
|
125
|
+
TextAlignment["CENTER"] = "CENTER";
|
|
126
|
+
/** Text is spaced to line up its left and right edges to the left and right edges of the line box, except for the last line */
|
|
127
|
+
TextAlignment["JUSTIFY"] = "JUSTIFY";
|
|
128
|
+
})(TextAlignment || (exports.TextAlignment = TextAlignment = {}));
|
|
129
|
+
var LineStyle;
|
|
130
|
+
(function (LineStyle) {
|
|
131
|
+
/** Single Line */
|
|
132
|
+
LineStyle["SINGLE"] = "SINGLE";
|
|
133
|
+
/** Double Line */
|
|
134
|
+
LineStyle["DOUBLE"] = "DOUBLE";
|
|
135
|
+
/** Dashed Line */
|
|
136
|
+
LineStyle["DASHED"] = "DASHED";
|
|
137
|
+
/** Dotted Line */
|
|
138
|
+
LineStyle["DOTTED"] = "DOTTED";
|
|
139
|
+
})(LineStyle || (exports.LineStyle = LineStyle = {}));
|
|
140
|
+
var Width;
|
|
141
|
+
(function (Width) {
|
|
142
|
+
/** Large line */
|
|
143
|
+
Width["LARGE"] = "LARGE";
|
|
144
|
+
/** Medium line */
|
|
145
|
+
Width["MEDIUM"] = "MEDIUM";
|
|
146
|
+
/** Small line */
|
|
147
|
+
Width["SMALL"] = "SMALL";
|
|
148
|
+
})(Width || (exports.Width = Width = {}));
|
|
149
|
+
var Alignment;
|
|
150
|
+
(function (Alignment) {
|
|
151
|
+
/** Center alignment */
|
|
152
|
+
Alignment["CENTER"] = "CENTER";
|
|
153
|
+
/** Left alignment */
|
|
154
|
+
Alignment["LEFT"] = "LEFT";
|
|
155
|
+
/** Right alignment */
|
|
156
|
+
Alignment["RIGHT"] = "RIGHT";
|
|
157
|
+
})(Alignment || (exports.Alignment = Alignment = {}));
|
|
158
|
+
var ViewMode;
|
|
159
|
+
(function (ViewMode) {
|
|
160
|
+
/** No PDF view */
|
|
161
|
+
ViewMode["NONE"] = "NONE";
|
|
162
|
+
/** Full PDF view */
|
|
163
|
+
ViewMode["FULL"] = "FULL";
|
|
164
|
+
/** Mini PDF view */
|
|
165
|
+
ViewMode["MINI"] = "MINI";
|
|
166
|
+
})(ViewMode || (exports.ViewMode = ViewMode = {}));
|
|
167
|
+
var LayoutType;
|
|
168
|
+
(function (LayoutType) {
|
|
169
|
+
/** Collage type */
|
|
170
|
+
LayoutType["COLLAGE"] = "COLLAGE";
|
|
171
|
+
/** Masonry type */
|
|
172
|
+
LayoutType["MASONRY"] = "MASONRY";
|
|
173
|
+
/** Grid type */
|
|
174
|
+
LayoutType["GRID"] = "GRID";
|
|
175
|
+
/** Thumbnail type */
|
|
176
|
+
LayoutType["THUMBNAIL"] = "THUMBNAIL";
|
|
177
|
+
/** Slider type */
|
|
178
|
+
LayoutType["SLIDER"] = "SLIDER";
|
|
179
|
+
/** Slideshow type */
|
|
180
|
+
LayoutType["SLIDESHOW"] = "SLIDESHOW";
|
|
181
|
+
/** Panorama type */
|
|
182
|
+
LayoutType["PANORAMA"] = "PANORAMA";
|
|
183
|
+
/** Column type */
|
|
184
|
+
LayoutType["COLUMN"] = "COLUMN";
|
|
185
|
+
/** Magic type */
|
|
186
|
+
LayoutType["MAGIC"] = "MAGIC";
|
|
187
|
+
/** Fullsize images type */
|
|
188
|
+
LayoutType["FULLSIZE"] = "FULLSIZE";
|
|
189
|
+
})(LayoutType || (exports.LayoutType = LayoutType = {}));
|
|
190
|
+
var Orientation;
|
|
191
|
+
(function (Orientation) {
|
|
192
|
+
/** Rows Orientation */
|
|
193
|
+
Orientation["ROWS"] = "ROWS";
|
|
194
|
+
/** Columns Orientation */
|
|
195
|
+
Orientation["COLUMNS"] = "COLUMNS";
|
|
196
|
+
})(Orientation || (exports.Orientation = Orientation = {}));
|
|
197
|
+
var Crop;
|
|
198
|
+
(function (Crop) {
|
|
199
|
+
/** Crop to fill */
|
|
200
|
+
Crop["FILL"] = "FILL";
|
|
201
|
+
/** Crop to fit */
|
|
202
|
+
Crop["FIT"] = "FIT";
|
|
203
|
+
})(Crop || (exports.Crop = Crop = {}));
|
|
204
|
+
var ThumbnailsAlignment;
|
|
205
|
+
(function (ThumbnailsAlignment) {
|
|
206
|
+
/** Top alignment */
|
|
207
|
+
ThumbnailsAlignment["TOP"] = "TOP";
|
|
208
|
+
/** Right alignment */
|
|
209
|
+
ThumbnailsAlignment["RIGHT"] = "RIGHT";
|
|
210
|
+
/** Bottom alignment */
|
|
211
|
+
ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
|
|
212
|
+
/** Left alignment */
|
|
213
|
+
ThumbnailsAlignment["LEFT"] = "LEFT";
|
|
214
|
+
/** No thumbnail */
|
|
215
|
+
ThumbnailsAlignment["NONE"] = "NONE";
|
|
216
|
+
})(ThumbnailsAlignment || (exports.ThumbnailsAlignment = ThumbnailsAlignment = {}));
|
|
217
|
+
var GIFType;
|
|
218
|
+
(function (GIFType) {
|
|
219
|
+
GIFType["GIF"] = "GIF";
|
|
220
|
+
GIFType["STICKER"] = "STICKER";
|
|
221
|
+
})(GIFType || (exports.GIFType = GIFType = {}));
|
|
222
|
+
var Source;
|
|
223
|
+
(function (Source) {
|
|
224
|
+
Source["HTML"] = "HTML";
|
|
225
|
+
Source["ADSENSE"] = "ADSENSE";
|
|
226
|
+
})(Source || (exports.Source = Source = {}));
|
|
227
|
+
var MapType;
|
|
228
|
+
(function (MapType) {
|
|
229
|
+
/** Roadmap map type */
|
|
230
|
+
MapType["ROADMAP"] = "ROADMAP";
|
|
231
|
+
/** Satellite map type */
|
|
232
|
+
MapType["SATELITE"] = "SATELITE";
|
|
233
|
+
/** Hybrid map type */
|
|
234
|
+
MapType["HYBRID"] = "HYBRID";
|
|
235
|
+
/** Terrain map type */
|
|
236
|
+
MapType["TERRAIN"] = "TERRAIN";
|
|
237
|
+
})(MapType || (exports.MapType = MapType = {}));
|
|
238
|
+
var ViewRole;
|
|
239
|
+
(function (ViewRole) {
|
|
240
|
+
/** Only Poll creator can view the results */
|
|
241
|
+
ViewRole["CREATOR"] = "CREATOR";
|
|
242
|
+
/** Anyone who voted can see the results */
|
|
243
|
+
ViewRole["VOTERS"] = "VOTERS";
|
|
244
|
+
/** Anyone can see the results, even if one didn't vote */
|
|
245
|
+
ViewRole["EVERYONE"] = "EVERYONE";
|
|
246
|
+
})(ViewRole || (exports.ViewRole = ViewRole = {}));
|
|
247
|
+
var VoteRole;
|
|
248
|
+
(function (VoteRole) {
|
|
249
|
+
/** Logged in member */
|
|
250
|
+
VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
|
|
251
|
+
/** Anyone */
|
|
252
|
+
VoteRole["ALL"] = "ALL";
|
|
253
|
+
})(VoteRole || (exports.VoteRole = VoteRole = {}));
|
|
254
|
+
var PollLayoutType;
|
|
255
|
+
(function (PollLayoutType) {
|
|
256
|
+
/** List */
|
|
257
|
+
PollLayoutType["LIST"] = "LIST";
|
|
258
|
+
/** Grid */
|
|
259
|
+
PollLayoutType["GRID"] = "GRID";
|
|
260
|
+
})(PollLayoutType || (exports.PollLayoutType = PollLayoutType = {}));
|
|
261
|
+
var PollLayoutDirection;
|
|
262
|
+
(function (PollLayoutDirection) {
|
|
263
|
+
/** Left-to-right */
|
|
264
|
+
PollLayoutDirection["LTR"] = "LTR";
|
|
265
|
+
/** Right-to-left */
|
|
266
|
+
PollLayoutDirection["RTL"] = "RTL";
|
|
267
|
+
})(PollLayoutDirection || (exports.PollLayoutDirection = PollLayoutDirection = {}));
|
|
268
|
+
var BackgroundType;
|
|
269
|
+
(function (BackgroundType) {
|
|
270
|
+
/** Color background type */
|
|
271
|
+
BackgroundType["COLOR"] = "COLOR";
|
|
272
|
+
/** Image background type */
|
|
273
|
+
BackgroundType["IMAGE"] = "IMAGE";
|
|
274
|
+
/** Gradiant background type */
|
|
275
|
+
BackgroundType["GRADIENT"] = "GRADIENT";
|
|
276
|
+
})(BackgroundType || (exports.BackgroundType = BackgroundType = {}));
|
|
277
|
+
var DecorationType;
|
|
278
|
+
(function (DecorationType) {
|
|
279
|
+
DecorationType["BOLD"] = "BOLD";
|
|
280
|
+
DecorationType["ITALIC"] = "ITALIC";
|
|
281
|
+
DecorationType["UNDERLINE"] = "UNDERLINE";
|
|
282
|
+
DecorationType["SPOILER"] = "SPOILER";
|
|
283
|
+
DecorationType["ANCHOR"] = "ANCHOR";
|
|
284
|
+
DecorationType["MENTION"] = "MENTION";
|
|
285
|
+
DecorationType["LINK"] = "LINK";
|
|
286
|
+
DecorationType["COLOR"] = "COLOR";
|
|
287
|
+
DecorationType["FONT_SIZE"] = "FONT_SIZE";
|
|
288
|
+
DecorationType["EXTERNAL"] = "EXTERNAL";
|
|
289
|
+
})(DecorationType || (exports.DecorationType = DecorationType = {}));
|
|
290
|
+
var FontType;
|
|
291
|
+
(function (FontType) {
|
|
292
|
+
FontType["PX"] = "PX";
|
|
293
|
+
FontType["EM"] = "EM";
|
|
294
|
+
})(FontType || (exports.FontType = FontType = {}));
|
|
295
|
+
var AppType;
|
|
296
|
+
(function (AppType) {
|
|
297
|
+
AppType["PRODUCT"] = "PRODUCT";
|
|
298
|
+
AppType["EVENT"] = "EVENT";
|
|
299
|
+
AppType["BOOKING"] = "BOOKING";
|
|
300
|
+
})(AppType || (exports.AppType = AppType = {}));
|
|
301
|
+
var InitialExpandedItems;
|
|
302
|
+
(function (InitialExpandedItems) {
|
|
303
|
+
/** First item will be expended initally */
|
|
304
|
+
InitialExpandedItems["FIRST"] = "FIRST";
|
|
305
|
+
/** All items will expended initally */
|
|
306
|
+
InitialExpandedItems["ALL"] = "ALL";
|
|
307
|
+
/** All items collapsed initally */
|
|
308
|
+
InitialExpandedItems["NONE"] = "NONE";
|
|
309
|
+
})(InitialExpandedItems || (exports.InitialExpandedItems = InitialExpandedItems = {}));
|
|
310
|
+
var Direction;
|
|
311
|
+
(function (Direction) {
|
|
312
|
+
/** Left-to-right */
|
|
313
|
+
Direction["LTR"] = "LTR";
|
|
314
|
+
/** Right-to-left */
|
|
315
|
+
Direction["RTL"] = "RTL";
|
|
316
|
+
})(Direction || (exports.Direction = Direction = {}));
|
|
317
|
+
var VerticalAlignment;
|
|
318
|
+
(function (VerticalAlignment) {
|
|
319
|
+
/** Top alignment */
|
|
320
|
+
VerticalAlignment["TOP"] = "TOP";
|
|
321
|
+
/** Middle alignment */
|
|
322
|
+
VerticalAlignment["MIDDLE"] = "MIDDLE";
|
|
323
|
+
/** Bottom alignment */
|
|
324
|
+
VerticalAlignment["BOTTOM"] = "BOTTOM";
|
|
325
|
+
})(VerticalAlignment || (exports.VerticalAlignment = VerticalAlignment = {}));
|
|
326
|
+
/**
|
|
327
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
328
|
+
* `Value` type union.
|
|
329
|
+
*
|
|
330
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
331
|
+
*/
|
|
332
|
+
var NullValue;
|
|
333
|
+
(function (NullValue) {
|
|
334
|
+
/** Null value. */
|
|
335
|
+
NullValue["NULL_VALUE"] = "NULL_VALUE";
|
|
336
|
+
})(NullValue || (exports.NullValue = NullValue = {}));
|
|
337
|
+
var MediaType;
|
|
338
|
+
(function (MediaType) {
|
|
339
|
+
MediaType["UNKNOWN_MEDIA_TYPE"] = "UNKNOWN_MEDIA_TYPE";
|
|
340
|
+
/** Image media type. */
|
|
341
|
+
MediaType["IMAGE"] = "IMAGE";
|
|
342
|
+
/** Video media type. */
|
|
343
|
+
MediaType["VIDEO"] = "VIDEO";
|
|
344
|
+
})(MediaType || (exports.MediaType = MediaType = {}));
|
|
345
|
+
var ProductOptionRenderType;
|
|
346
|
+
(function (ProductOptionRenderType) {
|
|
347
|
+
/** Not implemented. */
|
|
348
|
+
ProductOptionRenderType["UNKNOWN_OPTION_RENDER_TYPE"] = "UNKNOWN_OPTION_RENDER_TYPE";
|
|
349
|
+
/** Text choices. */
|
|
350
|
+
ProductOptionRenderType["TEXT_CHOICES"] = "TEXT_CHOICES";
|
|
351
|
+
/** Swatch choices. */
|
|
352
|
+
ProductOptionRenderType["SWATCH_CHOICES"] = "SWATCH_CHOICES";
|
|
353
|
+
})(ProductOptionRenderType || (exports.ProductOptionRenderType = ProductOptionRenderType = {}));
|
|
354
|
+
var ChoiceType;
|
|
355
|
+
(function (ChoiceType) {
|
|
356
|
+
ChoiceType["UNKNOWN_CHOICE_TYPE"] = "UNKNOWN_CHOICE_TYPE";
|
|
357
|
+
/** Text choice. */
|
|
358
|
+
ChoiceType["CHOICE_TEXT"] = "CHOICE_TEXT";
|
|
359
|
+
/** Single color choice. */
|
|
360
|
+
ChoiceType["ONE_COLOR"] = "ONE_COLOR";
|
|
361
|
+
/** Multiple colors choice. */
|
|
362
|
+
ChoiceType["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
|
|
363
|
+
/** Image choice. */
|
|
364
|
+
ChoiceType["IMAGE"] = "IMAGE";
|
|
365
|
+
})(ChoiceType || (exports.ChoiceType = ChoiceType = {}));
|
|
366
|
+
var ModifierRenderType;
|
|
367
|
+
(function (ModifierRenderType) {
|
|
368
|
+
/** Not implemented. */
|
|
369
|
+
ModifierRenderType["UNKNOWN_MODIFIER_RENDER_TYPE"] = "UNKNOWN_MODIFIER_RENDER_TYPE";
|
|
370
|
+
/** Free text. */
|
|
371
|
+
ModifierRenderType["FREE_TEXT"] = "FREE_TEXT";
|
|
372
|
+
/** Text choices. */
|
|
373
|
+
ModifierRenderType["TEXT_CHOICES"] = "TEXT_CHOICES";
|
|
374
|
+
/** Swatch choices. */
|
|
375
|
+
ModifierRenderType["SWATCH_CHOICES"] = "SWATCH_CHOICES";
|
|
376
|
+
})(ModifierRenderType || (exports.ModifierRenderType = ModifierRenderType = {}));
|
|
377
|
+
var InventoryAvailabilityStatus;
|
|
378
|
+
(function (InventoryAvailabilityStatus) {
|
|
379
|
+
InventoryAvailabilityStatus["UNKNOWN_AVAILABILITY_STATUS"] = "UNKNOWN_AVAILABILITY_STATUS";
|
|
380
|
+
/** All variants are in stock and available for purchase. */
|
|
381
|
+
InventoryAvailabilityStatus["IN_STOCK"] = "IN_STOCK";
|
|
382
|
+
/** All variants are out of stock. */
|
|
383
|
+
InventoryAvailabilityStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
384
|
+
/** Some variants are out of stock and some are in stock and available for purchase. */
|
|
385
|
+
InventoryAvailabilityStatus["PARTIALLY_OUT_OF_STOCK"] = "PARTIALLY_OUT_OF_STOCK";
|
|
386
|
+
})(InventoryAvailabilityStatus || (exports.InventoryAvailabilityStatus = InventoryAvailabilityStatus = {}));
|
|
387
|
+
var PreorderStatus;
|
|
388
|
+
(function (PreorderStatus) {
|
|
389
|
+
PreorderStatus["UNKNOWN_PREORDER_STATUS"] = "UNKNOWN_PREORDER_STATUS";
|
|
390
|
+
/** All variants are enabled for preorder. */
|
|
391
|
+
PreorderStatus["ENABLED"] = "ENABLED";
|
|
392
|
+
/** All variants are disabled for preorder. */
|
|
393
|
+
PreorderStatus["DISABLED"] = "DISABLED";
|
|
394
|
+
/** Some variants are disabled and some are enabled for preorder. */
|
|
395
|
+
PreorderStatus["PARTIALLY_ENABLED"] = "PARTIALLY_ENABLED";
|
|
396
|
+
})(PreorderStatus || (exports.PreorderStatus = PreorderStatus = {}));
|
|
397
|
+
var ProductPreorderAvailability;
|
|
398
|
+
(function (ProductPreorderAvailability) {
|
|
399
|
+
ProductPreorderAvailability["UNKNOWN_PREORDER_AVAILABILITY_STATUS"] = "UNKNOWN_PREORDER_AVAILABILITY_STATUS";
|
|
400
|
+
/** All the product variants are available for preorder. */
|
|
401
|
+
ProductPreorderAvailability["ALL_VARIANTS"] = "ALL_VARIANTS";
|
|
402
|
+
/** None of the product variants are available for preorder. */
|
|
403
|
+
ProductPreorderAvailability["NO_VARIANTS"] = "NO_VARIANTS";
|
|
404
|
+
/** Some of the product variants are available for preorder. */
|
|
405
|
+
ProductPreorderAvailability["SOME_VARIANTS"] = "SOME_VARIANTS";
|
|
406
|
+
})(ProductPreorderAvailability || (exports.ProductPreorderAvailability = ProductPreorderAvailability = {}));
|
|
407
|
+
var ProductType;
|
|
408
|
+
(function (ProductType) {
|
|
409
|
+
/** Not implemented. */
|
|
410
|
+
ProductType["UNKNOWN_PRODUCT_TYPE"] = "UNKNOWN_PRODUCT_TYPE";
|
|
411
|
+
/** Physical product. */
|
|
412
|
+
ProductType["PHYSICAL"] = "PHYSICAL";
|
|
413
|
+
/** Digital product. */
|
|
414
|
+
ProductType["DIGITAL"] = "DIGITAL";
|
|
415
|
+
})(ProductType || (exports.ProductType = ProductType = {}));
|
|
416
|
+
var MeasurementUnit;
|
|
417
|
+
(function (MeasurementUnit) {
|
|
418
|
+
MeasurementUnit["UNSPECIFIED"] = "UNSPECIFIED";
|
|
419
|
+
MeasurementUnit["ML"] = "ML";
|
|
420
|
+
MeasurementUnit["CL"] = "CL";
|
|
421
|
+
MeasurementUnit["L"] = "L";
|
|
422
|
+
MeasurementUnit["CBM"] = "CBM";
|
|
423
|
+
MeasurementUnit["MG"] = "MG";
|
|
424
|
+
MeasurementUnit["G"] = "G";
|
|
425
|
+
MeasurementUnit["KG"] = "KG";
|
|
426
|
+
MeasurementUnit["MM"] = "MM";
|
|
427
|
+
MeasurementUnit["CM"] = "CM";
|
|
428
|
+
MeasurementUnit["M"] = "M";
|
|
429
|
+
MeasurementUnit["SQM"] = "SQM";
|
|
430
|
+
MeasurementUnit["OZ"] = "OZ";
|
|
431
|
+
MeasurementUnit["LB"] = "LB";
|
|
432
|
+
MeasurementUnit["FLOZ"] = "FLOZ";
|
|
433
|
+
MeasurementUnit["PT"] = "PT";
|
|
434
|
+
MeasurementUnit["QT"] = "QT";
|
|
435
|
+
MeasurementUnit["GAL"] = "GAL";
|
|
436
|
+
MeasurementUnit["IN"] = "IN";
|
|
437
|
+
MeasurementUnit["FT"] = "FT";
|
|
438
|
+
MeasurementUnit["YD"] = "YD";
|
|
439
|
+
MeasurementUnit["SQFT"] = "SQFT";
|
|
440
|
+
})(MeasurementUnit || (exports.MeasurementUnit = MeasurementUnit = {}));
|
|
441
|
+
var WeightUnit;
|
|
442
|
+
(function (WeightUnit) {
|
|
443
|
+
/** Weight unit can't be classified, due to an error */
|
|
444
|
+
WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
445
|
+
/** Kilograms */
|
|
446
|
+
WeightUnit["KG"] = "KG";
|
|
447
|
+
/** Pounds */
|
|
448
|
+
WeightUnit["LB"] = "LB";
|
|
449
|
+
})(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
|
|
450
|
+
var FileType;
|
|
451
|
+
(function (FileType) {
|
|
452
|
+
/** Unspecified file type. */
|
|
453
|
+
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
454
|
+
/** Secure picture file. */
|
|
455
|
+
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
456
|
+
/** Secure video file. */
|
|
457
|
+
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
458
|
+
/** Secure document file. */
|
|
459
|
+
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
460
|
+
/** Secure music file. */
|
|
461
|
+
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
462
|
+
/** Secure archive file. */
|
|
463
|
+
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
464
|
+
})(FileType || (exports.FileType = FileType = {}));
|
|
465
|
+
/** Frequency unit of recurring payment */
|
|
466
|
+
var SubscriptionFrequency;
|
|
467
|
+
(function (SubscriptionFrequency) {
|
|
468
|
+
SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
|
|
469
|
+
SubscriptionFrequency["DAY"] = "DAY";
|
|
470
|
+
SubscriptionFrequency["WEEK"] = "WEEK";
|
|
471
|
+
SubscriptionFrequency["MONTH"] = "MONTH";
|
|
472
|
+
SubscriptionFrequency["YEAR"] = "YEAR";
|
|
473
|
+
})(SubscriptionFrequency || (exports.SubscriptionFrequency = SubscriptionFrequency = {}));
|
|
474
|
+
var DiscountType;
|
|
475
|
+
(function (DiscountType) {
|
|
476
|
+
DiscountType["UNKNOWN_DISCOUNT"] = "UNKNOWN_DISCOUNT";
|
|
477
|
+
/** Discount by a specific amount. */
|
|
478
|
+
DiscountType["AMOUNT"] = "AMOUNT";
|
|
479
|
+
/** Discount by a percentage. */
|
|
480
|
+
DiscountType["PERCENT"] = "PERCENT";
|
|
481
|
+
})(DiscountType || (exports.DiscountType = DiscountType = {}));
|
|
482
|
+
var CommonSortOrder;
|
|
483
|
+
(function (CommonSortOrder) {
|
|
484
|
+
CommonSortOrder["ASC"] = "ASC";
|
|
485
|
+
CommonSortOrder["DESC"] = "DESC";
|
|
486
|
+
})(CommonSortOrder || (exports.CommonSortOrder = CommonSortOrder = {}));
|
|
487
|
+
var ProductMediaMediaType;
|
|
488
|
+
(function (ProductMediaMediaType) {
|
|
489
|
+
ProductMediaMediaType["UNKNOWN_MEDIA_TYPE"] = "UNKNOWN_MEDIA_TYPE";
|
|
490
|
+
/** Image media type. */
|
|
491
|
+
ProductMediaMediaType["IMAGE"] = "IMAGE";
|
|
492
|
+
/** Video media type. */
|
|
493
|
+
ProductMediaMediaType["VIDEO"] = "VIDEO";
|
|
494
|
+
})(ProductMediaMediaType || (exports.ProductMediaMediaType = ProductMediaMediaType = {}));
|
|
495
|
+
var SecuredMediaFileType;
|
|
496
|
+
(function (SecuredMediaFileType) {
|
|
497
|
+
/** Unspecified file type. */
|
|
498
|
+
SecuredMediaFileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
499
|
+
/** Secure picture file. */
|
|
500
|
+
SecuredMediaFileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
501
|
+
/** Secure video file. */
|
|
502
|
+
SecuredMediaFileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
503
|
+
/** Secure document file. */
|
|
504
|
+
SecuredMediaFileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
505
|
+
/** Secure music file. */
|
|
506
|
+
SecuredMediaFileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
507
|
+
/** Secure archive file. */
|
|
508
|
+
SecuredMediaFileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
509
|
+
})(SecuredMediaFileType || (exports.SecuredMediaFileType = SecuredMediaFileType = {}));
|
|
510
|
+
var V3ProductType;
|
|
511
|
+
(function (V3ProductType) {
|
|
512
|
+
/** Not implemented. */
|
|
513
|
+
V3ProductType["UNKNOWN_PRODUCT_TYPE"] = "UNKNOWN_PRODUCT_TYPE";
|
|
514
|
+
/** Physical product. */
|
|
515
|
+
V3ProductType["PHYSICAL"] = "PHYSICAL";
|
|
516
|
+
/** Digital product. */
|
|
517
|
+
V3ProductType["DIGITAL"] = "DIGITAL";
|
|
518
|
+
})(V3ProductType || (exports.V3ProductType = V3ProductType = {}));
|
|
519
|
+
var Enum;
|
|
520
|
+
(function (Enum) {
|
|
521
|
+
/** Default value. Means that permission not set */
|
|
522
|
+
Enum["UNKNOWN"] = "UNKNOWN";
|
|
523
|
+
/** Protected exposure. Exposed to members and owners */
|
|
524
|
+
Enum["PROTECTED"] = "PROTECTED";
|
|
525
|
+
/** Private exposure. Exposed to owners */
|
|
526
|
+
Enum["PRIVATE"] = "PRIVATE";
|
|
527
|
+
/** Public exposure. Visible to everyone */
|
|
528
|
+
Enum["PUBLIC"] = "PUBLIC";
|
|
529
|
+
/** Used for partial updates, to state that exposure is not changing */
|
|
530
|
+
Enum["UNCHANGED"] = "UNCHANGED";
|
|
531
|
+
/** Protected to members of permitted groups and owners */
|
|
532
|
+
Enum["GROUP_PROTECTED"] = "GROUP_PROTECTED";
|
|
533
|
+
})(Enum || (exports.Enum = Enum = {}));
|
|
534
|
+
var State;
|
|
535
|
+
(function (State) {
|
|
536
|
+
/** default state */
|
|
537
|
+
State["Unknown"] = "Unknown";
|
|
538
|
+
/** metasite does not require site search indexing */
|
|
539
|
+
State["Off"] = "Off";
|
|
540
|
+
/** metasite requires site search indexing */
|
|
541
|
+
State["On"] = "On";
|
|
542
|
+
})(State || (exports.State = State = {}));
|
|
543
|
+
var WebhookIdentityType;
|
|
544
|
+
(function (WebhookIdentityType) {
|
|
545
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
546
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
547
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
548
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
549
|
+
WebhookIdentityType["APP"] = "APP";
|
|
550
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
551
|
+
var SingleEntityOpsRequestedFields;
|
|
552
|
+
(function (SingleEntityOpsRequestedFields) {
|
|
553
|
+
/** Not implemented. */
|
|
554
|
+
SingleEntityOpsRequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
555
|
+
SingleEntityOpsRequestedFields["URL"] = "URL";
|
|
556
|
+
SingleEntityOpsRequestedFields["CURRENCY"] = "CURRENCY";
|
|
557
|
+
SingleEntityOpsRequestedFields["INFO_SECTION"] = "INFO_SECTION";
|
|
558
|
+
/** You can request merchant data only if you have the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope. */
|
|
559
|
+
SingleEntityOpsRequestedFields["MERCHANT_DATA"] = "MERCHANT_DATA";
|
|
560
|
+
SingleEntityOpsRequestedFields["PLAIN_DESCRIPTION"] = "PLAIN_DESCRIPTION";
|
|
561
|
+
SingleEntityOpsRequestedFields["INFO_SECTION_PLAIN_DESCRIPTION"] = "INFO_SECTION_PLAIN_DESCRIPTION";
|
|
562
|
+
SingleEntityOpsRequestedFields["SUBSCRIPTION_PRICES_INFO"] = "SUBSCRIPTION_PRICES_INFO";
|
|
563
|
+
SingleEntityOpsRequestedFields["BREADCRUMBS_INFO"] = "BREADCRUMBS_INFO";
|
|
564
|
+
SingleEntityOpsRequestedFields["WEIGHT_MEASUREMENT_UNIT_INFO"] = "WEIGHT_MEASUREMENT_UNIT_INFO";
|
|
565
|
+
SingleEntityOpsRequestedFields["VARIANT_OPTION_CHOICE_NAMES"] = "VARIANT_OPTION_CHOICE_NAMES";
|
|
566
|
+
SingleEntityOpsRequestedFields["MEDIA_ITEMS_INFO"] = "MEDIA_ITEMS_INFO";
|
|
567
|
+
SingleEntityOpsRequestedFields["DESCRIPTION"] = "DESCRIPTION";
|
|
568
|
+
SingleEntityOpsRequestedFields["DIRECT_CATEGORIES_INFO"] = "DIRECT_CATEGORIES_INFO";
|
|
569
|
+
SingleEntityOpsRequestedFields["ALL_CATEGORIES_INFO"] = "ALL_CATEGORIES_INFO";
|
|
570
|
+
SingleEntityOpsRequestedFields["INFO_SECTION_DESCRIPTION"] = "INFO_SECTION_DESCRIPTION";
|
|
571
|
+
SingleEntityOpsRequestedFields["THUMBNAIL"] = "THUMBNAIL";
|
|
572
|
+
})(SingleEntityOpsRequestedFields || (exports.SingleEntityOpsRequestedFields = SingleEntityOpsRequestedFields = {}));
|
|
573
|
+
var AvailabilityStatus;
|
|
574
|
+
(function (AvailabilityStatus) {
|
|
575
|
+
AvailabilityStatus["UNKNOWN_AVAILABILITY_STATUS"] = "UNKNOWN_AVAILABILITY_STATUS";
|
|
576
|
+
/** Product is out of stock. */
|
|
577
|
+
AvailabilityStatus["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
578
|
+
/** Product is in stock. See `quantity` field for exact amount in stock. */
|
|
579
|
+
AvailabilityStatus["IN_STOCK"] = "IN_STOCK";
|
|
580
|
+
/** Product is only available for preorder. See `preorderInfo` field for more info. */
|
|
581
|
+
AvailabilityStatus["PREORDER"] = "PREORDER";
|
|
582
|
+
})(AvailabilityStatus || (exports.AvailabilityStatus = AvailabilityStatus = {}));
|
|
583
|
+
var RequestedFields;
|
|
584
|
+
(function (RequestedFields) {
|
|
585
|
+
/** Not implemented. */
|
|
586
|
+
RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
587
|
+
RequestedFields["URL"] = "URL";
|
|
588
|
+
RequestedFields["CURRENCY"] = "CURRENCY";
|
|
589
|
+
RequestedFields["INFO_SECTION"] = "INFO_SECTION";
|
|
590
|
+
/** You can request merchant data only if you have the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope. */
|
|
591
|
+
RequestedFields["MERCHANT_DATA"] = "MERCHANT_DATA";
|
|
592
|
+
RequestedFields["PLAIN_DESCRIPTION"] = "PLAIN_DESCRIPTION";
|
|
593
|
+
RequestedFields["INFO_SECTION_PLAIN_DESCRIPTION"] = "INFO_SECTION_PLAIN_DESCRIPTION";
|
|
594
|
+
RequestedFields["SUBSCRIPTION_PRICES_INFO"] = "SUBSCRIPTION_PRICES_INFO";
|
|
595
|
+
RequestedFields["BREADCRUMBS_INFO"] = "BREADCRUMBS_INFO";
|
|
596
|
+
RequestedFields["WEIGHT_MEASUREMENT_UNIT_INFO"] = "WEIGHT_MEASUREMENT_UNIT_INFO";
|
|
597
|
+
RequestedFields["VARIANT_OPTION_CHOICE_NAMES"] = "VARIANT_OPTION_CHOICE_NAMES";
|
|
598
|
+
RequestedFields["MEDIA_ITEMS_INFO"] = "MEDIA_ITEMS_INFO";
|
|
599
|
+
RequestedFields["DESCRIPTION"] = "DESCRIPTION";
|
|
600
|
+
RequestedFields["DIRECT_CATEGORIES_INFO"] = "DIRECT_CATEGORIES_INFO";
|
|
601
|
+
RequestedFields["ALL_CATEGORIES_INFO"] = "ALL_CATEGORIES_INFO";
|
|
602
|
+
RequestedFields["INFO_SECTION_DESCRIPTION"] = "INFO_SECTION_DESCRIPTION";
|
|
603
|
+
RequestedFields["THUMBNAIL"] = "THUMBNAIL";
|
|
604
|
+
})(RequestedFields || (exports.RequestedFields = RequestedFields = {}));
|
|
605
|
+
var CommonSearchDetailsMode;
|
|
606
|
+
(function (CommonSearchDetailsMode) {
|
|
607
|
+
/** Any of the search terms must be present */
|
|
608
|
+
CommonSearchDetailsMode["OR"] = "OR";
|
|
609
|
+
/** All search terms must be present */
|
|
610
|
+
CommonSearchDetailsMode["AND"] = "AND";
|
|
611
|
+
})(CommonSearchDetailsMode || (exports.CommonSearchDetailsMode = CommonSearchDetailsMode = {}));
|
|
612
|
+
var UpstreamWixCommonSortOrder;
|
|
613
|
+
(function (UpstreamWixCommonSortOrder) {
|
|
614
|
+
UpstreamWixCommonSortOrder["ASC"] = "ASC";
|
|
615
|
+
UpstreamWixCommonSortOrder["DESC"] = "DESC";
|
|
616
|
+
})(UpstreamWixCommonSortOrder || (exports.UpstreamWixCommonSortOrder = UpstreamWixCommonSortOrder = {}));
|
|
617
|
+
var AggregationValueAggregationSortType;
|
|
618
|
+
(function (AggregationValueAggregationSortType) {
|
|
619
|
+
/** Should sort by number of matches */
|
|
620
|
+
AggregationValueAggregationSortType["COUNT"] = "COUNT";
|
|
621
|
+
/** Should sort by value of the field alphabetically */
|
|
622
|
+
AggregationValueAggregationSortType["VALUE"] = "VALUE";
|
|
623
|
+
})(AggregationValueAggregationSortType || (exports.AggregationValueAggregationSortType = AggregationValueAggregationSortType = {}));
|
|
624
|
+
var AggregationValueAggregationSortDirection;
|
|
625
|
+
(function (AggregationValueAggregationSortDirection) {
|
|
626
|
+
/** Should sort in descending order */
|
|
627
|
+
AggregationValueAggregationSortDirection["DESC"] = "DESC";
|
|
628
|
+
/** Should sort in ascending order */
|
|
629
|
+
AggregationValueAggregationSortDirection["ASC"] = "ASC";
|
|
630
|
+
})(AggregationValueAggregationSortDirection || (exports.AggregationValueAggregationSortDirection = AggregationValueAggregationSortDirection = {}));
|
|
631
|
+
var AggregationValueAggregationMissingValues;
|
|
632
|
+
(function (AggregationValueAggregationMissingValues) {
|
|
633
|
+
/** Should missing values be excluded from the aggregation results */
|
|
634
|
+
AggregationValueAggregationMissingValues["EXCLUDE"] = "EXCLUDE";
|
|
635
|
+
/** Should missing values be included in the aggregation results */
|
|
636
|
+
AggregationValueAggregationMissingValues["INCLUDE"] = "INCLUDE";
|
|
637
|
+
})(AggregationValueAggregationMissingValues || (exports.AggregationValueAggregationMissingValues = AggregationValueAggregationMissingValues = {}));
|
|
638
|
+
var WixCommonScalarType;
|
|
639
|
+
(function (WixCommonScalarType) {
|
|
640
|
+
WixCommonScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
641
|
+
/** Count of distinct values */
|
|
642
|
+
WixCommonScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
643
|
+
/** Minimum value */
|
|
644
|
+
WixCommonScalarType["MIN"] = "MIN";
|
|
645
|
+
/** Maximum value */
|
|
646
|
+
WixCommonScalarType["MAX"] = "MAX";
|
|
647
|
+
})(WixCommonScalarType || (exports.WixCommonScalarType = WixCommonScalarType = {}));
|
|
648
|
+
var AggregationNestedAggregationNestedAggregationType;
|
|
649
|
+
(function (AggregationNestedAggregationNestedAggregationType) {
|
|
650
|
+
AggregationNestedAggregationNestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
651
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
652
|
+
AggregationNestedAggregationNestedAggregationType["VALUE"] = "VALUE";
|
|
653
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
654
|
+
AggregationNestedAggregationNestedAggregationType["RANGE"] = "RANGE";
|
|
655
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
656
|
+
AggregationNestedAggregationNestedAggregationType["SCALAR"] = "SCALAR";
|
|
657
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
658
|
+
AggregationNestedAggregationNestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
659
|
+
})(AggregationNestedAggregationNestedAggregationType || (exports.AggregationNestedAggregationNestedAggregationType = AggregationNestedAggregationNestedAggregationType = {}));
|
|
660
|
+
var AggregationDateHistogramAggregationInterval;
|
|
661
|
+
(function (AggregationDateHistogramAggregationInterval) {
|
|
662
|
+
AggregationDateHistogramAggregationInterval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
663
|
+
/** Yearly interval */
|
|
664
|
+
AggregationDateHistogramAggregationInterval["YEAR"] = "YEAR";
|
|
665
|
+
/** Monthly interval */
|
|
666
|
+
AggregationDateHistogramAggregationInterval["MONTH"] = "MONTH";
|
|
667
|
+
/** Weekly interval */
|
|
668
|
+
AggregationDateHistogramAggregationInterval["WEEK"] = "WEEK";
|
|
669
|
+
/** Daily interval */
|
|
670
|
+
AggregationDateHistogramAggregationInterval["DAY"] = "DAY";
|
|
671
|
+
/** Hourly interval */
|
|
672
|
+
AggregationDateHistogramAggregationInterval["HOUR"] = "HOUR";
|
|
673
|
+
/** Minute interval */
|
|
674
|
+
AggregationDateHistogramAggregationInterval["MINUTE"] = "MINUTE";
|
|
675
|
+
/** Second interval */
|
|
676
|
+
AggregationDateHistogramAggregationInterval["SECOND"] = "SECOND";
|
|
677
|
+
})(AggregationDateHistogramAggregationInterval || (exports.AggregationDateHistogramAggregationInterval = AggregationDateHistogramAggregationInterval = {}));
|
|
678
|
+
var WixCommonAggregationType;
|
|
679
|
+
(function (WixCommonAggregationType) {
|
|
680
|
+
WixCommonAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
681
|
+
/** An aggregation where result buckets are dynamically built - one per unique value */
|
|
682
|
+
WixCommonAggregationType["VALUE"] = "VALUE";
|
|
683
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket */
|
|
684
|
+
WixCommonAggregationType["RANGE"] = "RANGE";
|
|
685
|
+
/** A single-value metric aggregation - e.g. min, max, sum, avg */
|
|
686
|
+
WixCommonAggregationType["SCALAR"] = "SCALAR";
|
|
687
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
688
|
+
WixCommonAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
689
|
+
/** Multi-level aggregation, where each next aggregation is nested within previous one */
|
|
690
|
+
WixCommonAggregationType["NESTED"] = "NESTED";
|
|
691
|
+
})(WixCommonAggregationType || (exports.WixCommonAggregationType = WixCommonAggregationType = {}));
|
|
692
|
+
var BulkAdjustProductVariantsByFilterRequestRoundingStrategy;
|
|
693
|
+
(function (BulkAdjustProductVariantsByFilterRequestRoundingStrategy) {
|
|
694
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["UNKNOWN_ROUNDING_STRATEGY"] = "UNKNOWN_ROUNDING_STRATEGY";
|
|
695
|
+
/**
|
|
696
|
+
* Calculated prices will be saved without rounding to keep max possible precision. It's still good idea to round numbers before displaying them.
|
|
697
|
+
* Example: input $3.5555 -> saved value $3.5555
|
|
698
|
+
*/
|
|
699
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["NO_ROUNDING"] = "NO_ROUNDING";
|
|
700
|
+
/**
|
|
701
|
+
* Calculated prices will be rounded according to currency precision.
|
|
702
|
+
* Example: input $3.5555 -> saved value $3.56, input ¥3.5555 -> saved value ¥4
|
|
703
|
+
*/
|
|
704
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["CURRENCY_PRECISION"] = "CURRENCY_PRECISION";
|
|
705
|
+
/**
|
|
706
|
+
* Calculated prices will be rounded to nearest whole number.
|
|
707
|
+
* Example: input $3.5555 -> saved value $4
|
|
708
|
+
*/
|
|
709
|
+
BulkAdjustProductVariantsByFilterRequestRoundingStrategy["NEAREST_WHOLE_NUMBER"] = "NEAREST_WHOLE_NUMBER";
|
|
710
|
+
})(BulkAdjustProductVariantsByFilterRequestRoundingStrategy || (exports.BulkAdjustProductVariantsByFilterRequestRoundingStrategy = BulkAdjustProductVariantsByFilterRequestRoundingStrategy = {}));
|
|
711
|
+
var SortOrder;
|
|
712
|
+
(function (SortOrder) {
|
|
713
|
+
/** Ascending order. */
|
|
714
|
+
SortOrder["ASC"] = "ASC";
|
|
715
|
+
/** Descending order. */
|
|
716
|
+
SortOrder["DESC"] = "DESC";
|
|
717
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
718
|
+
var SortType;
|
|
719
|
+
(function (SortType) {
|
|
720
|
+
/** Should sort by number of matches. */
|
|
721
|
+
SortType["COUNT"] = "COUNT";
|
|
722
|
+
/** Should sort by value of the field alphabetically. */
|
|
723
|
+
SortType["VALUE"] = "VALUE";
|
|
724
|
+
})(SortType || (exports.SortType = SortType = {}));
|
|
725
|
+
var SortDirection;
|
|
726
|
+
(function (SortDirection) {
|
|
727
|
+
/** Should sort by descending order. */
|
|
728
|
+
SortDirection["DESC"] = "DESC";
|
|
729
|
+
/** Should sort by ascending order. */
|
|
730
|
+
SortDirection["ASC"] = "ASC";
|
|
731
|
+
})(SortDirection || (exports.SortDirection = SortDirection = {}));
|
|
732
|
+
var MissingValues;
|
|
733
|
+
(function (MissingValues) {
|
|
734
|
+
/** Exclude missing values from the aggregation results. */
|
|
735
|
+
MissingValues["EXCLUDE"] = "EXCLUDE";
|
|
736
|
+
/** Include missing values from the aggregation results. */
|
|
737
|
+
MissingValues["INCLUDE"] = "INCLUDE";
|
|
738
|
+
})(MissingValues || (exports.MissingValues = MissingValues = {}));
|
|
739
|
+
var ScalarType;
|
|
740
|
+
(function (ScalarType) {
|
|
741
|
+
/** Undefined scalar type. */
|
|
742
|
+
ScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
743
|
+
/** Count of distinct values. */
|
|
744
|
+
ScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
745
|
+
/** Minimum value. */
|
|
746
|
+
ScalarType["MIN"] = "MIN";
|
|
747
|
+
/** Maximum value. */
|
|
748
|
+
ScalarType["MAX"] = "MAX";
|
|
749
|
+
})(ScalarType || (exports.ScalarType = ScalarType = {}));
|
|
750
|
+
var NestedAggregationType;
|
|
751
|
+
(function (NestedAggregationType) {
|
|
752
|
+
/** Undefined nested aggregation type. */
|
|
753
|
+
NestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
754
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
755
|
+
NestedAggregationType["VALUE"] = "VALUE";
|
|
756
|
+
/** An aggregation where user can define set of ranges - each representing a bucket. */
|
|
757
|
+
NestedAggregationType["RANGE"] = "RANGE";
|
|
758
|
+
/** A single-value metric aggregation. For example: min, max, sum, avg. */
|
|
759
|
+
NestedAggregationType["SCALAR"] = "SCALAR";
|
|
760
|
+
/** An aggregation where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
761
|
+
NestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
762
|
+
})(NestedAggregationType || (exports.NestedAggregationType = NestedAggregationType = {}));
|
|
763
|
+
var Interval;
|
|
764
|
+
(function (Interval) {
|
|
765
|
+
/** Undefined interval type. */
|
|
766
|
+
Interval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
767
|
+
/** Yearly interval. */
|
|
768
|
+
Interval["YEAR"] = "YEAR";
|
|
769
|
+
/** Monthly interval. */
|
|
770
|
+
Interval["MONTH"] = "MONTH";
|
|
771
|
+
/** Weekly interval. */
|
|
772
|
+
Interval["WEEK"] = "WEEK";
|
|
773
|
+
/** Daily interval. */
|
|
774
|
+
Interval["DAY"] = "DAY";
|
|
775
|
+
/** Hourly interval. */
|
|
776
|
+
Interval["HOUR"] = "HOUR";
|
|
777
|
+
/** Minute interval. */
|
|
778
|
+
Interval["MINUTE"] = "MINUTE";
|
|
779
|
+
/** Second interval. */
|
|
780
|
+
Interval["SECOND"] = "SECOND";
|
|
781
|
+
})(Interval || (exports.Interval = Interval = {}));
|
|
782
|
+
var AggregationType;
|
|
783
|
+
(function (AggregationType) {
|
|
784
|
+
/** Undefined aggregation type. */
|
|
785
|
+
AggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
786
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
787
|
+
AggregationType["VALUE"] = "VALUE";
|
|
788
|
+
/** An aggregation where a user can define set of ranges - each representing a bucket. */
|
|
789
|
+
AggregationType["RANGE"] = "RANGE";
|
|
790
|
+
/** A single-value metric aggregation. For example: min, max, sum, avg. */
|
|
791
|
+
AggregationType["SCALAR"] = "SCALAR";
|
|
792
|
+
/** An aggregation where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
793
|
+
AggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
794
|
+
/** A Multi-level aggregation where each next aggregation is nested within previous one. */
|
|
795
|
+
AggregationType["NESTED"] = "NESTED";
|
|
796
|
+
})(AggregationType || (exports.AggregationType = AggregationType = {}));
|
|
797
|
+
var Mode;
|
|
798
|
+
(function (Mode) {
|
|
799
|
+
/** Any of the search terms must be present. */
|
|
800
|
+
Mode["OR"] = "OR";
|
|
801
|
+
/** All search terms must be present. */
|
|
802
|
+
Mode["AND"] = "AND";
|
|
803
|
+
})(Mode || (exports.Mode = Mode = {}));
|
|
804
|
+
var WixCommonSortOrder;
|
|
805
|
+
(function (WixCommonSortOrder) {
|
|
806
|
+
WixCommonSortOrder["ASC"] = "ASC";
|
|
807
|
+
WixCommonSortOrder["DESC"] = "DESC";
|
|
808
|
+
})(WixCommonSortOrder || (exports.WixCommonSortOrder = WixCommonSortOrder = {}));
|
|
809
|
+
var ValueAggregationSortType;
|
|
810
|
+
(function (ValueAggregationSortType) {
|
|
811
|
+
/** Sort by number of matches. */
|
|
812
|
+
ValueAggregationSortType["COUNT"] = "COUNT";
|
|
813
|
+
/** Sort by value of the field alphabetically. */
|
|
814
|
+
ValueAggregationSortType["VALUE"] = "VALUE";
|
|
815
|
+
})(ValueAggregationSortType || (exports.ValueAggregationSortType = ValueAggregationSortType = {}));
|
|
816
|
+
var ValueAggregationSortDirection;
|
|
817
|
+
(function (ValueAggregationSortDirection) {
|
|
818
|
+
/** Sort in descending order. */
|
|
819
|
+
ValueAggregationSortDirection["DESC"] = "DESC";
|
|
820
|
+
/** Sort in ascending order. */
|
|
821
|
+
ValueAggregationSortDirection["ASC"] = "ASC";
|
|
822
|
+
})(ValueAggregationSortDirection || (exports.ValueAggregationSortDirection = ValueAggregationSortDirection = {}));
|
|
823
|
+
var ValueAggregationMissingValues;
|
|
824
|
+
(function (ValueAggregationMissingValues) {
|
|
825
|
+
/** Exclude missing values from the aggregation results. */
|
|
826
|
+
ValueAggregationMissingValues["EXCLUDE"] = "EXCLUDE";
|
|
827
|
+
/** Include missing values in the aggregation results. */
|
|
828
|
+
ValueAggregationMissingValues["INCLUDE"] = "INCLUDE";
|
|
829
|
+
})(ValueAggregationMissingValues || (exports.ValueAggregationMissingValues = ValueAggregationMissingValues = {}));
|
|
830
|
+
var CommonScalarType;
|
|
831
|
+
(function (CommonScalarType) {
|
|
832
|
+
CommonScalarType["UNKNOWN_SCALAR_TYPE"] = "UNKNOWN_SCALAR_TYPE";
|
|
833
|
+
/** Count of distinct values. */
|
|
834
|
+
CommonScalarType["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
835
|
+
/** Minimum value. */
|
|
836
|
+
CommonScalarType["MIN"] = "MIN";
|
|
837
|
+
/** Maximum value. */
|
|
838
|
+
CommonScalarType["MAX"] = "MAX";
|
|
839
|
+
})(CommonScalarType || (exports.CommonScalarType = CommonScalarType = {}));
|
|
840
|
+
var NestedAggregationNestedAggregationType;
|
|
841
|
+
(function (NestedAggregationNestedAggregationType) {
|
|
842
|
+
NestedAggregationNestedAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
843
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
844
|
+
NestedAggregationNestedAggregationType["VALUE"] = "VALUE";
|
|
845
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket. */
|
|
846
|
+
NestedAggregationNestedAggregationType["RANGE"] = "RANGE";
|
|
847
|
+
/** A single-value metric aggregation. For example, min, max, sum, avg. */
|
|
848
|
+
NestedAggregationNestedAggregationType["SCALAR"] = "SCALAR";
|
|
849
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.). */
|
|
850
|
+
NestedAggregationNestedAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
851
|
+
})(NestedAggregationNestedAggregationType || (exports.NestedAggregationNestedAggregationType = NestedAggregationNestedAggregationType = {}));
|
|
852
|
+
var DateHistogramAggregationInterval;
|
|
853
|
+
(function (DateHistogramAggregationInterval) {
|
|
854
|
+
DateHistogramAggregationInterval["UNKNOWN_INTERVAL"] = "UNKNOWN_INTERVAL";
|
|
855
|
+
/** Yearly interval */
|
|
856
|
+
DateHistogramAggregationInterval["YEAR"] = "YEAR";
|
|
857
|
+
/** Monthly interval */
|
|
858
|
+
DateHistogramAggregationInterval["MONTH"] = "MONTH";
|
|
859
|
+
/** Weekly interval */
|
|
860
|
+
DateHistogramAggregationInterval["WEEK"] = "WEEK";
|
|
861
|
+
/** Daily interval */
|
|
862
|
+
DateHistogramAggregationInterval["DAY"] = "DAY";
|
|
863
|
+
/** Hourly interval */
|
|
864
|
+
DateHistogramAggregationInterval["HOUR"] = "HOUR";
|
|
865
|
+
/** Minute interval */
|
|
866
|
+
DateHistogramAggregationInterval["MINUTE"] = "MINUTE";
|
|
867
|
+
/** Second interval */
|
|
868
|
+
DateHistogramAggregationInterval["SECOND"] = "SECOND";
|
|
869
|
+
})(DateHistogramAggregationInterval || (exports.DateHistogramAggregationInterval = DateHistogramAggregationInterval = {}));
|
|
870
|
+
var CommonAggregationType;
|
|
871
|
+
(function (CommonAggregationType) {
|
|
872
|
+
CommonAggregationType["UNKNOWN_AGGREGATION_TYPE"] = "UNKNOWN_AGGREGATION_TYPE";
|
|
873
|
+
/** An aggregation where result buckets are dynamically built - one per unique value. */
|
|
874
|
+
CommonAggregationType["VALUE"] = "VALUE";
|
|
875
|
+
/** An aggregation, where user can define set of ranges - each representing a bucket. */
|
|
876
|
+
CommonAggregationType["RANGE"] = "RANGE";
|
|
877
|
+
/** A single-value metric aggregation. For example, min, max, sum, avg. */
|
|
878
|
+
CommonAggregationType["SCALAR"] = "SCALAR";
|
|
879
|
+
/** An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.) */
|
|
880
|
+
CommonAggregationType["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
881
|
+
/** Multi-level aggregation, where each next aggregation is nested within previous one. */
|
|
882
|
+
CommonAggregationType["NESTED"] = "NESTED";
|
|
883
|
+
})(CommonAggregationType || (exports.CommonAggregationType = CommonAggregationType = {}));
|
|
884
|
+
var SearchDetailsMode;
|
|
885
|
+
(function (SearchDetailsMode) {
|
|
886
|
+
/** Any of the search terms must be present. */
|
|
887
|
+
SearchDetailsMode["OR"] = "OR";
|
|
888
|
+
/** All search terms must be present. */
|
|
889
|
+
SearchDetailsMode["AND"] = "AND";
|
|
890
|
+
})(SearchDetailsMode || (exports.SearchDetailsMode = SearchDetailsMode = {}));
|
|
891
|
+
var VariantsOpsRequestedFields;
|
|
892
|
+
(function (VariantsOpsRequestedFields) {
|
|
893
|
+
/** Not implemented. */
|
|
894
|
+
VariantsOpsRequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
895
|
+
VariantsOpsRequestedFields["CURRENCY"] = "CURRENCY";
|
|
896
|
+
/** You can request merchant data only if you have the `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope. */
|
|
897
|
+
VariantsOpsRequestedFields["MERCHANT_DATA"] = "MERCHANT_DATA";
|
|
898
|
+
VariantsOpsRequestedFields["SUBSCRIPTION_PRICES_INFO"] = "SUBSCRIPTION_PRICES_INFO";
|
|
899
|
+
VariantsOpsRequestedFields["VARIANT_OPTION_CHOICE_NAMES"] = "VARIANT_OPTION_CHOICE_NAMES";
|
|
900
|
+
VariantsOpsRequestedFields["THUMBNAIL"] = "THUMBNAIL";
|
|
901
|
+
})(VariantsOpsRequestedFields || (exports.VariantsOpsRequestedFields = VariantsOpsRequestedFields = {}));
|
|
902
|
+
var RoundingStrategy;
|
|
903
|
+
(function (RoundingStrategy) {
|
|
904
|
+
/** Undefined rounding strategy. */
|
|
905
|
+
RoundingStrategy["UNKNOWN_ROUNDING_STRATEGY"] = "UNKNOWN_ROUNDING_STRATEGY";
|
|
906
|
+
/**
|
|
907
|
+
* Calculated prices are saved without rounding to keep the maximum possible precision. It's a good idea to round numbers before displaying them.
|
|
908
|
+
* For example, input $3.5555 -> saved value $3.5555
|
|
909
|
+
*/
|
|
910
|
+
RoundingStrategy["NO_ROUNDING"] = "NO_ROUNDING";
|
|
911
|
+
/**
|
|
912
|
+
* Calculated prices are rounded according to currency precision.
|
|
913
|
+
* For example:, input $3.5555 -> saved value $3.56, input ¥3.5555 -> saved value ¥4
|
|
914
|
+
*/
|
|
915
|
+
RoundingStrategy["CURRENCY_PRECISION"] = "CURRENCY_PRECISION";
|
|
916
|
+
/**
|
|
917
|
+
* Calculated prices are rounded to nearest whole number.
|
|
918
|
+
* For example, input $3.5555 -> saved value $4
|
|
919
|
+
*/
|
|
920
|
+
RoundingStrategy["NEAREST_WHOLE_NUMBER"] = "NEAREST_WHOLE_NUMBER";
|
|
921
|
+
})(RoundingStrategy || (exports.RoundingStrategy = RoundingStrategy = {}));
|
|
922
|
+
/**
|
|
923
|
+
* Creates a new product.
|
|
924
|
+
*
|
|
925
|
+
* This endpoint also allows to add a ribbon, brand, info sections, options, and modifiers.
|
|
926
|
+
* @param product - Product to create.
|
|
927
|
+
*
|
|
928
|
+
* At least 1 variant must be provided and each variant must have relevant item in `choices` field for every item in `options`.
|
|
929
|
+
* If `options` is empty one default variant must be provided with empty `choices` list.
|
|
930
|
+
* @public
|
|
931
|
+
* @documentationMaturity preview
|
|
932
|
+
* @requiredField product
|
|
933
|
+
* @requiredField product.media.itemsInfo.items
|
|
934
|
+
* @requiredField product.modifiers
|
|
935
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
936
|
+
* @requiredField product.name
|
|
937
|
+
* @requiredField product.options
|
|
938
|
+
* @requiredField product.options.choicesSettings.choices
|
|
939
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
940
|
+
* @requiredField product.productType
|
|
941
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
942
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
943
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
944
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
945
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
946
|
+
* @requiredField product.variantsInfo
|
|
947
|
+
* @requiredField product.variantsInfo.variants
|
|
948
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
949
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
950
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
951
|
+
* @requiredField product.variantsInfo.variants.price
|
|
952
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
953
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
954
|
+
* @permissionScope Manage Stores - all permissions
|
|
955
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
956
|
+
* @permissionScope Manage Products
|
|
957
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
958
|
+
* @permissionScope Product write in v3 catalog
|
|
959
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
960
|
+
* @permissionScope Manage v3 catalog
|
|
961
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
962
|
+
* @applicableIdentity APP
|
|
963
|
+
* @returns Created product.
|
|
964
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.CreateProduct
|
|
965
|
+
*/
|
|
966
|
+
async function createProduct(product, options) {
|
|
967
|
+
// @ts-ignore
|
|
968
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
969
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
970
|
+
product: product,
|
|
971
|
+
fields: options?.fields,
|
|
972
|
+
}), [
|
|
973
|
+
{
|
|
974
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
975
|
+
paths: [{ path: 'product.url' }],
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
979
|
+
paths: [
|
|
980
|
+
{ path: 'product.media.main.image' },
|
|
981
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
982
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
983
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
984
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
985
|
+
{
|
|
986
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
987
|
+
},
|
|
988
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
989
|
+
],
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
993
|
+
paths: [
|
|
994
|
+
{ path: 'product.media.main.video' },
|
|
995
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
996
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
997
|
+
{
|
|
998
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
999
|
+
},
|
|
1000
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1001
|
+
],
|
|
1002
|
+
},
|
|
1003
|
+
]);
|
|
1004
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.createProduct(payload);
|
|
1005
|
+
sideEffects?.onSiteCall?.();
|
|
1006
|
+
try {
|
|
1007
|
+
const result = await httpClient.request(reqOpts);
|
|
1008
|
+
sideEffects?.onSuccess?.(result);
|
|
1009
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1010
|
+
{
|
|
1011
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1012
|
+
paths: [{ path: 'product.url' }],
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1016
|
+
paths: [
|
|
1017
|
+
{ path: 'product.media.main.image' },
|
|
1018
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1019
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1020
|
+
{
|
|
1021
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1022
|
+
},
|
|
1023
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1024
|
+
{
|
|
1025
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1026
|
+
},
|
|
1027
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1028
|
+
],
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1032
|
+
paths: [
|
|
1033
|
+
{ path: 'product.media.main.video' },
|
|
1034
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1035
|
+
{
|
|
1036
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1040
|
+
},
|
|
1041
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1042
|
+
],
|
|
1043
|
+
},
|
|
1044
|
+
]))?.product;
|
|
1045
|
+
}
|
|
1046
|
+
catch (err) {
|
|
1047
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1048
|
+
spreadPathsToArguments: {},
|
|
1049
|
+
explicitPathsToArguments: { product: '$[0]', fields: '$[1].fields' },
|
|
1050
|
+
singleArgumentUnchanged: false,
|
|
1051
|
+
}, ['product', 'options']);
|
|
1052
|
+
sideEffects?.onError?.(err);
|
|
1053
|
+
throw transformedError;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
exports.createProduct = createProduct;
|
|
1057
|
+
/**
|
|
1058
|
+
* Creates a new product, and can create the product's inventory in the variants' default locations.
|
|
1059
|
+
*
|
|
1060
|
+
* This endpoint also allows to add a ribbon, brand, info sections, options, and modifiers.
|
|
1061
|
+
* @param product - Product to create with inventory.
|
|
1062
|
+
*
|
|
1063
|
+
* At least one variant must be provided and each variant must have relevant item in `choices` field for every item in `options`.
|
|
1064
|
+
* If `options` is empty one default variant must be provided with empty `choices` list.
|
|
1065
|
+
* @public
|
|
1066
|
+
* @documentationMaturity preview
|
|
1067
|
+
* @requiredField product
|
|
1068
|
+
* @requiredField product.media.itemsInfo.items
|
|
1069
|
+
* @requiredField product.modifiers
|
|
1070
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
1071
|
+
* @requiredField product.name
|
|
1072
|
+
* @requiredField product.options
|
|
1073
|
+
* @requiredField product.options.choicesSettings.choices
|
|
1074
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
1075
|
+
* @requiredField product.productType
|
|
1076
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
1077
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
1078
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
1079
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
1080
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
1081
|
+
* @requiredField product.variantsInfo
|
|
1082
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1083
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1084
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1085
|
+
* @requiredField product.variantsInfo.variants.price
|
|
1086
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
1087
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
1088
|
+
* @permissionScope Manage Stores - all permissions
|
|
1089
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1090
|
+
* @permissionScope Manage Products
|
|
1091
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1092
|
+
* @permissionScope Product write in v3 catalog
|
|
1093
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1094
|
+
* @permissionScope Manage v3 catalog
|
|
1095
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1096
|
+
* @applicableIdentity APP
|
|
1097
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.CreateProductWithInventory
|
|
1098
|
+
*/
|
|
1099
|
+
async function createProductWithInventory(product, options) {
|
|
1100
|
+
// @ts-ignore
|
|
1101
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1102
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1103
|
+
product: product,
|
|
1104
|
+
returnEntity: options?.returnEntity,
|
|
1105
|
+
fields: options?.fields,
|
|
1106
|
+
}), [
|
|
1107
|
+
{
|
|
1108
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1109
|
+
paths: [
|
|
1110
|
+
{ path: 'product.media.main.image' },
|
|
1111
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1112
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1113
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
1114
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1115
|
+
{
|
|
1116
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1117
|
+
},
|
|
1118
|
+
],
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1122
|
+
paths: [
|
|
1123
|
+
{ path: 'product.media.main.video' },
|
|
1124
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1125
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
1126
|
+
{
|
|
1127
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1128
|
+
},
|
|
1129
|
+
],
|
|
1130
|
+
},
|
|
1131
|
+
]);
|
|
1132
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.createProductWithInventory(payload);
|
|
1133
|
+
sideEffects?.onSiteCall?.();
|
|
1134
|
+
try {
|
|
1135
|
+
const result = await httpClient.request(reqOpts);
|
|
1136
|
+
sideEffects?.onSuccess?.(result);
|
|
1137
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1138
|
+
{
|
|
1139
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1140
|
+
paths: [{ path: 'product.url' }],
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1144
|
+
paths: [
|
|
1145
|
+
{ path: 'product.media.main.image' },
|
|
1146
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1147
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1148
|
+
{
|
|
1149
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1150
|
+
},
|
|
1151
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1152
|
+
{
|
|
1153
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1154
|
+
},
|
|
1155
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1156
|
+
],
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1160
|
+
paths: [
|
|
1161
|
+
{ path: 'product.media.main.video' },
|
|
1162
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1163
|
+
{
|
|
1164
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1168
|
+
},
|
|
1169
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1170
|
+
],
|
|
1171
|
+
},
|
|
1172
|
+
]));
|
|
1173
|
+
}
|
|
1174
|
+
catch (err) {
|
|
1175
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1176
|
+
spreadPathsToArguments: {},
|
|
1177
|
+
explicitPathsToArguments: {
|
|
1178
|
+
product: '$[0]',
|
|
1179
|
+
returnEntity: '$[1].returnEntity',
|
|
1180
|
+
fields: '$[1].fields',
|
|
1181
|
+
},
|
|
1182
|
+
singleArgumentUnchanged: false,
|
|
1183
|
+
}, ['product', 'options']);
|
|
1184
|
+
sideEffects?.onError?.(err);
|
|
1185
|
+
throw transformedError;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
exports.createProductWithInventory = createProductWithInventory;
|
|
1189
|
+
/**
|
|
1190
|
+
* Updates a product.
|
|
1191
|
+
*
|
|
1192
|
+
* Each time the product is updated, `revision` increments by 1.
|
|
1193
|
+
* The current `revision` must be passed when updating the product.
|
|
1194
|
+
* This ensures you're working with the latest product and prevents unintended overwrites.
|
|
1195
|
+
*
|
|
1196
|
+
* >**Notes:**
|
|
1197
|
+
* > + If `variantsInfo.variants` are passed, they will replace all existing variants.
|
|
1198
|
+
* > + To update existing `variantsInfo.variants`, make sure to provide `variantsInfo.variants.id`. If no ID is passed, the variant will be created with a new ID.
|
|
1199
|
+
* @param _id - Product ID.
|
|
1200
|
+
* @public
|
|
1201
|
+
* @documentationMaturity preview
|
|
1202
|
+
* @requiredField _id
|
|
1203
|
+
* @requiredField product
|
|
1204
|
+
* @requiredField product.media.itemsInfo.items
|
|
1205
|
+
* @requiredField product.modifiers
|
|
1206
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
1207
|
+
* @requiredField product.options
|
|
1208
|
+
* @requiredField product.options.choicesSettings.choices
|
|
1209
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
1210
|
+
* @requiredField product.revision
|
|
1211
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
1212
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
1213
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
1214
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
1215
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
1216
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1217
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1218
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1219
|
+
* @requiredField product.variantsInfo.variants.price
|
|
1220
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
1221
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1222
|
+
* @permissionScope Manage Stores - all permissions
|
|
1223
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1224
|
+
* @permissionScope Manage Products
|
|
1225
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1226
|
+
* @permissionScope Product write in v3 catalog
|
|
1227
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1228
|
+
* @permissionScope Manage v3 catalog
|
|
1229
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1230
|
+
* @applicableIdentity APP
|
|
1231
|
+
* @returns Updated product.
|
|
1232
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.UpdateProduct
|
|
1233
|
+
*/
|
|
1234
|
+
async function updateProduct(_id, product, options) {
|
|
1235
|
+
// @ts-ignore
|
|
1236
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
1237
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1238
|
+
product: { ...product, id: _id },
|
|
1239
|
+
fields: options?.fields,
|
|
1240
|
+
}), [
|
|
1241
|
+
{
|
|
1242
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
1243
|
+
paths: [{ path: 'product.url' }],
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1247
|
+
paths: [
|
|
1248
|
+
{ path: 'product.media.main.image' },
|
|
1249
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1250
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1251
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
1252
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1253
|
+
{
|
|
1254
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1255
|
+
},
|
|
1256
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1257
|
+
],
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1261
|
+
paths: [
|
|
1262
|
+
{ path: 'product.media.main.video' },
|
|
1263
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1264
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
1265
|
+
{
|
|
1266
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1267
|
+
},
|
|
1268
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1269
|
+
],
|
|
1270
|
+
},
|
|
1271
|
+
]);
|
|
1272
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.updateProduct(payload);
|
|
1273
|
+
sideEffects?.onSiteCall?.();
|
|
1274
|
+
try {
|
|
1275
|
+
const result = await httpClient.request(reqOpts);
|
|
1276
|
+
sideEffects?.onSuccess?.(result);
|
|
1277
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1278
|
+
{
|
|
1279
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1280
|
+
paths: [{ path: 'product.url' }],
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1284
|
+
paths: [
|
|
1285
|
+
{ path: 'product.media.main.image' },
|
|
1286
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1287
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1288
|
+
{
|
|
1289
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1290
|
+
},
|
|
1291
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1292
|
+
{
|
|
1293
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1294
|
+
},
|
|
1295
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1296
|
+
],
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1300
|
+
paths: [
|
|
1301
|
+
{ path: 'product.media.main.video' },
|
|
1302
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1303
|
+
{
|
|
1304
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1308
|
+
},
|
|
1309
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1310
|
+
],
|
|
1311
|
+
},
|
|
1312
|
+
]))?.product;
|
|
1313
|
+
}
|
|
1314
|
+
catch (err) {
|
|
1315
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1316
|
+
spreadPathsToArguments: { product: '$[1]' },
|
|
1317
|
+
explicitPathsToArguments: {
|
|
1318
|
+
'product.id': '$[0]',
|
|
1319
|
+
fields: '$[2].fields',
|
|
1320
|
+
},
|
|
1321
|
+
singleArgumentUnchanged: false,
|
|
1322
|
+
}, ['_id', 'product', 'options']);
|
|
1323
|
+
sideEffects?.onError?.(err);
|
|
1324
|
+
throw transformedError;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
exports.updateProduct = updateProduct;
|
|
1328
|
+
/**
|
|
1329
|
+
* Updates a new product, and can update the product's inventory.
|
|
1330
|
+
*
|
|
1331
|
+
* Each time the product is updated, `revision` increments by 1.
|
|
1332
|
+
* The current `revision` must be passed when updating the product.
|
|
1333
|
+
* This ensures you're working with the latest product and prevents unintended overwrites.
|
|
1334
|
+
*
|
|
1335
|
+
* >**Notes:**
|
|
1336
|
+
* > + Passing `variantsInfo.variants` will replace all existing variants.
|
|
1337
|
+
* > + To update existing `variantsInfo.variants`, pass `variantsInfo.variants.id`. If no ID is passed, the variant will be created with a new ID.
|
|
1338
|
+
* @param _id - Product ID.
|
|
1339
|
+
* @public
|
|
1340
|
+
* @documentationMaturity preview
|
|
1341
|
+
* @requiredField _id
|
|
1342
|
+
* @requiredField product
|
|
1343
|
+
* @requiredField product.media.itemsInfo.items
|
|
1344
|
+
* @requiredField product.modifiers
|
|
1345
|
+
* @requiredField product.modifiers.choicesSettings.choices
|
|
1346
|
+
* @requiredField product.options
|
|
1347
|
+
* @requiredField product.options.choicesSettings.choices
|
|
1348
|
+
* @requiredField product.physicalProperties.pricePerUnit.measurementUnit
|
|
1349
|
+
* @requiredField product.revision
|
|
1350
|
+
* @requiredField product.subscriptionDetails.subscriptions
|
|
1351
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount
|
|
1352
|
+
* @requiredField product.subscriptionDetails.subscriptions.discount.type
|
|
1353
|
+
* @requiredField product.subscriptionDetails.subscriptions.frequency
|
|
1354
|
+
* @requiredField product.subscriptionDetails.subscriptions.title
|
|
1355
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1356
|
+
* @requiredField product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1357
|
+
* @requiredField product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1358
|
+
* @requiredField product.variantsInfo.variants.price
|
|
1359
|
+
* @requiredField product.variantsInfo.variants.price.actualPrice
|
|
1360
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1361
|
+
* @permissionScope Manage Stores - all permissions
|
|
1362
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1363
|
+
* @permissionScope Manage Products
|
|
1364
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1365
|
+
* @permissionScope Product write in v3 catalog
|
|
1366
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1367
|
+
* @permissionScope Manage v3 catalog
|
|
1368
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1369
|
+
* @applicableIdentity APP
|
|
1370
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.UpdateProductWithInventory
|
|
1371
|
+
*/
|
|
1372
|
+
async function updateProductWithInventory(_id, product, options) {
|
|
1373
|
+
// @ts-ignore
|
|
1374
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
1375
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1376
|
+
product: { ...product, id: _id },
|
|
1377
|
+
returnEntity: options?.returnEntity,
|
|
1378
|
+
fields: options?.fields,
|
|
1379
|
+
}), [
|
|
1380
|
+
{
|
|
1381
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1382
|
+
paths: [
|
|
1383
|
+
{ path: 'product.media.main.image' },
|
|
1384
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1385
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1386
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
1387
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1388
|
+
{
|
|
1389
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1390
|
+
},
|
|
1391
|
+
],
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1395
|
+
paths: [
|
|
1396
|
+
{ path: 'product.media.main.video' },
|
|
1397
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1398
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
1399
|
+
{
|
|
1400
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1401
|
+
},
|
|
1402
|
+
],
|
|
1403
|
+
},
|
|
1404
|
+
]);
|
|
1405
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.updateProductWithInventory(payload);
|
|
1406
|
+
sideEffects?.onSiteCall?.();
|
|
1407
|
+
try {
|
|
1408
|
+
const result = await httpClient.request(reqOpts);
|
|
1409
|
+
sideEffects?.onSuccess?.(result);
|
|
1410
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1411
|
+
{
|
|
1412
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1413
|
+
paths: [{ path: 'product.url' }],
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1417
|
+
paths: [
|
|
1418
|
+
{ path: 'product.media.main.image' },
|
|
1419
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
1420
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
1421
|
+
{
|
|
1422
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
1423
|
+
},
|
|
1424
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
1425
|
+
{
|
|
1426
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1427
|
+
},
|
|
1428
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
1429
|
+
],
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1433
|
+
paths: [
|
|
1434
|
+
{ path: 'product.media.main.video' },
|
|
1435
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
1436
|
+
{
|
|
1437
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1441
|
+
},
|
|
1442
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
1443
|
+
],
|
|
1444
|
+
},
|
|
1445
|
+
]));
|
|
1446
|
+
}
|
|
1447
|
+
catch (err) {
|
|
1448
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1449
|
+
spreadPathsToArguments: { product: '$[1]' },
|
|
1450
|
+
explicitPathsToArguments: {
|
|
1451
|
+
'product.id': '$[0]',
|
|
1452
|
+
returnEntity: '$[2].returnEntity',
|
|
1453
|
+
fields: '$[2].fields',
|
|
1454
|
+
},
|
|
1455
|
+
singleArgumentUnchanged: false,
|
|
1456
|
+
}, ['_id', 'product', 'options']);
|
|
1457
|
+
sideEffects?.onError?.(err);
|
|
1458
|
+
throw transformedError;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
exports.updateProductWithInventory = updateProductWithInventory;
|
|
1462
|
+
/**
|
|
1463
|
+
* Creates up to 100 products.
|
|
1464
|
+
*
|
|
1465
|
+
* >**Note:**
|
|
1466
|
+
* > The following limits apply to the total number of creatable entities in a single request.
|
|
1467
|
+
* > For example, you can create 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1468
|
+
* > Alternatively, you can create 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1469
|
+
* > + `options`: 100
|
|
1470
|
+
* > + `modifiers`: 100
|
|
1471
|
+
* > + `infoSections`: 100
|
|
1472
|
+
* > + `variantsInfo.variants`: 1000
|
|
1473
|
+
* @param products - List of products to create.
|
|
1474
|
+
* @public
|
|
1475
|
+
* @documentationMaturity preview
|
|
1476
|
+
* @requiredField products
|
|
1477
|
+
* @requiredField products.media.itemsInfo.items
|
|
1478
|
+
* @requiredField products.modifiers
|
|
1479
|
+
* @requiredField products.modifiers.choicesSettings.choices
|
|
1480
|
+
* @requiredField products.name
|
|
1481
|
+
* @requiredField products.options
|
|
1482
|
+
* @requiredField products.options.choicesSettings.choices
|
|
1483
|
+
* @requiredField products.physicalProperties.pricePerUnit.measurementUnit
|
|
1484
|
+
* @requiredField products.productType
|
|
1485
|
+
* @requiredField products.subscriptionDetails.subscriptions
|
|
1486
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount
|
|
1487
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount.type
|
|
1488
|
+
* @requiredField products.subscriptionDetails.subscriptions.frequency
|
|
1489
|
+
* @requiredField products.subscriptionDetails.subscriptions.title
|
|
1490
|
+
* @requiredField products.variantsInfo
|
|
1491
|
+
* @requiredField products.variantsInfo.variants
|
|
1492
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile
|
|
1493
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1494
|
+
* @requiredField products.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1495
|
+
* @requiredField products.variantsInfo.variants.price
|
|
1496
|
+
* @requiredField products.variantsInfo.variants.price.actualPrice
|
|
1497
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
1498
|
+
* @permissionScope Manage Stores - all permissions
|
|
1499
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1500
|
+
* @permissionScope Manage Products
|
|
1501
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1502
|
+
* @permissionScope Product write in v3 catalog
|
|
1503
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1504
|
+
* @permissionScope Manage v3 catalog
|
|
1505
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1506
|
+
* @applicableIdentity APP
|
|
1507
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkCreateProducts
|
|
1508
|
+
*/
|
|
1509
|
+
async function bulkCreateProducts(products, options) {
|
|
1510
|
+
// @ts-ignore
|
|
1511
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1512
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1513
|
+
products: products,
|
|
1514
|
+
returnEntity: options?.returnEntity,
|
|
1515
|
+
fields: options?.fields,
|
|
1516
|
+
}), [
|
|
1517
|
+
{
|
|
1518
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
1519
|
+
paths: [{ path: 'products.url' }],
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1523
|
+
paths: [
|
|
1524
|
+
{ path: 'products.media.main.image' },
|
|
1525
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
1526
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
1527
|
+
{
|
|
1528
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
1529
|
+
},
|
|
1530
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
1531
|
+
{
|
|
1532
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1533
|
+
},
|
|
1534
|
+
{ path: 'products.variantsInfo.variants.media.image' },
|
|
1535
|
+
],
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1539
|
+
paths: [
|
|
1540
|
+
{ path: 'products.media.main.video' },
|
|
1541
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
1542
|
+
{
|
|
1543
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1547
|
+
},
|
|
1548
|
+
{ path: 'products.variantsInfo.variants.media.video' },
|
|
1549
|
+
],
|
|
1550
|
+
},
|
|
1551
|
+
]);
|
|
1552
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkCreateProducts(payload);
|
|
1553
|
+
sideEffects?.onSiteCall?.();
|
|
1554
|
+
try {
|
|
1555
|
+
const result = await httpClient.request(reqOpts);
|
|
1556
|
+
sideEffects?.onSuccess?.(result);
|
|
1557
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1558
|
+
{
|
|
1559
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1560
|
+
paths: [{ path: 'results.item.url' }],
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1564
|
+
paths: [
|
|
1565
|
+
{ path: 'results.item.media.main.image' },
|
|
1566
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
1567
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
1568
|
+
{
|
|
1569
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1570
|
+
},
|
|
1571
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
1572
|
+
{
|
|
1573
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1574
|
+
},
|
|
1575
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
1576
|
+
],
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1580
|
+
paths: [
|
|
1581
|
+
{ path: 'results.item.media.main.video' },
|
|
1582
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
1583
|
+
{
|
|
1584
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1588
|
+
},
|
|
1589
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
1590
|
+
],
|
|
1591
|
+
},
|
|
1592
|
+
]));
|
|
1593
|
+
}
|
|
1594
|
+
catch (err) {
|
|
1595
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1596
|
+
spreadPathsToArguments: {},
|
|
1597
|
+
explicitPathsToArguments: {
|
|
1598
|
+
products: '$[0]',
|
|
1599
|
+
returnEntity: '$[1].returnEntity',
|
|
1600
|
+
fields: '$[1].fields',
|
|
1601
|
+
},
|
|
1602
|
+
singleArgumentUnchanged: false,
|
|
1603
|
+
}, ['products', 'options']);
|
|
1604
|
+
sideEffects?.onError?.(err);
|
|
1605
|
+
throw transformedError;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
exports.bulkCreateProducts = bulkCreateProducts;
|
|
1609
|
+
/**
|
|
1610
|
+
* Creates up to 100 products, and can create the products' inventories in the variants' default locations.
|
|
1611
|
+
*
|
|
1612
|
+
* >**Note:**
|
|
1613
|
+
* > The following limits apply to the total number of creatable entities in a single request.
|
|
1614
|
+
* > For example, you can create 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1615
|
+
* > Alternatively, you can create 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1616
|
+
* > + `options`: 100
|
|
1617
|
+
* > + `modifiers`: 100
|
|
1618
|
+
* > + `infoSections`: 100
|
|
1619
|
+
* > + `variantsInfo.variants`: 1000
|
|
1620
|
+
* @param products - List of products to create with inventory.
|
|
1621
|
+
* @public
|
|
1622
|
+
* @documentationMaturity preview
|
|
1623
|
+
* @requiredField products
|
|
1624
|
+
* @requiredField products.media.itemsInfo.items
|
|
1625
|
+
* @requiredField products.modifiers
|
|
1626
|
+
* @requiredField products.modifiers.choicesSettings.choices
|
|
1627
|
+
* @requiredField products.name
|
|
1628
|
+
* @requiredField products.options
|
|
1629
|
+
* @requiredField products.options.choicesSettings.choices
|
|
1630
|
+
* @requiredField products.physicalProperties.pricePerUnit.measurementUnit
|
|
1631
|
+
* @requiredField products.productType
|
|
1632
|
+
* @requiredField products.subscriptionDetails.subscriptions
|
|
1633
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount
|
|
1634
|
+
* @requiredField products.subscriptionDetails.subscriptions.discount.type
|
|
1635
|
+
* @requiredField products.subscriptionDetails.subscriptions.frequency
|
|
1636
|
+
* @requiredField products.subscriptionDetails.subscriptions.title
|
|
1637
|
+
* @requiredField products.variantsInfo
|
|
1638
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile
|
|
1639
|
+
* @requiredField products.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1640
|
+
* @requiredField products.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1641
|
+
* @requiredField products.variantsInfo.variants.price
|
|
1642
|
+
* @requiredField products.variantsInfo.variants.price.actualPrice
|
|
1643
|
+
* @permissionId WIX_STORES.PRODUCT_CREATE
|
|
1644
|
+
* @permissionId WIX_STORES.INVENTORY_CREATE
|
|
1645
|
+
* @permissionScope Manage Stores - all permissions
|
|
1646
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1647
|
+
* @permissionScope Manage Products
|
|
1648
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1649
|
+
* @permissionScope Product write in v3 catalog
|
|
1650
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1651
|
+
* @permissionScope Manage v3 catalog
|
|
1652
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1653
|
+
* @permissionScope Manage Stores - all permissions
|
|
1654
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1655
|
+
* @permissionScope Inventory write in v3 catalog
|
|
1656
|
+
* @permissionScopeId SCOPE.STORES.INVENTORY_ITEM_WRITE
|
|
1657
|
+
* @permissionScope Manage Products
|
|
1658
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1659
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1660
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1661
|
+
* @permissionScope Manage v3 catalog
|
|
1662
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1663
|
+
* @applicableIdentity APP
|
|
1664
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkCreateProductsWithInventory
|
|
1665
|
+
*/
|
|
1666
|
+
async function bulkCreateProductsWithInventory(products, options) {
|
|
1667
|
+
// @ts-ignore
|
|
1668
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1669
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1670
|
+
products: products,
|
|
1671
|
+
returnEntity: options?.returnEntity,
|
|
1672
|
+
fields: options?.fields,
|
|
1673
|
+
}), [
|
|
1674
|
+
{
|
|
1675
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1676
|
+
paths: [
|
|
1677
|
+
{ path: 'products.media.main.image' },
|
|
1678
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
1679
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
1680
|
+
{
|
|
1681
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
1682
|
+
},
|
|
1683
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
1684
|
+
{
|
|
1685
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1686
|
+
},
|
|
1687
|
+
],
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1691
|
+
paths: [
|
|
1692
|
+
{ path: 'products.media.main.video' },
|
|
1693
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
1694
|
+
{
|
|
1695
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1699
|
+
},
|
|
1700
|
+
],
|
|
1701
|
+
},
|
|
1702
|
+
]);
|
|
1703
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkCreateProductsWithInventory(payload);
|
|
1704
|
+
sideEffects?.onSiteCall?.();
|
|
1705
|
+
try {
|
|
1706
|
+
const result = await httpClient.request(reqOpts);
|
|
1707
|
+
sideEffects?.onSuccess?.(result);
|
|
1708
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1709
|
+
{
|
|
1710
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1711
|
+
paths: [{ path: 'productResults.results.item.url' }],
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1715
|
+
paths: [
|
|
1716
|
+
{ path: 'productResults.results.item.media.main.image' },
|
|
1717
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.image' },
|
|
1718
|
+
{
|
|
1719
|
+
path: 'productResults.results.item.options.choicesSettings.choices.image',
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.image',
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
path: 'productResults.results.item.variantsInfo.variants.media.image',
|
|
1732
|
+
},
|
|
1733
|
+
],
|
|
1734
|
+
},
|
|
1735
|
+
{
|
|
1736
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1737
|
+
paths: [
|
|
1738
|
+
{ path: 'productResults.results.item.media.main.video' },
|
|
1739
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.video' },
|
|
1740
|
+
{
|
|
1741
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
1742
|
+
},
|
|
1743
|
+
{
|
|
1744
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
path: 'productResults.results.item.variantsInfo.variants.media.video',
|
|
1748
|
+
},
|
|
1749
|
+
],
|
|
1750
|
+
},
|
|
1751
|
+
]));
|
|
1752
|
+
}
|
|
1753
|
+
catch (err) {
|
|
1754
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1755
|
+
spreadPathsToArguments: {},
|
|
1756
|
+
explicitPathsToArguments: {
|
|
1757
|
+
products: '$[0]',
|
|
1758
|
+
returnEntity: '$[1].returnEntity',
|
|
1759
|
+
fields: '$[1].fields',
|
|
1760
|
+
},
|
|
1761
|
+
singleArgumentUnchanged: false,
|
|
1762
|
+
}, ['products', 'options']);
|
|
1763
|
+
sideEffects?.onError?.(err);
|
|
1764
|
+
throw transformedError;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
exports.bulkCreateProductsWithInventory = bulkCreateProductsWithInventory;
|
|
1768
|
+
/**
|
|
1769
|
+
* Updates up to 100 products.
|
|
1770
|
+
*
|
|
1771
|
+
* >**Note:**
|
|
1772
|
+
* > The following limits apply to the total number of updatable entities in a single request.
|
|
1773
|
+
* > For example, you can update 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1774
|
+
* > Alternatively, you can update 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1775
|
+
* > + `options`: 100
|
|
1776
|
+
* > + `modifiers`: 100
|
|
1777
|
+
* > + `infoSections`: 100
|
|
1778
|
+
* > + `variantsInfo.variants`: 1000
|
|
1779
|
+
* @param products - List of products to update.
|
|
1780
|
+
* @public
|
|
1781
|
+
* @documentationMaturity preview
|
|
1782
|
+
* @requiredField products
|
|
1783
|
+
* @requiredField products.product
|
|
1784
|
+
* @requiredField products.product._id
|
|
1785
|
+
* @requiredField products.product.media.itemsInfo.items
|
|
1786
|
+
* @requiredField products.product.modifiers
|
|
1787
|
+
* @requiredField products.product.modifiers.choicesSettings.choices
|
|
1788
|
+
* @requiredField products.product.options
|
|
1789
|
+
* @requiredField products.product.options.choicesSettings.choices
|
|
1790
|
+
* @requiredField products.product.physicalProperties.pricePerUnit.measurementUnit
|
|
1791
|
+
* @requiredField products.product.revision
|
|
1792
|
+
* @requiredField products.product.subscriptionDetails.subscriptions
|
|
1793
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount
|
|
1794
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount.type
|
|
1795
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.frequency
|
|
1796
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.title
|
|
1797
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1798
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1799
|
+
* @requiredField products.product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1800
|
+
* @requiredField products.product.variantsInfo.variants.price
|
|
1801
|
+
* @requiredField products.product.variantsInfo.variants.price.actualPrice
|
|
1802
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1803
|
+
* @permissionScope Manage Stores - all permissions
|
|
1804
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1805
|
+
* @permissionScope Manage Products
|
|
1806
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1807
|
+
* @permissionScope Product write in v3 catalog
|
|
1808
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1809
|
+
* @permissionScope Manage v3 catalog
|
|
1810
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1811
|
+
* @applicableIdentity APP
|
|
1812
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProducts
|
|
1813
|
+
*/
|
|
1814
|
+
async function bulkUpdateProducts(products, options) {
|
|
1815
|
+
// @ts-ignore
|
|
1816
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1817
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1818
|
+
products: products,
|
|
1819
|
+
returnEntity: options?.returnEntity,
|
|
1820
|
+
fields: options?.fields,
|
|
1821
|
+
}), [
|
|
1822
|
+
{
|
|
1823
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
1824
|
+
paths: [{ path: 'products.product.url' }],
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1828
|
+
paths: [
|
|
1829
|
+
{ path: 'products.product.media.main.image' },
|
|
1830
|
+
{ path: 'products.product.media.itemsInfo.items.image' },
|
|
1831
|
+
{ path: 'products.product.options.choicesSettings.choices.image' },
|
|
1832
|
+
{
|
|
1833
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.image',
|
|
1834
|
+
},
|
|
1835
|
+
{ path: 'products.product.modifiers.choicesSettings.choices.image' },
|
|
1836
|
+
{
|
|
1837
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1838
|
+
},
|
|
1839
|
+
{ path: 'products.product.variantsInfo.variants.media.image' },
|
|
1840
|
+
],
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1844
|
+
paths: [
|
|
1845
|
+
{ path: 'products.product.media.main.video' },
|
|
1846
|
+
{ path: 'products.product.media.itemsInfo.items.video' },
|
|
1847
|
+
{
|
|
1848
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.video',
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1852
|
+
},
|
|
1853
|
+
{ path: 'products.product.variantsInfo.variants.media.video' },
|
|
1854
|
+
],
|
|
1855
|
+
},
|
|
1856
|
+
]);
|
|
1857
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProducts(payload);
|
|
1858
|
+
sideEffects?.onSiteCall?.();
|
|
1859
|
+
try {
|
|
1860
|
+
const result = await httpClient.request(reqOpts);
|
|
1861
|
+
sideEffects?.onSuccess?.(result);
|
|
1862
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1863
|
+
{
|
|
1864
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1865
|
+
paths: [{ path: 'results.item.url' }],
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1869
|
+
paths: [
|
|
1870
|
+
{ path: 'results.item.media.main.image' },
|
|
1871
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
1872
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
1873
|
+
{
|
|
1874
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
1875
|
+
},
|
|
1876
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
1877
|
+
{
|
|
1878
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1879
|
+
},
|
|
1880
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
1881
|
+
],
|
|
1882
|
+
},
|
|
1883
|
+
{
|
|
1884
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
1885
|
+
paths: [
|
|
1886
|
+
{ path: 'results.item.media.main.video' },
|
|
1887
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
1888
|
+
{
|
|
1889
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
1893
|
+
},
|
|
1894
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
1895
|
+
],
|
|
1896
|
+
},
|
|
1897
|
+
]));
|
|
1898
|
+
}
|
|
1899
|
+
catch (err) {
|
|
1900
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1901
|
+
spreadPathsToArguments: {},
|
|
1902
|
+
explicitPathsToArguments: {
|
|
1903
|
+
products: '$[0]',
|
|
1904
|
+
returnEntity: '$[1].returnEntity',
|
|
1905
|
+
fields: '$[1].fields',
|
|
1906
|
+
},
|
|
1907
|
+
singleArgumentUnchanged: false,
|
|
1908
|
+
}, ['products', 'options']);
|
|
1909
|
+
sideEffects?.onError?.(err);
|
|
1910
|
+
throw transformedError;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
exports.bulkUpdateProducts = bulkUpdateProducts;
|
|
1914
|
+
/**
|
|
1915
|
+
* Updates up to 100 products, and can update the products' inventories in the variants' default locations.
|
|
1916
|
+
*
|
|
1917
|
+
* >**Note:**
|
|
1918
|
+
* > The following limits apply to the total number of updatable entities in a single request.
|
|
1919
|
+
* > For example, you can update 10 products with up to 10 options for each product (10 x 10 = 100), or one product with 100 options.
|
|
1920
|
+
* > Alternatively, you can update 100 products with up to 10 variants in each (100 x 10 = 1000), or one product with 1000 variants.
|
|
1921
|
+
* > + `options`: 100
|
|
1922
|
+
* > + `modifiers`: 100
|
|
1923
|
+
* > + `infoSections`: 100
|
|
1924
|
+
* > + `variantsInfo.variants`: 1000
|
|
1925
|
+
* @param products - List of products to update.
|
|
1926
|
+
* @public
|
|
1927
|
+
* @documentationMaturity preview
|
|
1928
|
+
* @requiredField products
|
|
1929
|
+
* @requiredField products.product
|
|
1930
|
+
* @requiredField products.product._id
|
|
1931
|
+
* @requiredField products.product.media.itemsInfo.items
|
|
1932
|
+
* @requiredField products.product.modifiers
|
|
1933
|
+
* @requiredField products.product.modifiers.choicesSettings.choices
|
|
1934
|
+
* @requiredField products.product.options
|
|
1935
|
+
* @requiredField products.product.options.choicesSettings.choices
|
|
1936
|
+
* @requiredField products.product.physicalProperties.pricePerUnit.measurementUnit
|
|
1937
|
+
* @requiredField products.product.revision
|
|
1938
|
+
* @requiredField products.product.subscriptionDetails.subscriptions
|
|
1939
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount
|
|
1940
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.discount.type
|
|
1941
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.frequency
|
|
1942
|
+
* @requiredField products.product.subscriptionDetails.subscriptions.title
|
|
1943
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile
|
|
1944
|
+
* @requiredField products.product.variantsInfo.variants.digitalProperties.digitalFile._id
|
|
1945
|
+
* @requiredField products.product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.measurementUnit
|
|
1946
|
+
* @requiredField products.product.variantsInfo.variants.price
|
|
1947
|
+
* @requiredField products.product.variantsInfo.variants.price.actualPrice
|
|
1948
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
1949
|
+
* @permissionId WIX_STORES.INVENTORY_UPDATE
|
|
1950
|
+
* @permissionScope Manage Stores - all permissions
|
|
1951
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1952
|
+
* @permissionScope Manage Products
|
|
1953
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1954
|
+
* @permissionScope Product write in v3 catalog
|
|
1955
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
1956
|
+
* @permissionScope Manage v3 catalog
|
|
1957
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1958
|
+
* @permissionScope Manage Stores - all permissions
|
|
1959
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1960
|
+
* @permissionScope Inventory write in v3 catalog
|
|
1961
|
+
* @permissionScopeId SCOPE.STORES.INVENTORY_ITEM_WRITE
|
|
1962
|
+
* @permissionScope Manage Products
|
|
1963
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
1964
|
+
* @permissionScope Manage Restaurants - all permissions
|
|
1965
|
+
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1966
|
+
* @permissionScope Manage v3 catalog
|
|
1967
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
1968
|
+
* @applicableIdentity APP
|
|
1969
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProductsWithInventory
|
|
1970
|
+
*/
|
|
1971
|
+
async function bulkUpdateProductsWithInventory(products, options) {
|
|
1972
|
+
// @ts-ignore
|
|
1973
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1974
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1975
|
+
products: products,
|
|
1976
|
+
returnEntity: options?.returnEntity,
|
|
1977
|
+
fields: options?.fields,
|
|
1978
|
+
}), [
|
|
1979
|
+
{
|
|
1980
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
1981
|
+
paths: [
|
|
1982
|
+
{ path: 'products.product.media.main.image' },
|
|
1983
|
+
{ path: 'products.product.media.itemsInfo.items.image' },
|
|
1984
|
+
{ path: 'products.product.options.choicesSettings.choices.image' },
|
|
1985
|
+
{
|
|
1986
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.image',
|
|
1987
|
+
},
|
|
1988
|
+
{ path: 'products.product.modifiers.choicesSettings.choices.image' },
|
|
1989
|
+
{
|
|
1990
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
1991
|
+
},
|
|
1992
|
+
],
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
1996
|
+
paths: [
|
|
1997
|
+
{ path: 'products.product.media.main.video' },
|
|
1998
|
+
{ path: 'products.product.media.itemsInfo.items.video' },
|
|
1999
|
+
{
|
|
2000
|
+
path: 'products.product.options.choicesSettings.choices.linkedMedia.video',
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
path: 'products.product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2004
|
+
},
|
|
2005
|
+
],
|
|
2006
|
+
},
|
|
2007
|
+
]);
|
|
2008
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProductsWithInventory(payload);
|
|
2009
|
+
sideEffects?.onSiteCall?.();
|
|
2010
|
+
try {
|
|
2011
|
+
const result = await httpClient.request(reqOpts);
|
|
2012
|
+
sideEffects?.onSuccess?.(result);
|
|
2013
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
2014
|
+
{
|
|
2015
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2016
|
+
paths: [{ path: 'productResults.results.item.url' }],
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
2020
|
+
paths: [
|
|
2021
|
+
{ path: 'productResults.results.item.media.main.image' },
|
|
2022
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.image' },
|
|
2023
|
+
{
|
|
2024
|
+
path: 'productResults.results.item.options.choicesSettings.choices.image',
|
|
2025
|
+
},
|
|
2026
|
+
{
|
|
2027
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.image',
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
path: 'productResults.results.item.variantsInfo.variants.media.image',
|
|
2037
|
+
},
|
|
2038
|
+
],
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
2042
|
+
paths: [
|
|
2043
|
+
{ path: 'productResults.results.item.media.main.video' },
|
|
2044
|
+
{ path: 'productResults.results.item.media.itemsInfo.items.video' },
|
|
2045
|
+
{
|
|
2046
|
+
path: 'productResults.results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
path: 'productResults.results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
path: 'productResults.results.item.variantsInfo.variants.media.video',
|
|
2053
|
+
},
|
|
2054
|
+
],
|
|
2055
|
+
},
|
|
2056
|
+
]));
|
|
2057
|
+
}
|
|
2058
|
+
catch (err) {
|
|
2059
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2060
|
+
spreadPathsToArguments: {},
|
|
2061
|
+
explicitPathsToArguments: {
|
|
2062
|
+
products: '$[0]',
|
|
2063
|
+
returnEntity: '$[1].returnEntity',
|
|
2064
|
+
fields: '$[1].fields',
|
|
2065
|
+
},
|
|
2066
|
+
singleArgumentUnchanged: false,
|
|
2067
|
+
}, ['products', 'options']);
|
|
2068
|
+
sideEffects?.onError?.(err);
|
|
2069
|
+
throw transformedError;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
exports.bulkUpdateProductsWithInventory = bulkUpdateProductsWithInventory;
|
|
2073
|
+
/**
|
|
2074
|
+
* Updates multiple products, given the provided filter.
|
|
2075
|
+
*
|
|
2076
|
+
* To update `infoSections`, `brand` or `ribbon` fields, you must also pass their existing `id`.
|
|
2077
|
+
*
|
|
2078
|
+
* > **Note:**
|
|
2079
|
+
* > The following fields cannot be updated with this endpoint:
|
|
2080
|
+
* > + `slug`
|
|
2081
|
+
* > + `options`
|
|
2082
|
+
* > + `modifiers`
|
|
2083
|
+
* > + `variantsInfo`
|
|
2084
|
+
* >
|
|
2085
|
+
* > To update these fields, use [Bulk Update Products](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/products-v3/bulk-update-products).
|
|
2086
|
+
* @public
|
|
2087
|
+
* @documentationMaturity preview
|
|
2088
|
+
* @requiredField options.product
|
|
2089
|
+
* @requiredField options.product.media.itemsInfo.items
|
|
2090
|
+
* @requiredField options.product.subscriptionDetails.subscriptions
|
|
2091
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.discount
|
|
2092
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.discount.type
|
|
2093
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.frequency
|
|
2094
|
+
* @requiredField options.product.subscriptionDetails.subscriptions.title
|
|
2095
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2096
|
+
* @permissionScope Manage Stores - all permissions
|
|
2097
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2098
|
+
* @permissionScope Manage Products
|
|
2099
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2100
|
+
* @permissionScope Product write in v3 catalog
|
|
2101
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2102
|
+
* @permissionScope Manage v3 catalog
|
|
2103
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2104
|
+
* @applicableIdentity APP
|
|
2105
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProductsByFilter
|
|
2106
|
+
*/
|
|
2107
|
+
async function bulkUpdateProductsByFilter(options) {
|
|
2108
|
+
// @ts-ignore
|
|
2109
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2110
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2111
|
+
filter: options?.filter,
|
|
2112
|
+
product: options?.product,
|
|
2113
|
+
search: options?.search,
|
|
2114
|
+
}), [
|
|
2115
|
+
{
|
|
2116
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
2117
|
+
paths: [{ path: 'product.url' }],
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
2121
|
+
paths: [
|
|
2122
|
+
{ path: 'product.media.main.image' },
|
|
2123
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2124
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2125
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.image' },
|
|
2126
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2127
|
+
{
|
|
2128
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2129
|
+
},
|
|
2130
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2131
|
+
],
|
|
2132
|
+
},
|
|
2133
|
+
{
|
|
2134
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
2135
|
+
paths: [
|
|
2136
|
+
{ path: 'product.media.main.video' },
|
|
2137
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2138
|
+
{ path: 'product.options.choicesSettings.choices.linkedMedia.video' },
|
|
2139
|
+
{
|
|
2140
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2141
|
+
},
|
|
2142
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2143
|
+
],
|
|
2144
|
+
},
|
|
2145
|
+
]);
|
|
2146
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProductsByFilter(payload);
|
|
2147
|
+
sideEffects?.onSiteCall?.();
|
|
2148
|
+
try {
|
|
2149
|
+
const result = await httpClient.request(reqOpts);
|
|
2150
|
+
sideEffects?.onSuccess?.(result);
|
|
2151
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
2152
|
+
}
|
|
2153
|
+
catch (err) {
|
|
2154
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2155
|
+
spreadPathsToArguments: {},
|
|
2156
|
+
explicitPathsToArguments: {
|
|
2157
|
+
filter: '$[0].filter',
|
|
2158
|
+
product: '$[0].product',
|
|
2159
|
+
search: '$[0].search',
|
|
2160
|
+
},
|
|
2161
|
+
singleArgumentUnchanged: false,
|
|
2162
|
+
}, ['options']);
|
|
2163
|
+
sideEffects?.onError?.(err);
|
|
2164
|
+
throw transformedError;
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
exports.bulkUpdateProductsByFilter = bulkUpdateProductsByFilter;
|
|
2168
|
+
/**
|
|
2169
|
+
* Updates a product's extended fields.
|
|
2170
|
+
*
|
|
2171
|
+
* [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must first be configured in the app dashboard.
|
|
2172
|
+
* @param productId - Product ID.
|
|
2173
|
+
* @param namespace - App namespace.
|
|
2174
|
+
* @public
|
|
2175
|
+
* @documentationMaturity preview
|
|
2176
|
+
* @requiredField namespace
|
|
2177
|
+
* @requiredField options.namespaceData
|
|
2178
|
+
* @requiredField productId
|
|
2179
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2180
|
+
* @permissionScope Manage Stores - all permissions
|
|
2181
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2182
|
+
* @permissionScope Manage Products
|
|
2183
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2184
|
+
* @permissionScope Product write in v3 catalog
|
|
2185
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2186
|
+
* @permissionScope Manage v3 catalog
|
|
2187
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2188
|
+
* @applicableIdentity APP
|
|
2189
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.UpdateExtendedFields
|
|
2190
|
+
*/
|
|
2191
|
+
async function updateExtendedFields(productId, namespace, options) {
|
|
2192
|
+
// @ts-ignore
|
|
2193
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
2194
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2195
|
+
productId: productId,
|
|
2196
|
+
namespace: namespace,
|
|
2197
|
+
namespaceData: options?.namespaceData,
|
|
2198
|
+
fields: options?.fields,
|
|
2199
|
+
});
|
|
2200
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.updateExtendedFields(payload);
|
|
2201
|
+
sideEffects?.onSiteCall?.();
|
|
2202
|
+
try {
|
|
2203
|
+
const result = await httpClient.request(reqOpts);
|
|
2204
|
+
sideEffects?.onSuccess?.(result);
|
|
2205
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
2206
|
+
{
|
|
2207
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2208
|
+
paths: [{ path: 'product.url' }],
|
|
2209
|
+
},
|
|
2210
|
+
{
|
|
2211
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
2212
|
+
paths: [
|
|
2213
|
+
{ path: 'product.media.main.image' },
|
|
2214
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2215
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2216
|
+
{
|
|
2217
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
2218
|
+
},
|
|
2219
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2220
|
+
{
|
|
2221
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2222
|
+
},
|
|
2223
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2224
|
+
],
|
|
2225
|
+
},
|
|
2226
|
+
{
|
|
2227
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
2228
|
+
paths: [
|
|
2229
|
+
{ path: 'product.media.main.video' },
|
|
2230
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2231
|
+
{
|
|
2232
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2236
|
+
},
|
|
2237
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2238
|
+
],
|
|
2239
|
+
},
|
|
2240
|
+
]));
|
|
2241
|
+
}
|
|
2242
|
+
catch (err) {
|
|
2243
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2244
|
+
spreadPathsToArguments: {},
|
|
2245
|
+
explicitPathsToArguments: {
|
|
2246
|
+
productId: '$[0]',
|
|
2247
|
+
namespace: '$[1]',
|
|
2248
|
+
namespaceData: '$[2].namespaceData',
|
|
2249
|
+
fields: '$[2].fields',
|
|
2250
|
+
},
|
|
2251
|
+
singleArgumentUnchanged: false,
|
|
2252
|
+
}, ['productId', 'namespace', 'options']);
|
|
2253
|
+
sideEffects?.onError?.(err);
|
|
2254
|
+
throw transformedError;
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
exports.updateExtendedFields = updateExtendedFields;
|
|
2258
|
+
/**
|
|
2259
|
+
* Deletes a product and all its variants.
|
|
2260
|
+
* @param productId - Product ID.
|
|
2261
|
+
* @public
|
|
2262
|
+
* @documentationMaturity preview
|
|
2263
|
+
* @requiredField productId
|
|
2264
|
+
* @permissionId WIX_STORES.PRODUCT_DELETE
|
|
2265
|
+
* @permissionScope Manage Stores - all permissions
|
|
2266
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2267
|
+
* @permissionScope Manage Products
|
|
2268
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2269
|
+
* @permissionScope Product write in v3 catalog
|
|
2270
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2271
|
+
* @permissionScope Manage v3 catalog
|
|
2272
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2273
|
+
* @applicableIdentity APP
|
|
2274
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.DeleteProduct
|
|
2275
|
+
*/
|
|
2276
|
+
async function deleteProduct(productId) {
|
|
2277
|
+
// @ts-ignore
|
|
2278
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2279
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2280
|
+
productId: productId,
|
|
2281
|
+
});
|
|
2282
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.deleteProduct(payload);
|
|
2283
|
+
sideEffects?.onSiteCall?.();
|
|
2284
|
+
try {
|
|
2285
|
+
const result = await httpClient.request(reqOpts);
|
|
2286
|
+
sideEffects?.onSuccess?.(result);
|
|
2287
|
+
}
|
|
2288
|
+
catch (err) {
|
|
2289
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2290
|
+
spreadPathsToArguments: {},
|
|
2291
|
+
explicitPathsToArguments: { productId: '$[0]' },
|
|
2292
|
+
singleArgumentUnchanged: false,
|
|
2293
|
+
}, ['productId']);
|
|
2294
|
+
sideEffects?.onError?.(err);
|
|
2295
|
+
throw transformedError;
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
exports.deleteProduct = deleteProduct;
|
|
2299
|
+
/**
|
|
2300
|
+
* Deletes multiple products.
|
|
2301
|
+
* @param productIds - IDs of products to delete.
|
|
2302
|
+
* @public
|
|
2303
|
+
* @documentationMaturity preview
|
|
2304
|
+
* @requiredField productIds
|
|
2305
|
+
* @permissionId WIX_STORES.PRODUCT_DELETE
|
|
2306
|
+
* @permissionScope Manage Stores - all permissions
|
|
2307
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2308
|
+
* @permissionScope Manage Products
|
|
2309
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2310
|
+
* @permissionScope Product write in v3 catalog
|
|
2311
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2312
|
+
* @permissionScope Manage v3 catalog
|
|
2313
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2314
|
+
* @applicableIdentity APP
|
|
2315
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkDeleteProducts
|
|
2316
|
+
*/
|
|
2317
|
+
async function bulkDeleteProducts(productIds) {
|
|
2318
|
+
// @ts-ignore
|
|
2319
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2320
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2321
|
+
productIds: productIds,
|
|
2322
|
+
});
|
|
2323
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkDeleteProducts(payload);
|
|
2324
|
+
sideEffects?.onSiteCall?.();
|
|
2325
|
+
try {
|
|
2326
|
+
const result = await httpClient.request(reqOpts);
|
|
2327
|
+
sideEffects?.onSuccess?.(result);
|
|
2328
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
2329
|
+
}
|
|
2330
|
+
catch (err) {
|
|
2331
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2332
|
+
spreadPathsToArguments: {},
|
|
2333
|
+
explicitPathsToArguments: { productIds: '$[0]' },
|
|
2334
|
+
singleArgumentUnchanged: false,
|
|
2335
|
+
}, ['productIds']);
|
|
2336
|
+
sideEffects?.onError?.(err);
|
|
2337
|
+
throw transformedError;
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
exports.bulkDeleteProducts = bulkDeleteProducts;
|
|
2341
|
+
/**
|
|
2342
|
+
* Delete multiple products, given the provided filter.
|
|
2343
|
+
* @param filter - Filter object.
|
|
2344
|
+
* @public
|
|
2345
|
+
* @documentationMaturity preview
|
|
2346
|
+
* @requiredField filter
|
|
2347
|
+
* @permissionId WIX_STORES.PRODUCT_DELETE
|
|
2348
|
+
* @permissionScope Manage Stores - all permissions
|
|
2349
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2350
|
+
* @permissionScope Manage Products
|
|
2351
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2352
|
+
* @permissionScope Product write in v3 catalog
|
|
2353
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2354
|
+
* @permissionScope Manage v3 catalog
|
|
2355
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2356
|
+
* @applicableIdentity APP
|
|
2357
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkDeleteProductsByFilter
|
|
2358
|
+
*/
|
|
2359
|
+
async function bulkDeleteProductsByFilter(filter, options) {
|
|
2360
|
+
// @ts-ignore
|
|
2361
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2362
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2363
|
+
filter: filter,
|
|
2364
|
+
search: options?.search,
|
|
2365
|
+
});
|
|
2366
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkDeleteProductsByFilter(payload);
|
|
2367
|
+
sideEffects?.onSiteCall?.();
|
|
2368
|
+
try {
|
|
2369
|
+
const result = await httpClient.request(reqOpts);
|
|
2370
|
+
sideEffects?.onSuccess?.(result);
|
|
2371
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
2372
|
+
}
|
|
2373
|
+
catch (err) {
|
|
2374
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2375
|
+
spreadPathsToArguments: {},
|
|
2376
|
+
explicitPathsToArguments: { filter: '$[0]', search: '$[1].search' },
|
|
2377
|
+
singleArgumentUnchanged: false,
|
|
2378
|
+
}, ['filter', 'options']);
|
|
2379
|
+
sideEffects?.onError?.(err);
|
|
2380
|
+
throw transformedError;
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
exports.bulkDeleteProductsByFilter = bulkDeleteProductsByFilter;
|
|
2384
|
+
/**
|
|
2385
|
+
* Retrieves a product.
|
|
2386
|
+
*
|
|
2387
|
+
* > **Note:**
|
|
2388
|
+
* > To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2389
|
+
* @param productId - Product ID.
|
|
2390
|
+
* @public
|
|
2391
|
+
* @documentationMaturity preview
|
|
2392
|
+
* @requiredField productId
|
|
2393
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2394
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2395
|
+
* @permissionScope Manage Stores - all permissions
|
|
2396
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2397
|
+
* @permissionScope Read products in v3 catalog
|
|
2398
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2399
|
+
* @permissionScope Read v3 catalog
|
|
2400
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2401
|
+
* @permissionScope Manage Products
|
|
2402
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2403
|
+
* @permissionScope Read Stores - all read permissions
|
|
2404
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2405
|
+
* @permissionScope Read Products
|
|
2406
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2407
|
+
* @permissionScope Product v3 read admin
|
|
2408
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2409
|
+
* @permissionScope Manage v3 catalog
|
|
2410
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2411
|
+
* @permissionScope Manage Orders
|
|
2412
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2413
|
+
* @permissionScope Manage Stores - all permissions
|
|
2414
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2415
|
+
* @permissionScope Manage Products
|
|
2416
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2417
|
+
* @permissionScope Read Stores - all read permissions
|
|
2418
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2419
|
+
* @permissionScope Read Products
|
|
2420
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2421
|
+
* @permissionScope Product v3 read admin
|
|
2422
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2423
|
+
* @applicableIdentity APP
|
|
2424
|
+
* @applicableIdentity VISITOR
|
|
2425
|
+
* @returns Product.
|
|
2426
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.GetProduct
|
|
2427
|
+
*/
|
|
2428
|
+
async function getProduct(productId, options) {
|
|
2429
|
+
// @ts-ignore
|
|
2430
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2431
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2432
|
+
productId: productId,
|
|
2433
|
+
fields: options?.fields,
|
|
2434
|
+
});
|
|
2435
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.getProduct(payload);
|
|
2436
|
+
sideEffects?.onSiteCall?.();
|
|
2437
|
+
try {
|
|
2438
|
+
const result = await httpClient.request(reqOpts);
|
|
2439
|
+
sideEffects?.onSuccess?.(result);
|
|
2440
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
2441
|
+
{
|
|
2442
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2443
|
+
paths: [{ path: 'product.url' }],
|
|
2444
|
+
},
|
|
2445
|
+
{
|
|
2446
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
2447
|
+
paths: [
|
|
2448
|
+
{ path: 'product.media.main.image' },
|
|
2449
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2450
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2451
|
+
{
|
|
2452
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
2453
|
+
},
|
|
2454
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2455
|
+
{
|
|
2456
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2457
|
+
},
|
|
2458
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2459
|
+
],
|
|
2460
|
+
},
|
|
2461
|
+
{
|
|
2462
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
2463
|
+
paths: [
|
|
2464
|
+
{ path: 'product.media.main.video' },
|
|
2465
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2466
|
+
{
|
|
2467
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
2468
|
+
},
|
|
2469
|
+
{
|
|
2470
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2471
|
+
},
|
|
2472
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2473
|
+
],
|
|
2474
|
+
},
|
|
2475
|
+
]))?.product;
|
|
2476
|
+
}
|
|
2477
|
+
catch (err) {
|
|
2478
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2479
|
+
spreadPathsToArguments: {},
|
|
2480
|
+
explicitPathsToArguments: { productId: '$[0]', fields: '$[1].fields' },
|
|
2481
|
+
singleArgumentUnchanged: false,
|
|
2482
|
+
}, ['productId', 'options']);
|
|
2483
|
+
sideEffects?.onError?.(err);
|
|
2484
|
+
throw transformedError;
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
exports.getProduct = getProduct;
|
|
2488
|
+
/**
|
|
2489
|
+
* Retrieves a product by slug.
|
|
2490
|
+
*
|
|
2491
|
+
* > **Note:**
|
|
2492
|
+
* > To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2493
|
+
* @param slug - Product slug.
|
|
2494
|
+
* @public
|
|
2495
|
+
* @documentationMaturity preview
|
|
2496
|
+
* @requiredField slug
|
|
2497
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2498
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2499
|
+
* @permissionScope Manage Stores - all permissions
|
|
2500
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2501
|
+
* @permissionScope Read products in v3 catalog
|
|
2502
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2503
|
+
* @permissionScope Read v3 catalog
|
|
2504
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2505
|
+
* @permissionScope Manage Products
|
|
2506
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2507
|
+
* @permissionScope Read Stores - all read permissions
|
|
2508
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2509
|
+
* @permissionScope Read Products
|
|
2510
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2511
|
+
* @permissionScope Product v3 read admin
|
|
2512
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2513
|
+
* @permissionScope Manage v3 catalog
|
|
2514
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2515
|
+
* @permissionScope Manage Orders
|
|
2516
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2517
|
+
* @permissionScope Manage Stores - all permissions
|
|
2518
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2519
|
+
* @permissionScope Manage Products
|
|
2520
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2521
|
+
* @permissionScope Read Stores - all read permissions
|
|
2522
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2523
|
+
* @permissionScope Read Products
|
|
2524
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2525
|
+
* @permissionScope Product v3 read admin
|
|
2526
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2527
|
+
* @applicableIdentity APP
|
|
2528
|
+
* @applicableIdentity VISITOR
|
|
2529
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.GetProductBySlug
|
|
2530
|
+
*/
|
|
2531
|
+
async function getProductBySlug(slug, options) {
|
|
2532
|
+
// @ts-ignore
|
|
2533
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2534
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2535
|
+
slug: slug,
|
|
2536
|
+
fields: options?.fields,
|
|
2537
|
+
});
|
|
2538
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.getProductBySlug(payload);
|
|
2539
|
+
sideEffects?.onSiteCall?.();
|
|
2540
|
+
try {
|
|
2541
|
+
const result = await httpClient.request(reqOpts);
|
|
2542
|
+
sideEffects?.onSuccess?.(result);
|
|
2543
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
2544
|
+
{
|
|
2545
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2546
|
+
paths: [{ path: 'product.url' }],
|
|
2547
|
+
},
|
|
2548
|
+
{
|
|
2549
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
2550
|
+
paths: [
|
|
2551
|
+
{ path: 'product.media.main.image' },
|
|
2552
|
+
{ path: 'product.media.itemsInfo.items.image' },
|
|
2553
|
+
{ path: 'product.options.choicesSettings.choices.image' },
|
|
2554
|
+
{
|
|
2555
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.image',
|
|
2556
|
+
},
|
|
2557
|
+
{ path: 'product.modifiers.choicesSettings.choices.image' },
|
|
2558
|
+
{
|
|
2559
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2560
|
+
},
|
|
2561
|
+
{ path: 'product.variantsInfo.variants.media.image' },
|
|
2562
|
+
],
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
2566
|
+
paths: [
|
|
2567
|
+
{ path: 'product.media.main.video' },
|
|
2568
|
+
{ path: 'product.media.itemsInfo.items.video' },
|
|
2569
|
+
{
|
|
2570
|
+
path: 'product.options.choicesSettings.choices.linkedMedia.video',
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
path: 'product.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2574
|
+
},
|
|
2575
|
+
{ path: 'product.variantsInfo.variants.media.video' },
|
|
2576
|
+
],
|
|
2577
|
+
},
|
|
2578
|
+
]));
|
|
2579
|
+
}
|
|
2580
|
+
catch (err) {
|
|
2581
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2582
|
+
spreadPathsToArguments: {},
|
|
2583
|
+
explicitPathsToArguments: { slug: '$[0]', fields: '$[1].fields' },
|
|
2584
|
+
singleArgumentUnchanged: false,
|
|
2585
|
+
}, ['slug', 'options']);
|
|
2586
|
+
sideEffects?.onError?.(err);
|
|
2587
|
+
throw transformedError;
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
exports.getProductBySlug = getProductBySlug;
|
|
2591
|
+
/**
|
|
2592
|
+
* Retrieves a list of up to 100 products, given the provided filtering, search expression, sorting, and cursor paging.
|
|
2593
|
+
* Pass supported values to the `fields` array in the request to include those fields in the response.
|
|
2594
|
+
*
|
|
2595
|
+
* To learn about working with _Search_ endpoints, see
|
|
2596
|
+
* [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
|
|
2597
|
+
* and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
|
|
2598
|
+
*
|
|
2599
|
+
* > **Notes:**
|
|
2600
|
+
* > + This method does not return `variantsInfo`. To retrieve product variants, use the Get Product method.
|
|
2601
|
+
* > + To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2602
|
+
* @public
|
|
2603
|
+
* @documentationMaturity preview
|
|
2604
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2605
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2606
|
+
* @permissionScope Manage Stores - all permissions
|
|
2607
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2608
|
+
* @permissionScope Read products in v3 catalog
|
|
2609
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2610
|
+
* @permissionScope Read v3 catalog
|
|
2611
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2612
|
+
* @permissionScope Manage Products
|
|
2613
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2614
|
+
* @permissionScope Read Stores - all read permissions
|
|
2615
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2616
|
+
* @permissionScope Read Products
|
|
2617
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2618
|
+
* @permissionScope Product v3 read admin
|
|
2619
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2620
|
+
* @permissionScope Manage v3 catalog
|
|
2621
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2622
|
+
* @permissionScope Manage Orders
|
|
2623
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2624
|
+
* @permissionScope Manage Stores - all permissions
|
|
2625
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2626
|
+
* @permissionScope Manage Products
|
|
2627
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2628
|
+
* @permissionScope Read Stores - all read permissions
|
|
2629
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2630
|
+
* @permissionScope Read Products
|
|
2631
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2632
|
+
* @permissionScope Product v3 read admin
|
|
2633
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2634
|
+
* @applicableIdentity APP
|
|
2635
|
+
* @applicableIdentity VISITOR
|
|
2636
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.SearchProducts
|
|
2637
|
+
*/
|
|
2638
|
+
async function searchProducts(options) {
|
|
2639
|
+
// @ts-ignore
|
|
2640
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2641
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2642
|
+
search: options?.search,
|
|
2643
|
+
fields: options?.fields,
|
|
2644
|
+
});
|
|
2645
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.searchProducts(payload);
|
|
2646
|
+
sideEffects?.onSiteCall?.();
|
|
2647
|
+
try {
|
|
2648
|
+
const result = await httpClient.request(reqOpts);
|
|
2649
|
+
sideEffects?.onSuccess?.(result);
|
|
2650
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
2651
|
+
{
|
|
2652
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2653
|
+
paths: [{ path: 'products.url' }],
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
2657
|
+
paths: [
|
|
2658
|
+
{ path: 'products.media.main.image' },
|
|
2659
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
2660
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
2661
|
+
{
|
|
2662
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
2663
|
+
},
|
|
2664
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
2665
|
+
{
|
|
2666
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2667
|
+
},
|
|
2668
|
+
{ path: 'products.variantsInfo.variants.media.image' },
|
|
2669
|
+
],
|
|
2670
|
+
},
|
|
2671
|
+
{
|
|
2672
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
2673
|
+
paths: [
|
|
2674
|
+
{ path: 'products.media.main.video' },
|
|
2675
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
2676
|
+
{
|
|
2677
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
2678
|
+
},
|
|
2679
|
+
{
|
|
2680
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2681
|
+
},
|
|
2682
|
+
{ path: 'products.variantsInfo.variants.media.video' },
|
|
2683
|
+
],
|
|
2684
|
+
},
|
|
2685
|
+
]));
|
|
2686
|
+
}
|
|
2687
|
+
catch (err) {
|
|
2688
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2689
|
+
spreadPathsToArguments: {},
|
|
2690
|
+
explicitPathsToArguments: {
|
|
2691
|
+
search: '$[0].search',
|
|
2692
|
+
fields: '$[0].fields',
|
|
2693
|
+
},
|
|
2694
|
+
singleArgumentUnchanged: false,
|
|
2695
|
+
}, ['options']);
|
|
2696
|
+
sideEffects?.onError?.(err);
|
|
2697
|
+
throw transformedError;
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
exports.searchProducts = searchProducts;
|
|
2701
|
+
/**
|
|
2702
|
+
* Retrieves a list of up to 100 products, given the provided filtering, sorting, and cursor paging.
|
|
2703
|
+
* Pass supported values to the `fields` array in the request to include those fields in the response.
|
|
2704
|
+
*
|
|
2705
|
+
* To learn about working with _Query_ endpoints, see
|
|
2706
|
+
* [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
|
|
2707
|
+
* and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
|
|
2708
|
+
*
|
|
2709
|
+
* > **Notes:**
|
|
2710
|
+
* > + This method does not return `variantsInfo`. To retrieve product variants, use the Get Product method.
|
|
2711
|
+
* > + To retrieve a non-visible product (`visible: false`), your app must have the required `SCOPE.STORES.PRODUCT_READ_ADMIN` permission scope.
|
|
2712
|
+
* @public
|
|
2713
|
+
* @documentationMaturity preview
|
|
2714
|
+
* @permissionScope Manage Stores - all permissions
|
|
2715
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2716
|
+
* @permissionScope Read products in v3 catalog
|
|
2717
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2718
|
+
* @permissionScope Read v3 catalog
|
|
2719
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2720
|
+
* @permissionScope Manage Products
|
|
2721
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2722
|
+
* @permissionScope Read Stores - all read permissions
|
|
2723
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2724
|
+
* @permissionScope Read Products
|
|
2725
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2726
|
+
* @permissionScope Product v3 read admin
|
|
2727
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2728
|
+
* @permissionScope Manage v3 catalog
|
|
2729
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2730
|
+
* @permissionScope Manage Orders
|
|
2731
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2732
|
+
* @permissionScope Manage Stores - all permissions
|
|
2733
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2734
|
+
* @permissionScope Manage Products
|
|
2735
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2736
|
+
* @permissionScope Read Stores - all read permissions
|
|
2737
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2738
|
+
* @permissionScope Read Products
|
|
2739
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2740
|
+
* @permissionScope Product v3 read admin
|
|
2741
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2742
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2743
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2744
|
+
* @applicableIdentity APP
|
|
2745
|
+
* @applicableIdentity VISITOR
|
|
2746
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.QueryProducts
|
|
2747
|
+
*/
|
|
2748
|
+
function queryProducts(options) {
|
|
2749
|
+
// @ts-ignore
|
|
2750
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2751
|
+
return (0, query_builder_1.queryBuilder)({
|
|
2752
|
+
func: async (payload) => {
|
|
2753
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.queryProducts({
|
|
2754
|
+
...payload,
|
|
2755
|
+
...(options ?? {}),
|
|
2756
|
+
});
|
|
2757
|
+
sideEffects?.onSiteCall?.();
|
|
2758
|
+
try {
|
|
2759
|
+
const result = await httpClient.request(reqOpts);
|
|
2760
|
+
sideEffects?.onSuccess?.(result);
|
|
2761
|
+
return result;
|
|
2762
|
+
}
|
|
2763
|
+
catch (err) {
|
|
2764
|
+
sideEffects?.onError?.(err);
|
|
2765
|
+
throw err;
|
|
2766
|
+
}
|
|
2767
|
+
},
|
|
2768
|
+
requestTransformer: (query) => {
|
|
2769
|
+
const args = [query, options];
|
|
2770
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2771
|
+
...args?.[1],
|
|
2772
|
+
query: args?.[0],
|
|
2773
|
+
});
|
|
2774
|
+
},
|
|
2775
|
+
responseTransformer: ({ data }) => {
|
|
2776
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
|
|
2777
|
+
{
|
|
2778
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2779
|
+
paths: [{ path: 'products.url' }],
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
2783
|
+
paths: [
|
|
2784
|
+
{ path: 'products.media.main.image' },
|
|
2785
|
+
{ path: 'products.media.itemsInfo.items.image' },
|
|
2786
|
+
{ path: 'products.options.choicesSettings.choices.image' },
|
|
2787
|
+
{
|
|
2788
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.image',
|
|
2789
|
+
},
|
|
2790
|
+
{ path: 'products.modifiers.choicesSettings.choices.image' },
|
|
2791
|
+
{
|
|
2792
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
2793
|
+
},
|
|
2794
|
+
{ path: 'products.variantsInfo.variants.media.image' },
|
|
2795
|
+
],
|
|
2796
|
+
},
|
|
2797
|
+
{
|
|
2798
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
2799
|
+
paths: [
|
|
2800
|
+
{ path: 'products.media.main.video' },
|
|
2801
|
+
{ path: 'products.media.itemsInfo.items.video' },
|
|
2802
|
+
{
|
|
2803
|
+
path: 'products.options.choicesSettings.choices.linkedMedia.video',
|
|
2804
|
+
},
|
|
2805
|
+
{
|
|
2806
|
+
path: 'products.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
2807
|
+
},
|
|
2808
|
+
{ path: 'products.variantsInfo.variants.media.video' },
|
|
2809
|
+
],
|
|
2810
|
+
},
|
|
2811
|
+
]));
|
|
2812
|
+
return {
|
|
2813
|
+
items: transformedData?.products,
|
|
2814
|
+
pagingMetadata: transformedData?.pagingMetadata,
|
|
2815
|
+
};
|
|
2816
|
+
},
|
|
2817
|
+
errorTransformer: (err) => {
|
|
2818
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2819
|
+
spreadPathsToArguments: {},
|
|
2820
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
2821
|
+
singleArgumentUnchanged: false,
|
|
2822
|
+
});
|
|
2823
|
+
throw transformedError;
|
|
2824
|
+
},
|
|
2825
|
+
pagingMethod: 'CURSOR',
|
|
2826
|
+
transformationPaths: {},
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
exports.queryProducts = queryProducts;
|
|
2830
|
+
/**
|
|
2831
|
+
* Counts the number of products that match the provided filtering.
|
|
2832
|
+
* @public
|
|
2833
|
+
* @documentationMaturity preview
|
|
2834
|
+
* @permissionId WIX_STORES.PRODUCT_READ
|
|
2835
|
+
* @permissionId WIX_STORES.PRODUCT_READ_NON_VISIBLE
|
|
2836
|
+
* @permissionScope Manage Stores - all permissions
|
|
2837
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2838
|
+
* @permissionScope Read products in v3 catalog
|
|
2839
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ
|
|
2840
|
+
* @permissionScope Read v3 catalog
|
|
2841
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_READ
|
|
2842
|
+
* @permissionScope Manage Products
|
|
2843
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2844
|
+
* @permissionScope Read Stores - all read permissions
|
|
2845
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2846
|
+
* @permissionScope Read Products
|
|
2847
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2848
|
+
* @permissionScope Product v3 read admin
|
|
2849
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2850
|
+
* @permissionScope Manage v3 catalog
|
|
2851
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2852
|
+
* @permissionScope Manage Orders
|
|
2853
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
2854
|
+
* @permissionScope Manage Stores - all permissions
|
|
2855
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2856
|
+
* @permissionScope Manage Products
|
|
2857
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2858
|
+
* @permissionScope Read Stores - all read permissions
|
|
2859
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
2860
|
+
* @permissionScope Read Products
|
|
2861
|
+
* @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS
|
|
2862
|
+
* @permissionScope Product v3 read admin
|
|
2863
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_READ_ADMIN
|
|
2864
|
+
* @applicableIdentity APP
|
|
2865
|
+
* @applicableIdentity VISITOR
|
|
2866
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.CountProducts
|
|
2867
|
+
*/
|
|
2868
|
+
async function countProducts(options) {
|
|
2869
|
+
// @ts-ignore
|
|
2870
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
2871
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2872
|
+
filter: options?.filter,
|
|
2873
|
+
search: options?.search,
|
|
2874
|
+
returnNonVisibleProducts: options?.returnNonVisibleProducts,
|
|
2875
|
+
});
|
|
2876
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.countProducts(payload);
|
|
2877
|
+
sideEffects?.onSiteCall?.();
|
|
2878
|
+
try {
|
|
2879
|
+
const result = await httpClient.request(reqOpts);
|
|
2880
|
+
sideEffects?.onSuccess?.(result);
|
|
2881
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
2882
|
+
}
|
|
2883
|
+
catch (err) {
|
|
2884
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2885
|
+
spreadPathsToArguments: {},
|
|
2886
|
+
explicitPathsToArguments: {
|
|
2887
|
+
filter: '$[0].filter',
|
|
2888
|
+
search: '$[0].search',
|
|
2889
|
+
returnNonVisibleProducts: '$[0].returnNonVisibleProducts',
|
|
2890
|
+
},
|
|
2891
|
+
singleArgumentUnchanged: false,
|
|
2892
|
+
}, ['options']);
|
|
2893
|
+
sideEffects?.onError?.(err);
|
|
2894
|
+
throw transformedError;
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
exports.countProducts = countProducts;
|
|
2898
|
+
/**
|
|
2899
|
+
* Updates a variant of multiple products, given the provided filter and search expression.
|
|
2900
|
+
*
|
|
2901
|
+
*
|
|
2902
|
+
* Only the following variant fields can be updated:
|
|
2903
|
+
* + `visible`
|
|
2904
|
+
* + `price`
|
|
2905
|
+
* + `revenueDetails.cost`
|
|
2906
|
+
* + `physicalOptions`
|
|
2907
|
+
* @param filter - Filter object.
|
|
2908
|
+
* @public
|
|
2909
|
+
* @documentationMaturity preview
|
|
2910
|
+
* @requiredField filter
|
|
2911
|
+
* @requiredField options.variant
|
|
2912
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2913
|
+
* @permissionScope Manage Stores - all permissions
|
|
2914
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2915
|
+
* @permissionScope Manage Products
|
|
2916
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2917
|
+
* @permissionScope Product write in v3 catalog
|
|
2918
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2919
|
+
* @permissionScope Manage v3 catalog
|
|
2920
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2921
|
+
* @applicableIdentity APP
|
|
2922
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkUpdateProductVariantsByFilter
|
|
2923
|
+
*/
|
|
2924
|
+
async function bulkUpdateProductVariantsByFilter(filter, options) {
|
|
2925
|
+
// @ts-ignore
|
|
2926
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2927
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2928
|
+
filter: filter,
|
|
2929
|
+
variant: options?.variant,
|
|
2930
|
+
search: options?.search,
|
|
2931
|
+
}), [
|
|
2932
|
+
{
|
|
2933
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
2934
|
+
paths: [{ path: 'variant.media.image' }],
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
2938
|
+
paths: [{ path: 'variant.media.video' }],
|
|
2939
|
+
},
|
|
2940
|
+
]);
|
|
2941
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkUpdateProductVariantsByFilter(payload);
|
|
2942
|
+
sideEffects?.onSiteCall?.();
|
|
2943
|
+
try {
|
|
2944
|
+
const result = await httpClient.request(reqOpts);
|
|
2945
|
+
sideEffects?.onSuccess?.(result);
|
|
2946
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
2947
|
+
}
|
|
2948
|
+
catch (err) {
|
|
2949
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
2950
|
+
spreadPathsToArguments: {},
|
|
2951
|
+
explicitPathsToArguments: {
|
|
2952
|
+
filter: '$[0]',
|
|
2953
|
+
variant: '$[1].variant',
|
|
2954
|
+
search: '$[1].search',
|
|
2955
|
+
},
|
|
2956
|
+
singleArgumentUnchanged: false,
|
|
2957
|
+
}, ['filter', 'options']);
|
|
2958
|
+
sideEffects?.onError?.(err);
|
|
2959
|
+
throw transformedError;
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
exports.bulkUpdateProductVariantsByFilter = bulkUpdateProductVariantsByFilter;
|
|
2963
|
+
/**
|
|
2964
|
+
* Adjusts the price and cost of multiple variants, given the provided filter and search expression.
|
|
2965
|
+
*
|
|
2966
|
+
*
|
|
2967
|
+
* Only the following variant fields can be increased/decreased by amount or percentage:
|
|
2968
|
+
* + `basePrice`
|
|
2969
|
+
* + `salePrice`
|
|
2970
|
+
* + `cost`
|
|
2971
|
+
* + `salePriceFromBasePrice`
|
|
2972
|
+
* @param filter - Filter object.
|
|
2973
|
+
* @public
|
|
2974
|
+
* @documentationMaturity preview
|
|
2975
|
+
* @requiredField filter
|
|
2976
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
2977
|
+
* @permissionScope Manage Stores - all permissions
|
|
2978
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
2979
|
+
* @permissionScope Manage Products
|
|
2980
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
2981
|
+
* @permissionScope Product write in v3 catalog
|
|
2982
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
2983
|
+
* @permissionScope Manage v3 catalog
|
|
2984
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
2985
|
+
* @applicableIdentity APP
|
|
2986
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAdjustProductVariantsByFilter
|
|
2987
|
+
*/
|
|
2988
|
+
async function bulkAdjustProductVariantsByFilter(filter, options) {
|
|
2989
|
+
// @ts-ignore
|
|
2990
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2991
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
2992
|
+
filter: filter,
|
|
2993
|
+
basePrice: options?.basePrice,
|
|
2994
|
+
salePrice: options?.salePrice,
|
|
2995
|
+
cost: options?.cost,
|
|
2996
|
+
salePriceFromBasePrice: options?.salePriceFromBasePrice,
|
|
2997
|
+
rounding: options?.rounding,
|
|
2998
|
+
search: options?.search,
|
|
2999
|
+
actualPrice: options?.actualPrice,
|
|
3000
|
+
compareAtPrice: options?.compareAtPrice,
|
|
3001
|
+
compareAtPriceDiscount: options?.compareAtPriceDiscount,
|
|
3002
|
+
});
|
|
3003
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAdjustProductVariantsByFilter(payload);
|
|
3004
|
+
sideEffects?.onSiteCall?.();
|
|
3005
|
+
try {
|
|
3006
|
+
const result = await httpClient.request(reqOpts);
|
|
3007
|
+
sideEffects?.onSuccess?.(result);
|
|
3008
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
3009
|
+
}
|
|
3010
|
+
catch (err) {
|
|
3011
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3012
|
+
spreadPathsToArguments: {},
|
|
3013
|
+
explicitPathsToArguments: {
|
|
3014
|
+
filter: '$[0]',
|
|
3015
|
+
basePrice: '$[1].basePrice',
|
|
3016
|
+
salePrice: '$[1].salePrice',
|
|
3017
|
+
cost: '$[1].cost',
|
|
3018
|
+
salePriceFromBasePrice: '$[1].salePriceFromBasePrice',
|
|
3019
|
+
rounding: '$[1].rounding',
|
|
3020
|
+
search: '$[1].search',
|
|
3021
|
+
actualPrice: '$[1].actualPrice',
|
|
3022
|
+
compareAtPrice: '$[1].compareAtPrice',
|
|
3023
|
+
compareAtPriceDiscount: '$[1].compareAtPriceDiscount',
|
|
3024
|
+
},
|
|
3025
|
+
singleArgumentUnchanged: false,
|
|
3026
|
+
}, ['filter', 'options']);
|
|
3027
|
+
sideEffects?.onError?.(err);
|
|
3028
|
+
throw transformedError;
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
exports.bulkAdjustProductVariantsByFilter = bulkAdjustProductVariantsByFilter;
|
|
3032
|
+
/**
|
|
3033
|
+
* Adds info sections to multiple products, given the provided filter and search expression.
|
|
3034
|
+
* @param filter - Filter object.
|
|
3035
|
+
* @public
|
|
3036
|
+
* @documentationMaturity preview
|
|
3037
|
+
* @requiredField filter
|
|
3038
|
+
* @requiredField options.infoSectionIds
|
|
3039
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3040
|
+
* @permissionScope Manage Stores - all permissions
|
|
3041
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3042
|
+
* @permissionScope Manage Products
|
|
3043
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3044
|
+
* @permissionScope Product write in v3 catalog
|
|
3045
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3046
|
+
* @permissionScope Manage v3 catalog
|
|
3047
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3048
|
+
* @applicableIdentity APP
|
|
3049
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAddInfoSectionsToProductsByFilter
|
|
3050
|
+
*/
|
|
3051
|
+
async function bulkAddInfoSectionsToProductsByFilter(filter, options) {
|
|
3052
|
+
// @ts-ignore
|
|
3053
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3054
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
3055
|
+
filter: filter,
|
|
3056
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3057
|
+
search: options?.search,
|
|
3058
|
+
});
|
|
3059
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAddInfoSectionsToProductsByFilter(payload);
|
|
3060
|
+
sideEffects?.onSiteCall?.();
|
|
3061
|
+
try {
|
|
3062
|
+
const result = await httpClient.request(reqOpts);
|
|
3063
|
+
sideEffects?.onSuccess?.(result);
|
|
3064
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
3065
|
+
}
|
|
3066
|
+
catch (err) {
|
|
3067
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3068
|
+
spreadPathsToArguments: {},
|
|
3069
|
+
explicitPathsToArguments: {
|
|
3070
|
+
filter: '$[0]',
|
|
3071
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3072
|
+
search: '$[1].search',
|
|
3073
|
+
},
|
|
3074
|
+
singleArgumentUnchanged: false,
|
|
3075
|
+
}, ['filter', 'options']);
|
|
3076
|
+
sideEffects?.onError?.(err);
|
|
3077
|
+
throw transformedError;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
exports.bulkAddInfoSectionsToProductsByFilter = bulkAddInfoSectionsToProductsByFilter;
|
|
3081
|
+
/**
|
|
3082
|
+
* Adds info sections to multiple products.
|
|
3083
|
+
* @param products - List of product IDs and revisions.
|
|
3084
|
+
* @public
|
|
3085
|
+
* @documentationMaturity preview
|
|
3086
|
+
* @requiredField options.infoSectionIds
|
|
3087
|
+
* @requiredField products
|
|
3088
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3089
|
+
* @permissionScope Manage Stores - all permissions
|
|
3090
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3091
|
+
* @permissionScope Manage Products
|
|
3092
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3093
|
+
* @permissionScope Product write in v3 catalog
|
|
3094
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3095
|
+
* @permissionScope Manage v3 catalog
|
|
3096
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3097
|
+
* @applicableIdentity APP
|
|
3098
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAddInfoSectionsToProducts
|
|
3099
|
+
*/
|
|
3100
|
+
async function bulkAddInfoSectionsToProducts(products, options) {
|
|
3101
|
+
// @ts-ignore
|
|
3102
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3103
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
3104
|
+
products: products,
|
|
3105
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3106
|
+
returnEntity: options?.returnEntity,
|
|
3107
|
+
fields: options?.fields,
|
|
3108
|
+
});
|
|
3109
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAddInfoSectionsToProducts(payload);
|
|
3110
|
+
sideEffects?.onSiteCall?.();
|
|
3111
|
+
try {
|
|
3112
|
+
const result = await httpClient.request(reqOpts);
|
|
3113
|
+
sideEffects?.onSuccess?.(result);
|
|
3114
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
3115
|
+
{
|
|
3116
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
3117
|
+
paths: [{ path: 'results.item.url' }],
|
|
3118
|
+
},
|
|
3119
|
+
{
|
|
3120
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
3121
|
+
paths: [
|
|
3122
|
+
{ path: 'results.item.media.main.image' },
|
|
3123
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
3124
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
3125
|
+
{
|
|
3126
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
3127
|
+
},
|
|
3128
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
3129
|
+
{
|
|
3130
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
3131
|
+
},
|
|
3132
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
3133
|
+
],
|
|
3134
|
+
},
|
|
3135
|
+
{
|
|
3136
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
3137
|
+
paths: [
|
|
3138
|
+
{ path: 'results.item.media.main.video' },
|
|
3139
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
3140
|
+
{
|
|
3141
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
3142
|
+
},
|
|
3143
|
+
{
|
|
3144
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
3145
|
+
},
|
|
3146
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
3147
|
+
],
|
|
3148
|
+
},
|
|
3149
|
+
]));
|
|
3150
|
+
}
|
|
3151
|
+
catch (err) {
|
|
3152
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3153
|
+
spreadPathsToArguments: {},
|
|
3154
|
+
explicitPathsToArguments: {
|
|
3155
|
+
products: '$[0]',
|
|
3156
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3157
|
+
returnEntity: '$[1].returnEntity',
|
|
3158
|
+
fields: '$[1].fields',
|
|
3159
|
+
},
|
|
3160
|
+
singleArgumentUnchanged: false,
|
|
3161
|
+
}, ['products', 'options']);
|
|
3162
|
+
sideEffects?.onError?.(err);
|
|
3163
|
+
throw transformedError;
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
exports.bulkAddInfoSectionsToProducts = bulkAddInfoSectionsToProducts;
|
|
3167
|
+
/**
|
|
3168
|
+
* Removes info sections from multiple products, given the provided filter and search expression.
|
|
3169
|
+
* @param filter - Filter object.
|
|
3170
|
+
* @public
|
|
3171
|
+
* @documentationMaturity preview
|
|
3172
|
+
* @requiredField filter
|
|
3173
|
+
* @requiredField options.infoSectionIds
|
|
3174
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3175
|
+
* @permissionScope Manage Stores - all permissions
|
|
3176
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3177
|
+
* @permissionScope Manage Products
|
|
3178
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3179
|
+
* @permissionScope Product write in v3 catalog
|
|
3180
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3181
|
+
* @permissionScope Manage v3 catalog
|
|
3182
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3183
|
+
* @applicableIdentity APP
|
|
3184
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkRemoveInfoSectionsFromProductsByFilter
|
|
3185
|
+
*/
|
|
3186
|
+
async function bulkRemoveInfoSectionsFromProductsByFilter(filter, options) {
|
|
3187
|
+
// @ts-ignore
|
|
3188
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3189
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
3190
|
+
filter: filter,
|
|
3191
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3192
|
+
search: options?.search,
|
|
3193
|
+
});
|
|
3194
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkRemoveInfoSectionsFromProductsByFilter(payload);
|
|
3195
|
+
sideEffects?.onSiteCall?.();
|
|
3196
|
+
try {
|
|
3197
|
+
const result = await httpClient.request(reqOpts);
|
|
3198
|
+
sideEffects?.onSuccess?.(result);
|
|
3199
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
3200
|
+
}
|
|
3201
|
+
catch (err) {
|
|
3202
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3203
|
+
spreadPathsToArguments: {},
|
|
3204
|
+
explicitPathsToArguments: {
|
|
3205
|
+
filter: '$[0]',
|
|
3206
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3207
|
+
search: '$[1].search',
|
|
3208
|
+
},
|
|
3209
|
+
singleArgumentUnchanged: false,
|
|
3210
|
+
}, ['filter', 'options']);
|
|
3211
|
+
sideEffects?.onError?.(err);
|
|
3212
|
+
throw transformedError;
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
exports.bulkRemoveInfoSectionsFromProductsByFilter = bulkRemoveInfoSectionsFromProductsByFilter;
|
|
3216
|
+
/**
|
|
3217
|
+
* Removes info sections from multiple products.
|
|
3218
|
+
* @param products - List of product IDs and revisions.
|
|
3219
|
+
* @public
|
|
3220
|
+
* @documentationMaturity preview
|
|
3221
|
+
* @requiredField options.infoSectionIds
|
|
3222
|
+
* @requiredField products
|
|
3223
|
+
* @permissionId WIX_STORES.PRODUCT_UPDATE
|
|
3224
|
+
* @permissionScope Manage Stores - all permissions
|
|
3225
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3226
|
+
* @permissionScope Manage Products
|
|
3227
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3228
|
+
* @permissionScope Product write in v3 catalog
|
|
3229
|
+
* @permissionScopeId SCOPE.STORES.PRODUCT_WRITE
|
|
3230
|
+
* @permissionScope Manage v3 catalog
|
|
3231
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3232
|
+
* @applicableIdentity APP
|
|
3233
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkRemoveInfoSectionsFromProducts
|
|
3234
|
+
*/
|
|
3235
|
+
async function bulkRemoveInfoSectionsFromProducts(products, options) {
|
|
3236
|
+
// @ts-ignore
|
|
3237
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
3238
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
3239
|
+
products: products,
|
|
3240
|
+
infoSectionIds: options?.infoSectionIds,
|
|
3241
|
+
returnEntity: options?.returnEntity,
|
|
3242
|
+
fields: options?.fields,
|
|
3243
|
+
});
|
|
3244
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkRemoveInfoSectionsFromProducts(payload);
|
|
3245
|
+
sideEffects?.onSiteCall?.();
|
|
3246
|
+
try {
|
|
3247
|
+
const result = await httpClient.request(reqOpts);
|
|
3248
|
+
sideEffects?.onSuccess?.(result);
|
|
3249
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
3250
|
+
{
|
|
3251
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
3252
|
+
paths: [{ path: 'results.item.url' }],
|
|
3253
|
+
},
|
|
3254
|
+
{
|
|
3255
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
3256
|
+
paths: [
|
|
3257
|
+
{ path: 'results.item.media.main.image' },
|
|
3258
|
+
{ path: 'results.item.media.itemsInfo.items.image' },
|
|
3259
|
+
{ path: 'results.item.options.choicesSettings.choices.image' },
|
|
3260
|
+
{
|
|
3261
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.image',
|
|
3262
|
+
},
|
|
3263
|
+
{ path: 'results.item.modifiers.choicesSettings.choices.image' },
|
|
3264
|
+
{
|
|
3265
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.image',
|
|
3266
|
+
},
|
|
3267
|
+
{ path: 'results.item.variantsInfo.variants.media.image' },
|
|
3268
|
+
],
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
3272
|
+
paths: [
|
|
3273
|
+
{ path: 'results.item.media.main.video' },
|
|
3274
|
+
{ path: 'results.item.media.itemsInfo.items.video' },
|
|
3275
|
+
{
|
|
3276
|
+
path: 'results.item.options.choicesSettings.choices.linkedMedia.video',
|
|
3277
|
+
},
|
|
3278
|
+
{
|
|
3279
|
+
path: 'results.item.modifiers.choicesSettings.choices.linkedMedia.video',
|
|
3280
|
+
},
|
|
3281
|
+
{ path: 'results.item.variantsInfo.variants.media.video' },
|
|
3282
|
+
],
|
|
3283
|
+
},
|
|
3284
|
+
]));
|
|
3285
|
+
}
|
|
3286
|
+
catch (err) {
|
|
3287
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3288
|
+
spreadPathsToArguments: {},
|
|
3289
|
+
explicitPathsToArguments: {
|
|
3290
|
+
products: '$[0]',
|
|
3291
|
+
infoSectionIds: '$[1].infoSectionIds',
|
|
3292
|
+
returnEntity: '$[1].returnEntity',
|
|
3293
|
+
fields: '$[1].fields',
|
|
3294
|
+
},
|
|
3295
|
+
singleArgumentUnchanged: false,
|
|
3296
|
+
}, ['products', 'options']);
|
|
3297
|
+
sideEffects?.onError?.(err);
|
|
3298
|
+
throw transformedError;
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
exports.bulkRemoveInfoSectionsFromProducts = bulkRemoveInfoSectionsFromProducts;
|
|
3302
|
+
/**
|
|
3303
|
+
* Adds multiple products, given the provided filter and search expression, to up to 5 categories.
|
|
3304
|
+
*
|
|
3305
|
+
* Learn more about the [Categories API](https://dev.wix.com/docs/rest/business-management/categories/introduction).
|
|
3306
|
+
* @public
|
|
3307
|
+
* @documentationMaturity preview
|
|
3308
|
+
* @requiredField options.categoryIds
|
|
3309
|
+
* @permissionId CATEGORIES.CATEGORY_ADD_ITEM
|
|
3310
|
+
* @permissionScope Manage Stores - all permissions
|
|
3311
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3312
|
+
* @permissionScope Category item write
|
|
3313
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_ITEM_WRITE
|
|
3314
|
+
* @permissionScope Manage Products
|
|
3315
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3316
|
+
* @permissionScope Manage v3 catalog
|
|
3317
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3318
|
+
* @permissionScope Category write
|
|
3319
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_WRITE
|
|
3320
|
+
* @applicableIdentity APP
|
|
3321
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkAddProductsToCategoriesByFilter
|
|
3322
|
+
*/
|
|
3323
|
+
async function bulkAddProductsToCategoriesByFilter(options) {
|
|
3324
|
+
// @ts-ignore
|
|
3325
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
3326
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
3327
|
+
filter: options?.filter,
|
|
3328
|
+
categoryIds: options?.categoryIds,
|
|
3329
|
+
search: options?.search,
|
|
3330
|
+
});
|
|
3331
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkAddProductsToCategoriesByFilter(payload);
|
|
3332
|
+
sideEffects?.onSiteCall?.();
|
|
3333
|
+
try {
|
|
3334
|
+
const result = await httpClient.request(reqOpts);
|
|
3335
|
+
sideEffects?.onSuccess?.(result);
|
|
3336
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
3337
|
+
}
|
|
3338
|
+
catch (err) {
|
|
3339
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3340
|
+
spreadPathsToArguments: {},
|
|
3341
|
+
explicitPathsToArguments: {
|
|
3342
|
+
filter: '$[0].filter',
|
|
3343
|
+
categoryIds: '$[0].categoryIds',
|
|
3344
|
+
search: '$[0].search',
|
|
3345
|
+
},
|
|
3346
|
+
singleArgumentUnchanged: false,
|
|
3347
|
+
}, ['options']);
|
|
3348
|
+
sideEffects?.onError?.(err);
|
|
3349
|
+
throw transformedError;
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
exports.bulkAddProductsToCategoriesByFilter = bulkAddProductsToCategoriesByFilter;
|
|
3353
|
+
/**
|
|
3354
|
+
* Removes multiple products, given the provided filter and search expression, from up to 5 categories.
|
|
3355
|
+
*
|
|
3356
|
+
* Learn more about the [Categories API](https://dev.wix.com/docs/rest/business-management/categories/introduction).
|
|
3357
|
+
* @public
|
|
3358
|
+
* @documentationMaturity preview
|
|
3359
|
+
* @requiredField options.categoryIds
|
|
3360
|
+
* @permissionId CATEGORIES.CATEGORY_REMOVE_ITEM
|
|
3361
|
+
* @permissionScope Manage Stores - all permissions
|
|
3362
|
+
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
3363
|
+
* @permissionScope Category item write
|
|
3364
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_ITEM_WRITE
|
|
3365
|
+
* @permissionScope Manage Products
|
|
3366
|
+
* @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS
|
|
3367
|
+
* @permissionScope Manage v3 catalog
|
|
3368
|
+
* @permissionScopeId SCOPE.STORES.CATALOG_WRITE
|
|
3369
|
+
* @permissionScope Category write
|
|
3370
|
+
* @permissionScopeId SCOPE.CATEGORIES.CATEGORY_WRITE
|
|
3371
|
+
* @applicableIdentity APP
|
|
3372
|
+
* @fqn wix.stores.catalog.v3.CatalogApi.BulkRemoveProductsFromCategoriesByFilter
|
|
3373
|
+
*/
|
|
3374
|
+
async function bulkRemoveProductsFromCategoriesByFilter(options) {
|
|
3375
|
+
// @ts-ignore
|
|
3376
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
3377
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
3378
|
+
filter: options?.filter,
|
|
3379
|
+
categoryIds: options?.categoryIds,
|
|
3380
|
+
search: options?.search,
|
|
3381
|
+
});
|
|
3382
|
+
const reqOpts = ambassadorWixStoresCatalogV3Product.bulkRemoveProductsFromCategoriesByFilter(payload);
|
|
3383
|
+
sideEffects?.onSiteCall?.();
|
|
3384
|
+
try {
|
|
3385
|
+
const result = await httpClient.request(reqOpts);
|
|
3386
|
+
sideEffects?.onSuccess?.(result);
|
|
3387
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
3388
|
+
}
|
|
3389
|
+
catch (err) {
|
|
3390
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
3391
|
+
spreadPathsToArguments: {},
|
|
3392
|
+
explicitPathsToArguments: {
|
|
3393
|
+
filter: '$[0].filter',
|
|
3394
|
+
categoryIds: '$[0].categoryIds',
|
|
3395
|
+
search: '$[0].search',
|
|
3396
|
+
},
|
|
3397
|
+
singleArgumentUnchanged: false,
|
|
3398
|
+
}, ['options']);
|
|
3399
|
+
sideEffects?.onError?.(err);
|
|
3400
|
+
throw transformedError;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
exports.bulkRemoveProductsFromCategoriesByFilter = bulkRemoveProductsFromCategoriesByFilter;
|
|
3404
|
+
//# sourceMappingURL=stores-catalog-v3-product-products-v-3.universal.js.map
|