@wix/auto_sdk_metro_products 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/metroinspector-v1-product-products.context.d.ts +14 -0
- package/build/cjs/src/metroinspector-v1-product-products.context.js +20 -0
- package/build/cjs/src/metroinspector-v1-product-products.context.js.map +1 -0
- package/build/cjs/src/metroinspector-v1-product-products.http.d.ts +16 -0
- package/build/cjs/src/metroinspector-v1-product-products.http.js +728 -0
- package/build/cjs/src/metroinspector-v1-product-products.http.js.map +1 -0
- package/build/cjs/src/metroinspector-v1-product-products.meta.d.ts +30 -0
- package/build/cjs/src/metroinspector-v1-product-products.meta.js +218 -0
- package/build/cjs/src/metroinspector-v1-product-products.meta.js.map +1 -0
- package/build/cjs/src/metroinspector-v1-product-products.public.d.ts +68 -0
- package/build/cjs/src/metroinspector-v1-product-products.public.js +70 -0
- package/build/cjs/src/metroinspector-v1-product-products.public.js.map +1 -0
- package/build/cjs/src/metroinspector-v1-product-products.types.d.ts +587 -0
- package/build/cjs/src/metroinspector-v1-product-products.types.js +43 -0
- package/build/cjs/src/metroinspector-v1-product-products.types.js.map +1 -0
- package/build/cjs/src/metroinspector-v1-product-products.universal.d.ts +626 -0
- package/build/cjs/src/metroinspector-v1-product-products.universal.js +721 -0
- package/build/cjs/src/metroinspector-v1-product-products.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/metroinspector-v1-product-products.context.d.ts +14 -0
- package/build/es/src/metroinspector-v1-product-products.context.js +14 -0
- package/build/es/src/metroinspector-v1-product-products.context.js.map +1 -0
- package/build/es/src/metroinspector-v1-product-products.http.d.ts +16 -0
- package/build/es/src/metroinspector-v1-product-products.http.js +715 -0
- package/build/es/src/metroinspector-v1-product-products.http.js.map +1 -0
- package/build/es/src/metroinspector-v1-product-products.meta.d.ts +30 -0
- package/build/es/src/metroinspector-v1-product-products.meta.js +182 -0
- package/build/es/src/metroinspector-v1-product-products.meta.js.map +1 -0
- package/build/es/src/metroinspector-v1-product-products.public.d.ts +68 -0
- package/build/es/src/metroinspector-v1-product-products.public.js +54 -0
- package/build/es/src/metroinspector-v1-product-products.public.js.map +1 -0
- package/build/es/src/metroinspector-v1-product-products.types.d.ts +587 -0
- package/build/es/src/metroinspector-v1-product-products.types.js +40 -0
- package/build/es/src/metroinspector-v1-product-products.types.js.map +1 -0
- package/build/es/src/metroinspector-v1-product-products.universal.d.ts +626 -0
- package/build/es/src/metroinspector-v1-product-products.universal.js +685 -0
- package/build/es/src/metroinspector-v1-product-products.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/metroinspector-v1-product-products.context.d.ts +14 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.context.js +20 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.context.js.map +1 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.http.d.ts +16 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.http.js +728 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.http.js.map +1 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.meta.d.ts +30 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.meta.js +218 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.meta.js.map +1 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.public.d.ts +68 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.public.js +70 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.public.js.map +1 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.types.d.ts +587 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.types.js +43 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.types.js.map +1 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.universal.d.ts +626 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.universal.js +721 -0
- package/build/internal/cjs/src/metroinspector-v1-product-products.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/metroinspector-v1-product-products.context.d.ts +14 -0
- package/build/internal/es/src/metroinspector-v1-product-products.context.js +14 -0
- package/build/internal/es/src/metroinspector-v1-product-products.context.js.map +1 -0
- package/build/internal/es/src/metroinspector-v1-product-products.http.d.ts +16 -0
- package/build/internal/es/src/metroinspector-v1-product-products.http.js +715 -0
- package/build/internal/es/src/metroinspector-v1-product-products.http.js.map +1 -0
- package/build/internal/es/src/metroinspector-v1-product-products.meta.d.ts +30 -0
- package/build/internal/es/src/metroinspector-v1-product-products.meta.js +182 -0
- package/build/internal/es/src/metroinspector-v1-product-products.meta.js.map +1 -0
- package/build/internal/es/src/metroinspector-v1-product-products.public.d.ts +68 -0
- package/build/internal/es/src/metroinspector-v1-product-products.public.js +54 -0
- package/build/internal/es/src/metroinspector-v1-product-products.public.js.map +1 -0
- package/build/internal/es/src/metroinspector-v1-product-products.types.d.ts +587 -0
- package/build/internal/es/src/metroinspector-v1-product-products.types.js +40 -0
- package/build/internal/es/src/metroinspector-v1-product-products.types.js.map +1 -0
- package/build/internal/es/src/metroinspector-v1-product-products.universal.d.ts +626 -0
- package/build/internal/es/src/metroinspector-v1-product-products.universal.js +685 -0
- package/build/internal/es/src/metroinspector-v1-product-products.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,721 @@
|
|
|
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.bulkDeleteProducts = exports.bulkUpdateProducts = exports.bulkCreateProducts = exports.queryProducts = exports.getProductsStartWith = exports.countProducts = exports.getProduct = exports.updateProduct = exports.deleteProduct = exports.createProduct = exports.SortOrder = exports.LinkRel = exports.SubdivisionType = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixMetroinspectorV1Product = __importStar(require("./metroinspector-v1-product-products.http.js"));
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const audio_1 = require("@wix/sdk-runtime/transformations/audio");
|
|
33
|
+
const audio_2 = require("@wix/sdk-runtime/transformations/audio");
|
|
34
|
+
const address_1 = require("@wix/sdk-runtime/transformations/address");
|
|
35
|
+
const address_2 = require("@wix/sdk-runtime/transformations/address");
|
|
36
|
+
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
37
|
+
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
38
|
+
const video_v2_1 = require("@wix/sdk-runtime/transformations/video-v2");
|
|
39
|
+
const video_v2_2 = require("@wix/sdk-runtime/transformations/video-v2");
|
|
40
|
+
const document_1 = require("@wix/sdk-runtime/transformations/document");
|
|
41
|
+
const document_2 = require("@wix/sdk-runtime/transformations/document");
|
|
42
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
43
|
+
var SubdivisionType;
|
|
44
|
+
(function (SubdivisionType) {
|
|
45
|
+
SubdivisionType["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
|
|
46
|
+
/** State */
|
|
47
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
|
|
48
|
+
/** County */
|
|
49
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
|
|
50
|
+
/** City/town */
|
|
51
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
|
|
52
|
+
/** Neighborhood/quarter */
|
|
53
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
|
|
54
|
+
/** Street/block */
|
|
55
|
+
SubdivisionType["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
|
|
56
|
+
/** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
|
|
57
|
+
SubdivisionType["COUNTRY"] = "COUNTRY";
|
|
58
|
+
})(SubdivisionType || (exports.SubdivisionType = SubdivisionType = {}));
|
|
59
|
+
/**
|
|
60
|
+
* The 'rel' attribute of the link. The rel attribute defines the relationship between a linked resource and the current document.
|
|
61
|
+
* Further reading (also about different possible rel types): https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
|
|
62
|
+
* Following are the accepted 'rel' types by Wix applications.
|
|
63
|
+
*/
|
|
64
|
+
var LinkRel;
|
|
65
|
+
(function (LinkRel) {
|
|
66
|
+
/** default (not implemented) */
|
|
67
|
+
LinkRel["unknown_link_rel"] = "unknown_link_rel";
|
|
68
|
+
/** Indicates that the current document's original author or publisher does not endorse the referenced document. */
|
|
69
|
+
LinkRel["nofollow"] = "nofollow";
|
|
70
|
+
/** Instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it. */
|
|
71
|
+
LinkRel["noopener"] = "noopener";
|
|
72
|
+
/** No Referer header will be included. Additionally, has the same effect as noopener. */
|
|
73
|
+
LinkRel["noreferrer"] = "noreferrer";
|
|
74
|
+
/** Indicates a link that resulted from advertisements or paid placements. */
|
|
75
|
+
LinkRel["sponsored"] = "sponsored";
|
|
76
|
+
})(LinkRel || (exports.LinkRel = LinkRel = {}));
|
|
77
|
+
var SortOrder;
|
|
78
|
+
(function (SortOrder) {
|
|
79
|
+
SortOrder["ASC"] = "ASC";
|
|
80
|
+
SortOrder["DESC"] = "DESC";
|
|
81
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
82
|
+
/**
|
|
83
|
+
* Creating a product
|
|
84
|
+
* @public
|
|
85
|
+
* @requiredField options.product.title
|
|
86
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.CreateProduct
|
|
87
|
+
*/
|
|
88
|
+
async function createProduct(options) {
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
91
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ product: options?.product }), [
|
|
92
|
+
{
|
|
93
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
94
|
+
paths: [
|
|
95
|
+
{ path: 'product.image' },
|
|
96
|
+
{ path: 'product.variants.image' },
|
|
97
|
+
{ path: 'product.mainVariant.image' },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
102
|
+
paths: [{ path: 'product.address' }, { path: 'product.customAddress' }],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
transformFn: document_1.transformSDKDocumentToRESTDocument,
|
|
106
|
+
paths: [{ path: 'product.document' }],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
110
|
+
paths: [{ path: 'product.video' }],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
transformFn: audio_1.transformSDKAudioToRESTAudio,
|
|
114
|
+
paths: [{ path: 'product.audio' }],
|
|
115
|
+
},
|
|
116
|
+
]);
|
|
117
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.createProduct(payload);
|
|
118
|
+
sideEffects?.onSiteCall?.();
|
|
119
|
+
try {
|
|
120
|
+
const result = await httpClient.request(reqOpts);
|
|
121
|
+
sideEffects?.onSuccess?.(result);
|
|
122
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
123
|
+
{
|
|
124
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
125
|
+
paths: [
|
|
126
|
+
{ path: 'product.image' },
|
|
127
|
+
{ path: 'product.variants.image' },
|
|
128
|
+
{ path: 'product.mainVariant.image' },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
133
|
+
paths: [
|
|
134
|
+
{ path: 'product.address' },
|
|
135
|
+
{ path: 'product.customAddress' },
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
140
|
+
paths: [{ path: 'product.document' }],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
144
|
+
paths: [{ path: 'product.video' }],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
148
|
+
paths: [{ path: 'product.audio' }],
|
|
149
|
+
},
|
|
150
|
+
]))?.product;
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
154
|
+
spreadPathsToArguments: {},
|
|
155
|
+
explicitPathsToArguments: { product: '$[0].product' },
|
|
156
|
+
singleArgumentUnchanged: false,
|
|
157
|
+
}, ['options']);
|
|
158
|
+
sideEffects?.onError?.(err);
|
|
159
|
+
throw transformedError;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.createProduct = createProduct;
|
|
163
|
+
/** @public
|
|
164
|
+
* @requiredField productId
|
|
165
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.DeleteProduct
|
|
166
|
+
*/
|
|
167
|
+
async function deleteProduct(productId) {
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
170
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
171
|
+
productId: productId,
|
|
172
|
+
});
|
|
173
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.deleteProduct(payload);
|
|
174
|
+
sideEffects?.onSiteCall?.();
|
|
175
|
+
try {
|
|
176
|
+
const result = await httpClient.request(reqOpts);
|
|
177
|
+
sideEffects?.onSuccess?.(result);
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
181
|
+
spreadPathsToArguments: {},
|
|
182
|
+
explicitPathsToArguments: { productId: '$[0]' },
|
|
183
|
+
singleArgumentUnchanged: false,
|
|
184
|
+
}, ['productId']);
|
|
185
|
+
sideEffects?.onError?.(err);
|
|
186
|
+
throw transformedError;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
exports.deleteProduct = deleteProduct;
|
|
190
|
+
/** @public
|
|
191
|
+
* @requiredField options.product._id
|
|
192
|
+
* @requiredField productId
|
|
193
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.UpdateProduct
|
|
194
|
+
*/
|
|
195
|
+
async function updateProduct(productId, options) {
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
198
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
199
|
+
productId: productId,
|
|
200
|
+
product: options?.product,
|
|
201
|
+
mask: options?.mask,
|
|
202
|
+
}), [
|
|
203
|
+
{
|
|
204
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
205
|
+
paths: [
|
|
206
|
+
{ path: 'product.image' },
|
|
207
|
+
{ path: 'product.variants.image' },
|
|
208
|
+
{ path: 'product.mainVariant.image' },
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
213
|
+
paths: [{ path: 'product.address' }, { path: 'product.customAddress' }],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
transformFn: document_1.transformSDKDocumentToRESTDocument,
|
|
217
|
+
paths: [{ path: 'product.document' }],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
221
|
+
paths: [{ path: 'product.video' }],
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
transformFn: audio_1.transformSDKAudioToRESTAudio,
|
|
225
|
+
paths: [{ path: 'product.audio' }],
|
|
226
|
+
},
|
|
227
|
+
]);
|
|
228
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.updateProduct(payload);
|
|
229
|
+
sideEffects?.onSiteCall?.();
|
|
230
|
+
try {
|
|
231
|
+
const result = await httpClient.request(reqOpts);
|
|
232
|
+
sideEffects?.onSuccess?.(result);
|
|
233
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
234
|
+
{
|
|
235
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
236
|
+
paths: [
|
|
237
|
+
{ path: 'product.image' },
|
|
238
|
+
{ path: 'product.variants.image' },
|
|
239
|
+
{ path: 'product.mainVariant.image' },
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
244
|
+
paths: [
|
|
245
|
+
{ path: 'product.address' },
|
|
246
|
+
{ path: 'product.customAddress' },
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
251
|
+
paths: [{ path: 'product.document' }],
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
255
|
+
paths: [{ path: 'product.video' }],
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
259
|
+
paths: [{ path: 'product.audio' }],
|
|
260
|
+
},
|
|
261
|
+
]))?.product;
|
|
262
|
+
}
|
|
263
|
+
catch (err) {
|
|
264
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
265
|
+
spreadPathsToArguments: {},
|
|
266
|
+
explicitPathsToArguments: {
|
|
267
|
+
productId: '$[0]',
|
|
268
|
+
product: '$[1].product',
|
|
269
|
+
mask: '$[1].mask',
|
|
270
|
+
},
|
|
271
|
+
singleArgumentUnchanged: false,
|
|
272
|
+
}, ['productId', 'options']);
|
|
273
|
+
sideEffects?.onError?.(err);
|
|
274
|
+
throw transformedError;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
exports.updateProduct = updateProduct;
|
|
278
|
+
/**
|
|
279
|
+
* override description
|
|
280
|
+
* @public
|
|
281
|
+
* @requiredField productId
|
|
282
|
+
* @param arg1 - ## new override param 1
|
|
283
|
+
* @returns ## override return
|
|
284
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.GetProduct
|
|
285
|
+
*/
|
|
286
|
+
async function getProduct(productId) {
|
|
287
|
+
// @ts-ignore
|
|
288
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
289
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
290
|
+
productId: productId,
|
|
291
|
+
});
|
|
292
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.getProduct(payload);
|
|
293
|
+
sideEffects?.onSiteCall?.();
|
|
294
|
+
try {
|
|
295
|
+
const result = await httpClient.request(reqOpts);
|
|
296
|
+
sideEffects?.onSuccess?.(result);
|
|
297
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
298
|
+
{
|
|
299
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
300
|
+
paths: [
|
|
301
|
+
{ path: 'product.image' },
|
|
302
|
+
{ path: 'product.variants.image' },
|
|
303
|
+
{ path: 'product.mainVariant.image' },
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
308
|
+
paths: [
|
|
309
|
+
{ path: 'product.address' },
|
|
310
|
+
{ path: 'product.customAddress' },
|
|
311
|
+
],
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
315
|
+
paths: [{ path: 'product.document' }],
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
319
|
+
paths: [{ path: 'product.video' }],
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
323
|
+
paths: [{ path: 'product.audio' }],
|
|
324
|
+
},
|
|
325
|
+
]))?.product;
|
|
326
|
+
}
|
|
327
|
+
catch (err) {
|
|
328
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
329
|
+
spreadPathsToArguments: {},
|
|
330
|
+
explicitPathsToArguments: { productId: '$[0]' },
|
|
331
|
+
singleArgumentUnchanged: false,
|
|
332
|
+
}, ['productId']);
|
|
333
|
+
sideEffects?.onError?.(err);
|
|
334
|
+
throw transformedError;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
exports.getProduct = getProduct;
|
|
338
|
+
/** @public
|
|
339
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.CountProducts
|
|
340
|
+
*/
|
|
341
|
+
async function countProducts(options) {
|
|
342
|
+
// @ts-ignore
|
|
343
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
344
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
345
|
+
filter: options?.filter,
|
|
346
|
+
includeVariants: options?.includeVariants,
|
|
347
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
348
|
+
includeMerchantSpecificData: options?.includeMerchantSpecificData,
|
|
349
|
+
});
|
|
350
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.countProducts(payload);
|
|
351
|
+
sideEffects?.onSiteCall?.();
|
|
352
|
+
try {
|
|
353
|
+
const result = await httpClient.request(reqOpts);
|
|
354
|
+
sideEffects?.onSuccess?.(result);
|
|
355
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
356
|
+
}
|
|
357
|
+
catch (err) {
|
|
358
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
359
|
+
spreadPathsToArguments: {},
|
|
360
|
+
explicitPathsToArguments: {
|
|
361
|
+
filter: '$[0].filter',
|
|
362
|
+
includeVariants: '$[0].includeVariants',
|
|
363
|
+
includeHiddenProducts: '$[0].includeHiddenProducts',
|
|
364
|
+
includeMerchantSpecificData: '$[0].includeMerchantSpecificData',
|
|
365
|
+
},
|
|
366
|
+
singleArgumentUnchanged: false,
|
|
367
|
+
}, ['options']);
|
|
368
|
+
sideEffects?.onError?.(err);
|
|
369
|
+
throw transformedError;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
exports.countProducts = countProducts;
|
|
373
|
+
/** @public
|
|
374
|
+
* @requiredField title
|
|
375
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.GetProductsStartWith
|
|
376
|
+
*/
|
|
377
|
+
async function getProductsStartWith(title, options) {
|
|
378
|
+
// @ts-ignore
|
|
379
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
380
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
381
|
+
title: title,
|
|
382
|
+
addressLine2: options?.addressLine2,
|
|
383
|
+
});
|
|
384
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.getProductsStartWith(payload);
|
|
385
|
+
sideEffects?.onSiteCall?.();
|
|
386
|
+
try {
|
|
387
|
+
const result = await httpClient.request(reqOpts);
|
|
388
|
+
sideEffects?.onSuccess?.(result);
|
|
389
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
390
|
+
{
|
|
391
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
392
|
+
paths: [
|
|
393
|
+
{ path: 'products.image' },
|
|
394
|
+
{ path: 'products.variants.image' },
|
|
395
|
+
{ path: 'products.mainVariant.image' },
|
|
396
|
+
],
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
400
|
+
paths: [
|
|
401
|
+
{ path: 'products.address' },
|
|
402
|
+
{ path: 'products.customAddress' },
|
|
403
|
+
],
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
407
|
+
paths: [{ path: 'products.document' }],
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
411
|
+
paths: [{ path: 'products.video' }],
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
415
|
+
paths: [{ path: 'products.audio' }],
|
|
416
|
+
},
|
|
417
|
+
]));
|
|
418
|
+
}
|
|
419
|
+
catch (err) {
|
|
420
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
421
|
+
spreadPathsToArguments: {},
|
|
422
|
+
explicitPathsToArguments: {
|
|
423
|
+
title: '$[0]',
|
|
424
|
+
addressLine2: '$[1].addressLine2',
|
|
425
|
+
},
|
|
426
|
+
singleArgumentUnchanged: false,
|
|
427
|
+
}, ['title', 'options']);
|
|
428
|
+
sideEffects?.onError?.(err);
|
|
429
|
+
throw transformedError;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
exports.getProductsStartWith = getProductsStartWith;
|
|
433
|
+
/** @public
|
|
434
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.QueryProducts
|
|
435
|
+
*/
|
|
436
|
+
function queryProducts(options) {
|
|
437
|
+
// @ts-ignore
|
|
438
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
439
|
+
return (0, query_builder_1.queryBuilder)({
|
|
440
|
+
func: async (payload) => {
|
|
441
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.queryProducts({
|
|
442
|
+
...payload,
|
|
443
|
+
...(options ?? {}),
|
|
444
|
+
});
|
|
445
|
+
sideEffects?.onSiteCall?.();
|
|
446
|
+
try {
|
|
447
|
+
const result = await httpClient.request(reqOpts);
|
|
448
|
+
sideEffects?.onSuccess?.(result);
|
|
449
|
+
return result;
|
|
450
|
+
}
|
|
451
|
+
catch (err) {
|
|
452
|
+
sideEffects?.onError?.(err);
|
|
453
|
+
throw err;
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
requestTransformer: (query) => {
|
|
457
|
+
const args = [query, options];
|
|
458
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
459
|
+
...args?.[1],
|
|
460
|
+
query: args?.[0],
|
|
461
|
+
});
|
|
462
|
+
},
|
|
463
|
+
responseTransformer: ({ data }) => {
|
|
464
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
|
|
465
|
+
{
|
|
466
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
467
|
+
paths: [
|
|
468
|
+
{ path: 'products.image' },
|
|
469
|
+
{ path: 'products.variants.image' },
|
|
470
|
+
{ path: 'products.mainVariant.image' },
|
|
471
|
+
],
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
475
|
+
paths: [
|
|
476
|
+
{ path: 'products.address' },
|
|
477
|
+
{ path: 'products.customAddress' },
|
|
478
|
+
],
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
482
|
+
paths: [{ path: 'products.document' }],
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
486
|
+
paths: [{ path: 'products.video' }],
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
490
|
+
paths: [{ path: 'products.audio' }],
|
|
491
|
+
},
|
|
492
|
+
]));
|
|
493
|
+
return {
|
|
494
|
+
items: transformedData?.products,
|
|
495
|
+
pagingMetadata: transformedData?.metadata,
|
|
496
|
+
};
|
|
497
|
+
},
|
|
498
|
+
errorTransformer: (err) => {
|
|
499
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
500
|
+
spreadPathsToArguments: {},
|
|
501
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
502
|
+
singleArgumentUnchanged: false,
|
|
503
|
+
});
|
|
504
|
+
throw transformedError;
|
|
505
|
+
},
|
|
506
|
+
pagingMethod: 'CURSOR',
|
|
507
|
+
transformationPaths: {},
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
exports.queryProducts = queryProducts;
|
|
511
|
+
/**
|
|
512
|
+
* create multiple products in a single request. Works synchronously
|
|
513
|
+
* @public
|
|
514
|
+
* @requiredField products
|
|
515
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.BulkCreateProducts
|
|
516
|
+
*/
|
|
517
|
+
async function bulkCreateProducts(products, options) {
|
|
518
|
+
// @ts-ignore
|
|
519
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
520
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
521
|
+
products: products,
|
|
522
|
+
returnEntity: options?.returnEntity,
|
|
523
|
+
}), [
|
|
524
|
+
{
|
|
525
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
526
|
+
paths: [
|
|
527
|
+
{ path: 'products.image' },
|
|
528
|
+
{ path: 'products.variants.image' },
|
|
529
|
+
{ path: 'products.mainVariant.image' },
|
|
530
|
+
],
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
534
|
+
paths: [
|
|
535
|
+
{ path: 'products.address' },
|
|
536
|
+
{ path: 'products.customAddress' },
|
|
537
|
+
],
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
transformFn: document_1.transformSDKDocumentToRESTDocument,
|
|
541
|
+
paths: [{ path: 'products.document' }],
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
545
|
+
paths: [{ path: 'products.video' }],
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
transformFn: audio_1.transformSDKAudioToRESTAudio,
|
|
549
|
+
paths: [{ path: 'products.audio' }],
|
|
550
|
+
},
|
|
551
|
+
]);
|
|
552
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.bulkCreateProducts(payload);
|
|
553
|
+
sideEffects?.onSiteCall?.();
|
|
554
|
+
try {
|
|
555
|
+
const result = await httpClient.request(reqOpts);
|
|
556
|
+
sideEffects?.onSuccess?.(result);
|
|
557
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
558
|
+
{
|
|
559
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
560
|
+
paths: [
|
|
561
|
+
{ path: 'results.item.image' },
|
|
562
|
+
{ path: 'results.item.variants.image' },
|
|
563
|
+
{ path: 'results.item.mainVariant.image' },
|
|
564
|
+
],
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
568
|
+
paths: [
|
|
569
|
+
{ path: 'results.item.address' },
|
|
570
|
+
{ path: 'results.item.customAddress' },
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
575
|
+
paths: [{ path: 'results.item.document' }],
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
579
|
+
paths: [{ path: 'results.item.video' }],
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
583
|
+
paths: [{ path: 'results.item.audio' }],
|
|
584
|
+
},
|
|
585
|
+
]));
|
|
586
|
+
}
|
|
587
|
+
catch (err) {
|
|
588
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
589
|
+
spreadPathsToArguments: {},
|
|
590
|
+
explicitPathsToArguments: {
|
|
591
|
+
products: '$[0]',
|
|
592
|
+
returnEntity: '$[1].returnEntity',
|
|
593
|
+
},
|
|
594
|
+
singleArgumentUnchanged: false,
|
|
595
|
+
}, ['products', 'options']);
|
|
596
|
+
sideEffects?.onError?.(err);
|
|
597
|
+
throw transformedError;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
exports.bulkCreateProducts = bulkCreateProducts;
|
|
601
|
+
/**
|
|
602
|
+
* update multiple products in a single request. Works synchronously.
|
|
603
|
+
* @public
|
|
604
|
+
* @requiredField products
|
|
605
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.BulkUpdateProducts
|
|
606
|
+
*/
|
|
607
|
+
async function bulkUpdateProducts(products, options) {
|
|
608
|
+
// @ts-ignore
|
|
609
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
610
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
611
|
+
products: products,
|
|
612
|
+
returnEntity: options?.returnEntity,
|
|
613
|
+
}), [
|
|
614
|
+
{
|
|
615
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
616
|
+
paths: [
|
|
617
|
+
{ path: 'products.product.image' },
|
|
618
|
+
{ path: 'products.product.variants.image' },
|
|
619
|
+
{ path: 'products.product.mainVariant.image' },
|
|
620
|
+
],
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
624
|
+
paths: [
|
|
625
|
+
{ path: 'products.product.address' },
|
|
626
|
+
{ path: 'products.product.customAddress' },
|
|
627
|
+
],
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
transformFn: document_1.transformSDKDocumentToRESTDocument,
|
|
631
|
+
paths: [{ path: 'products.product.document' }],
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
635
|
+
paths: [{ path: 'products.product.video' }],
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
transformFn: audio_1.transformSDKAudioToRESTAudio,
|
|
639
|
+
paths: [{ path: 'products.product.audio' }],
|
|
640
|
+
},
|
|
641
|
+
]);
|
|
642
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.bulkUpdateProducts(payload);
|
|
643
|
+
sideEffects?.onSiteCall?.();
|
|
644
|
+
try {
|
|
645
|
+
const result = await httpClient.request(reqOpts);
|
|
646
|
+
sideEffects?.onSuccess?.(result);
|
|
647
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
648
|
+
{
|
|
649
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
650
|
+
paths: [
|
|
651
|
+
{ path: 'results.item.image' },
|
|
652
|
+
{ path: 'results.item.variants.image' },
|
|
653
|
+
{ path: 'results.item.mainVariant.image' },
|
|
654
|
+
],
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
658
|
+
paths: [
|
|
659
|
+
{ path: 'results.item.address' },
|
|
660
|
+
{ path: 'results.item.customAddress' },
|
|
661
|
+
],
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
transformFn: document_2.transformRESTDocumentToSDKDocument,
|
|
665
|
+
paths: [{ path: 'results.item.document' }],
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
669
|
+
paths: [{ path: 'results.item.video' }],
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
transformFn: audio_2.transformRESTAudioToSDKAudio,
|
|
673
|
+
paths: [{ path: 'results.item.audio' }],
|
|
674
|
+
},
|
|
675
|
+
]));
|
|
676
|
+
}
|
|
677
|
+
catch (err) {
|
|
678
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
679
|
+
spreadPathsToArguments: {},
|
|
680
|
+
explicitPathsToArguments: {
|
|
681
|
+
products: '$[0]',
|
|
682
|
+
returnEntity: '$[1].returnEntity',
|
|
683
|
+
},
|
|
684
|
+
singleArgumentUnchanged: false,
|
|
685
|
+
}, ['products', 'options']);
|
|
686
|
+
sideEffects?.onError?.(err);
|
|
687
|
+
throw transformedError;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
exports.bulkUpdateProducts = bulkUpdateProducts;
|
|
691
|
+
/**
|
|
692
|
+
* deletes multiple products in a single request. Works synchronously.
|
|
693
|
+
* @public
|
|
694
|
+
* @requiredField productIds
|
|
695
|
+
* @fqn wix.coreservices.metroinspector.v1.products.ProductsService.BulkDeleteProducts
|
|
696
|
+
*/
|
|
697
|
+
async function bulkDeleteProducts(productIds) {
|
|
698
|
+
// @ts-ignore
|
|
699
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
700
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
701
|
+
productIds: productIds,
|
|
702
|
+
});
|
|
703
|
+
const reqOpts = ambassadorWixMetroinspectorV1Product.bulkDeleteProducts(payload);
|
|
704
|
+
sideEffects?.onSiteCall?.();
|
|
705
|
+
try {
|
|
706
|
+
const result = await httpClient.request(reqOpts);
|
|
707
|
+
sideEffects?.onSuccess?.(result);
|
|
708
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
709
|
+
}
|
|
710
|
+
catch (err) {
|
|
711
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
712
|
+
spreadPathsToArguments: {},
|
|
713
|
+
explicitPathsToArguments: { productIds: '$[0]' },
|
|
714
|
+
singleArgumentUnchanged: false,
|
|
715
|
+
}, ['productIds']);
|
|
716
|
+
sideEffects?.onError?.(err);
|
|
717
|
+
throw transformedError;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
exports.bulkDeleteProducts = bulkDeleteProducts;
|
|
721
|
+
//# sourceMappingURL=metroinspector-v1-product-products.universal.js.map
|