@wix/auto_sdk_stores_customizations-v-3 1.0.23 → 1.0.24

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.
@@ -0,0 +1,1168 @@
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
+ },
83
+ {
84
+ transformFn: transformSDKFloatToRESTFloat,
85
+ paths: [
86
+ { path: "customization.choicesSettings.choices.image.focalPoint.x" },
87
+ { path: "customization.choicesSettings.choices.image.focalPoint.y" }
88
+ ]
89
+ }
90
+ ]);
91
+ const metadata = {
92
+ entityFqdn: "wix.stores.catalog.v3.customization",
93
+ method: "POST",
94
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.CreateCustomization",
95
+ packageName: PACKAGE_NAME,
96
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
97
+ protoPath: "/v3/customizations",
98
+ data: serializedData,
99
+ host
100
+ }),
101
+ data: serializedData,
102
+ transformResponse: (payload2) => transformPaths(payload2, [
103
+ {
104
+ transformFn: transformRESTTimestampToSDKTimestamp,
105
+ paths: [
106
+ { path: "customization.createdDate" },
107
+ { path: "customization.updatedDate" },
108
+ {
109
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ transformFn: transformRESTFloatToSDKFloat,
115
+ paths: [
116
+ {
117
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
118
+ },
119
+ {
120
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
121
+ }
122
+ ]
123
+ }
124
+ ])
125
+ };
126
+ return metadata;
127
+ }
128
+ return __createCustomization;
129
+ }
130
+ function getCustomization(payload) {
131
+ function __getCustomization({ host }) {
132
+ const metadata = {
133
+ entityFqdn: "wix.stores.catalog.v3.customization",
134
+ method: "GET",
135
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.GetCustomization",
136
+ packageName: PACKAGE_NAME,
137
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
138
+ protoPath: "/v3/customizations/{customizationId}",
139
+ data: payload,
140
+ host
141
+ }),
142
+ params: toURLSearchParams(payload),
143
+ transformResponse: (payload2) => transformPaths(payload2, [
144
+ {
145
+ transformFn: transformRESTTimestampToSDKTimestamp,
146
+ paths: [
147
+ { path: "customization.createdDate" },
148
+ { path: "customization.updatedDate" },
149
+ {
150
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ transformFn: transformRESTFloatToSDKFloat,
156
+ paths: [
157
+ {
158
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
159
+ },
160
+ {
161
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
162
+ }
163
+ ]
164
+ }
165
+ ])
166
+ };
167
+ return metadata;
168
+ }
169
+ return __getCustomization;
170
+ }
171
+ function updateCustomization(payload) {
172
+ function __updateCustomization({ host }) {
173
+ const serializedData = transformPaths(payload, [
174
+ {
175
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
176
+ paths: [{ path: "fieldMask" }]
177
+ },
178
+ {
179
+ transformFn: transformSDKTimestampToRESTTimestamp,
180
+ paths: [
181
+ { path: "customization.createdDate" },
182
+ { path: "customization.updatedDate" },
183
+ {
184
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ transformFn: transformSDKFloatToRESTFloat,
190
+ paths: [
191
+ { path: "customization.choicesSettings.choices.image.focalPoint.x" },
192
+ { path: "customization.choicesSettings.choices.image.focalPoint.y" }
193
+ ]
194
+ }
195
+ ]);
196
+ const metadata = {
197
+ entityFqdn: "wix.stores.catalog.v3.customization",
198
+ method: "PATCH",
199
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomization",
200
+ packageName: PACKAGE_NAME,
201
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
202
+ protoPath: "/v3/customizations/{customization.id}",
203
+ data: serializedData,
204
+ host
205
+ }),
206
+ data: serializedData,
207
+ transformResponse: (payload2) => transformPaths(payload2, [
208
+ {
209
+ transformFn: transformRESTTimestampToSDKTimestamp,
210
+ paths: [
211
+ { path: "customization.createdDate" },
212
+ { path: "customization.updatedDate" },
213
+ {
214
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ transformFn: transformRESTFloatToSDKFloat,
220
+ paths: [
221
+ {
222
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
223
+ },
224
+ {
225
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
226
+ }
227
+ ]
228
+ }
229
+ ])
230
+ };
231
+ return metadata;
232
+ }
233
+ return __updateCustomization;
234
+ }
235
+ function deleteCustomization(payload) {
236
+ function __deleteCustomization({ host }) {
237
+ const metadata = {
238
+ entityFqdn: "wix.stores.catalog.v3.customization",
239
+ method: "DELETE",
240
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.DeleteCustomization",
241
+ packageName: PACKAGE_NAME,
242
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
243
+ protoPath: "/v3/customizations/{customizationId}",
244
+ data: payload,
245
+ host
246
+ }),
247
+ params: toURLSearchParams(payload)
248
+ };
249
+ return metadata;
250
+ }
251
+ return __deleteCustomization;
252
+ }
253
+ function queryCustomizations(payload) {
254
+ function __queryCustomizations({ host }) {
255
+ const metadata = {
256
+ entityFqdn: "wix.stores.catalog.v3.customization",
257
+ method: "POST",
258
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations",
259
+ packageName: PACKAGE_NAME,
260
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
261
+ protoPath: "/v3/customizations/query",
262
+ data: payload,
263
+ host
264
+ }),
265
+ data: payload,
266
+ transformResponse: (payload2) => transformPaths(payload2, [
267
+ {
268
+ transformFn: transformRESTTimestampToSDKTimestamp,
269
+ paths: [
270
+ { path: "customizations.createdDate" },
271
+ { path: "customizations.updatedDate" },
272
+ {
273
+ path: "customizations.choicesSettings.choices.image.urlExpirationDate"
274
+ }
275
+ ]
276
+ },
277
+ {
278
+ transformFn: transformRESTFloatToSDKFloat,
279
+ paths: [
280
+ {
281
+ path: "customizations.choicesSettings.choices.image.focalPoint.x"
282
+ },
283
+ {
284
+ path: "customizations.choicesSettings.choices.image.focalPoint.y"
285
+ }
286
+ ]
287
+ }
288
+ ])
289
+ };
290
+ return metadata;
291
+ }
292
+ return __queryCustomizations;
293
+ }
294
+ function bulkCreateCustomizations(payload) {
295
+ function __bulkCreateCustomizations({ host }) {
296
+ const serializedData = transformPaths(payload, [
297
+ {
298
+ transformFn: transformSDKTimestampToRESTTimestamp,
299
+ paths: [
300
+ { path: "customizations.createdDate" },
301
+ { path: "customizations.updatedDate" },
302
+ {
303
+ path: "customizations.choicesSettings.choices.image.urlExpirationDate"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ transformFn: transformSDKFloatToRESTFloat,
309
+ paths: [
310
+ { path: "customizations.choicesSettings.choices.image.focalPoint.x" },
311
+ { path: "customizations.choicesSettings.choices.image.focalPoint.y" }
312
+ ]
313
+ }
314
+ ]);
315
+ const metadata = {
316
+ entityFqdn: "wix.stores.catalog.v3.customization",
317
+ method: "POST",
318
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations",
319
+ packageName: PACKAGE_NAME,
320
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
321
+ protoPath: "/v3/bulk/customizations/create",
322
+ data: serializedData,
323
+ host
324
+ }),
325
+ data: serializedData,
326
+ transformResponse: (payload2) => transformPaths(payload2, [
327
+ {
328
+ transformFn: transformRESTTimestampToSDKTimestamp,
329
+ paths: [
330
+ { path: "results.customization.createdDate" },
331
+ { path: "results.customization.updatedDate" },
332
+ {
333
+ path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
334
+ }
335
+ ]
336
+ },
337
+ {
338
+ transformFn: transformRESTFloatToSDKFloat,
339
+ paths: [
340
+ {
341
+ path: "results.customization.choicesSettings.choices.image.focalPoint.x"
342
+ },
343
+ {
344
+ path: "results.customization.choicesSettings.choices.image.focalPoint.y"
345
+ }
346
+ ]
347
+ }
348
+ ])
349
+ };
350
+ return metadata;
351
+ }
352
+ return __bulkCreateCustomizations;
353
+ }
354
+ function addCustomizationChoices(payload) {
355
+ function __addCustomizationChoices({ host }) {
356
+ const serializedData = transformPaths(payload, [
357
+ {
358
+ transformFn: transformSDKTimestampToRESTTimestamp,
359
+ paths: [{ path: "choices.image.urlExpirationDate" }]
360
+ },
361
+ {
362
+ transformFn: transformSDKFloatToRESTFloat,
363
+ paths: [
364
+ { path: "choices.image.focalPoint.x" },
365
+ { path: "choices.image.focalPoint.y" }
366
+ ]
367
+ }
368
+ ]);
369
+ const metadata = {
370
+ entityFqdn: "wix.stores.catalog.v3.customization",
371
+ method: "POST",
372
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices",
373
+ packageName: PACKAGE_NAME,
374
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
375
+ protoPath: "/v3/customizations/{customizationId}/add-choices",
376
+ data: serializedData,
377
+ host
378
+ }),
379
+ data: serializedData,
380
+ transformResponse: (payload2) => transformPaths(payload2, [
381
+ {
382
+ transformFn: transformRESTTimestampToSDKTimestamp,
383
+ paths: [
384
+ { path: "customization.createdDate" },
385
+ { path: "customization.updatedDate" },
386
+ {
387
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ transformFn: transformRESTFloatToSDKFloat,
393
+ paths: [
394
+ {
395
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
396
+ },
397
+ {
398
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
399
+ }
400
+ ]
401
+ }
402
+ ])
403
+ };
404
+ return metadata;
405
+ }
406
+ return __addCustomizationChoices;
407
+ }
408
+ function setCustomizationChoices(payload) {
409
+ function __setCustomizationChoices({ host }) {
410
+ const serializedData = transformPaths(payload, [
411
+ {
412
+ transformFn: transformSDKTimestampToRESTTimestamp,
413
+ paths: [{ path: "choices.image.urlExpirationDate" }]
414
+ },
415
+ {
416
+ transformFn: transformSDKFloatToRESTFloat,
417
+ paths: [
418
+ { path: "choices.image.focalPoint.x" },
419
+ { path: "choices.image.focalPoint.y" }
420
+ ]
421
+ }
422
+ ]);
423
+ const metadata = {
424
+ entityFqdn: "wix.stores.catalog.v3.customization",
425
+ method: "POST",
426
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices",
427
+ packageName: PACKAGE_NAME,
428
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
429
+ protoPath: "/v3/customizations/{customizationId}/set-choices",
430
+ data: serializedData,
431
+ host
432
+ }),
433
+ data: serializedData,
434
+ transformResponse: (payload2) => transformPaths(payload2, [
435
+ {
436
+ transformFn: transformRESTTimestampToSDKTimestamp,
437
+ paths: [
438
+ { path: "customization.createdDate" },
439
+ { path: "customization.updatedDate" },
440
+ {
441
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
442
+ }
443
+ ]
444
+ },
445
+ {
446
+ transformFn: transformRESTFloatToSDKFloat,
447
+ paths: [
448
+ {
449
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
450
+ },
451
+ {
452
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
453
+ }
454
+ ]
455
+ }
456
+ ])
457
+ };
458
+ return metadata;
459
+ }
460
+ return __setCustomizationChoices;
461
+ }
462
+ function removeCustomizationChoices(payload) {
463
+ function __removeCustomizationChoices({ host }) {
464
+ const metadata = {
465
+ entityFqdn: "wix.stores.catalog.v3.customization",
466
+ method: "POST",
467
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices",
468
+ packageName: PACKAGE_NAME,
469
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
470
+ protoPath: "/v3/customizations/{customizationId}/remove-choices",
471
+ data: payload,
472
+ host
473
+ }),
474
+ data: payload,
475
+ transformResponse: (payload2) => transformPaths(payload2, [
476
+ {
477
+ transformFn: transformRESTTimestampToSDKTimestamp,
478
+ paths: [
479
+ { path: "customization.createdDate" },
480
+ { path: "customization.updatedDate" },
481
+ {
482
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
483
+ }
484
+ ]
485
+ },
486
+ {
487
+ transformFn: transformRESTFloatToSDKFloat,
488
+ paths: [
489
+ {
490
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
491
+ },
492
+ {
493
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
494
+ }
495
+ ]
496
+ }
497
+ ])
498
+ };
499
+ return metadata;
500
+ }
501
+ return __removeCustomizationChoices;
502
+ }
503
+ function bulkAddCustomizationChoices(payload) {
504
+ function __bulkAddCustomizationChoices({ host }) {
505
+ const serializedData = transformPaths(payload, [
506
+ {
507
+ transformFn: transformSDKTimestampToRESTTimestamp,
508
+ paths: [
509
+ { path: "customizationsChoices.choices.image.urlExpirationDate" }
510
+ ]
511
+ },
512
+ {
513
+ transformFn: transformSDKFloatToRESTFloat,
514
+ paths: [
515
+ { path: "customizationsChoices.choices.image.focalPoint.x" },
516
+ { path: "customizationsChoices.choices.image.focalPoint.y" }
517
+ ]
518
+ }
519
+ ]);
520
+ const metadata = {
521
+ entityFqdn: "wix.stores.catalog.v3.customization",
522
+ method: "POST",
523
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices",
524
+ packageName: PACKAGE_NAME,
525
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
526
+ protoPath: "/v3/bulk/customizations/add-choices",
527
+ data: serializedData,
528
+ host
529
+ }),
530
+ data: serializedData,
531
+ transformResponse: (payload2) => transformPaths(payload2, [
532
+ {
533
+ transformFn: transformRESTTimestampToSDKTimestamp,
534
+ paths: [
535
+ { path: "results.customization.createdDate" },
536
+ { path: "results.customization.updatedDate" },
537
+ {
538
+ path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
539
+ }
540
+ ]
541
+ },
542
+ {
543
+ transformFn: transformRESTFloatToSDKFloat,
544
+ paths: [
545
+ {
546
+ path: "results.customization.choicesSettings.choices.image.focalPoint.x"
547
+ },
548
+ {
549
+ path: "results.customization.choicesSettings.choices.image.focalPoint.y"
550
+ }
551
+ ]
552
+ }
553
+ ])
554
+ };
555
+ return metadata;
556
+ }
557
+ return __bulkAddCustomizationChoices;
558
+ }
559
+ function bulkUpdateCustomizations(payload) {
560
+ function __bulkUpdateCustomizations({ host }) {
561
+ const serializedData = transformPaths(payload, [
562
+ {
563
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
564
+ paths: [{ path: "customizations.fieldMask" }]
565
+ },
566
+ {
567
+ transformFn: transformSDKTimestampToRESTTimestamp,
568
+ paths: [
569
+ { path: "customizations.customization.createdDate" },
570
+ { path: "customizations.customization.updatedDate" },
571
+ {
572
+ path: "customizations.customization.choicesSettings.choices.image.urlExpirationDate"
573
+ }
574
+ ]
575
+ },
576
+ {
577
+ transformFn: transformSDKFloatToRESTFloat,
578
+ paths: [
579
+ {
580
+ path: "customizations.customization.choicesSettings.choices.image.focalPoint.x"
581
+ },
582
+ {
583
+ path: "customizations.customization.choicesSettings.choices.image.focalPoint.y"
584
+ }
585
+ ]
586
+ }
587
+ ]);
588
+ const metadata = {
589
+ entityFqdn: "wix.stores.catalog.v3.customization",
590
+ method: "POST",
591
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations",
592
+ packageName: PACKAGE_NAME,
593
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
594
+ protoPath: "/v3/bulk/customizations/update",
595
+ data: serializedData,
596
+ host
597
+ }),
598
+ data: serializedData,
599
+ transformResponse: (payload2) => transformPaths(payload2, [
600
+ {
601
+ transformFn: transformRESTTimestampToSDKTimestamp,
602
+ paths: [
603
+ { path: "results.customization.createdDate" },
604
+ { path: "results.customization.updatedDate" },
605
+ {
606
+ path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
607
+ }
608
+ ]
609
+ },
610
+ {
611
+ transformFn: transformRESTFloatToSDKFloat,
612
+ paths: [
613
+ {
614
+ path: "results.customization.choicesSettings.choices.image.focalPoint.x"
615
+ },
616
+ {
617
+ path: "results.customization.choicesSettings.choices.image.focalPoint.y"
618
+ }
619
+ ]
620
+ }
621
+ ])
622
+ };
623
+ return metadata;
624
+ }
625
+ return __bulkUpdateCustomizations;
626
+ }
627
+
628
+ // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
629
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
630
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
631
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
632
+ var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
633
+ CustomizationType2["UNKNOWN_CUSTOMIZATION_TYPE"] = "UNKNOWN_CUSTOMIZATION_TYPE";
634
+ CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
635
+ CustomizationType2["MODIFIER"] = "MODIFIER";
636
+ return CustomizationType2;
637
+ })(CustomizationType || {});
638
+ var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
639
+ CustomizationRenderType2["UNKNOWN_CUSTOMIZATION_RENDER_TYPE"] = "UNKNOWN_CUSTOMIZATION_RENDER_TYPE";
640
+ CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
641
+ CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
642
+ CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
643
+ return CustomizationRenderType2;
644
+ })(CustomizationRenderType || {});
645
+ var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
646
+ ChoiceType2["UNKNOWN_CHOICE_TYPE"] = "UNKNOWN_CHOICE_TYPE";
647
+ ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
648
+ ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
649
+ ChoiceType2["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
650
+ ChoiceType2["IMAGE"] = "IMAGE";
651
+ return ChoiceType2;
652
+ })(ChoiceType || {});
653
+ var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
654
+ RequestedFields2["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
655
+ RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
656
+ return RequestedFields2;
657
+ })(RequestedFields || {});
658
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
659
+ SortOrder2["ASC"] = "ASC";
660
+ SortOrder2["DESC"] = "DESC";
661
+ return SortOrder2;
662
+ })(SortOrder || {});
663
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
664
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
665
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
666
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
667
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
668
+ WebhookIdentityType2["APP"] = "APP";
669
+ return WebhookIdentityType2;
670
+ })(WebhookIdentityType || {});
671
+ async function createCustomization2(customization) {
672
+ const { httpClient, sideEffects } = arguments[1];
673
+ const payload = transformPaths2(
674
+ renameKeysFromSDKRequestToRESTRequest({ customization }),
675
+ [
676
+ {
677
+ transformFn: transformSDKImageToRESTImage,
678
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
679
+ }
680
+ ]
681
+ );
682
+ const reqOpts = createCustomization(payload);
683
+ sideEffects?.onSiteCall?.();
684
+ try {
685
+ const result = await httpClient.request(reqOpts);
686
+ sideEffects?.onSuccess?.(result);
687
+ return renameKeysFromRESTResponseToSDKResponse(
688
+ transformPaths2(result.data, [
689
+ {
690
+ transformFn: transformRESTImageToSDKImage,
691
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
692
+ }
693
+ ])
694
+ )?.customization;
695
+ } catch (err) {
696
+ const transformedError = sdkTransformError(
697
+ err,
698
+ {
699
+ spreadPathsToArguments: {},
700
+ explicitPathsToArguments: { customization: "$[0]" },
701
+ singleArgumentUnchanged: false
702
+ },
703
+ ["customization"]
704
+ );
705
+ sideEffects?.onError?.(err);
706
+ throw transformedError;
707
+ }
708
+ }
709
+ async function getCustomization2(customizationId, options) {
710
+ const { httpClient, sideEffects } = arguments[2];
711
+ const payload = renameKeysFromSDKRequestToRESTRequest({
712
+ customizationId,
713
+ fields: options?.fields
714
+ });
715
+ const reqOpts = getCustomization(payload);
716
+ sideEffects?.onSiteCall?.();
717
+ try {
718
+ const result = await httpClient.request(reqOpts);
719
+ sideEffects?.onSuccess?.(result);
720
+ return renameKeysFromRESTResponseToSDKResponse(
721
+ transformPaths2(result.data, [
722
+ {
723
+ transformFn: transformRESTImageToSDKImage,
724
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
725
+ }
726
+ ])
727
+ )?.customization;
728
+ } catch (err) {
729
+ const transformedError = sdkTransformError(
730
+ err,
731
+ {
732
+ spreadPathsToArguments: {},
733
+ explicitPathsToArguments: {
734
+ customizationId: "$[0]",
735
+ fields: "$[1].fields"
736
+ },
737
+ singleArgumentUnchanged: false
738
+ },
739
+ ["customizationId", "options"]
740
+ );
741
+ sideEffects?.onError?.(err);
742
+ throw transformedError;
743
+ }
744
+ }
745
+ async function updateCustomization2(_id, customization, options) {
746
+ const { httpClient, sideEffects } = arguments[3];
747
+ const payload = transformPaths2(
748
+ renameKeysFromSDKRequestToRESTRequest({
749
+ customization: { ...customization, id: _id },
750
+ fields: options?.fields
751
+ }),
752
+ [
753
+ {
754
+ transformFn: transformSDKImageToRESTImage,
755
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
756
+ }
757
+ ]
758
+ );
759
+ const reqOpts = updateCustomization(payload);
760
+ sideEffects?.onSiteCall?.();
761
+ try {
762
+ const result = await httpClient.request(reqOpts);
763
+ sideEffects?.onSuccess?.(result);
764
+ return renameKeysFromRESTResponseToSDKResponse(
765
+ transformPaths2(result.data, [
766
+ {
767
+ transformFn: transformRESTImageToSDKImage,
768
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
769
+ }
770
+ ])
771
+ )?.customization;
772
+ } catch (err) {
773
+ const transformedError = sdkTransformError(
774
+ err,
775
+ {
776
+ spreadPathsToArguments: { customization: "$[1]" },
777
+ explicitPathsToArguments: {
778
+ "customization.id": "$[0]",
779
+ fields: "$[2].fields"
780
+ },
781
+ singleArgumentUnchanged: false
782
+ },
783
+ ["_id", "customization", "options"]
784
+ );
785
+ sideEffects?.onError?.(err);
786
+ throw transformedError;
787
+ }
788
+ }
789
+ async function deleteCustomization2(customizationId) {
790
+ const { httpClient, sideEffects } = arguments[1];
791
+ const payload = renameKeysFromSDKRequestToRESTRequest({
792
+ customizationId
793
+ });
794
+ const reqOpts = deleteCustomization(payload);
795
+ sideEffects?.onSiteCall?.();
796
+ try {
797
+ const result = await httpClient.request(reqOpts);
798
+ sideEffects?.onSuccess?.(result);
799
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
800
+ } catch (err) {
801
+ const transformedError = sdkTransformError(
802
+ err,
803
+ {
804
+ spreadPathsToArguments: {},
805
+ explicitPathsToArguments: { customizationId: "$[0]" },
806
+ singleArgumentUnchanged: false
807
+ },
808
+ ["customizationId"]
809
+ );
810
+ sideEffects?.onError?.(err);
811
+ throw transformedError;
812
+ }
813
+ }
814
+ function queryCustomizations2(options) {
815
+ const { httpClient, sideEffects } = arguments[1];
816
+ return queryBuilder({
817
+ func: async (payload) => {
818
+ const reqOpts = queryCustomizations({
819
+ ...payload,
820
+ ...options ?? {}
821
+ });
822
+ sideEffects?.onSiteCall?.();
823
+ try {
824
+ const result = await httpClient.request(reqOpts);
825
+ sideEffects?.onSuccess?.(result);
826
+ return result;
827
+ } catch (err) {
828
+ sideEffects?.onError?.(err);
829
+ throw err;
830
+ }
831
+ },
832
+ requestTransformer: (query) => {
833
+ const args = [query, options];
834
+ return renameKeysFromSDKRequestToRESTRequest({
835
+ ...args?.[1],
836
+ query: args?.[0]
837
+ });
838
+ },
839
+ responseTransformer: ({
840
+ data
841
+ }) => {
842
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(
843
+ transformPaths2(data, [
844
+ {
845
+ transformFn: transformRESTImageToSDKImage,
846
+ paths: [{ path: "customizations.choicesSettings.choices.image" }]
847
+ }
848
+ ])
849
+ );
850
+ return {
851
+ items: transformedData?.customizations,
852
+ pagingMetadata: transformedData?.pagingMetadata
853
+ };
854
+ },
855
+ errorTransformer: (err) => {
856
+ const transformedError = sdkTransformError(err, {
857
+ spreadPathsToArguments: {},
858
+ explicitPathsToArguments: { query: "$[0]" },
859
+ singleArgumentUnchanged: false
860
+ });
861
+ throw transformedError;
862
+ },
863
+ pagingMethod: "CURSOR",
864
+ transformationPaths: {}
865
+ });
866
+ }
867
+ async function bulkCreateCustomizations2(customizations, options) {
868
+ const { httpClient, sideEffects } = arguments[2];
869
+ const payload = transformPaths2(
870
+ renameKeysFromSDKRequestToRESTRequest({
871
+ customizations,
872
+ returnEntity: options?.returnEntity
873
+ }),
874
+ [
875
+ {
876
+ transformFn: transformSDKImageToRESTImage,
877
+ paths: [{ path: "customizations.choicesSettings.choices.image" }]
878
+ }
879
+ ]
880
+ );
881
+ const reqOpts = bulkCreateCustomizations(payload);
882
+ sideEffects?.onSiteCall?.();
883
+ try {
884
+ const result = await httpClient.request(reqOpts);
885
+ sideEffects?.onSuccess?.(result);
886
+ return renameKeysFromRESTResponseToSDKResponse(
887
+ transformPaths2(result.data, [
888
+ {
889
+ transformFn: transformRESTImageToSDKImage,
890
+ paths: [
891
+ { path: "results.customization.choicesSettings.choices.image" }
892
+ ]
893
+ }
894
+ ])
895
+ );
896
+ } catch (err) {
897
+ const transformedError = sdkTransformError(
898
+ err,
899
+ {
900
+ spreadPathsToArguments: {},
901
+ explicitPathsToArguments: {
902
+ customizations: "$[0]",
903
+ returnEntity: "$[1].returnEntity"
904
+ },
905
+ singleArgumentUnchanged: false
906
+ },
907
+ ["customizations", "options"]
908
+ );
909
+ sideEffects?.onError?.(err);
910
+ throw transformedError;
911
+ }
912
+ }
913
+ async function addCustomizationChoices2(customizationId, choices, options) {
914
+ const { httpClient, sideEffects } = arguments[3];
915
+ const payload = transformPaths2(
916
+ renameKeysFromSDKRequestToRESTRequest({
917
+ customizationId,
918
+ choices,
919
+ fields: options?.fields
920
+ }),
921
+ [
922
+ {
923
+ transformFn: transformSDKImageToRESTImage,
924
+ paths: [{ path: "choices.image" }]
925
+ }
926
+ ]
927
+ );
928
+ const reqOpts = addCustomizationChoices(payload);
929
+ sideEffects?.onSiteCall?.();
930
+ try {
931
+ const result = await httpClient.request(reqOpts);
932
+ sideEffects?.onSuccess?.(result);
933
+ return renameKeysFromRESTResponseToSDKResponse(
934
+ transformPaths2(result.data, [
935
+ {
936
+ transformFn: transformRESTImageToSDKImage,
937
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
938
+ }
939
+ ])
940
+ );
941
+ } catch (err) {
942
+ const transformedError = sdkTransformError(
943
+ err,
944
+ {
945
+ spreadPathsToArguments: {},
946
+ explicitPathsToArguments: {
947
+ customizationId: "$[0]",
948
+ choices: "$[1]",
949
+ fields: "$[2].fields"
950
+ },
951
+ singleArgumentUnchanged: false
952
+ },
953
+ ["customizationId", "choices", "options"]
954
+ );
955
+ sideEffects?.onError?.(err);
956
+ throw transformedError;
957
+ }
958
+ }
959
+ async function setCustomizationChoices2(customizationId, choices, options) {
960
+ const { httpClient, sideEffects } = arguments[3];
961
+ const payload = transformPaths2(
962
+ renameKeysFromSDKRequestToRESTRequest({
963
+ customizationId,
964
+ choices,
965
+ fields: options?.fields
966
+ }),
967
+ [
968
+ {
969
+ transformFn: transformSDKImageToRESTImage,
970
+ paths: [{ path: "choices.image" }]
971
+ }
972
+ ]
973
+ );
974
+ const reqOpts = setCustomizationChoices(payload);
975
+ sideEffects?.onSiteCall?.();
976
+ try {
977
+ const result = await httpClient.request(reqOpts);
978
+ sideEffects?.onSuccess?.(result);
979
+ return renameKeysFromRESTResponseToSDKResponse(
980
+ transformPaths2(result.data, [
981
+ {
982
+ transformFn: transformRESTImageToSDKImage,
983
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
984
+ }
985
+ ])
986
+ );
987
+ } catch (err) {
988
+ const transformedError = sdkTransformError(
989
+ err,
990
+ {
991
+ spreadPathsToArguments: {},
992
+ explicitPathsToArguments: {
993
+ customizationId: "$[0]",
994
+ choices: "$[1]",
995
+ fields: "$[2].fields"
996
+ },
997
+ singleArgumentUnchanged: false
998
+ },
999
+ ["customizationId", "choices", "options"]
1000
+ );
1001
+ sideEffects?.onError?.(err);
1002
+ throw transformedError;
1003
+ }
1004
+ }
1005
+ async function removeCustomizationChoices2(customizationId, choiceIds, options) {
1006
+ const { httpClient, sideEffects } = arguments[3];
1007
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1008
+ customizationId,
1009
+ choiceIds,
1010
+ revision: options?.revision,
1011
+ fields: options?.fields
1012
+ });
1013
+ const reqOpts = removeCustomizationChoices(
1014
+ payload
1015
+ );
1016
+ sideEffects?.onSiteCall?.();
1017
+ try {
1018
+ const result = await httpClient.request(reqOpts);
1019
+ sideEffects?.onSuccess?.(result);
1020
+ return renameKeysFromRESTResponseToSDKResponse(
1021
+ transformPaths2(result.data, [
1022
+ {
1023
+ transformFn: transformRESTImageToSDKImage,
1024
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
1025
+ }
1026
+ ])
1027
+ );
1028
+ } catch (err) {
1029
+ const transformedError = sdkTransformError(
1030
+ err,
1031
+ {
1032
+ spreadPathsToArguments: {},
1033
+ explicitPathsToArguments: {
1034
+ customizationId: "$[0]",
1035
+ choiceIds: "$[1]",
1036
+ revision: "$[2].revision",
1037
+ fields: "$[2].fields"
1038
+ },
1039
+ singleArgumentUnchanged: false
1040
+ },
1041
+ ["customizationId", "choiceIds", "options"]
1042
+ );
1043
+ sideEffects?.onError?.(err);
1044
+ throw transformedError;
1045
+ }
1046
+ }
1047
+ async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1048
+ const { httpClient, sideEffects } = arguments[2];
1049
+ const payload = transformPaths2(
1050
+ renameKeysFromSDKRequestToRESTRequest({
1051
+ customizationsChoices,
1052
+ returnEntity: options?.returnEntity,
1053
+ fields: options?.fields
1054
+ }),
1055
+ [
1056
+ {
1057
+ transformFn: transformSDKImageToRESTImage,
1058
+ paths: [{ path: "customizationsChoices.choices.image" }]
1059
+ }
1060
+ ]
1061
+ );
1062
+ const reqOpts = bulkAddCustomizationChoices(
1063
+ payload
1064
+ );
1065
+ sideEffects?.onSiteCall?.();
1066
+ try {
1067
+ const result = await httpClient.request(reqOpts);
1068
+ sideEffects?.onSuccess?.(result);
1069
+ return renameKeysFromRESTResponseToSDKResponse(
1070
+ transformPaths2(result.data, [
1071
+ {
1072
+ transformFn: transformRESTImageToSDKImage,
1073
+ paths: [
1074
+ { path: "results.customization.choicesSettings.choices.image" }
1075
+ ]
1076
+ }
1077
+ ])
1078
+ );
1079
+ } catch (err) {
1080
+ const transformedError = sdkTransformError(
1081
+ err,
1082
+ {
1083
+ spreadPathsToArguments: {},
1084
+ explicitPathsToArguments: {
1085
+ customizationsChoices: "$[0]",
1086
+ returnEntity: "$[1].returnEntity",
1087
+ fields: "$[1].fields"
1088
+ },
1089
+ singleArgumentUnchanged: false
1090
+ },
1091
+ ["customizationsChoices", "options"]
1092
+ );
1093
+ sideEffects?.onError?.(err);
1094
+ throw transformedError;
1095
+ }
1096
+ }
1097
+ async function bulkUpdateCustomizations2(customizations, options) {
1098
+ const { httpClient, sideEffects } = arguments[2];
1099
+ const payload = transformPaths2(
1100
+ renameKeysFromSDKRequestToRESTRequest({
1101
+ customizations,
1102
+ returnEntity: options?.returnEntity,
1103
+ fields: options?.fields
1104
+ }),
1105
+ [
1106
+ {
1107
+ transformFn: transformSDKImageToRESTImage,
1108
+ paths: [
1109
+ {
1110
+ path: "customizations.customization.choicesSettings.choices.image"
1111
+ }
1112
+ ]
1113
+ }
1114
+ ]
1115
+ );
1116
+ const reqOpts = bulkUpdateCustomizations(payload);
1117
+ sideEffects?.onSiteCall?.();
1118
+ try {
1119
+ const result = await httpClient.request(reqOpts);
1120
+ sideEffects?.onSuccess?.(result);
1121
+ return renameKeysFromRESTResponseToSDKResponse(
1122
+ transformPaths2(result.data, [
1123
+ {
1124
+ transformFn: transformRESTImageToSDKImage,
1125
+ paths: [
1126
+ { path: "results.customization.choicesSettings.choices.image" }
1127
+ ]
1128
+ }
1129
+ ])
1130
+ );
1131
+ } catch (err) {
1132
+ const transformedError = sdkTransformError(
1133
+ err,
1134
+ {
1135
+ spreadPathsToArguments: {},
1136
+ explicitPathsToArguments: {
1137
+ customizations: "$[0]",
1138
+ returnEntity: "$[1].returnEntity",
1139
+ fields: "$[1].fields"
1140
+ },
1141
+ singleArgumentUnchanged: false
1142
+ },
1143
+ ["customizations", "options"]
1144
+ );
1145
+ sideEffects?.onError?.(err);
1146
+ throw transformedError;
1147
+ }
1148
+ }
1149
+ export {
1150
+ ChoiceType,
1151
+ CustomizationRenderType,
1152
+ CustomizationType,
1153
+ RequestedFields,
1154
+ SortOrder,
1155
+ WebhookIdentityType,
1156
+ addCustomizationChoices2 as addCustomizationChoices,
1157
+ bulkAddCustomizationChoices2 as bulkAddCustomizationChoices,
1158
+ bulkCreateCustomizations2 as bulkCreateCustomizations,
1159
+ bulkUpdateCustomizations2 as bulkUpdateCustomizations,
1160
+ createCustomization2 as createCustomization,
1161
+ deleteCustomization2 as deleteCustomization,
1162
+ getCustomization2 as getCustomization,
1163
+ queryCustomizations2 as queryCustomizations,
1164
+ removeCustomizationChoices2 as removeCustomizationChoices,
1165
+ setCustomizationChoices2 as setCustomizationChoices,
1166
+ updateCustomization2 as updateCustomization
1167
+ };
1168
+ //# sourceMappingURL=index.typings.mjs.map