@wix/stores 1.0.4 → 1.0.6
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 +2 -2
- package/build/cjs/index.js +2 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/{stores-poc-v1-collection.http.d.ts → stores-catalog-v1-collection.http.d.ts} +7 -2
- package/build/cjs/src/{stores-poc-v1-collection.http.js → stores-catalog-v1-collection.http.js} +47 -44
- package/build/cjs/src/stores-catalog-v1-collection.http.js.map +1 -0
- package/build/cjs/src/stores-catalog-v1-collection.public.d.ts +5 -0
- package/build/cjs/src/stores-catalog-v1-collection.public.js +20 -0
- package/build/cjs/src/stores-catalog-v1-collection.public.js.map +1 -0
- package/build/cjs/src/{stores-poc-v1-collection.types.d.ts → stores-catalog-v1-collection.types.d.ts} +51 -17
- package/build/cjs/src/{stores-poc-v1-collection.types.js → stores-catalog-v1-collection.types.js} +1 -1
- package/build/cjs/src/stores-catalog-v1-collection.types.js.map +1 -0
- package/build/cjs/src/{stores-poc-v1-collection.universal.d.ts → stores-catalog-v1-collection.universal.d.ts} +63 -38
- package/build/cjs/src/{stores-poc-v1-collection.universal.js → stores-catalog-v1-collection.universal.js} +55 -55
- package/build/cjs/src/stores-catalog-v1-collection.universal.js.map +1 -0
- package/build/cjs/src/stores-catalog-v1-product.http.d.ts +62 -0
- package/build/cjs/src/stores-catalog-v1-product.http.js +775 -0
- package/build/cjs/src/stores-catalog-v1-product.http.js.map +1 -0
- package/build/cjs/src/stores-catalog-v1-product.public.d.ts +25 -0
- package/build/cjs/src/stores-catalog-v1-product.public.js +139 -0
- package/build/cjs/src/stores-catalog-v1-product.public.js.map +1 -0
- package/build/cjs/src/stores-catalog-v1-product.types.d.ts +1371 -0
- package/build/cjs/src/{stores-poc-v1-product.types.js → stores-catalog-v1-product.types.js} +1 -1
- package/build/cjs/src/stores-catalog-v1-product.types.js.map +1 -0
- package/build/cjs/src/stores-catalog-v1-product.universal.d.ts +1744 -0
- package/build/cjs/src/stores-catalog-v1-product.universal.js +1155 -0
- package/build/cjs/src/stores-catalog-v1-product.universal.js.map +1 -0
- package/build/es/index.d.ts +2 -2
- package/build/es/index.js +2 -2
- package/build/es/index.js.map +1 -1
- package/build/es/src/{stores-poc-v1-collection.http.d.ts → stores-catalog-v1-collection.http.d.ts} +7 -2
- package/build/es/src/{stores-poc-v1-collection.http.js → stores-catalog-v1-collection.http.js} +44 -41
- package/build/es/src/stores-catalog-v1-collection.http.js.map +1 -0
- package/build/es/src/stores-catalog-v1-collection.public.d.ts +5 -0
- package/build/es/src/stores-catalog-v1-collection.public.js +13 -0
- package/build/es/src/stores-catalog-v1-collection.public.js.map +1 -0
- package/build/es/src/{stores-poc-v1-collection.types.d.ts → stores-catalog-v1-collection.types.d.ts} +51 -17
- package/build/es/src/{stores-poc-v1-collection.types.js → stores-catalog-v1-collection.types.js} +1 -1
- package/build/es/src/stores-catalog-v1-collection.types.js.map +1 -0
- package/build/es/src/{stores-poc-v1-collection.universal.d.ts → stores-catalog-v1-collection.universal.d.ts} +63 -38
- package/build/es/src/{stores-poc-v1-collection.universal.js → stores-catalog-v1-collection.universal.js} +53 -53
- package/build/es/src/stores-catalog-v1-collection.universal.js.map +1 -0
- package/build/es/src/stores-catalog-v1-product.http.d.ts +62 -0
- package/build/es/src/stores-catalog-v1-product.http.js +751 -0
- package/build/es/src/stores-catalog-v1-product.http.js.map +1 -0
- package/build/es/src/stores-catalog-v1-product.public.d.ts +25 -0
- package/build/es/src/stores-catalog-v1-product.public.js +108 -0
- package/build/es/src/stores-catalog-v1-product.public.js.map +1 -0
- package/build/es/src/stores-catalog-v1-product.types.d.ts +1371 -0
- package/build/es/src/{stores-poc-v1-product.types.js → stores-catalog-v1-product.types.js} +1 -1
- package/build/es/src/stores-catalog-v1-product.types.js.map +1 -0
- package/build/es/src/stores-catalog-v1-product.universal.d.ts +1744 -0
- package/build/es/src/stores-catalog-v1-product.universal.js +1112 -0
- package/build/es/src/stores-catalog-v1-product.universal.js.map +1 -0
- package/package.json +2 -2
- package/build/cjs/src/stores-poc-v1-collection.http.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-collection.public.d.ts +0 -6
- package/build/cjs/src/stores-poc-v1-collection.public.js +0 -20
- package/build/cjs/src/stores-poc-v1-collection.public.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-collection.types.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-collection.universal.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-product.http.d.ts +0 -4
- package/build/cjs/src/stores-poc-v1-product.http.js +0 -143
- package/build/cjs/src/stores-poc-v1-product.http.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-product.public.d.ts +0 -6
- package/build/cjs/src/stores-poc-v1-product.public.js +0 -25
- package/build/cjs/src/stores-poc-v1-product.public.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-product.types.d.ts +0 -470
- package/build/cjs/src/stores-poc-v1-product.types.js.map +0 -1
- package/build/cjs/src/stores-poc-v1-product.universal.d.ts +0 -549
- package/build/cjs/src/stores-poc-v1-product.universal.js +0 -212
- package/build/cjs/src/stores-poc-v1-product.universal.js.map +0 -1
- package/build/es/src/stores-poc-v1-collection.http.js.map +0 -1
- package/build/es/src/stores-poc-v1-collection.public.d.ts +0 -6
- package/build/es/src/stores-poc-v1-collection.public.js +0 -13
- package/build/es/src/stores-poc-v1-collection.public.js.map +0 -1
- package/build/es/src/stores-poc-v1-collection.types.js.map +0 -1
- package/build/es/src/stores-poc-v1-collection.universal.js.map +0 -1
- package/build/es/src/stores-poc-v1-product.http.d.ts +0 -4
- package/build/es/src/stores-poc-v1-product.http.js +0 -138
- package/build/es/src/stores-poc-v1-product.http.js.map +0 -1
- package/build/es/src/stores-poc-v1-product.public.d.ts +0 -6
- package/build/es/src/stores-poc-v1-product.public.js +0 -13
- package/build/es/src/stores-poc-v1-product.public.js.map +0 -1
- package/build/es/src/stores-poc-v1-product.types.d.ts +0 -470
- package/build/es/src/stores-poc-v1-product.types.js.map +0 -1
- package/build/es/src/stores-poc-v1-product.universal.d.ts +0 -549
- package/build/es/src/stores-poc-v1-product.universal.js +0 -188
- package/build/es/src/stores-poc-v1-product.universal.js.map +0 -1
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProduct = exports.queryProductsPlatformized = exports.bulkAdjustProductProperties = exports.bulkUpdateProducts = exports.removeRibbon = exports.deleteCollection = exports.updateCollection = exports.createCollection = exports.removeBrand = exports.deleteProductOptions = exports.removeProductMediaFromChoices = exports.addProductMediaToChoices = exports.removeProductMedia = exports.addProductMedia = exports.removeProductsFromCollection = exports.addProductsToCollection = exports.resetAllVariantData = exports.updateVariants = exports.deleteProduct = exports.updateProduct = exports.createProduct = void 0;
|
|
4
|
+
const metro_runtime_1 = require("@wix/metro-runtime");
|
|
5
|
+
const ambassador_1 = require("@wix/metro-runtime/ambassador");
|
|
6
|
+
const metro_runtime_2 = require("@wix/metro-runtime");
|
|
7
|
+
const _addProductMediaRequest = {};
|
|
8
|
+
const _addProductMediaResponse = {};
|
|
9
|
+
const _addProductMediaToChoicesRequest = {};
|
|
10
|
+
const _addProductMediaToChoicesResponse = {};
|
|
11
|
+
const _addProductsToCollectionRequest = {};
|
|
12
|
+
const _addProductsToCollectionResponse = {};
|
|
13
|
+
const _adjustValue = {
|
|
14
|
+
price: '_propertyAdjustmentData',
|
|
15
|
+
cost: '_propertyAdjustmentData',
|
|
16
|
+
weight: '_propertyAdjustmentData',
|
|
17
|
+
};
|
|
18
|
+
const _bulkAdjustProductPropertiesRequest = { adjust: '_adjustValue' };
|
|
19
|
+
const _bulkAdjustProductPropertiesResponse = {};
|
|
20
|
+
const _bulkUpdateProductsRequest = { set: '_setValue' };
|
|
21
|
+
const _bulkUpdateProductsResponse = {};
|
|
22
|
+
const _costAndProfitData = {
|
|
23
|
+
itemCost: 'google.protobuf.DoubleValue',
|
|
24
|
+
profit: 'DOUBLE',
|
|
25
|
+
profitMargin: 'DOUBLE',
|
|
26
|
+
};
|
|
27
|
+
const _createCollectionRequest = {};
|
|
28
|
+
const _createCollectionResponse = {};
|
|
29
|
+
const _createProductRequest = { product: '_product' };
|
|
30
|
+
const _createProductResponse = { product: '_product' };
|
|
31
|
+
const _deleteCollectionRequest = {};
|
|
32
|
+
const _deleteCollectionResponse = {};
|
|
33
|
+
const _deleteProductOptionsRequest = {};
|
|
34
|
+
const _deleteProductOptionsResponse = {};
|
|
35
|
+
const _deleteProductRequest = {};
|
|
36
|
+
const _deleteProductResponse = {};
|
|
37
|
+
const _discount = { value: 'DOUBLE' };
|
|
38
|
+
const _getProductRequest = {};
|
|
39
|
+
const _getProductResponse = { product: '_product' };
|
|
40
|
+
const _numericPropertyRange = { minValue: 'DOUBLE', maxValue: 'DOUBLE' };
|
|
41
|
+
const _priceData = {
|
|
42
|
+
price: 'google.protobuf.DoubleValue',
|
|
43
|
+
discountedPrice: 'DOUBLE',
|
|
44
|
+
pricePerUnit: 'google.protobuf.DoubleValue',
|
|
45
|
+
};
|
|
46
|
+
const _pricePerUnitData = { totalQuantity: 'DOUBLE', baseQuantity: 'DOUBLE' };
|
|
47
|
+
const _product = {
|
|
48
|
+
weight: 'google.protobuf.DoubleValue',
|
|
49
|
+
lastUpdated: 'google.protobuf.Timestamp',
|
|
50
|
+
createdDate: 'google.protobuf.Timestamp',
|
|
51
|
+
weightRange: '_numericPropertyRange',
|
|
52
|
+
price: '_priceData',
|
|
53
|
+
priceData: '_priceData',
|
|
54
|
+
convertedPriceData: '_priceData',
|
|
55
|
+
priceRange: '_numericPropertyRange',
|
|
56
|
+
costAndProfitData: '_costAndProfitData',
|
|
57
|
+
costRange: '_numericPropertyRange',
|
|
58
|
+
pricePerUnitData: '_pricePerUnitData',
|
|
59
|
+
discount: '_discount',
|
|
60
|
+
variants: '_variant',
|
|
61
|
+
};
|
|
62
|
+
const _propertyAdjustmentData = { amount: 'DOUBLE' };
|
|
63
|
+
const _queryProductsPlatformizedRequest = {};
|
|
64
|
+
const _queryProductsPlatformizedResponse = { products: '_product' };
|
|
65
|
+
const _removeProductBrandRequest = {};
|
|
66
|
+
const _removeProductBrandResponse = {};
|
|
67
|
+
const _removeProductMediaFromChoicesRequest = {};
|
|
68
|
+
const _removeProductMediaFromChoicesResponse = {};
|
|
69
|
+
const _removeProductMediaRequest = {};
|
|
70
|
+
const _removeProductMediaResponse = {};
|
|
71
|
+
const _removeProductRibbonRequest = {};
|
|
72
|
+
const _removeProductRibbonResponse = {};
|
|
73
|
+
const _removeProductsFromCollectionRequest = {};
|
|
74
|
+
const _removeProductsFromCollectionResponse = {};
|
|
75
|
+
const _resetAllVariantDataRequest = {};
|
|
76
|
+
const _resetAllVariantDataResponse = {};
|
|
77
|
+
const _setValue = { price: 'DOUBLE', cost: 'DOUBLE', weight: 'DOUBLE' };
|
|
78
|
+
const _updateCollectionRequest = {};
|
|
79
|
+
const _updateCollectionResponse = {};
|
|
80
|
+
const _updateProductRequest = { product: '_product' };
|
|
81
|
+
const _updateProductResponse = { product: '_product' };
|
|
82
|
+
const _updateVariantsRequest = { variants: '_variantOverride' };
|
|
83
|
+
const _updateVariantsResponse = { variants: '_variant' };
|
|
84
|
+
const _variant = { variant: '_variantDataWithNoStock' };
|
|
85
|
+
const _variantDataWithNoStock = {
|
|
86
|
+
weight: 'DOUBLE',
|
|
87
|
+
priceData: '_priceData',
|
|
88
|
+
convertedPriceData: '_priceData',
|
|
89
|
+
costAndProfitData: '_costAndProfitData',
|
|
90
|
+
};
|
|
91
|
+
const _variantOverride = {
|
|
92
|
+
price: 'google.protobuf.DoubleValue',
|
|
93
|
+
cost: 'google.protobuf.DoubleValue',
|
|
94
|
+
weight: 'google.protobuf.DoubleValue',
|
|
95
|
+
};
|
|
96
|
+
function resolveWixCatalogApiV1CatalogReadApiUrl(opts) {
|
|
97
|
+
const domainToMappings = {
|
|
98
|
+
'api._api_base_domain_': [
|
|
99
|
+
{
|
|
100
|
+
srcPath: '/wix-ecommerce-catalog-reader-web',
|
|
101
|
+
destPath: '',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
'www._base_domain_': [
|
|
105
|
+
{
|
|
106
|
+
srcPath: '/wix-ecommerce-catalog-reader-web',
|
|
107
|
+
destPath: '',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
srcPath: '/_api/catalog-reader-server',
|
|
111
|
+
destPath: '',
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
'*.dev.wix-code.com': [
|
|
115
|
+
{
|
|
116
|
+
srcPath: '/_api/catalog-reader-server',
|
|
117
|
+
destPath: '',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
_: [
|
|
121
|
+
{
|
|
122
|
+
srcPath: '/_api/catalog-reader-server',
|
|
123
|
+
destPath: '',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
'manage._base_domain_': [
|
|
127
|
+
{
|
|
128
|
+
srcPath: '/wix-ecommerce-catalog-reader-web',
|
|
129
|
+
destPath: '',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
srcPath: '/_api/catalog-reader-server',
|
|
133
|
+
destPath: '',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
};
|
|
137
|
+
return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
138
|
+
}
|
|
139
|
+
function resolveWixCatalogApiV1CatalogWriteApiUrl(opts) {
|
|
140
|
+
const domainToMappings = {
|
|
141
|
+
'api._api_base_domain_': [
|
|
142
|
+
{
|
|
143
|
+
srcPath: '/wix-ecommerce-catalog-web',
|
|
144
|
+
destPath: '',
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
'www._base_domain_': [
|
|
148
|
+
{
|
|
149
|
+
srcPath: '/_api/catalog-server',
|
|
150
|
+
destPath: '',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
srcPath: '/wix-ecommerce-catalog',
|
|
154
|
+
destPath: '',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
_: [
|
|
158
|
+
{
|
|
159
|
+
srcPath: '/_api/catalog-server',
|
|
160
|
+
destPath: '',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
'ecom._base_domain_': [
|
|
164
|
+
{
|
|
165
|
+
srcPath: '/_api/catalog-server',
|
|
166
|
+
destPath: '',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
'*.dev.wix-code.com': [
|
|
170
|
+
{
|
|
171
|
+
srcPath: '/_api/catalog-server',
|
|
172
|
+
destPath: '',
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
'*.pub.wix-code.com': [
|
|
176
|
+
{
|
|
177
|
+
srcPath: '/_api/catalog-server',
|
|
178
|
+
destPath: '',
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
'www.wixapis.com': [
|
|
182
|
+
{
|
|
183
|
+
srcPath: '/stores/v1/collections',
|
|
184
|
+
destPath: '/v1/collections',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
srcPath: '/stores/v1/products',
|
|
188
|
+
destPath: '/v1/products',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
srcPath: '/stores/v1/inventoryItems',
|
|
192
|
+
destPath: '/v1/inventoryItems',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
srcPath: '/stores/v2/inventoryItems',
|
|
196
|
+
destPath: '/v2/inventoryItems',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
srcPath: '/stores/v1/variants',
|
|
200
|
+
destPath: '/v1/variants',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
srcPath: '/stores/v1/bulk/products',
|
|
204
|
+
destPath: '/v1/bulk/products',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
'manage._base_domain_': [
|
|
208
|
+
{
|
|
209
|
+
srcPath: '/wix-ecommerce-catalog',
|
|
210
|
+
destPath: '',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
srcPath: '/_api/catalog-server',
|
|
214
|
+
destPath: '',
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
'editor.wixapps.net': [
|
|
218
|
+
{
|
|
219
|
+
srcPath: '/_api/catalog-server',
|
|
220
|
+
destPath: '',
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
'www.wixgateway.com': [
|
|
224
|
+
{
|
|
225
|
+
srcPath: '/stores/v1/products',
|
|
226
|
+
destPath: '/v1/products',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
srcPath: '/stores/v1/collections',
|
|
230
|
+
destPath: '/v1/collections',
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
};
|
|
234
|
+
return metro_runtime_2.resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
235
|
+
}
|
|
236
|
+
/** Creates a new product. */
|
|
237
|
+
function createProduct(payload) {
|
|
238
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_createProductRequest, {
|
|
239
|
+
_costAndProfitData,
|
|
240
|
+
_discount,
|
|
241
|
+
_numericPropertyRange,
|
|
242
|
+
_priceData,
|
|
243
|
+
_pricePerUnitData,
|
|
244
|
+
_product,
|
|
245
|
+
_variant,
|
|
246
|
+
_variantDataWithNoStock,
|
|
247
|
+
});
|
|
248
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_createProductResponse, {
|
|
249
|
+
_costAndProfitData,
|
|
250
|
+
_discount,
|
|
251
|
+
_numericPropertyRange,
|
|
252
|
+
_priceData,
|
|
253
|
+
_pricePerUnitData,
|
|
254
|
+
_product,
|
|
255
|
+
_variant,
|
|
256
|
+
_variantDataWithNoStock,
|
|
257
|
+
});
|
|
258
|
+
function __createProduct({ host }) {
|
|
259
|
+
const serializedData = toReq(payload);
|
|
260
|
+
const metadata = {
|
|
261
|
+
method: 'POST',
|
|
262
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
263
|
+
protoPath: '/v1/products',
|
|
264
|
+
data: serializedData,
|
|
265
|
+
host,
|
|
266
|
+
}),
|
|
267
|
+
data: serializedData,
|
|
268
|
+
transformResponse: fromRes,
|
|
269
|
+
};
|
|
270
|
+
return metadata;
|
|
271
|
+
}
|
|
272
|
+
__createProduct.fromReq = fromReq;
|
|
273
|
+
return __createProduct;
|
|
274
|
+
}
|
|
275
|
+
exports.createProduct = createProduct;
|
|
276
|
+
/** Updates specified fields in a product. */
|
|
277
|
+
function updateProduct(payload) {
|
|
278
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_updateProductRequest, {
|
|
279
|
+
_costAndProfitData,
|
|
280
|
+
_discount,
|
|
281
|
+
_numericPropertyRange,
|
|
282
|
+
_priceData,
|
|
283
|
+
_pricePerUnitData,
|
|
284
|
+
_product,
|
|
285
|
+
_variant,
|
|
286
|
+
_variantDataWithNoStock,
|
|
287
|
+
});
|
|
288
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_updateProductResponse, {
|
|
289
|
+
_costAndProfitData,
|
|
290
|
+
_discount,
|
|
291
|
+
_numericPropertyRange,
|
|
292
|
+
_priceData,
|
|
293
|
+
_pricePerUnitData,
|
|
294
|
+
_product,
|
|
295
|
+
_variant,
|
|
296
|
+
_variantDataWithNoStock,
|
|
297
|
+
});
|
|
298
|
+
function __updateProduct({ host }) {
|
|
299
|
+
const serializedData = toReq(payload);
|
|
300
|
+
const metadata = {
|
|
301
|
+
method: 'PATCH',
|
|
302
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
303
|
+
protoPath: '/v1/products/{product.id}',
|
|
304
|
+
data: serializedData,
|
|
305
|
+
host,
|
|
306
|
+
}),
|
|
307
|
+
data: serializedData,
|
|
308
|
+
transformResponse: fromRes,
|
|
309
|
+
};
|
|
310
|
+
return metadata;
|
|
311
|
+
}
|
|
312
|
+
__updateProduct.fromReq = fromReq;
|
|
313
|
+
return __updateProduct;
|
|
314
|
+
}
|
|
315
|
+
exports.updateProduct = updateProduct;
|
|
316
|
+
/** Deletes a product. */
|
|
317
|
+
function deleteProduct(payload) {
|
|
318
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deleteProductRequest, {});
|
|
319
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_deleteProductResponse, {});
|
|
320
|
+
function __deleteProduct({ host }) {
|
|
321
|
+
const serializedData = toReq(payload);
|
|
322
|
+
const metadata = {
|
|
323
|
+
method: 'DELETE',
|
|
324
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
325
|
+
protoPath: '/v1/products/{id}',
|
|
326
|
+
data: serializedData,
|
|
327
|
+
host,
|
|
328
|
+
}),
|
|
329
|
+
params: metro_runtime_1.toURLSearchParams(serializedData),
|
|
330
|
+
transformResponse: fromRes,
|
|
331
|
+
};
|
|
332
|
+
return metadata;
|
|
333
|
+
}
|
|
334
|
+
__deleteProduct.fromReq = fromReq;
|
|
335
|
+
return __deleteProduct;
|
|
336
|
+
}
|
|
337
|
+
exports.deleteProduct = deleteProduct;
|
|
338
|
+
/** Updates variants of a specified product. */
|
|
339
|
+
function updateVariants(payload) {
|
|
340
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_updateVariantsRequest, { _variantOverride });
|
|
341
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_updateVariantsResponse, {
|
|
342
|
+
_costAndProfitData,
|
|
343
|
+
_priceData,
|
|
344
|
+
_variant,
|
|
345
|
+
_variantDataWithNoStock,
|
|
346
|
+
});
|
|
347
|
+
function __updateVariants({ host }) {
|
|
348
|
+
const serializedData = toReq(payload);
|
|
349
|
+
const metadata = {
|
|
350
|
+
method: 'PATCH',
|
|
351
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
352
|
+
protoPath: '/v1/products/{id}/variants',
|
|
353
|
+
data: serializedData,
|
|
354
|
+
host,
|
|
355
|
+
}),
|
|
356
|
+
data: serializedData,
|
|
357
|
+
transformResponse: fromRes,
|
|
358
|
+
};
|
|
359
|
+
return metadata;
|
|
360
|
+
}
|
|
361
|
+
__updateVariants.fromReq = fromReq;
|
|
362
|
+
return __updateVariants;
|
|
363
|
+
}
|
|
364
|
+
exports.updateVariants = updateVariants;
|
|
365
|
+
/** Resets all variant information to default values (price = current product price; weight = current product weight; SKU = current product SKU; visibility = true). */
|
|
366
|
+
function resetAllVariantData(payload) {
|
|
367
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_resetAllVariantDataRequest, {});
|
|
368
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_resetAllVariantDataResponse, {});
|
|
369
|
+
function __resetAllVariantData({ host }) {
|
|
370
|
+
const serializedData = toReq(payload);
|
|
371
|
+
const metadata = {
|
|
372
|
+
method: 'POST',
|
|
373
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
374
|
+
protoPath: '/v1/products/{id}/variants/resetToDefault',
|
|
375
|
+
data: serializedData,
|
|
376
|
+
host,
|
|
377
|
+
}),
|
|
378
|
+
data: serializedData,
|
|
379
|
+
transformResponse: fromRes,
|
|
380
|
+
};
|
|
381
|
+
return metadata;
|
|
382
|
+
}
|
|
383
|
+
__resetAllVariantData.fromReq = fromReq;
|
|
384
|
+
return __resetAllVariantData;
|
|
385
|
+
}
|
|
386
|
+
exports.resetAllVariantData = resetAllVariantData;
|
|
387
|
+
/** Adds products to a specified collection. */
|
|
388
|
+
function addProductsToCollection(payload) {
|
|
389
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_addProductsToCollectionRequest, {});
|
|
390
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_addProductsToCollectionResponse, {});
|
|
391
|
+
function __addProductsToCollection({ host }) {
|
|
392
|
+
const serializedData = toReq(payload);
|
|
393
|
+
const metadata = {
|
|
394
|
+
method: 'POST',
|
|
395
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
396
|
+
protoPath: '/v1/collections/{id}/productIds',
|
|
397
|
+
data: serializedData,
|
|
398
|
+
host,
|
|
399
|
+
}),
|
|
400
|
+
data: serializedData,
|
|
401
|
+
transformResponse: fromRes,
|
|
402
|
+
};
|
|
403
|
+
return metadata;
|
|
404
|
+
}
|
|
405
|
+
__addProductsToCollection.fromReq = fromReq;
|
|
406
|
+
return __addProductsToCollection;
|
|
407
|
+
}
|
|
408
|
+
exports.addProductsToCollection = addProductsToCollection;
|
|
409
|
+
/** Deletes products from a specified collection. */
|
|
410
|
+
function removeProductsFromCollection(payload) {
|
|
411
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_removeProductsFromCollectionRequest, {});
|
|
412
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_removeProductsFromCollectionResponse, {});
|
|
413
|
+
function __removeProductsFromCollection({ host }) {
|
|
414
|
+
const serializedData = toReq(payload);
|
|
415
|
+
const metadata = {
|
|
416
|
+
method: 'POST',
|
|
417
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
418
|
+
protoPath: '/v1/collections/{id}/productIds/delete',
|
|
419
|
+
data: serializedData,
|
|
420
|
+
host,
|
|
421
|
+
}),
|
|
422
|
+
data: serializedData,
|
|
423
|
+
transformResponse: fromRes,
|
|
424
|
+
};
|
|
425
|
+
return metadata;
|
|
426
|
+
}
|
|
427
|
+
__removeProductsFromCollection.fromReq = fromReq;
|
|
428
|
+
return __removeProductsFromCollection;
|
|
429
|
+
}
|
|
430
|
+
exports.removeProductsFromCollection = removeProductsFromCollection;
|
|
431
|
+
/** Adds media items to a specified product, either via URL or existing media ID. */
|
|
432
|
+
function addProductMedia(payload) {
|
|
433
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_addProductMediaRequest, {});
|
|
434
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_addProductMediaResponse, {});
|
|
435
|
+
function __addProductMedia({ host }) {
|
|
436
|
+
const serializedData = toReq(payload);
|
|
437
|
+
const metadata = {
|
|
438
|
+
method: 'POST',
|
|
439
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
440
|
+
protoPath: '/v1/products/{id}/media',
|
|
441
|
+
data: serializedData,
|
|
442
|
+
host,
|
|
443
|
+
}),
|
|
444
|
+
data: serializedData,
|
|
445
|
+
transformResponse: fromRes,
|
|
446
|
+
};
|
|
447
|
+
return metadata;
|
|
448
|
+
}
|
|
449
|
+
__addProductMedia.fromReq = fromReq;
|
|
450
|
+
return __addProductMedia;
|
|
451
|
+
}
|
|
452
|
+
exports.addProductMedia = addProductMedia;
|
|
453
|
+
/**
|
|
454
|
+
* Removes specified media items from a product.
|
|
455
|
+
* Pass an empty array to remove all media items.
|
|
456
|
+
*/
|
|
457
|
+
function removeProductMedia(payload) {
|
|
458
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_removeProductMediaRequest, {});
|
|
459
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_removeProductMediaResponse, {});
|
|
460
|
+
function __removeProductMedia({ host }) {
|
|
461
|
+
const serializedData = toReq(payload);
|
|
462
|
+
const metadata = {
|
|
463
|
+
method: 'POST',
|
|
464
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
465
|
+
protoPath: '/v1/products/{id}/media/delete',
|
|
466
|
+
data: serializedData,
|
|
467
|
+
host,
|
|
468
|
+
}),
|
|
469
|
+
data: serializedData,
|
|
470
|
+
transformResponse: fromRes,
|
|
471
|
+
};
|
|
472
|
+
return metadata;
|
|
473
|
+
}
|
|
474
|
+
__removeProductMedia.fromReq = fromReq;
|
|
475
|
+
return __removeProductMedia;
|
|
476
|
+
}
|
|
477
|
+
exports.removeProductMedia = removeProductMedia;
|
|
478
|
+
/**
|
|
479
|
+
* Links media items that are already associated with a specific product to a choice within the same product.
|
|
480
|
+
*
|
|
481
|
+
* Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).
|
|
482
|
+
*
|
|
483
|
+
* To remove all existing media items, call the [Remove Product Media From Choices](https://dev.wix.com/api/rest/wix-stores/catalog/products/remove-product-media-from-choices) endpoint.
|
|
484
|
+
*/
|
|
485
|
+
function addProductMediaToChoices(payload) {
|
|
486
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_addProductMediaToChoicesRequest, {});
|
|
487
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_addProductMediaToChoicesResponse, {});
|
|
488
|
+
function __addProductMediaToChoices({ host }) {
|
|
489
|
+
const serializedData = toReq(payload);
|
|
490
|
+
const metadata = {
|
|
491
|
+
method: 'PATCH',
|
|
492
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
493
|
+
protoPath: '/v1/products/{id}/choices/media',
|
|
494
|
+
data: serializedData,
|
|
495
|
+
host,
|
|
496
|
+
}),
|
|
497
|
+
data: serializedData,
|
|
498
|
+
transformResponse: fromRes,
|
|
499
|
+
};
|
|
500
|
+
return metadata;
|
|
501
|
+
}
|
|
502
|
+
__addProductMediaToChoices.fromReq = fromReq;
|
|
503
|
+
return __addProductMediaToChoices;
|
|
504
|
+
}
|
|
505
|
+
exports.addProductMediaToChoices = addProductMediaToChoices;
|
|
506
|
+
/**
|
|
507
|
+
* Removes media items from all or some of a product's choices.
|
|
508
|
+
* (Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).)
|
|
509
|
+
*/
|
|
510
|
+
function removeProductMediaFromChoices(payload) {
|
|
511
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_removeProductMediaFromChoicesRequest, {});
|
|
512
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_removeProductMediaFromChoicesResponse, {});
|
|
513
|
+
function __removeProductMediaFromChoices({ host }) {
|
|
514
|
+
const serializedData = toReq(payload);
|
|
515
|
+
const metadata = {
|
|
516
|
+
method: 'POST',
|
|
517
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
518
|
+
protoPath: '/v1/products/{id}/choices/media/delete',
|
|
519
|
+
data: serializedData,
|
|
520
|
+
host,
|
|
521
|
+
}),
|
|
522
|
+
data: serializedData,
|
|
523
|
+
transformResponse: fromRes,
|
|
524
|
+
};
|
|
525
|
+
return metadata;
|
|
526
|
+
}
|
|
527
|
+
__removeProductMediaFromChoices.fromReq = fromReq;
|
|
528
|
+
return __removeProductMediaFromChoices;
|
|
529
|
+
}
|
|
530
|
+
exports.removeProductMediaFromChoices = removeProductMediaFromChoices;
|
|
531
|
+
/** Delete all options from a specific product (only available when variant management is disabled). */
|
|
532
|
+
function deleteProductOptions(payload) {
|
|
533
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deleteProductOptionsRequest, {});
|
|
534
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_deleteProductOptionsResponse, {});
|
|
535
|
+
function __deleteProductOptions({ host }) {
|
|
536
|
+
const serializedData = toReq(payload);
|
|
537
|
+
const metadata = {
|
|
538
|
+
method: 'DELETE',
|
|
539
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
540
|
+
protoPath: '/v1/products/{id}/options',
|
|
541
|
+
data: serializedData,
|
|
542
|
+
host,
|
|
543
|
+
}),
|
|
544
|
+
params: metro_runtime_1.toURLSearchParams(serializedData),
|
|
545
|
+
transformResponse: fromRes,
|
|
546
|
+
};
|
|
547
|
+
return metadata;
|
|
548
|
+
}
|
|
549
|
+
__deleteProductOptions.fromReq = fromReq;
|
|
550
|
+
return __deleteProductOptions;
|
|
551
|
+
}
|
|
552
|
+
exports.deleteProductOptions = deleteProductOptions;
|
|
553
|
+
/** Deletes a product's brand. */
|
|
554
|
+
function removeBrand(payload) {
|
|
555
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_removeProductBrandRequest, {});
|
|
556
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_removeProductBrandResponse, {});
|
|
557
|
+
function __removeBrand({ host }) {
|
|
558
|
+
const serializedData = toReq(payload);
|
|
559
|
+
const metadata = {
|
|
560
|
+
method: 'POST',
|
|
561
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
562
|
+
protoPath: '/v1/products/{id}/remove-brand',
|
|
563
|
+
data: serializedData,
|
|
564
|
+
host,
|
|
565
|
+
}),
|
|
566
|
+
data: serializedData,
|
|
567
|
+
transformResponse: fromRes,
|
|
568
|
+
};
|
|
569
|
+
return metadata;
|
|
570
|
+
}
|
|
571
|
+
__removeBrand.fromReq = fromReq;
|
|
572
|
+
return __removeBrand;
|
|
573
|
+
}
|
|
574
|
+
exports.removeBrand = removeBrand;
|
|
575
|
+
/** Creates a new collection. */
|
|
576
|
+
function createCollection(payload) {
|
|
577
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_createCollectionRequest, {});
|
|
578
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_createCollectionResponse, {});
|
|
579
|
+
function __createCollection({ host }) {
|
|
580
|
+
const serializedData = toReq(payload);
|
|
581
|
+
const metadata = {
|
|
582
|
+
method: 'POST',
|
|
583
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
584
|
+
protoPath: '/v1/collections',
|
|
585
|
+
data: serializedData,
|
|
586
|
+
host,
|
|
587
|
+
}),
|
|
588
|
+
data: serializedData,
|
|
589
|
+
transformResponse: fromRes,
|
|
590
|
+
};
|
|
591
|
+
return metadata;
|
|
592
|
+
}
|
|
593
|
+
__createCollection.fromReq = fromReq;
|
|
594
|
+
return __createCollection;
|
|
595
|
+
}
|
|
596
|
+
exports.createCollection = createCollection;
|
|
597
|
+
/**
|
|
598
|
+
* Updates specified properties of a collection.
|
|
599
|
+
* To add products to a collection, call the [Add Products to Collection](https://dev.wix.com/api/rest/wix-stores/catalog/collection/add-products-to-collection) endpoint.
|
|
600
|
+
*/
|
|
601
|
+
function updateCollection(payload) {
|
|
602
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_updateCollectionRequest, {});
|
|
603
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_updateCollectionResponse, {});
|
|
604
|
+
function __updateCollection({ host }) {
|
|
605
|
+
const serializedData = toReq(payload);
|
|
606
|
+
const metadata = {
|
|
607
|
+
method: 'PATCH',
|
|
608
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
609
|
+
protoPath: '/v1/collections/{collection.id}',
|
|
610
|
+
data: serializedData,
|
|
611
|
+
host,
|
|
612
|
+
}),
|
|
613
|
+
data: serializedData,
|
|
614
|
+
transformResponse: fromRes,
|
|
615
|
+
};
|
|
616
|
+
return metadata;
|
|
617
|
+
}
|
|
618
|
+
__updateCollection.fromReq = fromReq;
|
|
619
|
+
return __updateCollection;
|
|
620
|
+
}
|
|
621
|
+
exports.updateCollection = updateCollection;
|
|
622
|
+
/** Deletes a collection. */
|
|
623
|
+
function deleteCollection(payload) {
|
|
624
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deleteCollectionRequest, {});
|
|
625
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_deleteCollectionResponse, {});
|
|
626
|
+
function __deleteCollection({ host }) {
|
|
627
|
+
const serializedData = toReq(payload);
|
|
628
|
+
const metadata = {
|
|
629
|
+
method: 'DELETE',
|
|
630
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
631
|
+
protoPath: '/v1/collections/{id}',
|
|
632
|
+
data: serializedData,
|
|
633
|
+
host,
|
|
634
|
+
}),
|
|
635
|
+
params: metro_runtime_1.toURLSearchParams(serializedData),
|
|
636
|
+
transformResponse: fromRes,
|
|
637
|
+
};
|
|
638
|
+
return metadata;
|
|
639
|
+
}
|
|
640
|
+
__deleteCollection.fromReq = fromReq;
|
|
641
|
+
return __deleteCollection;
|
|
642
|
+
}
|
|
643
|
+
exports.deleteCollection = deleteCollection;
|
|
644
|
+
/** Deletes a product's ribbon. */
|
|
645
|
+
function removeRibbon(payload) {
|
|
646
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_removeProductRibbonRequest, {});
|
|
647
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_removeProductRibbonResponse, {});
|
|
648
|
+
function __removeRibbon({ host }) {
|
|
649
|
+
const serializedData = toReq(payload);
|
|
650
|
+
const metadata = {
|
|
651
|
+
method: 'POST',
|
|
652
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
653
|
+
protoPath: '/v1/products/{id}/remove-ribbon',
|
|
654
|
+
data: serializedData,
|
|
655
|
+
host,
|
|
656
|
+
}),
|
|
657
|
+
data: serializedData,
|
|
658
|
+
transformResponse: fromRes,
|
|
659
|
+
};
|
|
660
|
+
return metadata;
|
|
661
|
+
}
|
|
662
|
+
__removeRibbon.fromReq = fromReq;
|
|
663
|
+
return __removeRibbon;
|
|
664
|
+
}
|
|
665
|
+
exports.removeRibbon = removeRibbon;
|
|
666
|
+
/** Updates a specified property for up to 100 products at a time. */
|
|
667
|
+
function bulkUpdateProducts(payload) {
|
|
668
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_bulkUpdateProductsRequest, { _setValue });
|
|
669
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_bulkUpdateProductsResponse, {});
|
|
670
|
+
function __bulkUpdateProducts({ host }) {
|
|
671
|
+
const serializedData = toReq(payload);
|
|
672
|
+
const metadata = {
|
|
673
|
+
method: 'POST',
|
|
674
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
675
|
+
protoPath: '/v1/bulk/products/update',
|
|
676
|
+
data: serializedData,
|
|
677
|
+
host,
|
|
678
|
+
}),
|
|
679
|
+
data: serializedData,
|
|
680
|
+
transformResponse: fromRes,
|
|
681
|
+
};
|
|
682
|
+
return metadata;
|
|
683
|
+
}
|
|
684
|
+
__bulkUpdateProducts.fromReq = fromReq;
|
|
685
|
+
return __bulkUpdateProducts;
|
|
686
|
+
}
|
|
687
|
+
exports.bulkUpdateProducts = bulkUpdateProducts;
|
|
688
|
+
/**
|
|
689
|
+
* Adjusts a specified numerical property for up to 100 products at a time.
|
|
690
|
+
* The property can be increased or decreased either by percentage or amount.
|
|
691
|
+
*/
|
|
692
|
+
function bulkAdjustProductProperties(payload) {
|
|
693
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_bulkAdjustProductPropertiesRequest, { _adjustValue, _propertyAdjustmentData });
|
|
694
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_bulkAdjustProductPropertiesResponse, {});
|
|
695
|
+
function __bulkAdjustProductProperties({ host }) {
|
|
696
|
+
const serializedData = toReq(payload);
|
|
697
|
+
const metadata = {
|
|
698
|
+
method: 'POST',
|
|
699
|
+
url: resolveWixCatalogApiV1CatalogWriteApiUrl({
|
|
700
|
+
protoPath: '/v1/bulk/products/adjust-properties',
|
|
701
|
+
data: serializedData,
|
|
702
|
+
host,
|
|
703
|
+
}),
|
|
704
|
+
data: serializedData,
|
|
705
|
+
transformResponse: fromRes,
|
|
706
|
+
};
|
|
707
|
+
return metadata;
|
|
708
|
+
}
|
|
709
|
+
__bulkAdjustProductProperties.fromReq = fromReq;
|
|
710
|
+
return __bulkAdjustProductProperties;
|
|
711
|
+
}
|
|
712
|
+
exports.bulkAdjustProductProperties = bulkAdjustProductProperties;
|
|
713
|
+
/** Returns a list of up to 100 products, given the provided paging, sorting and filtering. */
|
|
714
|
+
function queryProductsPlatformized(payload) {
|
|
715
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_queryProductsPlatformizedRequest, {});
|
|
716
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_queryProductsPlatformizedResponse, {
|
|
717
|
+
_costAndProfitData,
|
|
718
|
+
_discount,
|
|
719
|
+
_numericPropertyRange,
|
|
720
|
+
_priceData,
|
|
721
|
+
_pricePerUnitData,
|
|
722
|
+
_product,
|
|
723
|
+
_variant,
|
|
724
|
+
_variantDataWithNoStock,
|
|
725
|
+
});
|
|
726
|
+
function __queryProductsPlatformized({ host }) {
|
|
727
|
+
const serializedData = toReq(payload);
|
|
728
|
+
const metadata = {
|
|
729
|
+
method: 'POST',
|
|
730
|
+
url: resolveWixCatalogApiV1CatalogReadApiUrl({
|
|
731
|
+
protoPath: '/v1/products/query-platformized',
|
|
732
|
+
data: serializedData,
|
|
733
|
+
host,
|
|
734
|
+
}),
|
|
735
|
+
data: serializedData,
|
|
736
|
+
transformResponse: fromRes,
|
|
737
|
+
};
|
|
738
|
+
return metadata;
|
|
739
|
+
}
|
|
740
|
+
__queryProductsPlatformized.fromReq = fromReq;
|
|
741
|
+
return __queryProductsPlatformized;
|
|
742
|
+
}
|
|
743
|
+
exports.queryProductsPlatformized = queryProductsPlatformized;
|
|
744
|
+
/** Retrieves a product with the provided ID. */
|
|
745
|
+
function getProduct(payload) {
|
|
746
|
+
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_getProductRequest, {});
|
|
747
|
+
const { fromJSON: fromRes } = ambassador_1.serializer(_getProductResponse, {
|
|
748
|
+
_costAndProfitData,
|
|
749
|
+
_discount,
|
|
750
|
+
_numericPropertyRange,
|
|
751
|
+
_priceData,
|
|
752
|
+
_pricePerUnitData,
|
|
753
|
+
_product,
|
|
754
|
+
_variant,
|
|
755
|
+
_variantDataWithNoStock,
|
|
756
|
+
});
|
|
757
|
+
function __getProduct({ host }) {
|
|
758
|
+
const serializedData = toReq(payload);
|
|
759
|
+
const metadata = {
|
|
760
|
+
method: 'GET',
|
|
761
|
+
url: resolveWixCatalogApiV1CatalogReadApiUrl({
|
|
762
|
+
protoPath: '/v1/products/{id}',
|
|
763
|
+
data: serializedData,
|
|
764
|
+
host,
|
|
765
|
+
}),
|
|
766
|
+
params: metro_runtime_1.toURLSearchParams(serializedData),
|
|
767
|
+
transformResponse: fromRes,
|
|
768
|
+
};
|
|
769
|
+
return metadata;
|
|
770
|
+
}
|
|
771
|
+
__getProduct.fromReq = fromReq;
|
|
772
|
+
return __getProduct;
|
|
773
|
+
}
|
|
774
|
+
exports.getProduct = getProduct;
|
|
775
|
+
//# sourceMappingURL=stores-catalog-v1-product.http.js.map
|