@wix/auto_sdk_stores_customizations-v-3 1.0.92 → 1.0.94

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.
@@ -1,1864 +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 countCustomizations(payload) {
346
- function __countCustomizations({ host }) {
347
- const metadata = {
348
- entityFqdn: "wix.stores.catalog.v3.customization",
349
- method: "POST",
350
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.CountCustomizations",
351
- packageName: PACKAGE_NAME,
352
- migrationOptions: {
353
- optInTransformResponse: true
354
- },
355
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
356
- protoPath: "/v3/customizations/count",
357
- data: payload,
358
- host
359
- }),
360
- data: payload
361
- };
362
- return metadata;
363
- }
364
- return __countCustomizations;
365
- }
366
- function bulkCreateCustomizations(payload) {
367
- function __bulkCreateCustomizations({ host }) {
368
- const serializedData = transformPaths(payload, [
369
- {
370
- transformFn: transformSDKTimestampToRESTTimestamp,
371
- paths: [
372
- { path: "customizations.createdDate" },
373
- { path: "customizations.updatedDate" },
374
- {
375
- path: "customizations.choicesSettings.choices.image.urlExpirationDate"
376
- },
377
- {
378
- path: "customizations.choicesSettings.choices.displayImage.urlExpirationDate"
379
- }
380
- ]
381
- },
382
- {
383
- transformFn: transformSDKFloatToRESTFloat,
384
- paths: [
385
- { path: "customizations.choicesSettings.choices.image.focalPoint.x" },
386
- { path: "customizations.choicesSettings.choices.image.focalPoint.y" }
387
- ]
388
- }
389
- ]);
390
- const metadata = {
391
- entityFqdn: "wix.stores.catalog.v3.customization",
392
- method: "POST",
393
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations",
394
- packageName: PACKAGE_NAME,
395
- migrationOptions: {
396
- optInTransformResponse: true
397
- },
398
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
399
- protoPath: "/v3/bulk/customizations/create",
400
- data: serializedData,
401
- host
402
- }),
403
- data: serializedData,
404
- transformResponse: (payload2) => transformPaths(payload2, [
405
- {
406
- transformFn: transformRESTTimestampToSDKTimestamp,
407
- paths: [
408
- { path: "results.customization.createdDate" },
409
- { path: "results.customization.updatedDate" },
410
- {
411
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
412
- },
413
- {
414
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
415
- }
416
- ]
417
- },
418
- {
419
- transformFn: transformRESTFloatToSDKFloat,
420
- paths: [
421
- {
422
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
423
- },
424
- {
425
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
426
- }
427
- ]
428
- }
429
- ])
430
- };
431
- return metadata;
432
- }
433
- return __bulkCreateCustomizations;
434
- }
435
- function addCustomizationChoices(payload) {
436
- function __addCustomizationChoices({ host }) {
437
- const serializedData = transformPaths(payload, [
438
- {
439
- transformFn: transformSDKTimestampToRESTTimestamp,
440
- paths: [
441
- { path: "choices.image.urlExpirationDate" },
442
- { path: "choices.displayImage.urlExpirationDate" }
443
- ]
444
- },
445
- {
446
- transformFn: transformSDKFloatToRESTFloat,
447
- paths: [
448
- { path: "choices.image.focalPoint.x" },
449
- { path: "choices.image.focalPoint.y" }
450
- ]
451
- }
452
- ]);
453
- const metadata = {
454
- entityFqdn: "wix.stores.catalog.v3.customization",
455
- method: "POST",
456
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices",
457
- packageName: PACKAGE_NAME,
458
- migrationOptions: {
459
- optInTransformResponse: true
460
- },
461
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
462
- protoPath: "/v3/customizations/{customizationId}/add-choices",
463
- data: serializedData,
464
- host
465
- }),
466
- data: serializedData,
467
- transformResponse: (payload2) => transformPaths(payload2, [
468
- {
469
- transformFn: transformRESTTimestampToSDKTimestamp,
470
- paths: [
471
- { path: "customization.createdDate" },
472
- { path: "customization.updatedDate" },
473
- {
474
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
475
- },
476
- {
477
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
478
- }
479
- ]
480
- },
481
- {
482
- transformFn: transformRESTFloatToSDKFloat,
483
- paths: [
484
- {
485
- path: "customization.choicesSettings.choices.image.focalPoint.x"
486
- },
487
- {
488
- path: "customization.choicesSettings.choices.image.focalPoint.y"
489
- }
490
- ]
491
- }
492
- ])
493
- };
494
- return metadata;
495
- }
496
- return __addCustomizationChoices;
497
- }
498
- function setCustomizationChoices(payload) {
499
- function __setCustomizationChoices({ host }) {
500
- const serializedData = transformPaths(payload, [
501
- {
502
- transformFn: transformSDKTimestampToRESTTimestamp,
503
- paths: [
504
- { path: "choices.image.urlExpirationDate" },
505
- { path: "choices.displayImage.urlExpirationDate" }
506
- ]
507
- },
508
- {
509
- transformFn: transformSDKFloatToRESTFloat,
510
- paths: [
511
- { path: "choices.image.focalPoint.x" },
512
- { path: "choices.image.focalPoint.y" }
513
- ]
514
- }
515
- ]);
516
- const metadata = {
517
- entityFqdn: "wix.stores.catalog.v3.customization",
518
- method: "POST",
519
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices",
520
- packageName: PACKAGE_NAME,
521
- migrationOptions: {
522
- optInTransformResponse: true
523
- },
524
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
525
- protoPath: "/v3/customizations/{customizationId}/set-choices",
526
- data: serializedData,
527
- host
528
- }),
529
- data: serializedData,
530
- transformResponse: (payload2) => transformPaths(payload2, [
531
- {
532
- transformFn: transformRESTTimestampToSDKTimestamp,
533
- paths: [
534
- { path: "customization.createdDate" },
535
- { path: "customization.updatedDate" },
536
- {
537
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
538
- },
539
- {
540
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
541
- }
542
- ]
543
- },
544
- {
545
- transformFn: transformRESTFloatToSDKFloat,
546
- paths: [
547
- {
548
- path: "customization.choicesSettings.choices.image.focalPoint.x"
549
- },
550
- {
551
- path: "customization.choicesSettings.choices.image.focalPoint.y"
552
- }
553
- ]
554
- }
555
- ])
556
- };
557
- return metadata;
558
- }
559
- return __setCustomizationChoices;
560
- }
561
- function removeCustomizationChoices(payload) {
562
- function __removeCustomizationChoices({ host }) {
563
- const metadata = {
564
- entityFqdn: "wix.stores.catalog.v3.customization",
565
- method: "POST",
566
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices",
567
- packageName: PACKAGE_NAME,
568
- migrationOptions: {
569
- optInTransformResponse: true
570
- },
571
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
572
- protoPath: "/v3/customizations/{customizationId}/remove-choices",
573
- data: payload,
574
- host
575
- }),
576
- data: payload,
577
- transformResponse: (payload2) => transformPaths(payload2, [
578
- {
579
- transformFn: transformRESTTimestampToSDKTimestamp,
580
- paths: [
581
- { path: "customization.createdDate" },
582
- { path: "customization.updatedDate" },
583
- {
584
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
585
- },
586
- {
587
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
588
- }
589
- ]
590
- },
591
- {
592
- transformFn: transformRESTFloatToSDKFloat,
593
- paths: [
594
- {
595
- path: "customization.choicesSettings.choices.image.focalPoint.x"
596
- },
597
- {
598
- path: "customization.choicesSettings.choices.image.focalPoint.y"
599
- }
600
- ]
601
- }
602
- ])
603
- };
604
- return metadata;
605
- }
606
- return __removeCustomizationChoices;
607
- }
608
- function updateCustomizationChoices(payload) {
609
- function __updateCustomizationChoices({ host }) {
610
- const serializedData = transformPaths(payload, [
611
- {
612
- transformFn: transformSDKFieldMaskToRESTFieldMask,
613
- paths: [{ path: "choices.fieldMask" }]
614
- },
615
- {
616
- transformFn: transformSDKTimestampToRESTTimestamp,
617
- paths: [
618
- { path: "choices.choice.image.urlExpirationDate" },
619
- { path: "choices.choice.displayImage.urlExpirationDate" }
620
- ]
621
- },
622
- {
623
- transformFn: transformSDKFloatToRESTFloat,
624
- paths: [
625
- { path: "choices.choice.image.focalPoint.x" },
626
- { path: "choices.choice.image.focalPoint.y" }
627
- ]
628
- }
629
- ]);
630
- const metadata = {
631
- entityFqdn: "wix.stores.catalog.v3.customization",
632
- method: "POST",
633
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomizationChoices",
634
- packageName: PACKAGE_NAME,
635
- migrationOptions: {
636
- optInTransformResponse: true
637
- },
638
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
639
- protoPath: "/v3/customizations/{customizationId}/update-choices",
640
- data: serializedData,
641
- host
642
- }),
643
- data: serializedData,
644
- transformResponse: (payload2) => transformPaths(payload2, [
645
- {
646
- transformFn: transformRESTTimestampToSDKTimestamp,
647
- paths: [
648
- { path: "customization.createdDate" },
649
- { path: "customization.updatedDate" },
650
- {
651
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
652
- },
653
- {
654
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
655
- }
656
- ]
657
- },
658
- {
659
- transformFn: transformRESTFloatToSDKFloat,
660
- paths: [
661
- {
662
- path: "customization.choicesSettings.choices.image.focalPoint.x"
663
- },
664
- {
665
- path: "customization.choicesSettings.choices.image.focalPoint.y"
666
- }
667
- ]
668
- }
669
- ])
670
- };
671
- return metadata;
672
- }
673
- return __updateCustomizationChoices;
674
- }
675
- function reorderCustomizationChoices(payload) {
676
- function __reorderCustomizationChoices({ host }) {
677
- const metadata = {
678
- entityFqdn: "wix.stores.catalog.v3.customization",
679
- method: "POST",
680
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.ReorderCustomizationChoices",
681
- packageName: PACKAGE_NAME,
682
- migrationOptions: {
683
- optInTransformResponse: true
684
- },
685
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
686
- protoPath: "/v3/customizations/{customizationId}/reorder-choices",
687
- data: payload,
688
- host
689
- }),
690
- data: payload,
691
- transformResponse: (payload2) => transformPaths(payload2, [
692
- {
693
- transformFn: transformRESTTimestampToSDKTimestamp,
694
- paths: [
695
- { path: "customization.createdDate" },
696
- { path: "customization.updatedDate" },
697
- {
698
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
699
- },
700
- {
701
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
702
- }
703
- ]
704
- },
705
- {
706
- transformFn: transformRESTFloatToSDKFloat,
707
- paths: [
708
- {
709
- path: "customization.choicesSettings.choices.image.focalPoint.x"
710
- },
711
- {
712
- path: "customization.choicesSettings.choices.image.focalPoint.y"
713
- }
714
- ]
715
- }
716
- ])
717
- };
718
- return metadata;
719
- }
720
- return __reorderCustomizationChoices;
721
- }
722
- function bulkAddCustomizationChoices(payload) {
723
- function __bulkAddCustomizationChoices({ host }) {
724
- const serializedData = transformPaths(payload, [
725
- {
726
- transformFn: transformSDKTimestampToRESTTimestamp,
727
- paths: [
728
- { path: "customizationsChoices.choices.image.urlExpirationDate" },
729
- {
730
- path: "customizationsChoices.choices.displayImage.urlExpirationDate"
731
- }
732
- ]
733
- },
734
- {
735
- transformFn: transformSDKFloatToRESTFloat,
736
- paths: [
737
- { path: "customizationsChoices.choices.image.focalPoint.x" },
738
- { path: "customizationsChoices.choices.image.focalPoint.y" }
739
- ]
740
- }
741
- ]);
742
- const metadata = {
743
- entityFqdn: "wix.stores.catalog.v3.customization",
744
- method: "POST",
745
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices",
746
- packageName: PACKAGE_NAME,
747
- migrationOptions: {
748
- optInTransformResponse: true
749
- },
750
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
751
- protoPath: "/v3/bulk/customizations/add-choices",
752
- data: serializedData,
753
- host
754
- }),
755
- data: serializedData,
756
- transformResponse: (payload2) => transformPaths(payload2, [
757
- {
758
- transformFn: transformRESTTimestampToSDKTimestamp,
759
- paths: [
760
- { path: "results.customization.createdDate" },
761
- { path: "results.customization.updatedDate" },
762
- {
763
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
764
- },
765
- {
766
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
767
- }
768
- ]
769
- },
770
- {
771
- transformFn: transformRESTFloatToSDKFloat,
772
- paths: [
773
- {
774
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
775
- },
776
- {
777
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
778
- }
779
- ]
780
- }
781
- ])
782
- };
783
- return metadata;
784
- }
785
- return __bulkAddCustomizationChoices;
786
- }
787
- function bulkUpdateCustomizations(payload) {
788
- function __bulkUpdateCustomizations({ host }) {
789
- const serializedData = transformPaths(payload, [
790
- {
791
- transformFn: transformSDKFieldMaskToRESTFieldMask,
792
- paths: [{ path: "customizations.fieldMask" }]
793
- },
794
- {
795
- transformFn: transformSDKTimestampToRESTTimestamp,
796
- paths: [
797
- { path: "customizations.customization.createdDate" },
798
- { path: "customizations.customization.updatedDate" },
799
- {
800
- path: "customizations.customization.choicesSettings.choices.image.urlExpirationDate"
801
- },
802
- {
803
- path: "customizations.customization.choicesSettings.choices.displayImage.urlExpirationDate"
804
- }
805
- ]
806
- },
807
- {
808
- transformFn: transformSDKFloatToRESTFloat,
809
- paths: [
810
- {
811
- path: "customizations.customization.choicesSettings.choices.image.focalPoint.x"
812
- },
813
- {
814
- path: "customizations.customization.choicesSettings.choices.image.focalPoint.y"
815
- }
816
- ]
817
- }
818
- ]);
819
- const metadata = {
820
- entityFqdn: "wix.stores.catalog.v3.customization",
821
- method: "POST",
822
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations",
823
- packageName: PACKAGE_NAME,
824
- migrationOptions: {
825
- optInTransformResponse: true
826
- },
827
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
828
- protoPath: "/v3/bulk/customizations/update",
829
- data: serializedData,
830
- host
831
- }),
832
- data: serializedData,
833
- transformResponse: (payload2) => transformPaths(payload2, [
834
- {
835
- transformFn: transformRESTTimestampToSDKTimestamp,
836
- paths: [
837
- { path: "results.customization.createdDate" },
838
- { path: "results.customization.updatedDate" },
839
- {
840
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
841
- },
842
- {
843
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
844
- }
845
- ]
846
- },
847
- {
848
- transformFn: transformRESTFloatToSDKFloat,
849
- paths: [
850
- {
851
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
852
- },
853
- {
854
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
855
- }
856
- ]
857
- }
858
- ])
859
- };
860
- return metadata;
861
- }
862
- return __bulkUpdateCustomizations;
863
- }
864
-
865
- // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
866
- import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
867
- import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
868
- import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
869
- import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
870
- var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
871
- CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
872
- CustomizationType2["MODIFIER"] = "MODIFIER";
873
- return CustomizationType2;
874
- })(CustomizationType || {});
875
- var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
876
- CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
877
- CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
878
- CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
879
- return CustomizationRenderType2;
880
- })(CustomizationRenderType || {});
881
- var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
882
- ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
883
- ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
884
- ChoiceType2["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
885
- ChoiceType2["IMAGE"] = "IMAGE";
886
- return ChoiceType2;
887
- })(ChoiceType || {});
888
- var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
889
- ChoiceSortStrategy2["DEFAULT"] = "DEFAULT";
890
- ChoiceSortStrategy2["BY_NAME"] = "BY_NAME";
891
- ChoiceSortStrategy2["BY_PRODUCT_COUNT"] = "BY_PRODUCT_COUNT";
892
- ChoiceSortStrategy2["MANUAL"] = "MANUAL";
893
- return ChoiceSortStrategy2;
894
- })(ChoiceSortStrategy || {});
895
- var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
896
- RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
897
- RequestedFields2["CHOICE_DISPLAY_IMAGE"] = "CHOICE_DISPLAY_IMAGE";
898
- return RequestedFields2;
899
- })(RequestedFields || {});
900
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
901
- SortOrder2["ASC"] = "ASC";
902
- SortOrder2["DESC"] = "DESC";
903
- return SortOrder2;
904
- })(SortOrder || {});
905
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
906
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
907
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
908
- WebhookIdentityType2["MEMBER"] = "MEMBER";
909
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
910
- WebhookIdentityType2["APP"] = "APP";
911
- return WebhookIdentityType2;
912
- })(WebhookIdentityType || {});
913
- async function createCustomization2(customization) {
914
- const { httpClient, sideEffects } = arguments[1];
915
- const payload = transformPaths2(
916
- renameKeysFromSDKRequestToRESTRequest({ customization }),
917
- [
918
- {
919
- transformFn: transformSDKImageToRESTImage,
920
- paths: [
921
- { path: "customization.choicesSettings.choices.image" },
922
- { path: "customization.choicesSettings.choices.displayImage" }
923
- ]
924
- }
925
- ]
926
- );
927
- const reqOpts = createCustomization(payload);
928
- sideEffects?.onSiteCall?.();
929
- try {
930
- const result = await httpClient.request(reqOpts);
931
- sideEffects?.onSuccess?.(result);
932
- return renameKeysFromRESTResponseToSDKResponse(
933
- transformPaths2(result.data, [
934
- {
935
- transformFn: transformRESTImageToSDKImage,
936
- paths: [
937
- { path: "customization.choicesSettings.choices.image" },
938
- { path: "customization.choicesSettings.choices.displayImage" }
939
- ]
940
- }
941
- ])
942
- )?.customization;
943
- } catch (err) {
944
- const transformedError = sdkTransformError(
945
- err,
946
- {
947
- spreadPathsToArguments: {},
948
- explicitPathsToArguments: { customization: "$[0]" },
949
- singleArgumentUnchanged: false
950
- },
951
- ["customization"]
952
- );
953
- sideEffects?.onError?.(err);
954
- throw transformedError;
955
- }
956
- }
957
- async function getCustomization2(customizationId, options) {
958
- const { httpClient, sideEffects } = arguments[2];
959
- const payload = renameKeysFromSDKRequestToRESTRequest({
960
- customizationId,
961
- fields: options?.fields
962
- });
963
- const reqOpts = getCustomization(payload);
964
- sideEffects?.onSiteCall?.();
965
- try {
966
- const result = await httpClient.request(reqOpts);
967
- sideEffects?.onSuccess?.(result);
968
- return renameKeysFromRESTResponseToSDKResponse(
969
- transformPaths2(result.data, [
970
- {
971
- transformFn: transformRESTImageToSDKImage,
972
- paths: [
973
- { path: "customization.choicesSettings.choices.image" },
974
- { path: "customization.choicesSettings.choices.displayImage" }
975
- ]
976
- }
977
- ])
978
- )?.customization;
979
- } catch (err) {
980
- const transformedError = sdkTransformError(
981
- err,
982
- {
983
- spreadPathsToArguments: {},
984
- explicitPathsToArguments: {
985
- customizationId: "$[0]",
986
- fields: "$[1].fields"
987
- },
988
- singleArgumentUnchanged: false
989
- },
990
- ["customizationId", "options"]
991
- );
992
- sideEffects?.onError?.(err);
993
- throw transformedError;
994
- }
995
- }
996
- async function updateCustomization2(_id, customization, options) {
997
- const { httpClient, sideEffects } = arguments[3];
998
- const payload = transformPaths2(
999
- renameKeysFromSDKRequestToRESTRequest({
1000
- customization: { ...customization, id: _id },
1001
- fields: options?.fields
1002
- }),
1003
- [
1004
- {
1005
- transformFn: transformSDKImageToRESTImage,
1006
- paths: [
1007
- { path: "customization.choicesSettings.choices.image" },
1008
- { path: "customization.choicesSettings.choices.displayImage" }
1009
- ]
1010
- }
1011
- ]
1012
- );
1013
- const reqOpts = updateCustomization(payload);
1014
- sideEffects?.onSiteCall?.();
1015
- try {
1016
- const result = await httpClient.request(reqOpts);
1017
- sideEffects?.onSuccess?.(result);
1018
- return renameKeysFromRESTResponseToSDKResponse(
1019
- transformPaths2(result.data, [
1020
- {
1021
- transformFn: transformRESTImageToSDKImage,
1022
- paths: [
1023
- { path: "customization.choicesSettings.choices.image" },
1024
- { path: "customization.choicesSettings.choices.displayImage" }
1025
- ]
1026
- }
1027
- ])
1028
- )?.customization;
1029
- } catch (err) {
1030
- const transformedError = sdkTransformError(
1031
- err,
1032
- {
1033
- spreadPathsToArguments: { customization: "$[1]" },
1034
- explicitPathsToArguments: {
1035
- "customization.id": "$[0]",
1036
- fields: "$[2].fields"
1037
- },
1038
- singleArgumentUnchanged: false
1039
- },
1040
- ["_id", "customization", "options"]
1041
- );
1042
- sideEffects?.onError?.(err);
1043
- throw transformedError;
1044
- }
1045
- }
1046
- async function deleteCustomization2(customizationId) {
1047
- const { httpClient, sideEffects } = arguments[1];
1048
- const payload = renameKeysFromSDKRequestToRESTRequest({
1049
- customizationId
1050
- });
1051
- const reqOpts = deleteCustomization(payload);
1052
- sideEffects?.onSiteCall?.();
1053
- try {
1054
- const result = await httpClient.request(reqOpts);
1055
- sideEffects?.onSuccess?.(result);
1056
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1057
- } catch (err) {
1058
- const transformedError = sdkTransformError(
1059
- err,
1060
- {
1061
- spreadPathsToArguments: {},
1062
- explicitPathsToArguments: { customizationId: "$[0]" },
1063
- singleArgumentUnchanged: false
1064
- },
1065
- ["customizationId"]
1066
- );
1067
- sideEffects?.onError?.(err);
1068
- throw transformedError;
1069
- }
1070
- }
1071
- function queryCustomizations2(options) {
1072
- const { httpClient, sideEffects } = arguments[1];
1073
- return queryBuilder({
1074
- func: async (payload) => {
1075
- const reqOpts = queryCustomizations({
1076
- ...payload,
1077
- ...options ?? {}
1078
- });
1079
- sideEffects?.onSiteCall?.();
1080
- try {
1081
- const result = await httpClient.request(reqOpts);
1082
- sideEffects?.onSuccess?.(result);
1083
- return result;
1084
- } catch (err) {
1085
- sideEffects?.onError?.(err);
1086
- throw err;
1087
- }
1088
- },
1089
- requestTransformer: (query) => {
1090
- const args = [query, options];
1091
- return renameKeysFromSDKRequestToRESTRequest({
1092
- ...args?.[1],
1093
- query: args?.[0]
1094
- });
1095
- },
1096
- responseTransformer: ({
1097
- data
1098
- }) => {
1099
- const transformedData = renameKeysFromRESTResponseToSDKResponse(
1100
- transformPaths2(data, [
1101
- {
1102
- transformFn: transformRESTImageToSDKImage,
1103
- paths: [
1104
- { path: "customizations.choicesSettings.choices.image" },
1105
- { path: "customizations.choicesSettings.choices.displayImage" }
1106
- ]
1107
- }
1108
- ])
1109
- );
1110
- return {
1111
- items: transformedData?.customizations,
1112
- pagingMetadata: transformedData?.pagingMetadata
1113
- };
1114
- },
1115
- errorTransformer: (err) => {
1116
- const transformedError = sdkTransformError(err, {
1117
- spreadPathsToArguments: {},
1118
- explicitPathsToArguments: { query: "$[0]" },
1119
- singleArgumentUnchanged: false
1120
- });
1121
- throw transformedError;
1122
- },
1123
- pagingMethod: "CURSOR",
1124
- transformationPaths: {}
1125
- });
1126
- }
1127
- async function typedQueryCustomizations(query, options) {
1128
- const { httpClient, sideEffects } = arguments[2];
1129
- const payload = renameKeysFromSDKRequestToRESTRequest({
1130
- query,
1131
- ...options
1132
- });
1133
- const reqOpts = queryCustomizations(payload);
1134
- sideEffects?.onSiteCall?.();
1135
- try {
1136
- const result = await httpClient.request(reqOpts);
1137
- sideEffects?.onSuccess?.(result);
1138
- return renameKeysFromRESTResponseToSDKResponse(
1139
- transformPaths2(result.data, [
1140
- {
1141
- transformFn: transformRESTImageToSDKImage,
1142
- paths: [
1143
- { path: "customizations.choicesSettings.choices.image" },
1144
- { path: "customizations.choicesSettings.choices.displayImage" }
1145
- ]
1146
- }
1147
- ])
1148
- );
1149
- } catch (err) {
1150
- const transformedError = sdkTransformError(
1151
- err,
1152
- {
1153
- spreadPathsToArguments: {},
1154
- explicitPathsToArguments: { query: "$[0]" },
1155
- singleArgumentUnchanged: false
1156
- },
1157
- ["query", "options"]
1158
- );
1159
- sideEffects?.onError?.(err);
1160
- throw transformedError;
1161
- }
1162
- }
1163
- var utils = {
1164
- query: /* @__PURE__ */ createQueryUtils()
1165
- };
1166
- async function countCustomizations2(options) {
1167
- const { httpClient, sideEffects } = arguments[1];
1168
- const payload = renameKeysFromSDKRequestToRESTRequest({
1169
- filter: options?.filter
1170
- });
1171
- const reqOpts = countCustomizations(payload);
1172
- sideEffects?.onSiteCall?.();
1173
- try {
1174
- const result = await httpClient.request(reqOpts);
1175
- sideEffects?.onSuccess?.(result);
1176
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1177
- } catch (err) {
1178
- const transformedError = sdkTransformError(
1179
- err,
1180
- {
1181
- spreadPathsToArguments: {},
1182
- explicitPathsToArguments: { filter: "$[0].filter" },
1183
- singleArgumentUnchanged: false
1184
- },
1185
- ["options"]
1186
- );
1187
- sideEffects?.onError?.(err);
1188
- throw transformedError;
1189
- }
1190
- }
1191
- async function bulkCreateCustomizations2(customizations, options) {
1192
- const { httpClient, sideEffects } = arguments[2];
1193
- const payload = transformPaths2(
1194
- renameKeysFromSDKRequestToRESTRequest({
1195
- customizations,
1196
- returnEntity: options?.returnEntity
1197
- }),
1198
- [
1199
- {
1200
- transformFn: transformSDKImageToRESTImage,
1201
- paths: [
1202
- { path: "customizations.choicesSettings.choices.image" },
1203
- { path: "customizations.choicesSettings.choices.displayImage" }
1204
- ]
1205
- }
1206
- ]
1207
- );
1208
- const reqOpts = bulkCreateCustomizations(payload);
1209
- sideEffects?.onSiteCall?.();
1210
- try {
1211
- const result = await httpClient.request(reqOpts);
1212
- sideEffects?.onSuccess?.(result);
1213
- return renameKeysFromRESTResponseToSDKResponse(
1214
- transformPaths2(result.data, [
1215
- {
1216
- transformFn: transformRESTImageToSDKImage,
1217
- paths: [
1218
- { path: "results.customization.choicesSettings.choices.image" },
1219
- {
1220
- path: "results.customization.choicesSettings.choices.displayImage"
1221
- }
1222
- ]
1223
- }
1224
- ])
1225
- );
1226
- } catch (err) {
1227
- const transformedError = sdkTransformError(
1228
- err,
1229
- {
1230
- spreadPathsToArguments: {},
1231
- explicitPathsToArguments: {
1232
- customizations: "$[0]",
1233
- returnEntity: "$[1].returnEntity"
1234
- },
1235
- singleArgumentUnchanged: false
1236
- },
1237
- ["customizations", "options"]
1238
- );
1239
- sideEffects?.onError?.(err);
1240
- throw transformedError;
1241
- }
1242
- }
1243
- async function addCustomizationChoices2(customizationId, choices, options) {
1244
- const { httpClient, sideEffects } = arguments[3];
1245
- const payload = transformPaths2(
1246
- renameKeysFromSDKRequestToRESTRequest({
1247
- customizationId,
1248
- choices,
1249
- fields: options?.fields
1250
- }),
1251
- [
1252
- {
1253
- transformFn: transformSDKImageToRESTImage,
1254
- paths: [{ path: "choices.image" }, { path: "choices.displayImage" }]
1255
- }
1256
- ]
1257
- );
1258
- const reqOpts = addCustomizationChoices(payload);
1259
- sideEffects?.onSiteCall?.();
1260
- try {
1261
- const result = await httpClient.request(reqOpts);
1262
- sideEffects?.onSuccess?.(result);
1263
- return renameKeysFromRESTResponseToSDKResponse(
1264
- transformPaths2(result.data, [
1265
- {
1266
- transformFn: transformRESTImageToSDKImage,
1267
- paths: [
1268
- { path: "customization.choicesSettings.choices.image" },
1269
- { path: "customization.choicesSettings.choices.displayImage" }
1270
- ]
1271
- }
1272
- ])
1273
- );
1274
- } catch (err) {
1275
- const transformedError = sdkTransformError(
1276
- err,
1277
- {
1278
- spreadPathsToArguments: {},
1279
- explicitPathsToArguments: {
1280
- customizationId: "$[0]",
1281
- choices: "$[1]",
1282
- fields: "$[2].fields"
1283
- },
1284
- singleArgumentUnchanged: false
1285
- },
1286
- ["customizationId", "choices", "options"]
1287
- );
1288
- sideEffects?.onError?.(err);
1289
- throw transformedError;
1290
- }
1291
- }
1292
- async function setCustomizationChoices2(customizationId, choices, options) {
1293
- const { httpClient, sideEffects } = arguments[3];
1294
- const payload = transformPaths2(
1295
- renameKeysFromSDKRequestToRESTRequest({
1296
- customizationId,
1297
- choices,
1298
- fields: options?.fields
1299
- }),
1300
- [
1301
- {
1302
- transformFn: transformSDKImageToRESTImage,
1303
- paths: [{ path: "choices.image" }, { path: "choices.displayImage" }]
1304
- }
1305
- ]
1306
- );
1307
- const reqOpts = setCustomizationChoices(payload);
1308
- sideEffects?.onSiteCall?.();
1309
- try {
1310
- const result = await httpClient.request(reqOpts);
1311
- sideEffects?.onSuccess?.(result);
1312
- return renameKeysFromRESTResponseToSDKResponse(
1313
- transformPaths2(result.data, [
1314
- {
1315
- transformFn: transformRESTImageToSDKImage,
1316
- paths: [
1317
- { path: "customization.choicesSettings.choices.image" },
1318
- { path: "customization.choicesSettings.choices.displayImage" }
1319
- ]
1320
- }
1321
- ])
1322
- );
1323
- } catch (err) {
1324
- const transformedError = sdkTransformError(
1325
- err,
1326
- {
1327
- spreadPathsToArguments: {},
1328
- explicitPathsToArguments: {
1329
- customizationId: "$[0]",
1330
- choices: "$[1]",
1331
- fields: "$[2].fields"
1332
- },
1333
- singleArgumentUnchanged: false
1334
- },
1335
- ["customizationId", "choices", "options"]
1336
- );
1337
- sideEffects?.onError?.(err);
1338
- throw transformedError;
1339
- }
1340
- }
1341
- async function removeCustomizationChoices2(customizationId, choiceIds, options) {
1342
- const { httpClient, sideEffects } = arguments[3];
1343
- const payload = renameKeysFromSDKRequestToRESTRequest({
1344
- customizationId,
1345
- choiceIds,
1346
- revision: options?.revision,
1347
- fields: options?.fields
1348
- });
1349
- const reqOpts = removeCustomizationChoices(
1350
- payload
1351
- );
1352
- sideEffects?.onSiteCall?.();
1353
- try {
1354
- const result = await httpClient.request(reqOpts);
1355
- sideEffects?.onSuccess?.(result);
1356
- return renameKeysFromRESTResponseToSDKResponse(
1357
- transformPaths2(result.data, [
1358
- {
1359
- transformFn: transformRESTImageToSDKImage,
1360
- paths: [
1361
- { path: "customization.choicesSettings.choices.image" },
1362
- { path: "customization.choicesSettings.choices.displayImage" }
1363
- ]
1364
- }
1365
- ])
1366
- );
1367
- } catch (err) {
1368
- const transformedError = sdkTransformError(
1369
- err,
1370
- {
1371
- spreadPathsToArguments: {},
1372
- explicitPathsToArguments: {
1373
- customizationId: "$[0]",
1374
- choiceIds: "$[1]",
1375
- revision: "$[2].revision",
1376
- fields: "$[2].fields"
1377
- },
1378
- singleArgumentUnchanged: false
1379
- },
1380
- ["customizationId", "choiceIds", "options"]
1381
- );
1382
- sideEffects?.onError?.(err);
1383
- throw transformedError;
1384
- }
1385
- }
1386
- async function updateCustomizationChoices2(customizationId, revision, options) {
1387
- const { httpClient, sideEffects } = arguments[3];
1388
- const payload = transformPaths2(
1389
- renameKeysFromSDKRequestToRESTRequest({
1390
- customizationId,
1391
- revision,
1392
- choices: options?.choices,
1393
- fields: options?.fields
1394
- }),
1395
- [
1396
- {
1397
- transformFn: transformSDKImageToRESTImage,
1398
- paths: [
1399
- { path: "choices.choice.image" },
1400
- { path: "choices.choice.displayImage" }
1401
- ]
1402
- }
1403
- ]
1404
- );
1405
- const reqOpts = updateCustomizationChoices(
1406
- payload
1407
- );
1408
- sideEffects?.onSiteCall?.();
1409
- try {
1410
- const result = await httpClient.request(reqOpts);
1411
- sideEffects?.onSuccess?.(result);
1412
- return renameKeysFromRESTResponseToSDKResponse(
1413
- transformPaths2(result.data, [
1414
- {
1415
- transformFn: transformRESTImageToSDKImage,
1416
- paths: [
1417
- { path: "customization.choicesSettings.choices.image" },
1418
- { path: "customization.choicesSettings.choices.displayImage" }
1419
- ]
1420
- }
1421
- ])
1422
- );
1423
- } catch (err) {
1424
- const transformedError = sdkTransformError(
1425
- err,
1426
- {
1427
- spreadPathsToArguments: {},
1428
- explicitPathsToArguments: {
1429
- customizationId: "$[0]",
1430
- revision: "$[1]",
1431
- choices: "$[2].choices",
1432
- fields: "$[2].fields"
1433
- },
1434
- singleArgumentUnchanged: false
1435
- },
1436
- ["customizationId", "revision", "options"]
1437
- );
1438
- sideEffects?.onError?.(err);
1439
- throw transformedError;
1440
- }
1441
- }
1442
- async function reorderCustomizationChoices2(customizationId, revision, options) {
1443
- const { httpClient, sideEffects } = arguments[3];
1444
- const payload = renameKeysFromSDKRequestToRESTRequest({
1445
- customizationId,
1446
- revision,
1447
- choiceIds: options?.choiceIds,
1448
- fields: options?.fields
1449
- });
1450
- const reqOpts = reorderCustomizationChoices(
1451
- payload
1452
- );
1453
- sideEffects?.onSiteCall?.();
1454
- try {
1455
- const result = await httpClient.request(reqOpts);
1456
- sideEffects?.onSuccess?.(result);
1457
- return renameKeysFromRESTResponseToSDKResponse(
1458
- transformPaths2(result.data, [
1459
- {
1460
- transformFn: transformRESTImageToSDKImage,
1461
- paths: [
1462
- { path: "customization.choicesSettings.choices.image" },
1463
- { path: "customization.choicesSettings.choices.displayImage" }
1464
- ]
1465
- }
1466
- ])
1467
- );
1468
- } catch (err) {
1469
- const transformedError = sdkTransformError(
1470
- err,
1471
- {
1472
- spreadPathsToArguments: {},
1473
- explicitPathsToArguments: {
1474
- customizationId: "$[0]",
1475
- revision: "$[1]",
1476
- choiceIds: "$[2].choiceIds",
1477
- fields: "$[2].fields"
1478
- },
1479
- singleArgumentUnchanged: false
1480
- },
1481
- ["customizationId", "revision", "options"]
1482
- );
1483
- sideEffects?.onError?.(err);
1484
- throw transformedError;
1485
- }
1486
- }
1487
- async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1488
- const { httpClient, sideEffects } = arguments[2];
1489
- const payload = transformPaths2(
1490
- renameKeysFromSDKRequestToRESTRequest({
1491
- customizationsChoices,
1492
- returnEntity: options?.returnEntity,
1493
- fields: options?.fields
1494
- }),
1495
- [
1496
- {
1497
- transformFn: transformSDKImageToRESTImage,
1498
- paths: [
1499
- { path: "customizationsChoices.choices.image" },
1500
- { path: "customizationsChoices.choices.displayImage" }
1501
- ]
1502
- }
1503
- ]
1504
- );
1505
- const reqOpts = bulkAddCustomizationChoices(
1506
- payload
1507
- );
1508
- sideEffects?.onSiteCall?.();
1509
- try {
1510
- const result = await httpClient.request(reqOpts);
1511
- sideEffects?.onSuccess?.(result);
1512
- return renameKeysFromRESTResponseToSDKResponse(
1513
- transformPaths2(result.data, [
1514
- {
1515
- transformFn: transformRESTImageToSDKImage,
1516
- paths: [
1517
- { path: "results.customization.choicesSettings.choices.image" },
1518
- {
1519
- path: "results.customization.choicesSettings.choices.displayImage"
1520
- }
1521
- ]
1522
- }
1523
- ])
1524
- );
1525
- } catch (err) {
1526
- const transformedError = sdkTransformError(
1527
- err,
1528
- {
1529
- spreadPathsToArguments: {},
1530
- explicitPathsToArguments: {
1531
- customizationsChoices: "$[0]",
1532
- returnEntity: "$[1].returnEntity",
1533
- fields: "$[1].fields"
1534
- },
1535
- singleArgumentUnchanged: false
1536
- },
1537
- ["customizationsChoices", "options"]
1538
- );
1539
- sideEffects?.onError?.(err);
1540
- throw transformedError;
1541
- }
1542
- }
1543
- async function bulkUpdateCustomizations2(customizations, options) {
1544
- const { httpClient, sideEffects } = arguments[2];
1545
- const payload = transformPaths2(
1546
- renameKeysFromSDKRequestToRESTRequest({
1547
- customizations,
1548
- returnEntity: options?.returnEntity,
1549
- fields: options?.fields
1550
- }),
1551
- [
1552
- {
1553
- transformFn: transformSDKImageToRESTImage,
1554
- paths: [
1555
- {
1556
- path: "customizations.customization.choicesSettings.choices.image"
1557
- },
1558
- {
1559
- path: "customizations.customization.choicesSettings.choices.displayImage"
1560
- }
1561
- ]
1562
- }
1563
- ]
1564
- );
1565
- const reqOpts = bulkUpdateCustomizations(payload);
1566
- sideEffects?.onSiteCall?.();
1567
- try {
1568
- const result = await httpClient.request(reqOpts);
1569
- sideEffects?.onSuccess?.(result);
1570
- return renameKeysFromRESTResponseToSDKResponse(
1571
- transformPaths2(result.data, [
1572
- {
1573
- transformFn: transformRESTImageToSDKImage,
1574
- paths: [
1575
- { path: "results.customization.choicesSettings.choices.image" },
1576
- {
1577
- path: "results.customization.choicesSettings.choices.displayImage"
1578
- }
1579
- ]
1580
- }
1581
- ])
1582
- );
1583
- } catch (err) {
1584
- const transformedError = sdkTransformError(
1585
- err,
1586
- {
1587
- spreadPathsToArguments: {},
1588
- explicitPathsToArguments: {
1589
- customizations: "$[0]",
1590
- returnEntity: "$[1].returnEntity",
1591
- fields: "$[1].fields"
1592
- },
1593
- singleArgumentUnchanged: false
1594
- },
1595
- ["customizations", "options"]
1596
- );
1597
- sideEffects?.onError?.(err);
1598
- throw transformedError;
1599
- }
1600
- }
1601
-
1602
- // src/stores-catalog-v3-customization-customizations-v-3.public.ts
1603
- function createCustomization3(httpClient) {
1604
- return (customization) => createCustomization2(
1605
- customization,
1606
- // @ts-ignore
1607
- { httpClient }
1608
- );
1609
- }
1610
- function getCustomization3(httpClient) {
1611
- return (customizationId, options) => getCustomization2(
1612
- customizationId,
1613
- options,
1614
- // @ts-ignore
1615
- { httpClient }
1616
- );
1617
- }
1618
- function updateCustomization3(httpClient) {
1619
- return (_id, customization, options) => updateCustomization2(
1620
- _id,
1621
- customization,
1622
- options,
1623
- // @ts-ignore
1624
- { httpClient }
1625
- );
1626
- }
1627
- function deleteCustomization3(httpClient) {
1628
- return (customizationId) => deleteCustomization2(
1629
- customizationId,
1630
- // @ts-ignore
1631
- { httpClient }
1632
- );
1633
- }
1634
- function queryCustomizations3(httpClient) {
1635
- return (options) => queryCustomizations2(
1636
- options,
1637
- // @ts-ignore
1638
- { httpClient }
1639
- );
1640
- }
1641
- function typedQueryCustomizations2(httpClient) {
1642
- return (query, options) => typedQueryCustomizations(
1643
- query,
1644
- options,
1645
- // @ts-ignore
1646
- { httpClient }
1647
- );
1648
- }
1649
- function countCustomizations3(httpClient) {
1650
- return (options) => countCustomizations2(
1651
- options,
1652
- // @ts-ignore
1653
- { httpClient }
1654
- );
1655
- }
1656
- function bulkCreateCustomizations3(httpClient) {
1657
- return (customizations, options) => bulkCreateCustomizations2(
1658
- customizations,
1659
- options,
1660
- // @ts-ignore
1661
- { httpClient }
1662
- );
1663
- }
1664
- function addCustomizationChoices3(httpClient) {
1665
- return (customizationId, choices, options) => addCustomizationChoices2(
1666
- customizationId,
1667
- choices,
1668
- options,
1669
- // @ts-ignore
1670
- { httpClient }
1671
- );
1672
- }
1673
- function setCustomizationChoices3(httpClient) {
1674
- return (customizationId, choices, options) => setCustomizationChoices2(
1675
- customizationId,
1676
- choices,
1677
- options,
1678
- // @ts-ignore
1679
- { httpClient }
1680
- );
1681
- }
1682
- function removeCustomizationChoices3(httpClient) {
1683
- return (customizationId, choiceIds, options) => removeCustomizationChoices2(
1684
- customizationId,
1685
- choiceIds,
1686
- options,
1687
- // @ts-ignore
1688
- { httpClient }
1689
- );
1690
- }
1691
- function updateCustomizationChoices3(httpClient) {
1692
- return (customizationId, revision, options) => updateCustomizationChoices2(
1693
- customizationId,
1694
- revision,
1695
- options,
1696
- // @ts-ignore
1697
- { httpClient }
1698
- );
1699
- }
1700
- function reorderCustomizationChoices3(httpClient) {
1701
- return (customizationId, revision, options) => reorderCustomizationChoices2(
1702
- customizationId,
1703
- revision,
1704
- options,
1705
- // @ts-ignore
1706
- { httpClient }
1707
- );
1708
- }
1709
- function bulkAddCustomizationChoices3(httpClient) {
1710
- return (customizationsChoices, options) => bulkAddCustomizationChoices2(
1711
- customizationsChoices,
1712
- options,
1713
- // @ts-ignore
1714
- { httpClient }
1715
- );
1716
- }
1717
- function bulkUpdateCustomizations3(httpClient) {
1718
- return (customizations, options) => bulkUpdateCustomizations2(
1719
- customizations,
1720
- options,
1721
- // @ts-ignore
1722
- { httpClient }
1723
- );
1724
- }
1725
- var onCustomizationCreated = /* @__PURE__ */ EventDefinition(
1726
- "wix.stores.catalog.v3.customization_created",
1727
- true,
1728
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1729
- transformPaths3(event, [
1730
- {
1731
- transformFn: transformRESTTimestampToSDKTimestamp2,
1732
- paths: [
1733
- { path: "entity.createdDate" },
1734
- { path: "entity.updatedDate" },
1735
- { path: "metadata.eventTime" }
1736
- ]
1737
- },
1738
- {
1739
- transformFn: transformRESTImageToSDKImage2,
1740
- paths: [
1741
- { path: "entity.choicesSettings.choices.image" },
1742
- { path: "entity.choicesSettings.choices.displayImage" }
1743
- ]
1744
- }
1745
- ])
1746
- )
1747
- )();
1748
- var onCustomizationDeleted = /* @__PURE__ */ EventDefinition(
1749
- "wix.stores.catalog.v3.customization_deleted",
1750
- true,
1751
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1752
- transformPaths3(event, [
1753
- {
1754
- transformFn: transformRESTTimestampToSDKTimestamp2,
1755
- paths: [
1756
- { path: "entity.createdDate" },
1757
- { path: "entity.updatedDate" },
1758
- { path: "metadata.eventTime" }
1759
- ]
1760
- },
1761
- {
1762
- transformFn: transformRESTImageToSDKImage2,
1763
- paths: [
1764
- { path: "entity.choicesSettings.choices.image" },
1765
- { path: "entity.choicesSettings.choices.displayImage" }
1766
- ]
1767
- }
1768
- ])
1769
- )
1770
- )();
1771
- var onCustomizationUpdated = /* @__PURE__ */ EventDefinition(
1772
- "wix.stores.catalog.v3.customization_updated",
1773
- true,
1774
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1775
- transformPaths3(event, [
1776
- {
1777
- transformFn: transformRESTTimestampToSDKTimestamp2,
1778
- paths: [
1779
- { path: "entity.createdDate" },
1780
- { path: "entity.updatedDate" },
1781
- { path: "metadata.eventTime" },
1782
- { path: "modifiedFields.createdDate" },
1783
- { path: "modifiedFields.updatedDate" }
1784
- ]
1785
- },
1786
- {
1787
- transformFn: transformRESTImageToSDKImage2,
1788
- paths: [
1789
- { path: "entity.choicesSettings.choices.image" },
1790
- { path: "entity.choicesSettings.choices.displayImage" },
1791
- { path: "modifiedFields.choicesSettings.choices.image" },
1792
- { path: "modifiedFields.choicesSettings.choices.displayImage" }
1793
- ]
1794
- }
1795
- ])
1796
- )
1797
- )();
1798
-
1799
- // src/stores-catalog-v3-customization-customizations-v-3.context.ts
1800
- import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1801
- import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1802
- import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
1803
- function customQueryCustomizations(httpClient) {
1804
- const router = /* @__PURE__ */ createQueryOverloadRouter({
1805
- builderQueryFunction: (options) => queryCustomizations3(httpClient)(options),
1806
- typedQueryFunction: (query, options) => typedQueryCustomizations2(httpClient)(query, options),
1807
- hasOptionsParameter: true
1808
- });
1809
- function overloadedQuery(queryOrOptions, options) {
1810
- return router(...arguments);
1811
- }
1812
- return overloadedQuery;
1813
- }
1814
- var createCustomization4 = /* @__PURE__ */ createRESTModule(createCustomization3);
1815
- var getCustomization4 = /* @__PURE__ */ createRESTModule(getCustomization3);
1816
- var updateCustomization4 = /* @__PURE__ */ createRESTModule(updateCustomization3);
1817
- var deleteCustomization4 = /* @__PURE__ */ createRESTModule(deleteCustomization3);
1818
- var countCustomizations4 = /* @__PURE__ */ createRESTModule(countCustomizations3);
1819
- var bulkCreateCustomizations4 = /* @__PURE__ */ createRESTModule(bulkCreateCustomizations3);
1820
- var addCustomizationChoices4 = /* @__PURE__ */ createRESTModule(addCustomizationChoices3);
1821
- var setCustomizationChoices4 = /* @__PURE__ */ createRESTModule(setCustomizationChoices3);
1822
- var removeCustomizationChoices4 = /* @__PURE__ */ createRESTModule(removeCustomizationChoices3);
1823
- var updateCustomizationChoices4 = /* @__PURE__ */ createRESTModule(updateCustomizationChoices3);
1824
- var reorderCustomizationChoices4 = /* @__PURE__ */ createRESTModule(reorderCustomizationChoices3);
1825
- var bulkAddCustomizationChoices4 = /* @__PURE__ */ createRESTModule(bulkAddCustomizationChoices3);
1826
- var bulkUpdateCustomizations4 = /* @__PURE__ */ createRESTModule(bulkUpdateCustomizations3);
1827
- var queryCustomizations4 = /* @__PURE__ */ createRESTModule(customQueryCustomizations);
1828
- var onCustomizationCreated2 = /* @__PURE__ */ createEventModule(
1829
- onCustomizationCreated
1830
- );
1831
- var onCustomizationDeleted2 = /* @__PURE__ */ createEventModule(
1832
- onCustomizationDeleted
1833
- );
1834
- var onCustomizationUpdated2 = /* @__PURE__ */ createEventModule(
1835
- onCustomizationUpdated
1836
- );
1837
- export {
1838
- ChoiceSortStrategy,
1839
- ChoiceType,
1840
- CustomizationRenderType,
1841
- CustomizationType,
1842
- RequestedFields,
1843
- SortOrder,
1844
- WebhookIdentityType,
1845
- addCustomizationChoices4 as addCustomizationChoices,
1846
- bulkAddCustomizationChoices4 as bulkAddCustomizationChoices,
1847
- bulkCreateCustomizations4 as bulkCreateCustomizations,
1848
- bulkUpdateCustomizations4 as bulkUpdateCustomizations,
1849
- countCustomizations4 as countCustomizations,
1850
- createCustomization4 as createCustomization,
1851
- deleteCustomization4 as deleteCustomization,
1852
- getCustomization4 as getCustomization,
1853
- onCustomizationCreated2 as onCustomizationCreated,
1854
- onCustomizationDeleted2 as onCustomizationDeleted,
1855
- onCustomizationUpdated2 as onCustomizationUpdated,
1856
- queryCustomizations4 as queryCustomizations,
1857
- removeCustomizationChoices4 as removeCustomizationChoices,
1858
- reorderCustomizationChoices4 as reorderCustomizationChoices,
1859
- setCustomizationChoices4 as setCustomizationChoices,
1860
- updateCustomization4 as updateCustomization,
1861
- updateCustomizationChoices4 as updateCustomizationChoices,
1862
- utils
1863
- };
1864
- //# sourceMappingURL=index.mjs.map