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