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