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