@wix/auto_sdk_stores_customizations-v-3 1.0.91 → 1.0.93

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 (49) hide show
  1. package/build/cjs/index.d.ts +11 -3
  2. package/build/cjs/index.js +56 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +21 -1
  5. package/build/cjs/index.typings.js +48 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +11 -2
  8. package/build/cjs/meta.js +41 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +9 -1
  11. package/build/cjs/schemas.js +973 -871
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +11 -3
  14. package/build/es/index.mjs +55 -0
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +21 -1
  17. package/build/es/index.typings.mjs +47 -0
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +11 -2
  20. package/build/es/meta.mjs +40 -0
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +9 -1
  23. package/build/es/schemas.mjs +971 -871
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +11 -3
  26. package/build/internal/cjs/index.typings.d.ts +21 -1
  27. package/build/internal/cjs/meta.d.ts +11 -2
  28. package/build/internal/cjs/schemas.d.ts +9 -1
  29. package/build/internal/es/index.d.mts +11 -3
  30. package/build/internal/es/index.typings.d.mts +21 -1
  31. package/build/internal/es/meta.d.mts +11 -2
  32. package/build/internal/es/schemas.d.mts +9 -1
  33. package/package.json +2 -2
  34. package/build/internal/cjs/index.js +0 -1856
  35. package/build/internal/cjs/index.js.map +0 -1
  36. package/build/internal/cjs/index.typings.js +0 -1617
  37. package/build/internal/cjs/index.typings.js.map +0 -1
  38. package/build/internal/cjs/meta.js +0 -1185
  39. package/build/internal/cjs/meta.js.map +0 -1
  40. package/build/internal/cjs/schemas.js +0 -1908
  41. package/build/internal/cjs/schemas.js.map +0 -1
  42. package/build/internal/es/index.mjs +0 -1809
  43. package/build/internal/es/index.mjs.map +0 -1
  44. package/build/internal/es/index.typings.mjs +0 -1572
  45. package/build/internal/es/index.typings.mjs.map +0 -1
  46. package/build/internal/es/meta.mjs +0 -1139
  47. package/build/internal/es/meta.mjs.map +0 -1
  48. package/build/internal/es/schemas.mjs +0 -1846
  49. package/build/internal/es/schemas.mjs.map +0 -1
@@ -1,1809 +0,0 @@
1
- // src/stores-catalog-v3-customization-customizations-v-3.public.ts
2
- import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
- import { transformRESTImageToSDKImage as transformRESTImageToSDKImage2 } from "@wix/sdk-runtime/transformations/image";
4
- import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
5
- import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
6
- import { EventDefinition } from "@wix/sdk-types";
7
-
8
- // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
9
- import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
10
- import { queryBuilder } from "@wix/sdk-runtime/query-builder";
11
- import {
12
- renameKeysFromSDKRequestToRESTRequest,
13
- renameKeysFromRESTResponseToSDKResponse
14
- } from "@wix/sdk-runtime/rename-all-nested-keys";
15
-
16
- // src/stores-catalog-v3-customization-customizations-v-3.http.ts
17
- import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
18
- import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
19
- import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
20
- import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
21
- import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
22
- import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
23
- import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
24
- import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
25
- function resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl(opts) {
26
- const domainToMappings = {
27
- "manage._base_domain_": [
28
- {
29
- srcPath: "/customization",
30
- destPath: ""
31
- }
32
- ],
33
- "www.wixapis.com": [
34
- {
35
- srcPath: "/stores/v3/customizations",
36
- destPath: "/v3/customizations"
37
- },
38
- {
39
- srcPath: "/stores/v3/bulk/customizations",
40
- destPath: "/v3/bulk/customizations"
41
- }
42
- ],
43
- "editor._base_domain_": [
44
- {
45
- srcPath: "/_api/customization",
46
- destPath: ""
47
- }
48
- ],
49
- "blocks._base_domain_": [
50
- {
51
- srcPath: "/_api/customization",
52
- destPath: ""
53
- }
54
- ],
55
- "create.editorx": [
56
- {
57
- srcPath: "/_api/customization",
58
- destPath: ""
59
- }
60
- ],
61
- _: [
62
- {
63
- srcPath: "/_api/customization",
64
- destPath: ""
65
- }
66
- ],
67
- "*.dev.wix-code.com": [
68
- {
69
- srcPath: "/_api/customization",
70
- destPath: ""
71
- }
72
- ]
73
- };
74
- return resolveUrl(Object.assign(opts, { domainToMappings }));
75
- }
76
- var PACKAGE_NAME = "@wix/auto_sdk_stores_customizations-v-3";
77
- function createCustomization(payload) {
78
- function __createCustomization({ host }) {
79
- const serializedData = transformPaths(payload, [
80
- {
81
- transformFn: transformSDKTimestampToRESTTimestamp,
82
- paths: [
83
- { path: "customization.createdDate" },
84
- { path: "customization.updatedDate" },
85
- {
86
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
87
- },
88
- {
89
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
90
- }
91
- ]
92
- },
93
- {
94
- transformFn: transformSDKFloatToRESTFloat,
95
- paths: [
96
- { path: "customization.choicesSettings.choices.image.focalPoint.x" },
97
- { path: "customization.choicesSettings.choices.image.focalPoint.y" }
98
- ]
99
- }
100
- ]);
101
- const metadata = {
102
- entityFqdn: "wix.stores.catalog.v3.customization",
103
- method: "POST",
104
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.CreateCustomization",
105
- packageName: PACKAGE_NAME,
106
- migrationOptions: {
107
- optInTransformResponse: true
108
- },
109
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
110
- protoPath: "/v3/customizations",
111
- data: serializedData,
112
- host
113
- }),
114
- data: serializedData,
115
- transformResponse: (payload2) => transformPaths(payload2, [
116
- {
117
- transformFn: transformRESTTimestampToSDKTimestamp,
118
- paths: [
119
- { path: "customization.createdDate" },
120
- { path: "customization.updatedDate" },
121
- {
122
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
123
- },
124
- {
125
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
126
- }
127
- ]
128
- },
129
- {
130
- transformFn: transformRESTFloatToSDKFloat,
131
- paths: [
132
- {
133
- path: "customization.choicesSettings.choices.image.focalPoint.x"
134
- },
135
- {
136
- path: "customization.choicesSettings.choices.image.focalPoint.y"
137
- }
138
- ]
139
- }
140
- ])
141
- };
142
- return metadata;
143
- }
144
- return __createCustomization;
145
- }
146
- function getCustomization(payload) {
147
- function __getCustomization({ host }) {
148
- const metadata = {
149
- entityFqdn: "wix.stores.catalog.v3.customization",
150
- method: "GET",
151
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.GetCustomization",
152
- packageName: PACKAGE_NAME,
153
- migrationOptions: {
154
- optInTransformResponse: true
155
- },
156
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
157
- protoPath: "/v3/customizations/{customizationId}",
158
- data: payload,
159
- host
160
- }),
161
- params: toURLSearchParams(payload),
162
- transformResponse: (payload2) => transformPaths(payload2, [
163
- {
164
- transformFn: transformRESTTimestampToSDKTimestamp,
165
- paths: [
166
- { path: "customization.createdDate" },
167
- { path: "customization.updatedDate" },
168
- {
169
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
170
- },
171
- {
172
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
173
- }
174
- ]
175
- },
176
- {
177
- transformFn: transformRESTFloatToSDKFloat,
178
- paths: [
179
- {
180
- path: "customization.choicesSettings.choices.image.focalPoint.x"
181
- },
182
- {
183
- path: "customization.choicesSettings.choices.image.focalPoint.y"
184
- }
185
- ]
186
- }
187
- ])
188
- };
189
- return metadata;
190
- }
191
- return __getCustomization;
192
- }
193
- function updateCustomization(payload) {
194
- function __updateCustomization({ host }) {
195
- const serializedData = transformPaths(payload, [
196
- {
197
- transformFn: transformSDKFieldMaskToRESTFieldMask,
198
- paths: [{ path: "fieldMask" }]
199
- },
200
- {
201
- transformFn: transformSDKTimestampToRESTTimestamp,
202
- paths: [
203
- { path: "customization.createdDate" },
204
- { path: "customization.updatedDate" },
205
- {
206
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
207
- },
208
- {
209
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
210
- }
211
- ]
212
- },
213
- {
214
- transformFn: transformSDKFloatToRESTFloat,
215
- paths: [
216
- { path: "customization.choicesSettings.choices.image.focalPoint.x" },
217
- { path: "customization.choicesSettings.choices.image.focalPoint.y" }
218
- ]
219
- }
220
- ]);
221
- const metadata = {
222
- entityFqdn: "wix.stores.catalog.v3.customization",
223
- method: "PATCH",
224
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomization",
225
- packageName: PACKAGE_NAME,
226
- migrationOptions: {
227
- optInTransformResponse: true
228
- },
229
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
230
- protoPath: "/v3/customizations/{customization.id}",
231
- data: serializedData,
232
- host
233
- }),
234
- data: serializedData,
235
- transformResponse: (payload2) => transformPaths(payload2, [
236
- {
237
- transformFn: transformRESTTimestampToSDKTimestamp,
238
- paths: [
239
- { path: "customization.createdDate" },
240
- { path: "customization.updatedDate" },
241
- {
242
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
243
- },
244
- {
245
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
246
- }
247
- ]
248
- },
249
- {
250
- transformFn: transformRESTFloatToSDKFloat,
251
- paths: [
252
- {
253
- path: "customization.choicesSettings.choices.image.focalPoint.x"
254
- },
255
- {
256
- path: "customization.choicesSettings.choices.image.focalPoint.y"
257
- }
258
- ]
259
- }
260
- ])
261
- };
262
- return metadata;
263
- }
264
- return __updateCustomization;
265
- }
266
- function deleteCustomization(payload) {
267
- function __deleteCustomization({ host }) {
268
- const metadata = {
269
- entityFqdn: "wix.stores.catalog.v3.customization",
270
- method: "DELETE",
271
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.DeleteCustomization",
272
- packageName: PACKAGE_NAME,
273
- migrationOptions: {
274
- optInTransformResponse: true
275
- },
276
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
277
- protoPath: "/v3/customizations/{customizationId}",
278
- data: payload,
279
- host
280
- }),
281
- params: toURLSearchParams(payload)
282
- };
283
- return metadata;
284
- }
285
- return __deleteCustomization;
286
- }
287
- function queryCustomizations(payload) {
288
- function __queryCustomizations({ host }) {
289
- const metadata = {
290
- entityFqdn: "wix.stores.catalog.v3.customization",
291
- method: "GET",
292
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations",
293
- packageName: PACKAGE_NAME,
294
- migrationOptions: {
295
- optInTransformResponse: true
296
- },
297
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
298
- protoPath: "/v3/customizations/query",
299
- data: payload,
300
- host
301
- }),
302
- params: toURLSearchParams(payload, true),
303
- transformResponse: (payload2) => transformPaths(payload2, [
304
- {
305
- transformFn: transformRESTTimestampToSDKTimestamp,
306
- paths: [
307
- { path: "customizations.createdDate" },
308
- { path: "customizations.updatedDate" },
309
- {
310
- path: "customizations.choicesSettings.choices.image.urlExpirationDate"
311
- },
312
- {
313
- path: "customizations.choicesSettings.choices.displayImage.urlExpirationDate"
314
- }
315
- ]
316
- },
317
- {
318
- transformFn: transformRESTFloatToSDKFloat,
319
- paths: [
320
- {
321
- path: "customizations.choicesSettings.choices.image.focalPoint.x"
322
- },
323
- {
324
- path: "customizations.choicesSettings.choices.image.focalPoint.y"
325
- }
326
- ]
327
- }
328
- ]),
329
- fallback: [
330
- {
331
- method: "POST",
332
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
333
- protoPath: "/v3/customizations/query",
334
- data: payload,
335
- host
336
- }),
337
- data: payload
338
- }
339
- ]
340
- };
341
- return metadata;
342
- }
343
- return __queryCustomizations;
344
- }
345
- function bulkCreateCustomizations(payload) {
346
- function __bulkCreateCustomizations({ host }) {
347
- const serializedData = transformPaths(payload, [
348
- {
349
- transformFn: transformSDKTimestampToRESTTimestamp,
350
- paths: [
351
- { path: "customizations.createdDate" },
352
- { path: "customizations.updatedDate" },
353
- {
354
- path: "customizations.choicesSettings.choices.image.urlExpirationDate"
355
- },
356
- {
357
- path: "customizations.choicesSettings.choices.displayImage.urlExpirationDate"
358
- }
359
- ]
360
- },
361
- {
362
- transformFn: transformSDKFloatToRESTFloat,
363
- paths: [
364
- { path: "customizations.choicesSettings.choices.image.focalPoint.x" },
365
- { path: "customizations.choicesSettings.choices.image.focalPoint.y" }
366
- ]
367
- }
368
- ]);
369
- const metadata = {
370
- entityFqdn: "wix.stores.catalog.v3.customization",
371
- method: "POST",
372
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations",
373
- packageName: PACKAGE_NAME,
374
- migrationOptions: {
375
- optInTransformResponse: true
376
- },
377
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
378
- protoPath: "/v3/bulk/customizations/create",
379
- data: serializedData,
380
- host
381
- }),
382
- data: serializedData,
383
- transformResponse: (payload2) => transformPaths(payload2, [
384
- {
385
- transformFn: transformRESTTimestampToSDKTimestamp,
386
- paths: [
387
- { path: "results.customization.createdDate" },
388
- { path: "results.customization.updatedDate" },
389
- {
390
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
391
- },
392
- {
393
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
394
- }
395
- ]
396
- },
397
- {
398
- transformFn: transformRESTFloatToSDKFloat,
399
- paths: [
400
- {
401
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
402
- },
403
- {
404
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
405
- }
406
- ]
407
- }
408
- ])
409
- };
410
- return metadata;
411
- }
412
- return __bulkCreateCustomizations;
413
- }
414
- function addCustomizationChoices(payload) {
415
- function __addCustomizationChoices({ host }) {
416
- const serializedData = transformPaths(payload, [
417
- {
418
- transformFn: transformSDKTimestampToRESTTimestamp,
419
- paths: [
420
- { path: "choices.image.urlExpirationDate" },
421
- { path: "choices.displayImage.urlExpirationDate" }
422
- ]
423
- },
424
- {
425
- transformFn: transformSDKFloatToRESTFloat,
426
- paths: [
427
- { path: "choices.image.focalPoint.x" },
428
- { path: "choices.image.focalPoint.y" }
429
- ]
430
- }
431
- ]);
432
- const metadata = {
433
- entityFqdn: "wix.stores.catalog.v3.customization",
434
- method: "POST",
435
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices",
436
- packageName: PACKAGE_NAME,
437
- migrationOptions: {
438
- optInTransformResponse: true
439
- },
440
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
441
- protoPath: "/v3/customizations/{customizationId}/add-choices",
442
- data: serializedData,
443
- host
444
- }),
445
- data: serializedData,
446
- transformResponse: (payload2) => transformPaths(payload2, [
447
- {
448
- transformFn: transformRESTTimestampToSDKTimestamp,
449
- paths: [
450
- { path: "customization.createdDate" },
451
- { path: "customization.updatedDate" },
452
- {
453
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
454
- },
455
- {
456
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
457
- }
458
- ]
459
- },
460
- {
461
- transformFn: transformRESTFloatToSDKFloat,
462
- paths: [
463
- {
464
- path: "customization.choicesSettings.choices.image.focalPoint.x"
465
- },
466
- {
467
- path: "customization.choicesSettings.choices.image.focalPoint.y"
468
- }
469
- ]
470
- }
471
- ])
472
- };
473
- return metadata;
474
- }
475
- return __addCustomizationChoices;
476
- }
477
- function setCustomizationChoices(payload) {
478
- function __setCustomizationChoices({ host }) {
479
- const serializedData = transformPaths(payload, [
480
- {
481
- transformFn: transformSDKTimestampToRESTTimestamp,
482
- paths: [
483
- { path: "choices.image.urlExpirationDate" },
484
- { path: "choices.displayImage.urlExpirationDate" }
485
- ]
486
- },
487
- {
488
- transformFn: transformSDKFloatToRESTFloat,
489
- paths: [
490
- { path: "choices.image.focalPoint.x" },
491
- { path: "choices.image.focalPoint.y" }
492
- ]
493
- }
494
- ]);
495
- const metadata = {
496
- entityFqdn: "wix.stores.catalog.v3.customization",
497
- method: "POST",
498
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices",
499
- packageName: PACKAGE_NAME,
500
- migrationOptions: {
501
- optInTransformResponse: true
502
- },
503
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
504
- protoPath: "/v3/customizations/{customizationId}/set-choices",
505
- data: serializedData,
506
- host
507
- }),
508
- data: serializedData,
509
- transformResponse: (payload2) => transformPaths(payload2, [
510
- {
511
- transformFn: transformRESTTimestampToSDKTimestamp,
512
- paths: [
513
- { path: "customization.createdDate" },
514
- { path: "customization.updatedDate" },
515
- {
516
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
517
- },
518
- {
519
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
520
- }
521
- ]
522
- },
523
- {
524
- transformFn: transformRESTFloatToSDKFloat,
525
- paths: [
526
- {
527
- path: "customization.choicesSettings.choices.image.focalPoint.x"
528
- },
529
- {
530
- path: "customization.choicesSettings.choices.image.focalPoint.y"
531
- }
532
- ]
533
- }
534
- ])
535
- };
536
- return metadata;
537
- }
538
- return __setCustomizationChoices;
539
- }
540
- function removeCustomizationChoices(payload) {
541
- function __removeCustomizationChoices({ host }) {
542
- const metadata = {
543
- entityFqdn: "wix.stores.catalog.v3.customization",
544
- method: "POST",
545
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices",
546
- packageName: PACKAGE_NAME,
547
- migrationOptions: {
548
- optInTransformResponse: true
549
- },
550
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
551
- protoPath: "/v3/customizations/{customizationId}/remove-choices",
552
- data: payload,
553
- host
554
- }),
555
- data: payload,
556
- transformResponse: (payload2) => transformPaths(payload2, [
557
- {
558
- transformFn: transformRESTTimestampToSDKTimestamp,
559
- paths: [
560
- { path: "customization.createdDate" },
561
- { path: "customization.updatedDate" },
562
- {
563
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
564
- },
565
- {
566
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
567
- }
568
- ]
569
- },
570
- {
571
- transformFn: transformRESTFloatToSDKFloat,
572
- paths: [
573
- {
574
- path: "customization.choicesSettings.choices.image.focalPoint.x"
575
- },
576
- {
577
- path: "customization.choicesSettings.choices.image.focalPoint.y"
578
- }
579
- ]
580
- }
581
- ])
582
- };
583
- return metadata;
584
- }
585
- return __removeCustomizationChoices;
586
- }
587
- function updateCustomizationChoices(payload) {
588
- function __updateCustomizationChoices({ host }) {
589
- const serializedData = transformPaths(payload, [
590
- {
591
- transformFn: transformSDKFieldMaskToRESTFieldMask,
592
- paths: [{ path: "choices.fieldMask" }]
593
- },
594
- {
595
- transformFn: transformSDKTimestampToRESTTimestamp,
596
- paths: [
597
- { path: "choices.choice.image.urlExpirationDate" },
598
- { path: "choices.choice.displayImage.urlExpirationDate" }
599
- ]
600
- },
601
- {
602
- transformFn: transformSDKFloatToRESTFloat,
603
- paths: [
604
- { path: "choices.choice.image.focalPoint.x" },
605
- { path: "choices.choice.image.focalPoint.y" }
606
- ]
607
- }
608
- ]);
609
- const metadata = {
610
- entityFqdn: "wix.stores.catalog.v3.customization",
611
- method: "POST",
612
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomizationChoices",
613
- packageName: PACKAGE_NAME,
614
- migrationOptions: {
615
- optInTransformResponse: true
616
- },
617
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
618
- protoPath: "/v3/customizations/{customizationId}/update-choices",
619
- data: serializedData,
620
- host
621
- }),
622
- data: serializedData,
623
- transformResponse: (payload2) => transformPaths(payload2, [
624
- {
625
- transformFn: transformRESTTimestampToSDKTimestamp,
626
- paths: [
627
- { path: "customization.createdDate" },
628
- { path: "customization.updatedDate" },
629
- {
630
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
631
- },
632
- {
633
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
634
- }
635
- ]
636
- },
637
- {
638
- transformFn: transformRESTFloatToSDKFloat,
639
- paths: [
640
- {
641
- path: "customization.choicesSettings.choices.image.focalPoint.x"
642
- },
643
- {
644
- path: "customization.choicesSettings.choices.image.focalPoint.y"
645
- }
646
- ]
647
- }
648
- ])
649
- };
650
- return metadata;
651
- }
652
- return __updateCustomizationChoices;
653
- }
654
- function reorderCustomizationChoices(payload) {
655
- function __reorderCustomizationChoices({ host }) {
656
- const metadata = {
657
- entityFqdn: "wix.stores.catalog.v3.customization",
658
- method: "POST",
659
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.ReorderCustomizationChoices",
660
- packageName: PACKAGE_NAME,
661
- migrationOptions: {
662
- optInTransformResponse: true
663
- },
664
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
665
- protoPath: "/v3/customizations/{customizationId}/reorder-choices",
666
- data: payload,
667
- host
668
- }),
669
- data: payload,
670
- transformResponse: (payload2) => transformPaths(payload2, [
671
- {
672
- transformFn: transformRESTTimestampToSDKTimestamp,
673
- paths: [
674
- { path: "customization.createdDate" },
675
- { path: "customization.updatedDate" },
676
- {
677
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
678
- },
679
- {
680
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
681
- }
682
- ]
683
- },
684
- {
685
- transformFn: transformRESTFloatToSDKFloat,
686
- paths: [
687
- {
688
- path: "customization.choicesSettings.choices.image.focalPoint.x"
689
- },
690
- {
691
- path: "customization.choicesSettings.choices.image.focalPoint.y"
692
- }
693
- ]
694
- }
695
- ])
696
- };
697
- return metadata;
698
- }
699
- return __reorderCustomizationChoices;
700
- }
701
- function bulkAddCustomizationChoices(payload) {
702
- function __bulkAddCustomizationChoices({ host }) {
703
- const serializedData = transformPaths(payload, [
704
- {
705
- transformFn: transformSDKTimestampToRESTTimestamp,
706
- paths: [
707
- { path: "customizationsChoices.choices.image.urlExpirationDate" },
708
- {
709
- path: "customizationsChoices.choices.displayImage.urlExpirationDate"
710
- }
711
- ]
712
- },
713
- {
714
- transformFn: transformSDKFloatToRESTFloat,
715
- paths: [
716
- { path: "customizationsChoices.choices.image.focalPoint.x" },
717
- { path: "customizationsChoices.choices.image.focalPoint.y" }
718
- ]
719
- }
720
- ]);
721
- const metadata = {
722
- entityFqdn: "wix.stores.catalog.v3.customization",
723
- method: "POST",
724
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices",
725
- packageName: PACKAGE_NAME,
726
- migrationOptions: {
727
- optInTransformResponse: true
728
- },
729
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
730
- protoPath: "/v3/bulk/customizations/add-choices",
731
- data: serializedData,
732
- host
733
- }),
734
- data: serializedData,
735
- transformResponse: (payload2) => transformPaths(payload2, [
736
- {
737
- transformFn: transformRESTTimestampToSDKTimestamp,
738
- paths: [
739
- { path: "results.customization.createdDate" },
740
- { path: "results.customization.updatedDate" },
741
- {
742
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
743
- },
744
- {
745
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
746
- }
747
- ]
748
- },
749
- {
750
- transformFn: transformRESTFloatToSDKFloat,
751
- paths: [
752
- {
753
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
754
- },
755
- {
756
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
757
- }
758
- ]
759
- }
760
- ])
761
- };
762
- return metadata;
763
- }
764
- return __bulkAddCustomizationChoices;
765
- }
766
- function bulkUpdateCustomizations(payload) {
767
- function __bulkUpdateCustomizations({ host }) {
768
- const serializedData = transformPaths(payload, [
769
- {
770
- transformFn: transformSDKFieldMaskToRESTFieldMask,
771
- paths: [{ path: "customizations.fieldMask" }]
772
- },
773
- {
774
- transformFn: transformSDKTimestampToRESTTimestamp,
775
- paths: [
776
- { path: "customizations.customization.createdDate" },
777
- { path: "customizations.customization.updatedDate" },
778
- {
779
- path: "customizations.customization.choicesSettings.choices.image.urlExpirationDate"
780
- },
781
- {
782
- path: "customizations.customization.choicesSettings.choices.displayImage.urlExpirationDate"
783
- }
784
- ]
785
- },
786
- {
787
- transformFn: transformSDKFloatToRESTFloat,
788
- paths: [
789
- {
790
- path: "customizations.customization.choicesSettings.choices.image.focalPoint.x"
791
- },
792
- {
793
- path: "customizations.customization.choicesSettings.choices.image.focalPoint.y"
794
- }
795
- ]
796
- }
797
- ]);
798
- const metadata = {
799
- entityFqdn: "wix.stores.catalog.v3.customization",
800
- method: "POST",
801
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations",
802
- packageName: PACKAGE_NAME,
803
- migrationOptions: {
804
- optInTransformResponse: true
805
- },
806
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
807
- protoPath: "/v3/bulk/customizations/update",
808
- data: serializedData,
809
- host
810
- }),
811
- data: serializedData,
812
- transformResponse: (payload2) => transformPaths(payload2, [
813
- {
814
- transformFn: transformRESTTimestampToSDKTimestamp,
815
- paths: [
816
- { path: "results.customization.createdDate" },
817
- { path: "results.customization.updatedDate" },
818
- {
819
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
820
- },
821
- {
822
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
823
- }
824
- ]
825
- },
826
- {
827
- transformFn: transformRESTFloatToSDKFloat,
828
- paths: [
829
- {
830
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
831
- },
832
- {
833
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
834
- }
835
- ]
836
- }
837
- ])
838
- };
839
- return metadata;
840
- }
841
- return __bulkUpdateCustomizations;
842
- }
843
-
844
- // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
845
- import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
846
- import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
847
- import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
848
- import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
849
- var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
850
- CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
851
- CustomizationType2["MODIFIER"] = "MODIFIER";
852
- return CustomizationType2;
853
- })(CustomizationType || {});
854
- var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
855
- CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
856
- CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
857
- CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
858
- return CustomizationRenderType2;
859
- })(CustomizationRenderType || {});
860
- var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
861
- ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
862
- ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
863
- ChoiceType2["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
864
- ChoiceType2["IMAGE"] = "IMAGE";
865
- return ChoiceType2;
866
- })(ChoiceType || {});
867
- var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
868
- ChoiceSortStrategy2["DEFAULT"] = "DEFAULT";
869
- ChoiceSortStrategy2["BY_NAME"] = "BY_NAME";
870
- ChoiceSortStrategy2["BY_PRODUCT_COUNT"] = "BY_PRODUCT_COUNT";
871
- ChoiceSortStrategy2["MANUAL"] = "MANUAL";
872
- return ChoiceSortStrategy2;
873
- })(ChoiceSortStrategy || {});
874
- var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
875
- RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
876
- RequestedFields2["CHOICE_DISPLAY_IMAGE"] = "CHOICE_DISPLAY_IMAGE";
877
- return RequestedFields2;
878
- })(RequestedFields || {});
879
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
880
- SortOrder2["ASC"] = "ASC";
881
- SortOrder2["DESC"] = "DESC";
882
- return SortOrder2;
883
- })(SortOrder || {});
884
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
885
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
886
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
887
- WebhookIdentityType2["MEMBER"] = "MEMBER";
888
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
889
- WebhookIdentityType2["APP"] = "APP";
890
- return WebhookIdentityType2;
891
- })(WebhookIdentityType || {});
892
- async function createCustomization2(customization) {
893
- const { httpClient, sideEffects } = arguments[1];
894
- const payload = transformPaths2(
895
- renameKeysFromSDKRequestToRESTRequest({ customization }),
896
- [
897
- {
898
- transformFn: transformSDKImageToRESTImage,
899
- paths: [
900
- { path: "customization.choicesSettings.choices.image" },
901
- { path: "customization.choicesSettings.choices.displayImage" }
902
- ]
903
- }
904
- ]
905
- );
906
- const reqOpts = createCustomization(payload);
907
- sideEffects?.onSiteCall?.();
908
- try {
909
- const result = await httpClient.request(reqOpts);
910
- sideEffects?.onSuccess?.(result);
911
- return renameKeysFromRESTResponseToSDKResponse(
912
- transformPaths2(result.data, [
913
- {
914
- transformFn: transformRESTImageToSDKImage,
915
- paths: [
916
- { path: "customization.choicesSettings.choices.image" },
917
- { path: "customization.choicesSettings.choices.displayImage" }
918
- ]
919
- }
920
- ])
921
- )?.customization;
922
- } catch (err) {
923
- const transformedError = sdkTransformError(
924
- err,
925
- {
926
- spreadPathsToArguments: {},
927
- explicitPathsToArguments: { customization: "$[0]" },
928
- singleArgumentUnchanged: false
929
- },
930
- ["customization"]
931
- );
932
- sideEffects?.onError?.(err);
933
- throw transformedError;
934
- }
935
- }
936
- async function getCustomization2(customizationId, options) {
937
- const { httpClient, sideEffects } = arguments[2];
938
- const payload = renameKeysFromSDKRequestToRESTRequest({
939
- customizationId,
940
- fields: options?.fields
941
- });
942
- const reqOpts = getCustomization(payload);
943
- sideEffects?.onSiteCall?.();
944
- try {
945
- const result = await httpClient.request(reqOpts);
946
- sideEffects?.onSuccess?.(result);
947
- return renameKeysFromRESTResponseToSDKResponse(
948
- transformPaths2(result.data, [
949
- {
950
- transformFn: transformRESTImageToSDKImage,
951
- paths: [
952
- { path: "customization.choicesSettings.choices.image" },
953
- { path: "customization.choicesSettings.choices.displayImage" }
954
- ]
955
- }
956
- ])
957
- )?.customization;
958
- } catch (err) {
959
- const transformedError = sdkTransformError(
960
- err,
961
- {
962
- spreadPathsToArguments: {},
963
- explicitPathsToArguments: {
964
- customizationId: "$[0]",
965
- fields: "$[1].fields"
966
- },
967
- singleArgumentUnchanged: false
968
- },
969
- ["customizationId", "options"]
970
- );
971
- sideEffects?.onError?.(err);
972
- throw transformedError;
973
- }
974
- }
975
- async function updateCustomization2(_id, customization, options) {
976
- const { httpClient, sideEffects } = arguments[3];
977
- const payload = transformPaths2(
978
- renameKeysFromSDKRequestToRESTRequest({
979
- customization: { ...customization, id: _id },
980
- fields: options?.fields
981
- }),
982
- [
983
- {
984
- transformFn: transformSDKImageToRESTImage,
985
- paths: [
986
- { path: "customization.choicesSettings.choices.image" },
987
- { path: "customization.choicesSettings.choices.displayImage" }
988
- ]
989
- }
990
- ]
991
- );
992
- const reqOpts = updateCustomization(payload);
993
- sideEffects?.onSiteCall?.();
994
- try {
995
- const result = await httpClient.request(reqOpts);
996
- sideEffects?.onSuccess?.(result);
997
- return renameKeysFromRESTResponseToSDKResponse(
998
- transformPaths2(result.data, [
999
- {
1000
- transformFn: transformRESTImageToSDKImage,
1001
- paths: [
1002
- { path: "customization.choicesSettings.choices.image" },
1003
- { path: "customization.choicesSettings.choices.displayImage" }
1004
- ]
1005
- }
1006
- ])
1007
- )?.customization;
1008
- } catch (err) {
1009
- const transformedError = sdkTransformError(
1010
- err,
1011
- {
1012
- spreadPathsToArguments: { customization: "$[1]" },
1013
- explicitPathsToArguments: {
1014
- "customization.id": "$[0]",
1015
- fields: "$[2].fields"
1016
- },
1017
- singleArgumentUnchanged: false
1018
- },
1019
- ["_id", "customization", "options"]
1020
- );
1021
- sideEffects?.onError?.(err);
1022
- throw transformedError;
1023
- }
1024
- }
1025
- async function deleteCustomization2(customizationId) {
1026
- const { httpClient, sideEffects } = arguments[1];
1027
- const payload = renameKeysFromSDKRequestToRESTRequest({
1028
- customizationId
1029
- });
1030
- const reqOpts = deleteCustomization(payload);
1031
- sideEffects?.onSiteCall?.();
1032
- try {
1033
- const result = await httpClient.request(reqOpts);
1034
- sideEffects?.onSuccess?.(result);
1035
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1036
- } catch (err) {
1037
- const transformedError = sdkTransformError(
1038
- err,
1039
- {
1040
- spreadPathsToArguments: {},
1041
- explicitPathsToArguments: { customizationId: "$[0]" },
1042
- singleArgumentUnchanged: false
1043
- },
1044
- ["customizationId"]
1045
- );
1046
- sideEffects?.onError?.(err);
1047
- throw transformedError;
1048
- }
1049
- }
1050
- function queryCustomizations2(options) {
1051
- const { httpClient, sideEffects } = arguments[1];
1052
- return queryBuilder({
1053
- func: async (payload) => {
1054
- const reqOpts = queryCustomizations({
1055
- ...payload,
1056
- ...options ?? {}
1057
- });
1058
- sideEffects?.onSiteCall?.();
1059
- try {
1060
- const result = await httpClient.request(reqOpts);
1061
- sideEffects?.onSuccess?.(result);
1062
- return result;
1063
- } catch (err) {
1064
- sideEffects?.onError?.(err);
1065
- throw err;
1066
- }
1067
- },
1068
- requestTransformer: (query) => {
1069
- const args = [query, options];
1070
- return renameKeysFromSDKRequestToRESTRequest({
1071
- ...args?.[1],
1072
- query: args?.[0]
1073
- });
1074
- },
1075
- responseTransformer: ({
1076
- data
1077
- }) => {
1078
- const transformedData = renameKeysFromRESTResponseToSDKResponse(
1079
- transformPaths2(data, [
1080
- {
1081
- transformFn: transformRESTImageToSDKImage,
1082
- paths: [
1083
- { path: "customizations.choicesSettings.choices.image" },
1084
- { path: "customizations.choicesSettings.choices.displayImage" }
1085
- ]
1086
- }
1087
- ])
1088
- );
1089
- return {
1090
- items: transformedData?.customizations,
1091
- pagingMetadata: transformedData?.pagingMetadata
1092
- };
1093
- },
1094
- errorTransformer: (err) => {
1095
- const transformedError = sdkTransformError(err, {
1096
- spreadPathsToArguments: {},
1097
- explicitPathsToArguments: { query: "$[0]" },
1098
- singleArgumentUnchanged: false
1099
- });
1100
- throw transformedError;
1101
- },
1102
- pagingMethod: "CURSOR",
1103
- transformationPaths: {}
1104
- });
1105
- }
1106
- async function typedQueryCustomizations(query, options) {
1107
- const { httpClient, sideEffects } = arguments[2];
1108
- const payload = renameKeysFromSDKRequestToRESTRequest({
1109
- query,
1110
- ...options
1111
- });
1112
- const reqOpts = queryCustomizations(payload);
1113
- sideEffects?.onSiteCall?.();
1114
- try {
1115
- const result = await httpClient.request(reqOpts);
1116
- sideEffects?.onSuccess?.(result);
1117
- return renameKeysFromRESTResponseToSDKResponse(
1118
- transformPaths2(result.data, [
1119
- {
1120
- transformFn: transformRESTImageToSDKImage,
1121
- paths: [
1122
- { path: "customizations.choicesSettings.choices.image" },
1123
- { path: "customizations.choicesSettings.choices.displayImage" }
1124
- ]
1125
- }
1126
- ])
1127
- );
1128
- } catch (err) {
1129
- const transformedError = sdkTransformError(
1130
- err,
1131
- {
1132
- spreadPathsToArguments: {},
1133
- explicitPathsToArguments: { query: "$[0]" },
1134
- singleArgumentUnchanged: false
1135
- },
1136
- ["query", "options"]
1137
- );
1138
- sideEffects?.onError?.(err);
1139
- throw transformedError;
1140
- }
1141
- }
1142
- var utils = {
1143
- query: /* @__PURE__ */ createQueryUtils()
1144
- };
1145
- async function bulkCreateCustomizations2(customizations, options) {
1146
- const { httpClient, sideEffects } = arguments[2];
1147
- const payload = transformPaths2(
1148
- renameKeysFromSDKRequestToRESTRequest({
1149
- customizations,
1150
- returnEntity: options?.returnEntity
1151
- }),
1152
- [
1153
- {
1154
- transformFn: transformSDKImageToRESTImage,
1155
- paths: [
1156
- { path: "customizations.choicesSettings.choices.image" },
1157
- { path: "customizations.choicesSettings.choices.displayImage" }
1158
- ]
1159
- }
1160
- ]
1161
- );
1162
- const reqOpts = bulkCreateCustomizations(payload);
1163
- sideEffects?.onSiteCall?.();
1164
- try {
1165
- const result = await httpClient.request(reqOpts);
1166
- sideEffects?.onSuccess?.(result);
1167
- return renameKeysFromRESTResponseToSDKResponse(
1168
- transformPaths2(result.data, [
1169
- {
1170
- transformFn: transformRESTImageToSDKImage,
1171
- paths: [
1172
- { path: "results.customization.choicesSettings.choices.image" },
1173
- {
1174
- path: "results.customization.choicesSettings.choices.displayImage"
1175
- }
1176
- ]
1177
- }
1178
- ])
1179
- );
1180
- } catch (err) {
1181
- const transformedError = sdkTransformError(
1182
- err,
1183
- {
1184
- spreadPathsToArguments: {},
1185
- explicitPathsToArguments: {
1186
- customizations: "$[0]",
1187
- returnEntity: "$[1].returnEntity"
1188
- },
1189
- singleArgumentUnchanged: false
1190
- },
1191
- ["customizations", "options"]
1192
- );
1193
- sideEffects?.onError?.(err);
1194
- throw transformedError;
1195
- }
1196
- }
1197
- async function addCustomizationChoices2(customizationId, choices, options) {
1198
- const { httpClient, sideEffects } = arguments[3];
1199
- const payload = transformPaths2(
1200
- renameKeysFromSDKRequestToRESTRequest({
1201
- customizationId,
1202
- choices,
1203
- fields: options?.fields
1204
- }),
1205
- [
1206
- {
1207
- transformFn: transformSDKImageToRESTImage,
1208
- paths: [{ path: "choices.image" }, { path: "choices.displayImage" }]
1209
- }
1210
- ]
1211
- );
1212
- const reqOpts = addCustomizationChoices(payload);
1213
- sideEffects?.onSiteCall?.();
1214
- try {
1215
- const result = await httpClient.request(reqOpts);
1216
- sideEffects?.onSuccess?.(result);
1217
- return renameKeysFromRESTResponseToSDKResponse(
1218
- transformPaths2(result.data, [
1219
- {
1220
- transformFn: transformRESTImageToSDKImage,
1221
- paths: [
1222
- { path: "customization.choicesSettings.choices.image" },
1223
- { path: "customization.choicesSettings.choices.displayImage" }
1224
- ]
1225
- }
1226
- ])
1227
- );
1228
- } catch (err) {
1229
- const transformedError = sdkTransformError(
1230
- err,
1231
- {
1232
- spreadPathsToArguments: {},
1233
- explicitPathsToArguments: {
1234
- customizationId: "$[0]",
1235
- choices: "$[1]",
1236
- fields: "$[2].fields"
1237
- },
1238
- singleArgumentUnchanged: false
1239
- },
1240
- ["customizationId", "choices", "options"]
1241
- );
1242
- sideEffects?.onError?.(err);
1243
- throw transformedError;
1244
- }
1245
- }
1246
- async function setCustomizationChoices2(customizationId, choices, options) {
1247
- const { httpClient, sideEffects } = arguments[3];
1248
- const payload = transformPaths2(
1249
- renameKeysFromSDKRequestToRESTRequest({
1250
- customizationId,
1251
- choices,
1252
- fields: options?.fields
1253
- }),
1254
- [
1255
- {
1256
- transformFn: transformSDKImageToRESTImage,
1257
- paths: [{ path: "choices.image" }, { path: "choices.displayImage" }]
1258
- }
1259
- ]
1260
- );
1261
- const reqOpts = setCustomizationChoices(payload);
1262
- sideEffects?.onSiteCall?.();
1263
- try {
1264
- const result = await httpClient.request(reqOpts);
1265
- sideEffects?.onSuccess?.(result);
1266
- return renameKeysFromRESTResponseToSDKResponse(
1267
- transformPaths2(result.data, [
1268
- {
1269
- transformFn: transformRESTImageToSDKImage,
1270
- paths: [
1271
- { path: "customization.choicesSettings.choices.image" },
1272
- { path: "customization.choicesSettings.choices.displayImage" }
1273
- ]
1274
- }
1275
- ])
1276
- );
1277
- } catch (err) {
1278
- const transformedError = sdkTransformError(
1279
- err,
1280
- {
1281
- spreadPathsToArguments: {},
1282
- explicitPathsToArguments: {
1283
- customizationId: "$[0]",
1284
- choices: "$[1]",
1285
- fields: "$[2].fields"
1286
- },
1287
- singleArgumentUnchanged: false
1288
- },
1289
- ["customizationId", "choices", "options"]
1290
- );
1291
- sideEffects?.onError?.(err);
1292
- throw transformedError;
1293
- }
1294
- }
1295
- async function removeCustomizationChoices2(customizationId, choiceIds, options) {
1296
- const { httpClient, sideEffects } = arguments[3];
1297
- const payload = renameKeysFromSDKRequestToRESTRequest({
1298
- customizationId,
1299
- choiceIds,
1300
- revision: options?.revision,
1301
- fields: options?.fields
1302
- });
1303
- const reqOpts = removeCustomizationChoices(
1304
- payload
1305
- );
1306
- sideEffects?.onSiteCall?.();
1307
- try {
1308
- const result = await httpClient.request(reqOpts);
1309
- sideEffects?.onSuccess?.(result);
1310
- return renameKeysFromRESTResponseToSDKResponse(
1311
- transformPaths2(result.data, [
1312
- {
1313
- transformFn: transformRESTImageToSDKImage,
1314
- paths: [
1315
- { path: "customization.choicesSettings.choices.image" },
1316
- { path: "customization.choicesSettings.choices.displayImage" }
1317
- ]
1318
- }
1319
- ])
1320
- );
1321
- } catch (err) {
1322
- const transformedError = sdkTransformError(
1323
- err,
1324
- {
1325
- spreadPathsToArguments: {},
1326
- explicitPathsToArguments: {
1327
- customizationId: "$[0]",
1328
- choiceIds: "$[1]",
1329
- revision: "$[2].revision",
1330
- fields: "$[2].fields"
1331
- },
1332
- singleArgumentUnchanged: false
1333
- },
1334
- ["customizationId", "choiceIds", "options"]
1335
- );
1336
- sideEffects?.onError?.(err);
1337
- throw transformedError;
1338
- }
1339
- }
1340
- async function updateCustomizationChoices2(customizationId, revision, options) {
1341
- const { httpClient, sideEffects } = arguments[3];
1342
- const payload = transformPaths2(
1343
- renameKeysFromSDKRequestToRESTRequest({
1344
- customizationId,
1345
- revision,
1346
- choices: options?.choices,
1347
- fields: options?.fields
1348
- }),
1349
- [
1350
- {
1351
- transformFn: transformSDKImageToRESTImage,
1352
- paths: [
1353
- { path: "choices.choice.image" },
1354
- { path: "choices.choice.displayImage" }
1355
- ]
1356
- }
1357
- ]
1358
- );
1359
- const reqOpts = updateCustomizationChoices(
1360
- payload
1361
- );
1362
- sideEffects?.onSiteCall?.();
1363
- try {
1364
- const result = await httpClient.request(reqOpts);
1365
- sideEffects?.onSuccess?.(result);
1366
- return renameKeysFromRESTResponseToSDKResponse(
1367
- transformPaths2(result.data, [
1368
- {
1369
- transformFn: transformRESTImageToSDKImage,
1370
- paths: [
1371
- { path: "customization.choicesSettings.choices.image" },
1372
- { path: "customization.choicesSettings.choices.displayImage" }
1373
- ]
1374
- }
1375
- ])
1376
- );
1377
- } catch (err) {
1378
- const transformedError = sdkTransformError(
1379
- err,
1380
- {
1381
- spreadPathsToArguments: {},
1382
- explicitPathsToArguments: {
1383
- customizationId: "$[0]",
1384
- revision: "$[1]",
1385
- choices: "$[2].choices",
1386
- fields: "$[2].fields"
1387
- },
1388
- singleArgumentUnchanged: false
1389
- },
1390
- ["customizationId", "revision", "options"]
1391
- );
1392
- sideEffects?.onError?.(err);
1393
- throw transformedError;
1394
- }
1395
- }
1396
- async function reorderCustomizationChoices2(customizationId, revision, options) {
1397
- const { httpClient, sideEffects } = arguments[3];
1398
- const payload = renameKeysFromSDKRequestToRESTRequest({
1399
- customizationId,
1400
- revision,
1401
- choiceIds: options?.choiceIds,
1402
- fields: options?.fields
1403
- });
1404
- const reqOpts = reorderCustomizationChoices(
1405
- payload
1406
- );
1407
- sideEffects?.onSiteCall?.();
1408
- try {
1409
- const result = await httpClient.request(reqOpts);
1410
- sideEffects?.onSuccess?.(result);
1411
- return renameKeysFromRESTResponseToSDKResponse(
1412
- transformPaths2(result.data, [
1413
- {
1414
- transformFn: transformRESTImageToSDKImage,
1415
- paths: [
1416
- { path: "customization.choicesSettings.choices.image" },
1417
- { path: "customization.choicesSettings.choices.displayImage" }
1418
- ]
1419
- }
1420
- ])
1421
- );
1422
- } catch (err) {
1423
- const transformedError = sdkTransformError(
1424
- err,
1425
- {
1426
- spreadPathsToArguments: {},
1427
- explicitPathsToArguments: {
1428
- customizationId: "$[0]",
1429
- revision: "$[1]",
1430
- choiceIds: "$[2].choiceIds",
1431
- fields: "$[2].fields"
1432
- },
1433
- singleArgumentUnchanged: false
1434
- },
1435
- ["customizationId", "revision", "options"]
1436
- );
1437
- sideEffects?.onError?.(err);
1438
- throw transformedError;
1439
- }
1440
- }
1441
- async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1442
- const { httpClient, sideEffects } = arguments[2];
1443
- const payload = transformPaths2(
1444
- renameKeysFromSDKRequestToRESTRequest({
1445
- customizationsChoices,
1446
- returnEntity: options?.returnEntity,
1447
- fields: options?.fields
1448
- }),
1449
- [
1450
- {
1451
- transformFn: transformSDKImageToRESTImage,
1452
- paths: [
1453
- { path: "customizationsChoices.choices.image" },
1454
- { path: "customizationsChoices.choices.displayImage" }
1455
- ]
1456
- }
1457
- ]
1458
- );
1459
- const reqOpts = bulkAddCustomizationChoices(
1460
- payload
1461
- );
1462
- sideEffects?.onSiteCall?.();
1463
- try {
1464
- const result = await httpClient.request(reqOpts);
1465
- sideEffects?.onSuccess?.(result);
1466
- return renameKeysFromRESTResponseToSDKResponse(
1467
- transformPaths2(result.data, [
1468
- {
1469
- transformFn: transformRESTImageToSDKImage,
1470
- paths: [
1471
- { path: "results.customization.choicesSettings.choices.image" },
1472
- {
1473
- path: "results.customization.choicesSettings.choices.displayImage"
1474
- }
1475
- ]
1476
- }
1477
- ])
1478
- );
1479
- } catch (err) {
1480
- const transformedError = sdkTransformError(
1481
- err,
1482
- {
1483
- spreadPathsToArguments: {},
1484
- explicitPathsToArguments: {
1485
- customizationsChoices: "$[0]",
1486
- returnEntity: "$[1].returnEntity",
1487
- fields: "$[1].fields"
1488
- },
1489
- singleArgumentUnchanged: false
1490
- },
1491
- ["customizationsChoices", "options"]
1492
- );
1493
- sideEffects?.onError?.(err);
1494
- throw transformedError;
1495
- }
1496
- }
1497
- async function bulkUpdateCustomizations2(customizations, options) {
1498
- const { httpClient, sideEffects } = arguments[2];
1499
- const payload = transformPaths2(
1500
- renameKeysFromSDKRequestToRESTRequest({
1501
- customizations,
1502
- returnEntity: options?.returnEntity,
1503
- fields: options?.fields
1504
- }),
1505
- [
1506
- {
1507
- transformFn: transformSDKImageToRESTImage,
1508
- paths: [
1509
- {
1510
- path: "customizations.customization.choicesSettings.choices.image"
1511
- },
1512
- {
1513
- path: "customizations.customization.choicesSettings.choices.displayImage"
1514
- }
1515
- ]
1516
- }
1517
- ]
1518
- );
1519
- const reqOpts = bulkUpdateCustomizations(payload);
1520
- sideEffects?.onSiteCall?.();
1521
- try {
1522
- const result = await httpClient.request(reqOpts);
1523
- sideEffects?.onSuccess?.(result);
1524
- return renameKeysFromRESTResponseToSDKResponse(
1525
- transformPaths2(result.data, [
1526
- {
1527
- transformFn: transformRESTImageToSDKImage,
1528
- paths: [
1529
- { path: "results.customization.choicesSettings.choices.image" },
1530
- {
1531
- path: "results.customization.choicesSettings.choices.displayImage"
1532
- }
1533
- ]
1534
- }
1535
- ])
1536
- );
1537
- } catch (err) {
1538
- const transformedError = sdkTransformError(
1539
- err,
1540
- {
1541
- spreadPathsToArguments: {},
1542
- explicitPathsToArguments: {
1543
- customizations: "$[0]",
1544
- returnEntity: "$[1].returnEntity",
1545
- fields: "$[1].fields"
1546
- },
1547
- singleArgumentUnchanged: false
1548
- },
1549
- ["customizations", "options"]
1550
- );
1551
- sideEffects?.onError?.(err);
1552
- throw transformedError;
1553
- }
1554
- }
1555
-
1556
- // src/stores-catalog-v3-customization-customizations-v-3.public.ts
1557
- function createCustomization3(httpClient) {
1558
- return (customization) => createCustomization2(
1559
- customization,
1560
- // @ts-ignore
1561
- { httpClient }
1562
- );
1563
- }
1564
- function getCustomization3(httpClient) {
1565
- return (customizationId, options) => getCustomization2(
1566
- customizationId,
1567
- options,
1568
- // @ts-ignore
1569
- { httpClient }
1570
- );
1571
- }
1572
- function updateCustomization3(httpClient) {
1573
- return (_id, customization, options) => updateCustomization2(
1574
- _id,
1575
- customization,
1576
- options,
1577
- // @ts-ignore
1578
- { httpClient }
1579
- );
1580
- }
1581
- function deleteCustomization3(httpClient) {
1582
- return (customizationId) => deleteCustomization2(
1583
- customizationId,
1584
- // @ts-ignore
1585
- { httpClient }
1586
- );
1587
- }
1588
- function queryCustomizations3(httpClient) {
1589
- return (options) => queryCustomizations2(
1590
- options,
1591
- // @ts-ignore
1592
- { httpClient }
1593
- );
1594
- }
1595
- function typedQueryCustomizations2(httpClient) {
1596
- return (query, options) => typedQueryCustomizations(
1597
- query,
1598
- options,
1599
- // @ts-ignore
1600
- { httpClient }
1601
- );
1602
- }
1603
- function bulkCreateCustomizations3(httpClient) {
1604
- return (customizations, options) => bulkCreateCustomizations2(
1605
- customizations,
1606
- options,
1607
- // @ts-ignore
1608
- { httpClient }
1609
- );
1610
- }
1611
- function addCustomizationChoices3(httpClient) {
1612
- return (customizationId, choices, options) => addCustomizationChoices2(
1613
- customizationId,
1614
- choices,
1615
- options,
1616
- // @ts-ignore
1617
- { httpClient }
1618
- );
1619
- }
1620
- function setCustomizationChoices3(httpClient) {
1621
- return (customizationId, choices, options) => setCustomizationChoices2(
1622
- customizationId,
1623
- choices,
1624
- options,
1625
- // @ts-ignore
1626
- { httpClient }
1627
- );
1628
- }
1629
- function removeCustomizationChoices3(httpClient) {
1630
- return (customizationId, choiceIds, options) => removeCustomizationChoices2(
1631
- customizationId,
1632
- choiceIds,
1633
- options,
1634
- // @ts-ignore
1635
- { httpClient }
1636
- );
1637
- }
1638
- function updateCustomizationChoices3(httpClient) {
1639
- return (customizationId, revision, options) => updateCustomizationChoices2(
1640
- customizationId,
1641
- revision,
1642
- options,
1643
- // @ts-ignore
1644
- { httpClient }
1645
- );
1646
- }
1647
- function reorderCustomizationChoices3(httpClient) {
1648
- return (customizationId, revision, options) => reorderCustomizationChoices2(
1649
- customizationId,
1650
- revision,
1651
- options,
1652
- // @ts-ignore
1653
- { httpClient }
1654
- );
1655
- }
1656
- function bulkAddCustomizationChoices3(httpClient) {
1657
- return (customizationsChoices, options) => bulkAddCustomizationChoices2(
1658
- customizationsChoices,
1659
- options,
1660
- // @ts-ignore
1661
- { httpClient }
1662
- );
1663
- }
1664
- function bulkUpdateCustomizations3(httpClient) {
1665
- return (customizations, options) => bulkUpdateCustomizations2(
1666
- customizations,
1667
- options,
1668
- // @ts-ignore
1669
- { httpClient }
1670
- );
1671
- }
1672
- var onCustomizationCreated = /* @__PURE__ */ EventDefinition(
1673
- "wix.stores.catalog.v3.customization_created",
1674
- true,
1675
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1676
- transformPaths3(event, [
1677
- {
1678
- transformFn: transformRESTTimestampToSDKTimestamp2,
1679
- paths: [
1680
- { path: "entity.createdDate" },
1681
- { path: "entity.updatedDate" },
1682
- { path: "metadata.eventTime" }
1683
- ]
1684
- },
1685
- {
1686
- transformFn: transformRESTImageToSDKImage2,
1687
- paths: [
1688
- { path: "entity.choicesSettings.choices.image" },
1689
- { path: "entity.choicesSettings.choices.displayImage" }
1690
- ]
1691
- }
1692
- ])
1693
- )
1694
- )();
1695
- var onCustomizationDeleted = /* @__PURE__ */ EventDefinition(
1696
- "wix.stores.catalog.v3.customization_deleted",
1697
- true,
1698
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1699
- transformPaths3(event, [
1700
- {
1701
- transformFn: transformRESTTimestampToSDKTimestamp2,
1702
- paths: [
1703
- { path: "entity.createdDate" },
1704
- { path: "entity.updatedDate" },
1705
- { path: "metadata.eventTime" }
1706
- ]
1707
- },
1708
- {
1709
- transformFn: transformRESTImageToSDKImage2,
1710
- paths: [
1711
- { path: "entity.choicesSettings.choices.image" },
1712
- { path: "entity.choicesSettings.choices.displayImage" }
1713
- ]
1714
- }
1715
- ])
1716
- )
1717
- )();
1718
- var onCustomizationUpdated = /* @__PURE__ */ EventDefinition(
1719
- "wix.stores.catalog.v3.customization_updated",
1720
- true,
1721
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1722
- transformPaths3(event, [
1723
- {
1724
- transformFn: transformRESTTimestampToSDKTimestamp2,
1725
- paths: [
1726
- { path: "entity.createdDate" },
1727
- { path: "entity.updatedDate" },
1728
- { path: "metadata.eventTime" },
1729
- { path: "modifiedFields.createdDate" },
1730
- { path: "modifiedFields.updatedDate" }
1731
- ]
1732
- },
1733
- {
1734
- transformFn: transformRESTImageToSDKImage2,
1735
- paths: [
1736
- { path: "entity.choicesSettings.choices.image" },
1737
- { path: "entity.choicesSettings.choices.displayImage" },
1738
- { path: "modifiedFields.choicesSettings.choices.image" },
1739
- { path: "modifiedFields.choicesSettings.choices.displayImage" }
1740
- ]
1741
- }
1742
- ])
1743
- )
1744
- )();
1745
-
1746
- // src/stores-catalog-v3-customization-customizations-v-3.context.ts
1747
- import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1748
- import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1749
- import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
1750
- function customQueryCustomizations(httpClient) {
1751
- const router = /* @__PURE__ */ createQueryOverloadRouter({
1752
- builderQueryFunction: (options) => queryCustomizations3(httpClient)(options),
1753
- typedQueryFunction: (query, options) => typedQueryCustomizations2(httpClient)(query, options),
1754
- hasOptionsParameter: true
1755
- });
1756
- function overloadedQuery(queryOrOptions, options) {
1757
- return router(...arguments);
1758
- }
1759
- return overloadedQuery;
1760
- }
1761
- var createCustomization4 = /* @__PURE__ */ createRESTModule(createCustomization3);
1762
- var getCustomization4 = /* @__PURE__ */ createRESTModule(getCustomization3);
1763
- var updateCustomization4 = /* @__PURE__ */ createRESTModule(updateCustomization3);
1764
- var deleteCustomization4 = /* @__PURE__ */ createRESTModule(deleteCustomization3);
1765
- var bulkCreateCustomizations4 = /* @__PURE__ */ createRESTModule(bulkCreateCustomizations3);
1766
- var addCustomizationChoices4 = /* @__PURE__ */ createRESTModule(addCustomizationChoices3);
1767
- var setCustomizationChoices4 = /* @__PURE__ */ createRESTModule(setCustomizationChoices3);
1768
- var removeCustomizationChoices4 = /* @__PURE__ */ createRESTModule(removeCustomizationChoices3);
1769
- var updateCustomizationChoices4 = /* @__PURE__ */ createRESTModule(updateCustomizationChoices3);
1770
- var reorderCustomizationChoices4 = /* @__PURE__ */ createRESTModule(reorderCustomizationChoices3);
1771
- var bulkAddCustomizationChoices4 = /* @__PURE__ */ createRESTModule(bulkAddCustomizationChoices3);
1772
- var bulkUpdateCustomizations4 = /* @__PURE__ */ createRESTModule(bulkUpdateCustomizations3);
1773
- var queryCustomizations4 = /* @__PURE__ */ createRESTModule(customQueryCustomizations);
1774
- var onCustomizationCreated2 = /* @__PURE__ */ createEventModule(
1775
- onCustomizationCreated
1776
- );
1777
- var onCustomizationDeleted2 = /* @__PURE__ */ createEventModule(
1778
- onCustomizationDeleted
1779
- );
1780
- var onCustomizationUpdated2 = /* @__PURE__ */ createEventModule(
1781
- onCustomizationUpdated
1782
- );
1783
- export {
1784
- ChoiceSortStrategy,
1785
- ChoiceType,
1786
- CustomizationRenderType,
1787
- CustomizationType,
1788
- RequestedFields,
1789
- SortOrder,
1790
- WebhookIdentityType,
1791
- addCustomizationChoices4 as addCustomizationChoices,
1792
- bulkAddCustomizationChoices4 as bulkAddCustomizationChoices,
1793
- bulkCreateCustomizations4 as bulkCreateCustomizations,
1794
- bulkUpdateCustomizations4 as bulkUpdateCustomizations,
1795
- createCustomization4 as createCustomization,
1796
- deleteCustomization4 as deleteCustomization,
1797
- getCustomization4 as getCustomization,
1798
- onCustomizationCreated2 as onCustomizationCreated,
1799
- onCustomizationDeleted2 as onCustomizationDeleted,
1800
- onCustomizationUpdated2 as onCustomizationUpdated,
1801
- queryCustomizations4 as queryCustomizations,
1802
- removeCustomizationChoices4 as removeCustomizationChoices,
1803
- reorderCustomizationChoices4 as reorderCustomizationChoices,
1804
- setCustomizationChoices4 as setCustomizationChoices,
1805
- updateCustomization4 as updateCustomization,
1806
- updateCustomizationChoices4 as updateCustomizationChoices,
1807
- utils
1808
- };
1809
- //# sourceMappingURL=index.mjs.map