@wix/auto_sdk_suppliers-hub_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 +175 -0
- package/build/cjs/index.js +1670 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +25 -0
- package/build/cjs/index.typings.js +1420 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1915 -0
- package/build/cjs/meta.js +1120 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.ts +2721 -0
- package/build/es/index.d.mts +175 -0
- package/build/es/index.mjs +1611 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +25 -0
- package/build/es/index.typings.mjs +1364 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +1915 -0
- package/build/es/meta.mjs +1063 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.mts +2721 -0
- package/build/internal/cjs/index.d.ts +175 -0
- package/build/internal/cjs/index.js +1670 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +25 -0
- package/build/internal/cjs/index.typings.js +1420 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1915 -0
- package/build/internal/cjs/meta.js +1120 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.ts +2721 -0
- package/build/internal/es/index.d.mts +175 -0
- package/build/internal/es/index.mjs +1611 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +25 -0
- package/build/internal/es/index.typings.mjs +1364 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1915 -0
- package/build/internal/es/meta.mjs +1063 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/suppliershub-marketplace-product-v1-product-products.universal-DInaBID7.d.mts +2721 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,1611 @@
|
|
|
1
|
+
// src/suppliershub-marketplace-product-v1-product-products.public.ts
|
|
2
|
+
import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
3
|
+
import { transformRESTImageToSDKImage as transformRESTImageToSDKImage2 } from "@wix/sdk-runtime/transformations/image";
|
|
4
|
+
import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
|
|
5
|
+
import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
6
|
+
import { EventDefinition } from "@wix/sdk-types";
|
|
7
|
+
|
|
8
|
+
// src/suppliershub-marketplace-product-v1-product-products.universal.ts
|
|
9
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
10
|
+
import { queryBuilder } from "@wix/sdk-runtime/query-builder";
|
|
11
|
+
import {
|
|
12
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
13
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
14
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
15
|
+
|
|
16
|
+
// src/suppliershub-marketplace-product-v1-product-products.http.ts
|
|
17
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
18
|
+
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
19
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
20
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
21
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
22
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
23
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
24
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
25
|
+
function resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl(opts) {
|
|
26
|
+
const domainToMappings = {
|
|
27
|
+
"manage._base_domain_": [
|
|
28
|
+
{
|
|
29
|
+
srcPath: "/_api/marketplace-product",
|
|
30
|
+
destPath: ""
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"api._api_base_domain_": [
|
|
34
|
+
{
|
|
35
|
+
srcPath: "/marketplace-product",
|
|
36
|
+
destPath: ""
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"www.wixapis.com": [
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/suppliers-hub/v1/products",
|
|
42
|
+
destPath: "/v1/products"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
srcPath: "/suppliers-hub/v1/bulk/products",
|
|
46
|
+
destPath: "/v1/bulk/products"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
srcPath: "/suppliers-hub/v1/categories",
|
|
50
|
+
destPath: "/v1/categories"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
srcPath: "/suppliershub/marketplace-product/v1/products",
|
|
54
|
+
destPath: "/v1/products"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"*.dev.wix-code.com": [
|
|
58
|
+
{
|
|
59
|
+
srcPath: "/suppliershub/marketplace-product/v1/products",
|
|
60
|
+
destPath: "/v1/products"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
srcPath: "/suppliershub/marketplace-product/v1/bulk/products",
|
|
64
|
+
destPath: "/v1/bulk/products"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/suppliershub/marketplace-product/v1/categories/query",
|
|
68
|
+
destPath: "/v1/categories/query"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
_: [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/suppliershub/marketplace-product/v1/products",
|
|
74
|
+
destPath: "/v1/products"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/suppliershub/marketplace-product/v1/bulk/products",
|
|
78
|
+
destPath: "/v1/bulk/products"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
srcPath: "/suppliershub/marketplace-product/v1/categories/query",
|
|
82
|
+
destPath: "/v1/categories/query"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
};
|
|
86
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
87
|
+
}
|
|
88
|
+
var PACKAGE_NAME = "@wix/auto_sdk_suppliers-hub_products";
|
|
89
|
+
function createProduct(payload) {
|
|
90
|
+
function __createProduct({ host }) {
|
|
91
|
+
const serializedData = transformPaths(payload, [
|
|
92
|
+
{
|
|
93
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
94
|
+
paths: [
|
|
95
|
+
{ path: "product.createdDate" },
|
|
96
|
+
{ path: "product.updatedDate" },
|
|
97
|
+
{ path: "product.providerInfo.productCreatedDate" },
|
|
98
|
+
{ path: "product.media.main.urlExpirationDate" },
|
|
99
|
+
{ path: "product.media.items.urlExpirationDate" },
|
|
100
|
+
{
|
|
101
|
+
path: "product.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
107
|
+
paths: [
|
|
108
|
+
{ path: "product.media.main.focalPoint.x" },
|
|
109
|
+
{ path: "product.media.main.focalPoint.y" },
|
|
110
|
+
{ path: "product.media.items.focalPoint.x" },
|
|
111
|
+
{ path: "product.media.items.focalPoint.y" },
|
|
112
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.x" },
|
|
113
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.y" }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]);
|
|
117
|
+
const metadata = {
|
|
118
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
119
|
+
method: "POST",
|
|
120
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.CreateProduct",
|
|
121
|
+
packageName: PACKAGE_NAME,
|
|
122
|
+
migrationOptions: {
|
|
123
|
+
optInTransformResponse: true
|
|
124
|
+
},
|
|
125
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
126
|
+
protoPath: "/v1/products",
|
|
127
|
+
data: serializedData,
|
|
128
|
+
host
|
|
129
|
+
}),
|
|
130
|
+
data: serializedData,
|
|
131
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
132
|
+
{
|
|
133
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
134
|
+
paths: [
|
|
135
|
+
{ path: "product.createdDate" },
|
|
136
|
+
{ path: "product.updatedDate" },
|
|
137
|
+
{ path: "product.providerInfo.productCreatedDate" },
|
|
138
|
+
{ path: "product.media.main.urlExpirationDate" },
|
|
139
|
+
{ path: "product.media.items.urlExpirationDate" },
|
|
140
|
+
{
|
|
141
|
+
path: "product.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
147
|
+
paths: [
|
|
148
|
+
{ path: "product.media.main.focalPoint.x" },
|
|
149
|
+
{ path: "product.media.main.focalPoint.y" },
|
|
150
|
+
{ path: "product.media.items.focalPoint.x" },
|
|
151
|
+
{ path: "product.media.items.focalPoint.y" },
|
|
152
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.x" },
|
|
153
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.y" }
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
])
|
|
157
|
+
};
|
|
158
|
+
return metadata;
|
|
159
|
+
}
|
|
160
|
+
return __createProduct;
|
|
161
|
+
}
|
|
162
|
+
function getProduct(payload) {
|
|
163
|
+
function __getProduct({ host }) {
|
|
164
|
+
const metadata = {
|
|
165
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
166
|
+
method: "GET",
|
|
167
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.GetProduct",
|
|
168
|
+
packageName: PACKAGE_NAME,
|
|
169
|
+
migrationOptions: {
|
|
170
|
+
optInTransformResponse: true
|
|
171
|
+
},
|
|
172
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
173
|
+
protoPath: "/v1/products/{productId}",
|
|
174
|
+
data: payload,
|
|
175
|
+
host
|
|
176
|
+
}),
|
|
177
|
+
params: toURLSearchParams(payload),
|
|
178
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
179
|
+
{
|
|
180
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
181
|
+
paths: [
|
|
182
|
+
{ path: "product.createdDate" },
|
|
183
|
+
{ path: "product.updatedDate" },
|
|
184
|
+
{ path: "product.providerInfo.productCreatedDate" },
|
|
185
|
+
{ path: "product.media.main.urlExpirationDate" },
|
|
186
|
+
{ path: "product.media.items.urlExpirationDate" },
|
|
187
|
+
{
|
|
188
|
+
path: "product.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
194
|
+
paths: [
|
|
195
|
+
{ path: "product.media.main.focalPoint.x" },
|
|
196
|
+
{ path: "product.media.main.focalPoint.y" },
|
|
197
|
+
{ path: "product.media.items.focalPoint.x" },
|
|
198
|
+
{ path: "product.media.items.focalPoint.y" },
|
|
199
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.x" },
|
|
200
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.y" }
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
])
|
|
204
|
+
};
|
|
205
|
+
return metadata;
|
|
206
|
+
}
|
|
207
|
+
return __getProduct;
|
|
208
|
+
}
|
|
209
|
+
function updateProduct(payload) {
|
|
210
|
+
function __updateProduct({ host }) {
|
|
211
|
+
const serializedData = transformPaths(payload, [
|
|
212
|
+
{
|
|
213
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
214
|
+
paths: [{ path: "fieldMask" }]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
218
|
+
paths: [
|
|
219
|
+
{ path: "product.createdDate" },
|
|
220
|
+
{ path: "product.updatedDate" },
|
|
221
|
+
{ path: "product.providerInfo.productCreatedDate" },
|
|
222
|
+
{ path: "product.media.main.urlExpirationDate" },
|
|
223
|
+
{ path: "product.media.items.urlExpirationDate" },
|
|
224
|
+
{
|
|
225
|
+
path: "product.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
231
|
+
paths: [
|
|
232
|
+
{ path: "product.media.main.focalPoint.x" },
|
|
233
|
+
{ path: "product.media.main.focalPoint.y" },
|
|
234
|
+
{ path: "product.media.items.focalPoint.x" },
|
|
235
|
+
{ path: "product.media.items.focalPoint.y" },
|
|
236
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.x" },
|
|
237
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.y" }
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
]);
|
|
241
|
+
const metadata = {
|
|
242
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
243
|
+
method: "PATCH",
|
|
244
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.UpdateProduct",
|
|
245
|
+
packageName: PACKAGE_NAME,
|
|
246
|
+
migrationOptions: {
|
|
247
|
+
optInTransformResponse: true
|
|
248
|
+
},
|
|
249
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
250
|
+
protoPath: "/v1/products/{product.id}",
|
|
251
|
+
data: serializedData,
|
|
252
|
+
host
|
|
253
|
+
}),
|
|
254
|
+
data: serializedData,
|
|
255
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
256
|
+
{
|
|
257
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
258
|
+
paths: [
|
|
259
|
+
{ path: "product.createdDate" },
|
|
260
|
+
{ path: "product.updatedDate" },
|
|
261
|
+
{ path: "product.providerInfo.productCreatedDate" },
|
|
262
|
+
{ path: "product.media.main.urlExpirationDate" },
|
|
263
|
+
{ path: "product.media.items.urlExpirationDate" },
|
|
264
|
+
{
|
|
265
|
+
path: "product.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
271
|
+
paths: [
|
|
272
|
+
{ path: "product.media.main.focalPoint.x" },
|
|
273
|
+
{ path: "product.media.main.focalPoint.y" },
|
|
274
|
+
{ path: "product.media.items.focalPoint.x" },
|
|
275
|
+
{ path: "product.media.items.focalPoint.y" },
|
|
276
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.x" },
|
|
277
|
+
{ path: "product.printOnDemandOptions.mockupImage.focalPoint.y" }
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
])
|
|
281
|
+
};
|
|
282
|
+
return metadata;
|
|
283
|
+
}
|
|
284
|
+
return __updateProduct;
|
|
285
|
+
}
|
|
286
|
+
function deleteProduct(payload) {
|
|
287
|
+
function __deleteProduct({ host }) {
|
|
288
|
+
const metadata = {
|
|
289
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
290
|
+
method: "DELETE",
|
|
291
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.DeleteProduct",
|
|
292
|
+
packageName: PACKAGE_NAME,
|
|
293
|
+
migrationOptions: {
|
|
294
|
+
optInTransformResponse: true
|
|
295
|
+
},
|
|
296
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
297
|
+
protoPath: "/v1/products/{productId}",
|
|
298
|
+
data: payload,
|
|
299
|
+
host
|
|
300
|
+
}),
|
|
301
|
+
params: toURLSearchParams(payload)
|
|
302
|
+
};
|
|
303
|
+
return metadata;
|
|
304
|
+
}
|
|
305
|
+
return __deleteProduct;
|
|
306
|
+
}
|
|
307
|
+
function bulkCreateProducts(payload) {
|
|
308
|
+
function __bulkCreateProducts({ host }) {
|
|
309
|
+
const serializedData = transformPaths(payload, [
|
|
310
|
+
{
|
|
311
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
312
|
+
paths: [
|
|
313
|
+
{ path: "products.createdDate" },
|
|
314
|
+
{ path: "products.updatedDate" },
|
|
315
|
+
{ path: "products.providerInfo.productCreatedDate" },
|
|
316
|
+
{ path: "products.media.main.urlExpirationDate" },
|
|
317
|
+
{ path: "products.media.items.urlExpirationDate" },
|
|
318
|
+
{
|
|
319
|
+
path: "products.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
325
|
+
paths: [
|
|
326
|
+
{ path: "products.media.main.focalPoint.x" },
|
|
327
|
+
{ path: "products.media.main.focalPoint.y" },
|
|
328
|
+
{ path: "products.media.items.focalPoint.x" },
|
|
329
|
+
{ path: "products.media.items.focalPoint.y" },
|
|
330
|
+
{ path: "products.printOnDemandOptions.mockupImage.focalPoint.x" },
|
|
331
|
+
{ path: "products.printOnDemandOptions.mockupImage.focalPoint.y" }
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
]);
|
|
335
|
+
const metadata = {
|
|
336
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
337
|
+
method: "POST",
|
|
338
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkCreateProducts",
|
|
339
|
+
packageName: PACKAGE_NAME,
|
|
340
|
+
migrationOptions: {
|
|
341
|
+
optInTransformResponse: true
|
|
342
|
+
},
|
|
343
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
344
|
+
protoPath: "/v1/bulk/products/create",
|
|
345
|
+
data: serializedData,
|
|
346
|
+
host
|
|
347
|
+
}),
|
|
348
|
+
data: serializedData,
|
|
349
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
350
|
+
{
|
|
351
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
352
|
+
paths: [
|
|
353
|
+
{ path: "results.item.createdDate" },
|
|
354
|
+
{ path: "results.item.updatedDate" },
|
|
355
|
+
{ path: "results.item.providerInfo.productCreatedDate" },
|
|
356
|
+
{ path: "results.item.media.main.urlExpirationDate" },
|
|
357
|
+
{ path: "results.item.media.items.urlExpirationDate" },
|
|
358
|
+
{
|
|
359
|
+
path: "results.item.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
365
|
+
paths: [
|
|
366
|
+
{ path: "results.item.media.main.focalPoint.x" },
|
|
367
|
+
{ path: "results.item.media.main.focalPoint.y" },
|
|
368
|
+
{ path: "results.item.media.items.focalPoint.x" },
|
|
369
|
+
{ path: "results.item.media.items.focalPoint.y" },
|
|
370
|
+
{
|
|
371
|
+
path: "results.item.printOnDemandOptions.mockupImage.focalPoint.x"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
path: "results.item.printOnDemandOptions.mockupImage.focalPoint.y"
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
])
|
|
379
|
+
};
|
|
380
|
+
return metadata;
|
|
381
|
+
}
|
|
382
|
+
return __bulkCreateProducts;
|
|
383
|
+
}
|
|
384
|
+
function bulkUpdateProducts(payload) {
|
|
385
|
+
function __bulkUpdateProducts({ host }) {
|
|
386
|
+
const serializedData = transformPaths(payload, [
|
|
387
|
+
{
|
|
388
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
389
|
+
paths: [{ path: "products.fieldMask" }]
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
393
|
+
paths: [
|
|
394
|
+
{ path: "products.product.createdDate" },
|
|
395
|
+
{ path: "products.product.updatedDate" },
|
|
396
|
+
{ path: "products.product.providerInfo.productCreatedDate" },
|
|
397
|
+
{ path: "products.product.media.main.urlExpirationDate" },
|
|
398
|
+
{ path: "products.product.media.items.urlExpirationDate" },
|
|
399
|
+
{
|
|
400
|
+
path: "products.product.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
406
|
+
paths: [
|
|
407
|
+
{ path: "products.product.media.main.focalPoint.x" },
|
|
408
|
+
{ path: "products.product.media.main.focalPoint.y" },
|
|
409
|
+
{ path: "products.product.media.items.focalPoint.x" },
|
|
410
|
+
{ path: "products.product.media.items.focalPoint.y" },
|
|
411
|
+
{
|
|
412
|
+
path: "products.product.printOnDemandOptions.mockupImage.focalPoint.x"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
path: "products.product.printOnDemandOptions.mockupImage.focalPoint.y"
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
]);
|
|
420
|
+
const metadata = {
|
|
421
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
422
|
+
method: "PATCH",
|
|
423
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkUpdateProducts",
|
|
424
|
+
packageName: PACKAGE_NAME,
|
|
425
|
+
migrationOptions: {
|
|
426
|
+
optInTransformResponse: true
|
|
427
|
+
},
|
|
428
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
429
|
+
protoPath: "/v1/bulk/products/update",
|
|
430
|
+
data: serializedData,
|
|
431
|
+
host
|
|
432
|
+
}),
|
|
433
|
+
data: serializedData,
|
|
434
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
435
|
+
{
|
|
436
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
437
|
+
paths: [
|
|
438
|
+
{ path: "results.item.createdDate" },
|
|
439
|
+
{ path: "results.item.updatedDate" },
|
|
440
|
+
{ path: "results.item.providerInfo.productCreatedDate" },
|
|
441
|
+
{ path: "results.item.media.main.urlExpirationDate" },
|
|
442
|
+
{ path: "results.item.media.items.urlExpirationDate" },
|
|
443
|
+
{
|
|
444
|
+
path: "results.item.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
445
|
+
}
|
|
446
|
+
]
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
450
|
+
paths: [
|
|
451
|
+
{ path: "results.item.media.main.focalPoint.x" },
|
|
452
|
+
{ path: "results.item.media.main.focalPoint.y" },
|
|
453
|
+
{ path: "results.item.media.items.focalPoint.x" },
|
|
454
|
+
{ path: "results.item.media.items.focalPoint.y" },
|
|
455
|
+
{
|
|
456
|
+
path: "results.item.printOnDemandOptions.mockupImage.focalPoint.x"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
path: "results.item.printOnDemandOptions.mockupImage.focalPoint.y"
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
])
|
|
464
|
+
};
|
|
465
|
+
return metadata;
|
|
466
|
+
}
|
|
467
|
+
return __bulkUpdateProducts;
|
|
468
|
+
}
|
|
469
|
+
function bulkDeleteProducts(payload) {
|
|
470
|
+
function __bulkDeleteProducts({ host }) {
|
|
471
|
+
const metadata = {
|
|
472
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
473
|
+
method: "POST",
|
|
474
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkDeleteProducts",
|
|
475
|
+
packageName: PACKAGE_NAME,
|
|
476
|
+
migrationOptions: {
|
|
477
|
+
optInTransformResponse: true
|
|
478
|
+
},
|
|
479
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
480
|
+
protoPath: "/v1/bulk/products/delete",
|
|
481
|
+
data: payload,
|
|
482
|
+
host
|
|
483
|
+
}),
|
|
484
|
+
data: payload
|
|
485
|
+
};
|
|
486
|
+
return metadata;
|
|
487
|
+
}
|
|
488
|
+
return __bulkDeleteProducts;
|
|
489
|
+
}
|
|
490
|
+
function queryProducts(payload) {
|
|
491
|
+
function __queryProducts({ host }) {
|
|
492
|
+
const metadata = {
|
|
493
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
494
|
+
method: "POST",
|
|
495
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.QueryProducts",
|
|
496
|
+
packageName: PACKAGE_NAME,
|
|
497
|
+
migrationOptions: {
|
|
498
|
+
optInTransformResponse: true
|
|
499
|
+
},
|
|
500
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
501
|
+
protoPath: "/v1/products/query",
|
|
502
|
+
data: payload,
|
|
503
|
+
host
|
|
504
|
+
}),
|
|
505
|
+
data: payload,
|
|
506
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
507
|
+
{
|
|
508
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
509
|
+
paths: [
|
|
510
|
+
{ path: "products.createdDate" },
|
|
511
|
+
{ path: "products.updatedDate" },
|
|
512
|
+
{ path: "products.providerInfo.productCreatedDate" },
|
|
513
|
+
{ path: "products.media.main.urlExpirationDate" },
|
|
514
|
+
{ path: "products.media.items.urlExpirationDate" },
|
|
515
|
+
{
|
|
516
|
+
path: "products.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
517
|
+
}
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
522
|
+
paths: [
|
|
523
|
+
{ path: "products.media.main.focalPoint.x" },
|
|
524
|
+
{ path: "products.media.main.focalPoint.y" },
|
|
525
|
+
{ path: "products.media.items.focalPoint.x" },
|
|
526
|
+
{ path: "products.media.items.focalPoint.y" },
|
|
527
|
+
{
|
|
528
|
+
path: "products.printOnDemandOptions.mockupImage.focalPoint.x"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
path: "products.printOnDemandOptions.mockupImage.focalPoint.y"
|
|
532
|
+
}
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
])
|
|
536
|
+
};
|
|
537
|
+
return metadata;
|
|
538
|
+
}
|
|
539
|
+
return __queryProducts;
|
|
540
|
+
}
|
|
541
|
+
function searchProducts(payload) {
|
|
542
|
+
function __searchProducts({ host }) {
|
|
543
|
+
const serializedData = transformPaths(payload, [
|
|
544
|
+
{
|
|
545
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
546
|
+
paths: [
|
|
547
|
+
{ path: "search.aggregations.range.buckets.from" },
|
|
548
|
+
{ path: "search.aggregations.range.buckets.to" },
|
|
549
|
+
{
|
|
550
|
+
path: "search.aggregations.nested.nestedAggregations.range.buckets.from"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
path: "search.aggregations.nested.nestedAggregations.range.buckets.to"
|
|
554
|
+
}
|
|
555
|
+
]
|
|
556
|
+
}
|
|
557
|
+
]);
|
|
558
|
+
const metadata = {
|
|
559
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
560
|
+
method: "POST",
|
|
561
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.SearchProducts",
|
|
562
|
+
packageName: PACKAGE_NAME,
|
|
563
|
+
migrationOptions: {
|
|
564
|
+
optInTransformResponse: true
|
|
565
|
+
},
|
|
566
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
567
|
+
protoPath: "/v1/products/search",
|
|
568
|
+
data: serializedData,
|
|
569
|
+
host
|
|
570
|
+
}),
|
|
571
|
+
data: serializedData,
|
|
572
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
573
|
+
{
|
|
574
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
575
|
+
paths: [
|
|
576
|
+
{ path: "products.createdDate" },
|
|
577
|
+
{ path: "products.updatedDate" },
|
|
578
|
+
{ path: "products.providerInfo.productCreatedDate" },
|
|
579
|
+
{ path: "products.media.main.urlExpirationDate" },
|
|
580
|
+
{ path: "products.media.items.urlExpirationDate" },
|
|
581
|
+
{
|
|
582
|
+
path: "products.printOnDemandOptions.mockupImage.urlExpirationDate"
|
|
583
|
+
}
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
588
|
+
paths: [
|
|
589
|
+
{ path: "products.media.main.focalPoint.x" },
|
|
590
|
+
{ path: "products.media.main.focalPoint.y" },
|
|
591
|
+
{ path: "products.media.items.focalPoint.x" },
|
|
592
|
+
{ path: "products.media.items.focalPoint.y" },
|
|
593
|
+
{
|
|
594
|
+
path: "products.printOnDemandOptions.mockupImage.focalPoint.x"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
path: "products.printOnDemandOptions.mockupImage.focalPoint.y"
|
|
598
|
+
},
|
|
599
|
+
{ path: "aggregationData.results.scalar.value" },
|
|
600
|
+
{
|
|
601
|
+
path: "aggregationData.results.groupedByValue.results.nestedResults.scalar.value"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
path: "aggregationData.results.nested.results.results.*.scalar.value"
|
|
605
|
+
},
|
|
606
|
+
{ path: "aggregationData.results.ranges.results.from" },
|
|
607
|
+
{ path: "aggregationData.results.ranges.results.to" },
|
|
608
|
+
{
|
|
609
|
+
path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
path: "aggregationData.results.nested.results.results.*.range.from"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
path: "aggregationData.results.nested.results.results.*.range.to"
|
|
619
|
+
}
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
])
|
|
623
|
+
};
|
|
624
|
+
return metadata;
|
|
625
|
+
}
|
|
626
|
+
return __searchProducts;
|
|
627
|
+
}
|
|
628
|
+
function bulkUpdateProductTags(payload) {
|
|
629
|
+
function __bulkUpdateProductTags({ host }) {
|
|
630
|
+
const metadata = {
|
|
631
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
632
|
+
method: "POST",
|
|
633
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkUpdateProductTags",
|
|
634
|
+
packageName: PACKAGE_NAME,
|
|
635
|
+
migrationOptions: {
|
|
636
|
+
optInTransformResponse: true
|
|
637
|
+
},
|
|
638
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
639
|
+
protoPath: "/v1/bulk/products/update-tags",
|
|
640
|
+
data: payload,
|
|
641
|
+
host
|
|
642
|
+
}),
|
|
643
|
+
data: payload
|
|
644
|
+
};
|
|
645
|
+
return metadata;
|
|
646
|
+
}
|
|
647
|
+
return __bulkUpdateProductTags;
|
|
648
|
+
}
|
|
649
|
+
function bulkUpdateProductTagsByFilter(payload) {
|
|
650
|
+
function __bulkUpdateProductTagsByFilter({ host }) {
|
|
651
|
+
const metadata = {
|
|
652
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
653
|
+
method: "POST",
|
|
654
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.BulkUpdateProductTagsByFilter",
|
|
655
|
+
packageName: PACKAGE_NAME,
|
|
656
|
+
migrationOptions: {
|
|
657
|
+
optInTransformResponse: true
|
|
658
|
+
},
|
|
659
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
660
|
+
protoPath: "/v1/bulk/products/update-tags-by-filter",
|
|
661
|
+
data: payload,
|
|
662
|
+
host
|
|
663
|
+
}),
|
|
664
|
+
data: payload
|
|
665
|
+
};
|
|
666
|
+
return metadata;
|
|
667
|
+
}
|
|
668
|
+
return __bulkUpdateProductTagsByFilter;
|
|
669
|
+
}
|
|
670
|
+
function queryCategories(payload) {
|
|
671
|
+
function __queryCategories({ host }) {
|
|
672
|
+
const metadata = {
|
|
673
|
+
entityFqdn: "wix.suppliershub.marketplace_product.v1.product",
|
|
674
|
+
method: "POST",
|
|
675
|
+
methodFqn: "wix.suppliershub.marketplace.product.v1.MarketplaceProduct.QueryCategories",
|
|
676
|
+
packageName: PACKAGE_NAME,
|
|
677
|
+
migrationOptions: {
|
|
678
|
+
optInTransformResponse: true
|
|
679
|
+
},
|
|
680
|
+
url: resolveWixSuppliershubMarketplaceProductV1MarketplaceProductUrl({
|
|
681
|
+
protoPath: "/v1/categories/query",
|
|
682
|
+
data: payload,
|
|
683
|
+
host
|
|
684
|
+
}),
|
|
685
|
+
data: payload
|
|
686
|
+
};
|
|
687
|
+
return metadata;
|
|
688
|
+
}
|
|
689
|
+
return __queryCategories;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// src/suppliershub-marketplace-product-v1-product-products.universal.ts
|
|
693
|
+
import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
|
|
694
|
+
import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
|
|
695
|
+
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
696
|
+
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
697
|
+
import { createSearchUtils } from "@wix/sdk-runtime/search-builder-utils";
|
|
698
|
+
var ProductType = /* @__PURE__ */ ((ProductType2) => {
|
|
699
|
+
ProductType2["DROPSHIPPING"] = "DROPSHIPPING";
|
|
700
|
+
ProductType2["WHOLESALE"] = "WHOLESALE";
|
|
701
|
+
ProductType2["PRINT_ON_DEMAND"] = "PRINT_ON_DEMAND";
|
|
702
|
+
return ProductType2;
|
|
703
|
+
})(ProductType || {});
|
|
704
|
+
var TimeUnit = /* @__PURE__ */ ((TimeUnit2) => {
|
|
705
|
+
TimeUnit2["DAY"] = "DAY";
|
|
706
|
+
TimeUnit2["WEEK"] = "WEEK";
|
|
707
|
+
TimeUnit2["MONTH"] = "MONTH";
|
|
708
|
+
return TimeUnit2;
|
|
709
|
+
})(TimeUnit || {});
|
|
710
|
+
var CountrySelections = /* @__PURE__ */ ((CountrySelections2) => {
|
|
711
|
+
CountrySelections2["REST_OF_THE_WORLD"] = "REST_OF_THE_WORLD";
|
|
712
|
+
CountrySelections2["SPECIFIC_COUNTRY"] = "SPECIFIC_COUNTRY";
|
|
713
|
+
return CountrySelections2;
|
|
714
|
+
})(CountrySelections || {});
|
|
715
|
+
var InventoryTier = /* @__PURE__ */ ((InventoryTier2) => {
|
|
716
|
+
InventoryTier2["EMPTY"] = "EMPTY";
|
|
717
|
+
InventoryTier2["LOW"] = "LOW";
|
|
718
|
+
InventoryTier2["MEDIUM"] = "MEDIUM";
|
|
719
|
+
InventoryTier2["HIGH"] = "HIGH";
|
|
720
|
+
return InventoryTier2;
|
|
721
|
+
})(InventoryTier || {});
|
|
722
|
+
var CategoryNamespace = /* @__PURE__ */ ((CategoryNamespace2) => {
|
|
723
|
+
CategoryNamespace2["DROPSHIPPING_NAMESPACE"] = "DROPSHIPPING_NAMESPACE";
|
|
724
|
+
CategoryNamespace2["WHOLESALE_NAMESPACE"] = "WHOLESALE_NAMESPACE";
|
|
725
|
+
CategoryNamespace2["PRINT_ON_DEMAND_NAMESPACE"] = "PRINT_ON_DEMAND_NAMESPACE";
|
|
726
|
+
return CategoryNamespace2;
|
|
727
|
+
})(CategoryNamespace || {});
|
|
728
|
+
var PrintTechnology = /* @__PURE__ */ ((PrintTechnology2) => {
|
|
729
|
+
PrintTechnology2["DIRECT_TO_FILM"] = "DIRECT_TO_FILM";
|
|
730
|
+
PrintTechnology2["DIRECT_TO_GARMENT"] = "DIRECT_TO_GARMENT";
|
|
731
|
+
PrintTechnology2["CUT_SEW_SUBLIMATION"] = "CUT_SEW_SUBLIMATION";
|
|
732
|
+
PrintTechnology2["DIGITAL_PRINTING"] = "DIGITAL_PRINTING";
|
|
733
|
+
PrintTechnology2["EMBROIDERY"] = "EMBROIDERY";
|
|
734
|
+
PrintTechnology2["SUBLIMATION"] = "SUBLIMATION";
|
|
735
|
+
PrintTechnology2["UV_PRINTING"] = "UV_PRINTING";
|
|
736
|
+
PrintTechnology2["KNITWEAR"] = "KNITWEAR";
|
|
737
|
+
PrintTechnology2["DIRECT_TO_FABRIC"] = "DIRECT_TO_FABRIC";
|
|
738
|
+
return PrintTechnology2;
|
|
739
|
+
})(PrintTechnology || {});
|
|
740
|
+
var MeasurementUnit = /* @__PURE__ */ ((MeasurementUnit2) => {
|
|
741
|
+
MeasurementUnit2["CM"] = "CM";
|
|
742
|
+
MeasurementUnit2["INCHES"] = "INCHES";
|
|
743
|
+
return MeasurementUnit2;
|
|
744
|
+
})(MeasurementUnit || {});
|
|
745
|
+
var RequestedField = /* @__PURE__ */ ((RequestedField2) => {
|
|
746
|
+
RequestedField2["INVENTORY_QUANTITY"] = "INVENTORY_QUANTITY";
|
|
747
|
+
return RequestedField2;
|
|
748
|
+
})(RequestedField || {});
|
|
749
|
+
var CommonSortOrder = /* @__PURE__ */ ((CommonSortOrder2) => {
|
|
750
|
+
CommonSortOrder2["ASC"] = "ASC";
|
|
751
|
+
CommonSortOrder2["DESC"] = "DESC";
|
|
752
|
+
return CommonSortOrder2;
|
|
753
|
+
})(CommonSortOrder || {});
|
|
754
|
+
var SortType = /* @__PURE__ */ ((SortType2) => {
|
|
755
|
+
SortType2["COUNT"] = "COUNT";
|
|
756
|
+
SortType2["VALUE"] = "VALUE";
|
|
757
|
+
return SortType2;
|
|
758
|
+
})(SortType || {});
|
|
759
|
+
var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
|
|
760
|
+
SortDirection2["DESC"] = "DESC";
|
|
761
|
+
SortDirection2["ASC"] = "ASC";
|
|
762
|
+
return SortDirection2;
|
|
763
|
+
})(SortDirection || {});
|
|
764
|
+
var MissingValues = /* @__PURE__ */ ((MissingValues2) => {
|
|
765
|
+
MissingValues2["EXCLUDE"] = "EXCLUDE";
|
|
766
|
+
MissingValues2["INCLUDE"] = "INCLUDE";
|
|
767
|
+
return MissingValues2;
|
|
768
|
+
})(MissingValues || {});
|
|
769
|
+
var ScalarType = /* @__PURE__ */ ((ScalarType2) => {
|
|
770
|
+
ScalarType2["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
771
|
+
ScalarType2["MIN"] = "MIN";
|
|
772
|
+
ScalarType2["MAX"] = "MAX";
|
|
773
|
+
return ScalarType2;
|
|
774
|
+
})(ScalarType || {});
|
|
775
|
+
var NestedAggregationType = /* @__PURE__ */ ((NestedAggregationType2) => {
|
|
776
|
+
NestedAggregationType2["VALUE"] = "VALUE";
|
|
777
|
+
NestedAggregationType2["RANGE"] = "RANGE";
|
|
778
|
+
NestedAggregationType2["SCALAR"] = "SCALAR";
|
|
779
|
+
NestedAggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
780
|
+
return NestedAggregationType2;
|
|
781
|
+
})(NestedAggregationType || {});
|
|
782
|
+
var Interval = /* @__PURE__ */ ((Interval2) => {
|
|
783
|
+
Interval2["YEAR"] = "YEAR";
|
|
784
|
+
Interval2["MONTH"] = "MONTH";
|
|
785
|
+
Interval2["WEEK"] = "WEEK";
|
|
786
|
+
Interval2["DAY"] = "DAY";
|
|
787
|
+
Interval2["HOUR"] = "HOUR";
|
|
788
|
+
Interval2["MINUTE"] = "MINUTE";
|
|
789
|
+
Interval2["SECOND"] = "SECOND";
|
|
790
|
+
return Interval2;
|
|
791
|
+
})(Interval || {});
|
|
792
|
+
var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
|
|
793
|
+
AggregationType2["VALUE"] = "VALUE";
|
|
794
|
+
AggregationType2["RANGE"] = "RANGE";
|
|
795
|
+
AggregationType2["SCALAR"] = "SCALAR";
|
|
796
|
+
AggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
797
|
+
AggregationType2["NESTED"] = "NESTED";
|
|
798
|
+
return AggregationType2;
|
|
799
|
+
})(AggregationType || {});
|
|
800
|
+
var Mode = /* @__PURE__ */ ((Mode2) => {
|
|
801
|
+
Mode2["OR"] = "OR";
|
|
802
|
+
Mode2["AND"] = "AND";
|
|
803
|
+
return Mode2;
|
|
804
|
+
})(Mode || {});
|
|
805
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
806
|
+
SortOrder2["ASC"] = "ASC";
|
|
807
|
+
SortOrder2["DESC"] = "DESC";
|
|
808
|
+
return SortOrder2;
|
|
809
|
+
})(SortOrder || {});
|
|
810
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
811
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
812
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
813
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
814
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
815
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
816
|
+
return WebhookIdentityType2;
|
|
817
|
+
})(WebhookIdentityType || {});
|
|
818
|
+
async function createProduct2(product) {
|
|
819
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
820
|
+
const payload = transformPaths2(
|
|
821
|
+
renameKeysFromSDKRequestToRESTRequest({ product }),
|
|
822
|
+
[
|
|
823
|
+
{
|
|
824
|
+
transformFn: transformSDKImageToRESTImage,
|
|
825
|
+
paths: [
|
|
826
|
+
{ path: "product.media.main" },
|
|
827
|
+
{ path: "product.media.items", isRepeated: true },
|
|
828
|
+
{ path: "product.printOnDemandOptions.mockupImage" }
|
|
829
|
+
]
|
|
830
|
+
}
|
|
831
|
+
]
|
|
832
|
+
);
|
|
833
|
+
const reqOpts = createProduct(payload);
|
|
834
|
+
sideEffects?.onSiteCall?.();
|
|
835
|
+
try {
|
|
836
|
+
const result = await httpClient.request(reqOpts);
|
|
837
|
+
sideEffects?.onSuccess?.(result);
|
|
838
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
839
|
+
transformPaths2(result.data, [
|
|
840
|
+
{
|
|
841
|
+
transformFn: transformRESTImageToSDKImage,
|
|
842
|
+
paths: [
|
|
843
|
+
{ path: "product.media.main" },
|
|
844
|
+
{ path: "product.media.items", isRepeated: true },
|
|
845
|
+
{ path: "product.printOnDemandOptions.mockupImage" }
|
|
846
|
+
]
|
|
847
|
+
}
|
|
848
|
+
])
|
|
849
|
+
)?.product;
|
|
850
|
+
} catch (err) {
|
|
851
|
+
const transformedError = sdkTransformError(
|
|
852
|
+
err,
|
|
853
|
+
{
|
|
854
|
+
spreadPathsToArguments: {},
|
|
855
|
+
explicitPathsToArguments: { product: "$[0]" },
|
|
856
|
+
singleArgumentUnchanged: false
|
|
857
|
+
},
|
|
858
|
+
["product"]
|
|
859
|
+
);
|
|
860
|
+
sideEffects?.onError?.(err);
|
|
861
|
+
throw transformedError;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
async function getProduct2(productId) {
|
|
865
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
866
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
867
|
+
productId
|
|
868
|
+
});
|
|
869
|
+
const reqOpts = getProduct(payload);
|
|
870
|
+
sideEffects?.onSiteCall?.();
|
|
871
|
+
try {
|
|
872
|
+
const result = await httpClient.request(reqOpts);
|
|
873
|
+
sideEffects?.onSuccess?.(result);
|
|
874
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
875
|
+
transformPaths2(result.data, [
|
|
876
|
+
{
|
|
877
|
+
transformFn: transformRESTImageToSDKImage,
|
|
878
|
+
paths: [
|
|
879
|
+
{ path: "product.media.main" },
|
|
880
|
+
{ path: "product.media.items", isRepeated: true },
|
|
881
|
+
{ path: "product.printOnDemandOptions.mockupImage" }
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
])
|
|
885
|
+
)?.product;
|
|
886
|
+
} catch (err) {
|
|
887
|
+
const transformedError = sdkTransformError(
|
|
888
|
+
err,
|
|
889
|
+
{
|
|
890
|
+
spreadPathsToArguments: {},
|
|
891
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
892
|
+
singleArgumentUnchanged: false
|
|
893
|
+
},
|
|
894
|
+
["productId"]
|
|
895
|
+
);
|
|
896
|
+
sideEffects?.onError?.(err);
|
|
897
|
+
throw transformedError;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
async function updateProduct2(_id, product) {
|
|
901
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
902
|
+
const payload = transformPaths2(
|
|
903
|
+
renameKeysFromSDKRequestToRESTRequest({ product: { ...product, id: _id } }),
|
|
904
|
+
[
|
|
905
|
+
{
|
|
906
|
+
transformFn: transformSDKImageToRESTImage,
|
|
907
|
+
paths: [
|
|
908
|
+
{ path: "product.media.main" },
|
|
909
|
+
{ path: "product.media.items", isRepeated: true },
|
|
910
|
+
{ path: "product.printOnDemandOptions.mockupImage" }
|
|
911
|
+
]
|
|
912
|
+
}
|
|
913
|
+
]
|
|
914
|
+
);
|
|
915
|
+
const reqOpts = updateProduct(payload);
|
|
916
|
+
sideEffects?.onSiteCall?.();
|
|
917
|
+
try {
|
|
918
|
+
const result = await httpClient.request(reqOpts);
|
|
919
|
+
sideEffects?.onSuccess?.(result);
|
|
920
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
921
|
+
transformPaths2(result.data, [
|
|
922
|
+
{
|
|
923
|
+
transformFn: transformRESTImageToSDKImage,
|
|
924
|
+
paths: [
|
|
925
|
+
{ path: "product.media.main" },
|
|
926
|
+
{ path: "product.media.items", isRepeated: true },
|
|
927
|
+
{ path: "product.printOnDemandOptions.mockupImage" }
|
|
928
|
+
]
|
|
929
|
+
}
|
|
930
|
+
])
|
|
931
|
+
)?.product;
|
|
932
|
+
} catch (err) {
|
|
933
|
+
const transformedError = sdkTransformError(
|
|
934
|
+
err,
|
|
935
|
+
{
|
|
936
|
+
spreadPathsToArguments: { product: "$[1]" },
|
|
937
|
+
explicitPathsToArguments: { "product.id": "$[0]" },
|
|
938
|
+
singleArgumentUnchanged: false
|
|
939
|
+
},
|
|
940
|
+
["_id", "product"]
|
|
941
|
+
);
|
|
942
|
+
sideEffects?.onError?.(err);
|
|
943
|
+
throw transformedError;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
async function deleteProduct2(productId) {
|
|
947
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
948
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
949
|
+
productId
|
|
950
|
+
});
|
|
951
|
+
const reqOpts = deleteProduct(payload);
|
|
952
|
+
sideEffects?.onSiteCall?.();
|
|
953
|
+
try {
|
|
954
|
+
const result = await httpClient.request(reqOpts);
|
|
955
|
+
sideEffects?.onSuccess?.(result);
|
|
956
|
+
} catch (err) {
|
|
957
|
+
const transformedError = sdkTransformError(
|
|
958
|
+
err,
|
|
959
|
+
{
|
|
960
|
+
spreadPathsToArguments: {},
|
|
961
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
962
|
+
singleArgumentUnchanged: false
|
|
963
|
+
},
|
|
964
|
+
["productId"]
|
|
965
|
+
);
|
|
966
|
+
sideEffects?.onError?.(err);
|
|
967
|
+
throw transformedError;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
async function bulkCreateProducts2(products, options) {
|
|
971
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
972
|
+
const payload = transformPaths2(
|
|
973
|
+
renameKeysFromSDKRequestToRESTRequest({
|
|
974
|
+
products,
|
|
975
|
+
returnEntity: options?.returnEntity
|
|
976
|
+
}),
|
|
977
|
+
[
|
|
978
|
+
{
|
|
979
|
+
transformFn: transformSDKImageToRESTImage,
|
|
980
|
+
paths: [
|
|
981
|
+
{ path: "products.media.main" },
|
|
982
|
+
{ path: "products.media.items", isRepeated: true },
|
|
983
|
+
{ path: "products.printOnDemandOptions.mockupImage" }
|
|
984
|
+
]
|
|
985
|
+
}
|
|
986
|
+
]
|
|
987
|
+
);
|
|
988
|
+
const reqOpts = bulkCreateProducts(
|
|
989
|
+
payload
|
|
990
|
+
);
|
|
991
|
+
sideEffects?.onSiteCall?.();
|
|
992
|
+
try {
|
|
993
|
+
const result = await httpClient.request(reqOpts);
|
|
994
|
+
sideEffects?.onSuccess?.(result);
|
|
995
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
996
|
+
transformPaths2(result.data, [
|
|
997
|
+
{
|
|
998
|
+
transformFn: transformRESTImageToSDKImage,
|
|
999
|
+
paths: [
|
|
1000
|
+
{ path: "results.item.media.main" },
|
|
1001
|
+
{ path: "results.item.media.items", isRepeated: true },
|
|
1002
|
+
{ path: "results.item.printOnDemandOptions.mockupImage" }
|
|
1003
|
+
]
|
|
1004
|
+
}
|
|
1005
|
+
])
|
|
1006
|
+
);
|
|
1007
|
+
} catch (err) {
|
|
1008
|
+
const transformedError = sdkTransformError(
|
|
1009
|
+
err,
|
|
1010
|
+
{
|
|
1011
|
+
spreadPathsToArguments: {},
|
|
1012
|
+
explicitPathsToArguments: {
|
|
1013
|
+
products: "$[0]",
|
|
1014
|
+
returnEntity: "$[1].returnEntity"
|
|
1015
|
+
},
|
|
1016
|
+
singleArgumentUnchanged: false
|
|
1017
|
+
},
|
|
1018
|
+
["products", "options"]
|
|
1019
|
+
);
|
|
1020
|
+
sideEffects?.onError?.(err);
|
|
1021
|
+
throw transformedError;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
async function bulkUpdateProducts2(products, options) {
|
|
1025
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1026
|
+
const payload = transformPaths2(
|
|
1027
|
+
renameKeysFromSDKRequestToRESTRequest({
|
|
1028
|
+
products,
|
|
1029
|
+
returnEntity: options?.returnEntity
|
|
1030
|
+
}),
|
|
1031
|
+
[
|
|
1032
|
+
{
|
|
1033
|
+
transformFn: transformSDKImageToRESTImage,
|
|
1034
|
+
paths: [
|
|
1035
|
+
{ path: "products.product.media.main" },
|
|
1036
|
+
{ path: "products.product.media.items", isRepeated: true },
|
|
1037
|
+
{ path: "products.product.printOnDemandOptions.mockupImage" }
|
|
1038
|
+
]
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
);
|
|
1042
|
+
const reqOpts = bulkUpdateProducts(
|
|
1043
|
+
payload
|
|
1044
|
+
);
|
|
1045
|
+
sideEffects?.onSiteCall?.();
|
|
1046
|
+
try {
|
|
1047
|
+
const result = await httpClient.request(reqOpts);
|
|
1048
|
+
sideEffects?.onSuccess?.(result);
|
|
1049
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1050
|
+
transformPaths2(result.data, [
|
|
1051
|
+
{
|
|
1052
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1053
|
+
paths: [
|
|
1054
|
+
{ path: "results.item.media.main" },
|
|
1055
|
+
{ path: "results.item.media.items", isRepeated: true },
|
|
1056
|
+
{ path: "results.item.printOnDemandOptions.mockupImage" }
|
|
1057
|
+
]
|
|
1058
|
+
}
|
|
1059
|
+
])
|
|
1060
|
+
);
|
|
1061
|
+
} catch (err) {
|
|
1062
|
+
const transformedError = sdkTransformError(
|
|
1063
|
+
err,
|
|
1064
|
+
{
|
|
1065
|
+
spreadPathsToArguments: {},
|
|
1066
|
+
explicitPathsToArguments: {
|
|
1067
|
+
products: "$[0]",
|
|
1068
|
+
returnEntity: "$[1].returnEntity"
|
|
1069
|
+
},
|
|
1070
|
+
singleArgumentUnchanged: false
|
|
1071
|
+
},
|
|
1072
|
+
["products", "options"]
|
|
1073
|
+
);
|
|
1074
|
+
sideEffects?.onError?.(err);
|
|
1075
|
+
throw transformedError;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
async function bulkDeleteProducts2(productIds) {
|
|
1079
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1080
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1081
|
+
productIds
|
|
1082
|
+
});
|
|
1083
|
+
const reqOpts = bulkDeleteProducts(
|
|
1084
|
+
payload
|
|
1085
|
+
);
|
|
1086
|
+
sideEffects?.onSiteCall?.();
|
|
1087
|
+
try {
|
|
1088
|
+
const result = await httpClient.request(reqOpts);
|
|
1089
|
+
sideEffects?.onSuccess?.(result);
|
|
1090
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1091
|
+
} catch (err) {
|
|
1092
|
+
const transformedError = sdkTransformError(
|
|
1093
|
+
err,
|
|
1094
|
+
{
|
|
1095
|
+
spreadPathsToArguments: {},
|
|
1096
|
+
explicitPathsToArguments: { productIds: "$[0]" },
|
|
1097
|
+
singleArgumentUnchanged: false
|
|
1098
|
+
},
|
|
1099
|
+
["productIds"]
|
|
1100
|
+
);
|
|
1101
|
+
sideEffects?.onError?.(err);
|
|
1102
|
+
throw transformedError;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
function queryProducts2() {
|
|
1106
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
1107
|
+
return queryBuilder({
|
|
1108
|
+
func: async (payload) => {
|
|
1109
|
+
const reqOpts = queryProducts(
|
|
1110
|
+
payload
|
|
1111
|
+
);
|
|
1112
|
+
sideEffects?.onSiteCall?.();
|
|
1113
|
+
try {
|
|
1114
|
+
const result = await httpClient.request(reqOpts);
|
|
1115
|
+
sideEffects?.onSuccess?.(result);
|
|
1116
|
+
return result;
|
|
1117
|
+
} catch (err) {
|
|
1118
|
+
sideEffects?.onError?.(err);
|
|
1119
|
+
throw err;
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
requestTransformer: (query) => {
|
|
1123
|
+
const args = [query, {}];
|
|
1124
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
1125
|
+
...args?.[1],
|
|
1126
|
+
query: args?.[0]
|
|
1127
|
+
});
|
|
1128
|
+
},
|
|
1129
|
+
responseTransformer: ({ data }) => {
|
|
1130
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(
|
|
1131
|
+
transformPaths2(data, [
|
|
1132
|
+
{
|
|
1133
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1134
|
+
paths: [
|
|
1135
|
+
{ path: "products.media.main" },
|
|
1136
|
+
{ path: "products.media.items", isRepeated: true },
|
|
1137
|
+
{ path: "products.printOnDemandOptions.mockupImage" }
|
|
1138
|
+
]
|
|
1139
|
+
}
|
|
1140
|
+
])
|
|
1141
|
+
);
|
|
1142
|
+
return {
|
|
1143
|
+
items: transformedData?.products,
|
|
1144
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
1145
|
+
};
|
|
1146
|
+
},
|
|
1147
|
+
errorTransformer: (err) => {
|
|
1148
|
+
const transformedError = sdkTransformError(err, {
|
|
1149
|
+
spreadPathsToArguments: {},
|
|
1150
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1151
|
+
singleArgumentUnchanged: false
|
|
1152
|
+
});
|
|
1153
|
+
throw transformedError;
|
|
1154
|
+
},
|
|
1155
|
+
pagingMethod: "CURSOR",
|
|
1156
|
+
transformationPaths: {}
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
async function typedQueryProducts(query) {
|
|
1160
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1161
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ query });
|
|
1162
|
+
const reqOpts = queryProducts(payload);
|
|
1163
|
+
sideEffects?.onSiteCall?.();
|
|
1164
|
+
try {
|
|
1165
|
+
const result = await httpClient.request(reqOpts);
|
|
1166
|
+
sideEffects?.onSuccess?.(result);
|
|
1167
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1168
|
+
transformPaths2(result.data, [
|
|
1169
|
+
{
|
|
1170
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1171
|
+
paths: [
|
|
1172
|
+
{ path: "products.media.main" },
|
|
1173
|
+
{ path: "products.media.items", isRepeated: true },
|
|
1174
|
+
{ path: "products.printOnDemandOptions.mockupImage" }
|
|
1175
|
+
]
|
|
1176
|
+
}
|
|
1177
|
+
])
|
|
1178
|
+
);
|
|
1179
|
+
} catch (err) {
|
|
1180
|
+
const transformedError = sdkTransformError(
|
|
1181
|
+
err,
|
|
1182
|
+
{
|
|
1183
|
+
spreadPathsToArguments: {},
|
|
1184
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1185
|
+
singleArgumentUnchanged: false
|
|
1186
|
+
},
|
|
1187
|
+
["query"]
|
|
1188
|
+
);
|
|
1189
|
+
sideEffects?.onError?.(err);
|
|
1190
|
+
throw transformedError;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
var utils = {
|
|
1194
|
+
query: {
|
|
1195
|
+
...createQueryUtils()
|
|
1196
|
+
},
|
|
1197
|
+
search: {
|
|
1198
|
+
...createSearchUtils()
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
async function searchProducts2(search) {
|
|
1202
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1203
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ search });
|
|
1204
|
+
const reqOpts = searchProducts(
|
|
1205
|
+
payload
|
|
1206
|
+
);
|
|
1207
|
+
sideEffects?.onSiteCall?.();
|
|
1208
|
+
try {
|
|
1209
|
+
const result = await httpClient.request(reqOpts);
|
|
1210
|
+
sideEffects?.onSuccess?.(result);
|
|
1211
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1212
|
+
transformPaths2(result.data, [
|
|
1213
|
+
{
|
|
1214
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1215
|
+
paths: [
|
|
1216
|
+
{ path: "products.media.main" },
|
|
1217
|
+
{ path: "products.media.items", isRepeated: true },
|
|
1218
|
+
{ path: "products.printOnDemandOptions.mockupImage" }
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
])
|
|
1222
|
+
);
|
|
1223
|
+
} catch (err) {
|
|
1224
|
+
const transformedError = sdkTransformError(
|
|
1225
|
+
err,
|
|
1226
|
+
{
|
|
1227
|
+
spreadPathsToArguments: {},
|
|
1228
|
+
explicitPathsToArguments: { search: "$[0]" },
|
|
1229
|
+
singleArgumentUnchanged: false
|
|
1230
|
+
},
|
|
1231
|
+
["search"]
|
|
1232
|
+
);
|
|
1233
|
+
sideEffects?.onError?.(err);
|
|
1234
|
+
throw transformedError;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
async function bulkUpdateProductTags2(productIds, options) {
|
|
1238
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1239
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1240
|
+
productIds,
|
|
1241
|
+
assignTags: options?.assignTags,
|
|
1242
|
+
unassignTags: options?.unassignTags
|
|
1243
|
+
});
|
|
1244
|
+
const reqOpts = bulkUpdateProductTags(
|
|
1245
|
+
payload
|
|
1246
|
+
);
|
|
1247
|
+
sideEffects?.onSiteCall?.();
|
|
1248
|
+
try {
|
|
1249
|
+
const result = await httpClient.request(reqOpts);
|
|
1250
|
+
sideEffects?.onSuccess?.(result);
|
|
1251
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1252
|
+
} catch (err) {
|
|
1253
|
+
const transformedError = sdkTransformError(
|
|
1254
|
+
err,
|
|
1255
|
+
{
|
|
1256
|
+
spreadPathsToArguments: {},
|
|
1257
|
+
explicitPathsToArguments: {
|
|
1258
|
+
productIds: "$[0]",
|
|
1259
|
+
assignTags: "$[1].assignTags",
|
|
1260
|
+
unassignTags: "$[1].unassignTags"
|
|
1261
|
+
},
|
|
1262
|
+
singleArgumentUnchanged: false
|
|
1263
|
+
},
|
|
1264
|
+
["productIds", "options"]
|
|
1265
|
+
);
|
|
1266
|
+
sideEffects?.onError?.(err);
|
|
1267
|
+
throw transformedError;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
async function bulkUpdateProductTagsByFilter2(filter, options) {
|
|
1271
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1272
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1273
|
+
filter,
|
|
1274
|
+
assignTags: options?.assignTags,
|
|
1275
|
+
unassignTags: options?.unassignTags
|
|
1276
|
+
});
|
|
1277
|
+
const reqOpts = bulkUpdateProductTagsByFilter(
|
|
1278
|
+
payload
|
|
1279
|
+
);
|
|
1280
|
+
sideEffects?.onSiteCall?.();
|
|
1281
|
+
try {
|
|
1282
|
+
const result = await httpClient.request(reqOpts);
|
|
1283
|
+
sideEffects?.onSuccess?.(result);
|
|
1284
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1285
|
+
} catch (err) {
|
|
1286
|
+
const transformedError = sdkTransformError(
|
|
1287
|
+
err,
|
|
1288
|
+
{
|
|
1289
|
+
spreadPathsToArguments: {},
|
|
1290
|
+
explicitPathsToArguments: {
|
|
1291
|
+
filter: "$[0]",
|
|
1292
|
+
assignTags: "$[1].assignTags",
|
|
1293
|
+
unassignTags: "$[1].unassignTags"
|
|
1294
|
+
},
|
|
1295
|
+
singleArgumentUnchanged: false
|
|
1296
|
+
},
|
|
1297
|
+
["filter", "options"]
|
|
1298
|
+
);
|
|
1299
|
+
sideEffects?.onError?.(err);
|
|
1300
|
+
throw transformedError;
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
async function queryCategories2(options) {
|
|
1304
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1305
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1306
|
+
query: options?.query,
|
|
1307
|
+
namespace: options?.namespace,
|
|
1308
|
+
returnNonVisibleCategories: options?.returnNonVisibleCategories
|
|
1309
|
+
});
|
|
1310
|
+
const reqOpts = queryCategories(
|
|
1311
|
+
payload
|
|
1312
|
+
);
|
|
1313
|
+
sideEffects?.onSiteCall?.();
|
|
1314
|
+
try {
|
|
1315
|
+
const result = await httpClient.request(reqOpts);
|
|
1316
|
+
sideEffects?.onSuccess?.(result);
|
|
1317
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1318
|
+
} catch (err) {
|
|
1319
|
+
const transformedError = sdkTransformError(
|
|
1320
|
+
err,
|
|
1321
|
+
{
|
|
1322
|
+
spreadPathsToArguments: {},
|
|
1323
|
+
explicitPathsToArguments: {
|
|
1324
|
+
query: "$[0].query",
|
|
1325
|
+
namespace: "$[0].namespace",
|
|
1326
|
+
returnNonVisibleCategories: "$[0].returnNonVisibleCategories"
|
|
1327
|
+
},
|
|
1328
|
+
singleArgumentUnchanged: false
|
|
1329
|
+
},
|
|
1330
|
+
["options"]
|
|
1331
|
+
);
|
|
1332
|
+
sideEffects?.onError?.(err);
|
|
1333
|
+
throw transformedError;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// src/suppliershub-marketplace-product-v1-product-products.public.ts
|
|
1338
|
+
function createProduct3(httpClient) {
|
|
1339
|
+
return (product) => createProduct2(
|
|
1340
|
+
product,
|
|
1341
|
+
// @ts-ignore
|
|
1342
|
+
{ httpClient }
|
|
1343
|
+
);
|
|
1344
|
+
}
|
|
1345
|
+
function getProduct3(httpClient) {
|
|
1346
|
+
return (productId) => getProduct2(
|
|
1347
|
+
productId,
|
|
1348
|
+
// @ts-ignore
|
|
1349
|
+
{ httpClient }
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
function updateProduct3(httpClient) {
|
|
1353
|
+
return (_id, product) => updateProduct2(
|
|
1354
|
+
_id,
|
|
1355
|
+
product,
|
|
1356
|
+
// @ts-ignore
|
|
1357
|
+
{ httpClient }
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
function deleteProduct3(httpClient) {
|
|
1361
|
+
return (productId) => deleteProduct2(
|
|
1362
|
+
productId,
|
|
1363
|
+
// @ts-ignore
|
|
1364
|
+
{ httpClient }
|
|
1365
|
+
);
|
|
1366
|
+
}
|
|
1367
|
+
function bulkCreateProducts3(httpClient) {
|
|
1368
|
+
return (products, options) => bulkCreateProducts2(
|
|
1369
|
+
products,
|
|
1370
|
+
options,
|
|
1371
|
+
// @ts-ignore
|
|
1372
|
+
{ httpClient }
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
function bulkUpdateProducts3(httpClient) {
|
|
1376
|
+
return (products, options) => bulkUpdateProducts2(
|
|
1377
|
+
products,
|
|
1378
|
+
options,
|
|
1379
|
+
// @ts-ignore
|
|
1380
|
+
{ httpClient }
|
|
1381
|
+
);
|
|
1382
|
+
}
|
|
1383
|
+
function bulkDeleteProducts3(httpClient) {
|
|
1384
|
+
return (productIds) => bulkDeleteProducts2(
|
|
1385
|
+
productIds,
|
|
1386
|
+
// @ts-ignore
|
|
1387
|
+
{ httpClient }
|
|
1388
|
+
);
|
|
1389
|
+
}
|
|
1390
|
+
function queryProducts3(httpClient) {
|
|
1391
|
+
return () => queryProducts2(
|
|
1392
|
+
// @ts-ignore
|
|
1393
|
+
{ httpClient }
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
function typedQueryProducts2(httpClient) {
|
|
1397
|
+
return (query) => typedQueryProducts(
|
|
1398
|
+
query,
|
|
1399
|
+
// @ts-ignore
|
|
1400
|
+
{ httpClient }
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
function searchProducts3(httpClient) {
|
|
1404
|
+
return (search) => searchProducts2(
|
|
1405
|
+
search,
|
|
1406
|
+
// @ts-ignore
|
|
1407
|
+
{ httpClient }
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
function bulkUpdateProductTags3(httpClient) {
|
|
1411
|
+
return (productIds, options) => bulkUpdateProductTags2(
|
|
1412
|
+
productIds,
|
|
1413
|
+
options,
|
|
1414
|
+
// @ts-ignore
|
|
1415
|
+
{ httpClient }
|
|
1416
|
+
);
|
|
1417
|
+
}
|
|
1418
|
+
function bulkUpdateProductTagsByFilter3(httpClient) {
|
|
1419
|
+
return (filter, options) => bulkUpdateProductTagsByFilter2(
|
|
1420
|
+
filter,
|
|
1421
|
+
options,
|
|
1422
|
+
// @ts-ignore
|
|
1423
|
+
{ httpClient }
|
|
1424
|
+
);
|
|
1425
|
+
}
|
|
1426
|
+
function queryCategories3(httpClient) {
|
|
1427
|
+
return (options) => queryCategories2(
|
|
1428
|
+
options,
|
|
1429
|
+
// @ts-ignore
|
|
1430
|
+
{ httpClient }
|
|
1431
|
+
);
|
|
1432
|
+
}
|
|
1433
|
+
var onProductCreated = EventDefinition(
|
|
1434
|
+
"wix.suppliershub.marketplace_product.v1.product_created",
|
|
1435
|
+
true,
|
|
1436
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1437
|
+
transformPaths3(event, [
|
|
1438
|
+
{
|
|
1439
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1440
|
+
paths: [
|
|
1441
|
+
{ path: "entity.createdDate" },
|
|
1442
|
+
{ path: "entity.updatedDate" },
|
|
1443
|
+
{ path: "entity.providerInfo.productCreatedDate" },
|
|
1444
|
+
{ path: "metadata.eventTime" }
|
|
1445
|
+
]
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
transformFn: transformRESTImageToSDKImage2,
|
|
1449
|
+
paths: [
|
|
1450
|
+
{ path: "entity.media.main" },
|
|
1451
|
+
{ path: "entity.media.items", isRepeated: true },
|
|
1452
|
+
{ path: "entity.printOnDemandOptions.mockupImage" }
|
|
1453
|
+
]
|
|
1454
|
+
}
|
|
1455
|
+
])
|
|
1456
|
+
)
|
|
1457
|
+
)();
|
|
1458
|
+
var onProductDeleted = EventDefinition(
|
|
1459
|
+
"wix.suppliershub.marketplace_product.v1.product_deleted",
|
|
1460
|
+
true,
|
|
1461
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1462
|
+
transformPaths3(event, [
|
|
1463
|
+
{
|
|
1464
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1465
|
+
paths: [
|
|
1466
|
+
{ path: "entity.createdDate" },
|
|
1467
|
+
{ path: "entity.updatedDate" },
|
|
1468
|
+
{ path: "entity.providerInfo.productCreatedDate" },
|
|
1469
|
+
{ path: "metadata.eventTime" }
|
|
1470
|
+
]
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
transformFn: transformRESTImageToSDKImage2,
|
|
1474
|
+
paths: [
|
|
1475
|
+
{ path: "entity.media.main" },
|
|
1476
|
+
{ path: "entity.media.items", isRepeated: true },
|
|
1477
|
+
{ path: "entity.printOnDemandOptions.mockupImage" }
|
|
1478
|
+
]
|
|
1479
|
+
}
|
|
1480
|
+
])
|
|
1481
|
+
)
|
|
1482
|
+
)();
|
|
1483
|
+
var onProductTagsModified = EventDefinition(
|
|
1484
|
+
"wix.suppliershub.marketplace_product.v1.product_tags_modified",
|
|
1485
|
+
true,
|
|
1486
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1487
|
+
transformPaths3(event, [
|
|
1488
|
+
{
|
|
1489
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1490
|
+
paths: [
|
|
1491
|
+
{ path: "data.product.createdDate" },
|
|
1492
|
+
{ path: "data.product.updatedDate" },
|
|
1493
|
+
{ path: "data.product.providerInfo.productCreatedDate" },
|
|
1494
|
+
{ path: "metadata.eventTime" }
|
|
1495
|
+
]
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
transformFn: transformRESTImageToSDKImage2,
|
|
1499
|
+
paths: [
|
|
1500
|
+
{ path: "data.product.media.main" },
|
|
1501
|
+
{ path: "data.product.media.items", isRepeated: true },
|
|
1502
|
+
{ path: "data.product.printOnDemandOptions.mockupImage" }
|
|
1503
|
+
]
|
|
1504
|
+
}
|
|
1505
|
+
])
|
|
1506
|
+
)
|
|
1507
|
+
)();
|
|
1508
|
+
var onProductUpdated = EventDefinition(
|
|
1509
|
+
"wix.suppliershub.marketplace_product.v1.product_updated",
|
|
1510
|
+
true,
|
|
1511
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1512
|
+
transformPaths3(event, [
|
|
1513
|
+
{
|
|
1514
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1515
|
+
paths: [
|
|
1516
|
+
{ path: "entity.createdDate" },
|
|
1517
|
+
{ path: "entity.updatedDate" },
|
|
1518
|
+
{ path: "entity.providerInfo.productCreatedDate" },
|
|
1519
|
+
{ path: "metadata.eventTime" },
|
|
1520
|
+
{ path: "modifiedFields.createdDate" },
|
|
1521
|
+
{ path: "modifiedFields.updatedDate" },
|
|
1522
|
+
{ path: "modifiedFields.providerInfo.productCreatedDate" }
|
|
1523
|
+
]
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
transformFn: transformRESTImageToSDKImage2,
|
|
1527
|
+
paths: [
|
|
1528
|
+
{ path: "entity.media.main" },
|
|
1529
|
+
{ path: "entity.media.items", isRepeated: true },
|
|
1530
|
+
{ path: "entity.printOnDemandOptions.mockupImage" },
|
|
1531
|
+
{ path: "modifiedFields.media.main" },
|
|
1532
|
+
{ path: "modifiedFields.media.items", isRepeated: true },
|
|
1533
|
+
{ path: "modifiedFields.printOnDemandOptions.mockupImage" }
|
|
1534
|
+
]
|
|
1535
|
+
}
|
|
1536
|
+
])
|
|
1537
|
+
)
|
|
1538
|
+
)();
|
|
1539
|
+
|
|
1540
|
+
// src/suppliershub-marketplace-product-v1-product-products.context.ts
|
|
1541
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
1542
|
+
import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
|
|
1543
|
+
import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
|
|
1544
|
+
function customQueryProducts(httpClient) {
|
|
1545
|
+
const router = createQueryOverloadRouter({
|
|
1546
|
+
builderQueryFunction: () => queryProducts3(httpClient)(),
|
|
1547
|
+
typedQueryFunction: (query) => typedQueryProducts2(httpClient)(query),
|
|
1548
|
+
hasOptionsParameter: false
|
|
1549
|
+
});
|
|
1550
|
+
function overloadedQuery(query) {
|
|
1551
|
+
return router(...arguments);
|
|
1552
|
+
}
|
|
1553
|
+
return overloadedQuery;
|
|
1554
|
+
}
|
|
1555
|
+
var createProduct4 = /* @__PURE__ */ createRESTModule(createProduct3);
|
|
1556
|
+
var getProduct4 = /* @__PURE__ */ createRESTModule(getProduct3);
|
|
1557
|
+
var updateProduct4 = /* @__PURE__ */ createRESTModule(updateProduct3);
|
|
1558
|
+
var deleteProduct4 = /* @__PURE__ */ createRESTModule(deleteProduct3);
|
|
1559
|
+
var bulkCreateProducts4 = /* @__PURE__ */ createRESTModule(bulkCreateProducts3);
|
|
1560
|
+
var bulkUpdateProducts4 = /* @__PURE__ */ createRESTModule(bulkUpdateProducts3);
|
|
1561
|
+
var bulkDeleteProducts4 = /* @__PURE__ */ createRESTModule(bulkDeleteProducts3);
|
|
1562
|
+
var searchProducts4 = /* @__PURE__ */ createRESTModule(searchProducts3);
|
|
1563
|
+
var bulkUpdateProductTags4 = /* @__PURE__ */ createRESTModule(bulkUpdateProductTags3);
|
|
1564
|
+
var bulkUpdateProductTagsByFilter4 = /* @__PURE__ */ createRESTModule(bulkUpdateProductTagsByFilter3);
|
|
1565
|
+
var queryCategories4 = /* @__PURE__ */ createRESTModule(queryCategories3);
|
|
1566
|
+
var queryProducts4 = /* @__PURE__ */ createRESTModule(customQueryProducts);
|
|
1567
|
+
var onProductCreated2 = createEventModule(onProductCreated);
|
|
1568
|
+
var onProductDeleted2 = createEventModule(onProductDeleted);
|
|
1569
|
+
var onProductTagsModified2 = createEventModule(
|
|
1570
|
+
onProductTagsModified
|
|
1571
|
+
);
|
|
1572
|
+
var onProductUpdated2 = createEventModule(onProductUpdated);
|
|
1573
|
+
export {
|
|
1574
|
+
AggregationType,
|
|
1575
|
+
CategoryNamespace,
|
|
1576
|
+
CommonSortOrder,
|
|
1577
|
+
CountrySelections,
|
|
1578
|
+
Interval,
|
|
1579
|
+
InventoryTier,
|
|
1580
|
+
MeasurementUnit,
|
|
1581
|
+
MissingValues,
|
|
1582
|
+
Mode,
|
|
1583
|
+
NestedAggregationType,
|
|
1584
|
+
PrintTechnology,
|
|
1585
|
+
ProductType,
|
|
1586
|
+
RequestedField,
|
|
1587
|
+
ScalarType,
|
|
1588
|
+
SortDirection,
|
|
1589
|
+
SortOrder,
|
|
1590
|
+
SortType,
|
|
1591
|
+
TimeUnit,
|
|
1592
|
+
WebhookIdentityType,
|
|
1593
|
+
bulkCreateProducts4 as bulkCreateProducts,
|
|
1594
|
+
bulkDeleteProducts4 as bulkDeleteProducts,
|
|
1595
|
+
bulkUpdateProductTags4 as bulkUpdateProductTags,
|
|
1596
|
+
bulkUpdateProductTagsByFilter4 as bulkUpdateProductTagsByFilter,
|
|
1597
|
+
bulkUpdateProducts4 as bulkUpdateProducts,
|
|
1598
|
+
createProduct4 as createProduct,
|
|
1599
|
+
deleteProduct4 as deleteProduct,
|
|
1600
|
+
getProduct4 as getProduct,
|
|
1601
|
+
onProductCreated2 as onProductCreated,
|
|
1602
|
+
onProductDeleted2 as onProductDeleted,
|
|
1603
|
+
onProductTagsModified2 as onProductTagsModified,
|
|
1604
|
+
onProductUpdated2 as onProductUpdated,
|
|
1605
|
+
queryCategories4 as queryCategories,
|
|
1606
|
+
queryProducts4 as queryProducts,
|
|
1607
|
+
searchProducts4 as searchProducts,
|
|
1608
|
+
updateProduct4 as updateProduct,
|
|
1609
|
+
utils
|
|
1610
|
+
};
|
|
1611
|
+
//# sourceMappingURL=index.mjs.map
|