@wix/auto_sdk_stores_customizations-v-3 1.0.91 → 1.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/build/cjs/index.d.ts +11 -3
  2. package/build/cjs/index.js +56 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +21 -1
  5. package/build/cjs/index.typings.js +48 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +11 -2
  8. package/build/cjs/meta.js +41 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +9 -1
  11. package/build/cjs/schemas.js +973 -871
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +11 -3
  14. package/build/es/index.mjs +55 -0
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +21 -1
  17. package/build/es/index.typings.mjs +47 -0
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +11 -2
  20. package/build/es/meta.mjs +40 -0
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +9 -1
  23. package/build/es/schemas.mjs +971 -871
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +11 -3
  26. package/build/internal/cjs/index.typings.d.ts +21 -1
  27. package/build/internal/cjs/meta.d.ts +11 -2
  28. package/build/internal/cjs/schemas.d.ts +9 -1
  29. package/build/internal/es/index.d.mts +11 -3
  30. package/build/internal/es/index.typings.d.mts +21 -1
  31. package/build/internal/es/meta.d.mts +11 -2
  32. package/build/internal/es/schemas.d.mts +9 -1
  33. package/package.json +2 -2
  34. package/build/internal/cjs/index.js +0 -1856
  35. package/build/internal/cjs/index.js.map +0 -1
  36. package/build/internal/cjs/index.typings.js +0 -1617
  37. package/build/internal/cjs/index.typings.js.map +0 -1
  38. package/build/internal/cjs/meta.js +0 -1185
  39. package/build/internal/cjs/meta.js.map +0 -1
  40. package/build/internal/cjs/schemas.js +0 -1908
  41. package/build/internal/cjs/schemas.js.map +0 -1
  42. package/build/internal/es/index.mjs +0 -1809
  43. package/build/internal/es/index.mjs.map +0 -1
  44. package/build/internal/es/index.typings.mjs +0 -1572
  45. package/build/internal/es/index.typings.mjs.map +0 -1
  46. package/build/internal/es/meta.mjs +0 -1139
  47. package/build/internal/es/meta.mjs.map +0 -1
  48. package/build/internal/es/schemas.mjs +0 -1846
  49. package/build/internal/es/schemas.mjs.map +0 -1
@@ -1,1572 +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 bulkCreateCustomizations(payload) {
339
- function __bulkCreateCustomizations({ host }) {
340
- const serializedData = transformPaths(payload, [
341
- {
342
- transformFn: transformSDKTimestampToRESTTimestamp,
343
- paths: [
344
- { path: "customizations.createdDate" },
345
- { path: "customizations.updatedDate" },
346
- {
347
- path: "customizations.choicesSettings.choices.image.urlExpirationDate"
348
- },
349
- {
350
- path: "customizations.choicesSettings.choices.displayImage.urlExpirationDate"
351
- }
352
- ]
353
- },
354
- {
355
- transformFn: transformSDKFloatToRESTFloat,
356
- paths: [
357
- { path: "customizations.choicesSettings.choices.image.focalPoint.x" },
358
- { path: "customizations.choicesSettings.choices.image.focalPoint.y" }
359
- ]
360
- }
361
- ]);
362
- const metadata = {
363
- entityFqdn: "wix.stores.catalog.v3.customization",
364
- method: "POST",
365
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations",
366
- packageName: PACKAGE_NAME,
367
- migrationOptions: {
368
- optInTransformResponse: true
369
- },
370
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
371
- protoPath: "/v3/bulk/customizations/create",
372
- data: serializedData,
373
- host
374
- }),
375
- data: serializedData,
376
- transformResponse: (payload2) => transformPaths(payload2, [
377
- {
378
- transformFn: transformRESTTimestampToSDKTimestamp,
379
- paths: [
380
- { path: "results.customization.createdDate" },
381
- { path: "results.customization.updatedDate" },
382
- {
383
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
384
- },
385
- {
386
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
387
- }
388
- ]
389
- },
390
- {
391
- transformFn: transformRESTFloatToSDKFloat,
392
- paths: [
393
- {
394
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
395
- },
396
- {
397
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
398
- }
399
- ]
400
- }
401
- ])
402
- };
403
- return metadata;
404
- }
405
- return __bulkCreateCustomizations;
406
- }
407
- function addCustomizationChoices(payload) {
408
- function __addCustomizationChoices({ host }) {
409
- const serializedData = transformPaths(payload, [
410
- {
411
- transformFn: transformSDKTimestampToRESTTimestamp,
412
- paths: [
413
- { path: "choices.image.urlExpirationDate" },
414
- { path: "choices.displayImage.urlExpirationDate" }
415
- ]
416
- },
417
- {
418
- transformFn: transformSDKFloatToRESTFloat,
419
- paths: [
420
- { path: "choices.image.focalPoint.x" },
421
- { path: "choices.image.focalPoint.y" }
422
- ]
423
- }
424
- ]);
425
- const metadata = {
426
- entityFqdn: "wix.stores.catalog.v3.customization",
427
- method: "POST",
428
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices",
429
- packageName: PACKAGE_NAME,
430
- migrationOptions: {
431
- optInTransformResponse: true
432
- },
433
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
434
- protoPath: "/v3/customizations/{customizationId}/add-choices",
435
- data: serializedData,
436
- host
437
- }),
438
- data: serializedData,
439
- transformResponse: (payload2) => transformPaths(payload2, [
440
- {
441
- transformFn: transformRESTTimestampToSDKTimestamp,
442
- paths: [
443
- { path: "customization.createdDate" },
444
- { path: "customization.updatedDate" },
445
- {
446
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
447
- },
448
- {
449
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
450
- }
451
- ]
452
- },
453
- {
454
- transformFn: transformRESTFloatToSDKFloat,
455
- paths: [
456
- {
457
- path: "customization.choicesSettings.choices.image.focalPoint.x"
458
- },
459
- {
460
- path: "customization.choicesSettings.choices.image.focalPoint.y"
461
- }
462
- ]
463
- }
464
- ])
465
- };
466
- return metadata;
467
- }
468
- return __addCustomizationChoices;
469
- }
470
- function setCustomizationChoices(payload) {
471
- function __setCustomizationChoices({ host }) {
472
- const serializedData = transformPaths(payload, [
473
- {
474
- transformFn: transformSDKTimestampToRESTTimestamp,
475
- paths: [
476
- { path: "choices.image.urlExpirationDate" },
477
- { path: "choices.displayImage.urlExpirationDate" }
478
- ]
479
- },
480
- {
481
- transformFn: transformSDKFloatToRESTFloat,
482
- paths: [
483
- { path: "choices.image.focalPoint.x" },
484
- { path: "choices.image.focalPoint.y" }
485
- ]
486
- }
487
- ]);
488
- const metadata = {
489
- entityFqdn: "wix.stores.catalog.v3.customization",
490
- method: "POST",
491
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices",
492
- packageName: PACKAGE_NAME,
493
- migrationOptions: {
494
- optInTransformResponse: true
495
- },
496
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
497
- protoPath: "/v3/customizations/{customizationId}/set-choices",
498
- data: serializedData,
499
- host
500
- }),
501
- data: serializedData,
502
- transformResponse: (payload2) => transformPaths(payload2, [
503
- {
504
- transformFn: transformRESTTimestampToSDKTimestamp,
505
- paths: [
506
- { path: "customization.createdDate" },
507
- { path: "customization.updatedDate" },
508
- {
509
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
510
- },
511
- {
512
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
513
- }
514
- ]
515
- },
516
- {
517
- transformFn: transformRESTFloatToSDKFloat,
518
- paths: [
519
- {
520
- path: "customization.choicesSettings.choices.image.focalPoint.x"
521
- },
522
- {
523
- path: "customization.choicesSettings.choices.image.focalPoint.y"
524
- }
525
- ]
526
- }
527
- ])
528
- };
529
- return metadata;
530
- }
531
- return __setCustomizationChoices;
532
- }
533
- function removeCustomizationChoices(payload) {
534
- function __removeCustomizationChoices({ host }) {
535
- const metadata = {
536
- entityFqdn: "wix.stores.catalog.v3.customization",
537
- method: "POST",
538
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices",
539
- packageName: PACKAGE_NAME,
540
- migrationOptions: {
541
- optInTransformResponse: true
542
- },
543
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
544
- protoPath: "/v3/customizations/{customizationId}/remove-choices",
545
- data: payload,
546
- host
547
- }),
548
- data: payload,
549
- transformResponse: (payload2) => transformPaths(payload2, [
550
- {
551
- transformFn: transformRESTTimestampToSDKTimestamp,
552
- paths: [
553
- { path: "customization.createdDate" },
554
- { path: "customization.updatedDate" },
555
- {
556
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
557
- },
558
- {
559
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
560
- }
561
- ]
562
- },
563
- {
564
- transformFn: transformRESTFloatToSDKFloat,
565
- paths: [
566
- {
567
- path: "customization.choicesSettings.choices.image.focalPoint.x"
568
- },
569
- {
570
- path: "customization.choicesSettings.choices.image.focalPoint.y"
571
- }
572
- ]
573
- }
574
- ])
575
- };
576
- return metadata;
577
- }
578
- return __removeCustomizationChoices;
579
- }
580
- function updateCustomizationChoices(payload) {
581
- function __updateCustomizationChoices({ host }) {
582
- const serializedData = transformPaths(payload, [
583
- {
584
- transformFn: transformSDKFieldMaskToRESTFieldMask,
585
- paths: [{ path: "choices.fieldMask" }]
586
- },
587
- {
588
- transformFn: transformSDKTimestampToRESTTimestamp,
589
- paths: [
590
- { path: "choices.choice.image.urlExpirationDate" },
591
- { path: "choices.choice.displayImage.urlExpirationDate" }
592
- ]
593
- },
594
- {
595
- transformFn: transformSDKFloatToRESTFloat,
596
- paths: [
597
- { path: "choices.choice.image.focalPoint.x" },
598
- { path: "choices.choice.image.focalPoint.y" }
599
- ]
600
- }
601
- ]);
602
- const metadata = {
603
- entityFqdn: "wix.stores.catalog.v3.customization",
604
- method: "POST",
605
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomizationChoices",
606
- packageName: PACKAGE_NAME,
607
- migrationOptions: {
608
- optInTransformResponse: true
609
- },
610
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
611
- protoPath: "/v3/customizations/{customizationId}/update-choices",
612
- data: serializedData,
613
- host
614
- }),
615
- data: serializedData,
616
- transformResponse: (payload2) => transformPaths(payload2, [
617
- {
618
- transformFn: transformRESTTimestampToSDKTimestamp,
619
- paths: [
620
- { path: "customization.createdDate" },
621
- { path: "customization.updatedDate" },
622
- {
623
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
624
- },
625
- {
626
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
627
- }
628
- ]
629
- },
630
- {
631
- transformFn: transformRESTFloatToSDKFloat,
632
- paths: [
633
- {
634
- path: "customization.choicesSettings.choices.image.focalPoint.x"
635
- },
636
- {
637
- path: "customization.choicesSettings.choices.image.focalPoint.y"
638
- }
639
- ]
640
- }
641
- ])
642
- };
643
- return metadata;
644
- }
645
- return __updateCustomizationChoices;
646
- }
647
- function reorderCustomizationChoices(payload) {
648
- function __reorderCustomizationChoices({ host }) {
649
- const metadata = {
650
- entityFqdn: "wix.stores.catalog.v3.customization",
651
- method: "POST",
652
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.ReorderCustomizationChoices",
653
- packageName: PACKAGE_NAME,
654
- migrationOptions: {
655
- optInTransformResponse: true
656
- },
657
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
658
- protoPath: "/v3/customizations/{customizationId}/reorder-choices",
659
- data: payload,
660
- host
661
- }),
662
- data: payload,
663
- transformResponse: (payload2) => transformPaths(payload2, [
664
- {
665
- transformFn: transformRESTTimestampToSDKTimestamp,
666
- paths: [
667
- { path: "customization.createdDate" },
668
- { path: "customization.updatedDate" },
669
- {
670
- path: "customization.choicesSettings.choices.image.urlExpirationDate"
671
- },
672
- {
673
- path: "customization.choicesSettings.choices.displayImage.urlExpirationDate"
674
- }
675
- ]
676
- },
677
- {
678
- transformFn: transformRESTFloatToSDKFloat,
679
- paths: [
680
- {
681
- path: "customization.choicesSettings.choices.image.focalPoint.x"
682
- },
683
- {
684
- path: "customization.choicesSettings.choices.image.focalPoint.y"
685
- }
686
- ]
687
- }
688
- ])
689
- };
690
- return metadata;
691
- }
692
- return __reorderCustomizationChoices;
693
- }
694
- function bulkAddCustomizationChoices(payload) {
695
- function __bulkAddCustomizationChoices({ host }) {
696
- const serializedData = transformPaths(payload, [
697
- {
698
- transformFn: transformSDKTimestampToRESTTimestamp,
699
- paths: [
700
- { path: "customizationsChoices.choices.image.urlExpirationDate" },
701
- {
702
- path: "customizationsChoices.choices.displayImage.urlExpirationDate"
703
- }
704
- ]
705
- },
706
- {
707
- transformFn: transformSDKFloatToRESTFloat,
708
- paths: [
709
- { path: "customizationsChoices.choices.image.focalPoint.x" },
710
- { path: "customizationsChoices.choices.image.focalPoint.y" }
711
- ]
712
- }
713
- ]);
714
- const metadata = {
715
- entityFqdn: "wix.stores.catalog.v3.customization",
716
- method: "POST",
717
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices",
718
- packageName: PACKAGE_NAME,
719
- migrationOptions: {
720
- optInTransformResponse: true
721
- },
722
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
723
- protoPath: "/v3/bulk/customizations/add-choices",
724
- data: serializedData,
725
- host
726
- }),
727
- data: serializedData,
728
- transformResponse: (payload2) => transformPaths(payload2, [
729
- {
730
- transformFn: transformRESTTimestampToSDKTimestamp,
731
- paths: [
732
- { path: "results.customization.createdDate" },
733
- { path: "results.customization.updatedDate" },
734
- {
735
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
736
- },
737
- {
738
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
739
- }
740
- ]
741
- },
742
- {
743
- transformFn: transformRESTFloatToSDKFloat,
744
- paths: [
745
- {
746
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
747
- },
748
- {
749
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
750
- }
751
- ]
752
- }
753
- ])
754
- };
755
- return metadata;
756
- }
757
- return __bulkAddCustomizationChoices;
758
- }
759
- function bulkUpdateCustomizations(payload) {
760
- function __bulkUpdateCustomizations({ host }) {
761
- const serializedData = transformPaths(payload, [
762
- {
763
- transformFn: transformSDKFieldMaskToRESTFieldMask,
764
- paths: [{ path: "customizations.fieldMask" }]
765
- },
766
- {
767
- transformFn: transformSDKTimestampToRESTTimestamp,
768
- paths: [
769
- { path: "customizations.customization.createdDate" },
770
- { path: "customizations.customization.updatedDate" },
771
- {
772
- path: "customizations.customization.choicesSettings.choices.image.urlExpirationDate"
773
- },
774
- {
775
- path: "customizations.customization.choicesSettings.choices.displayImage.urlExpirationDate"
776
- }
777
- ]
778
- },
779
- {
780
- transformFn: transformSDKFloatToRESTFloat,
781
- paths: [
782
- {
783
- path: "customizations.customization.choicesSettings.choices.image.focalPoint.x"
784
- },
785
- {
786
- path: "customizations.customization.choicesSettings.choices.image.focalPoint.y"
787
- }
788
- ]
789
- }
790
- ]);
791
- const metadata = {
792
- entityFqdn: "wix.stores.catalog.v3.customization",
793
- method: "POST",
794
- methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations",
795
- packageName: PACKAGE_NAME,
796
- migrationOptions: {
797
- optInTransformResponse: true
798
- },
799
- url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
800
- protoPath: "/v3/bulk/customizations/update",
801
- data: serializedData,
802
- host
803
- }),
804
- data: serializedData,
805
- transformResponse: (payload2) => transformPaths(payload2, [
806
- {
807
- transformFn: transformRESTTimestampToSDKTimestamp,
808
- paths: [
809
- { path: "results.customization.createdDate" },
810
- { path: "results.customization.updatedDate" },
811
- {
812
- path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
813
- },
814
- {
815
- path: "results.customization.choicesSettings.choices.displayImage.urlExpirationDate"
816
- }
817
- ]
818
- },
819
- {
820
- transformFn: transformRESTFloatToSDKFloat,
821
- paths: [
822
- {
823
- path: "results.customization.choicesSettings.choices.image.focalPoint.x"
824
- },
825
- {
826
- path: "results.customization.choicesSettings.choices.image.focalPoint.y"
827
- }
828
- ]
829
- }
830
- ])
831
- };
832
- return metadata;
833
- }
834
- return __bulkUpdateCustomizations;
835
- }
836
-
837
- // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
838
- import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
839
- import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
840
- import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
841
- import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
842
- var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
843
- CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
844
- CustomizationType2["MODIFIER"] = "MODIFIER";
845
- return CustomizationType2;
846
- })(CustomizationType || {});
847
- var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
848
- CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
849
- CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
850
- CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
851
- return CustomizationRenderType2;
852
- })(CustomizationRenderType || {});
853
- var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
854
- ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
855
- ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
856
- ChoiceType2["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
857
- ChoiceType2["IMAGE"] = "IMAGE";
858
- return ChoiceType2;
859
- })(ChoiceType || {});
860
- var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
861
- ChoiceSortStrategy2["DEFAULT"] = "DEFAULT";
862
- ChoiceSortStrategy2["BY_NAME"] = "BY_NAME";
863
- ChoiceSortStrategy2["BY_PRODUCT_COUNT"] = "BY_PRODUCT_COUNT";
864
- ChoiceSortStrategy2["MANUAL"] = "MANUAL";
865
- return ChoiceSortStrategy2;
866
- })(ChoiceSortStrategy || {});
867
- var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
868
- RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
869
- RequestedFields2["CHOICE_DISPLAY_IMAGE"] = "CHOICE_DISPLAY_IMAGE";
870
- return RequestedFields2;
871
- })(RequestedFields || {});
872
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
873
- SortOrder2["ASC"] = "ASC";
874
- SortOrder2["DESC"] = "DESC";
875
- return SortOrder2;
876
- })(SortOrder || {});
877
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
878
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
879
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
880
- WebhookIdentityType2["MEMBER"] = "MEMBER";
881
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
882
- WebhookIdentityType2["APP"] = "APP";
883
- return WebhookIdentityType2;
884
- })(WebhookIdentityType || {});
885
- async function createCustomization2(customization) {
886
- const { httpClient, sideEffects } = arguments[1];
887
- const payload = transformPaths2(
888
- renameKeysFromSDKRequestToRESTRequest({ customization }),
889
- [
890
- {
891
- transformFn: transformSDKImageToRESTImage,
892
- paths: [
893
- { path: "customization.choicesSettings.choices.image" },
894
- { path: "customization.choicesSettings.choices.displayImage" }
895
- ]
896
- }
897
- ]
898
- );
899
- const reqOpts = createCustomization(payload);
900
- sideEffects?.onSiteCall?.();
901
- try {
902
- const result = await httpClient.request(reqOpts);
903
- sideEffects?.onSuccess?.(result);
904
- return renameKeysFromRESTResponseToSDKResponse(
905
- transformPaths2(result.data, [
906
- {
907
- transformFn: transformRESTImageToSDKImage,
908
- paths: [
909
- { path: "customization.choicesSettings.choices.image" },
910
- { path: "customization.choicesSettings.choices.displayImage" }
911
- ]
912
- }
913
- ])
914
- )?.customization;
915
- } catch (err) {
916
- const transformedError = sdkTransformError(
917
- err,
918
- {
919
- spreadPathsToArguments: {},
920
- explicitPathsToArguments: { customization: "$[0]" },
921
- singleArgumentUnchanged: false
922
- },
923
- ["customization"]
924
- );
925
- sideEffects?.onError?.(err);
926
- throw transformedError;
927
- }
928
- }
929
- async function getCustomization2(customizationId, options) {
930
- const { httpClient, sideEffects } = arguments[2];
931
- const payload = renameKeysFromSDKRequestToRESTRequest({
932
- customizationId,
933
- fields: options?.fields
934
- });
935
- const reqOpts = getCustomization(payload);
936
- sideEffects?.onSiteCall?.();
937
- try {
938
- const result = await httpClient.request(reqOpts);
939
- sideEffects?.onSuccess?.(result);
940
- return renameKeysFromRESTResponseToSDKResponse(
941
- transformPaths2(result.data, [
942
- {
943
- transformFn: transformRESTImageToSDKImage,
944
- paths: [
945
- { path: "customization.choicesSettings.choices.image" },
946
- { path: "customization.choicesSettings.choices.displayImage" }
947
- ]
948
- }
949
- ])
950
- )?.customization;
951
- } catch (err) {
952
- const transformedError = sdkTransformError(
953
- err,
954
- {
955
- spreadPathsToArguments: {},
956
- explicitPathsToArguments: {
957
- customizationId: "$[0]",
958
- fields: "$[1].fields"
959
- },
960
- singleArgumentUnchanged: false
961
- },
962
- ["customizationId", "options"]
963
- );
964
- sideEffects?.onError?.(err);
965
- throw transformedError;
966
- }
967
- }
968
- async function updateCustomization2(_id, customization, options) {
969
- const { httpClient, sideEffects } = arguments[3];
970
- const payload = transformPaths2(
971
- renameKeysFromSDKRequestToRESTRequest({
972
- customization: { ...customization, id: _id },
973
- fields: options?.fields
974
- }),
975
- [
976
- {
977
- transformFn: transformSDKImageToRESTImage,
978
- paths: [
979
- { path: "customization.choicesSettings.choices.image" },
980
- { path: "customization.choicesSettings.choices.displayImage" }
981
- ]
982
- }
983
- ]
984
- );
985
- const reqOpts = updateCustomization(payload);
986
- sideEffects?.onSiteCall?.();
987
- try {
988
- const result = await httpClient.request(reqOpts);
989
- sideEffects?.onSuccess?.(result);
990
- return renameKeysFromRESTResponseToSDKResponse(
991
- transformPaths2(result.data, [
992
- {
993
- transformFn: transformRESTImageToSDKImage,
994
- paths: [
995
- { path: "customization.choicesSettings.choices.image" },
996
- { path: "customization.choicesSettings.choices.displayImage" }
997
- ]
998
- }
999
- ])
1000
- )?.customization;
1001
- } catch (err) {
1002
- const transformedError = sdkTransformError(
1003
- err,
1004
- {
1005
- spreadPathsToArguments: { customization: "$[1]" },
1006
- explicitPathsToArguments: {
1007
- "customization.id": "$[0]",
1008
- fields: "$[2].fields"
1009
- },
1010
- singleArgumentUnchanged: false
1011
- },
1012
- ["_id", "customization", "options"]
1013
- );
1014
- sideEffects?.onError?.(err);
1015
- throw transformedError;
1016
- }
1017
- }
1018
- async function deleteCustomization2(customizationId) {
1019
- const { httpClient, sideEffects } = arguments[1];
1020
- const payload = renameKeysFromSDKRequestToRESTRequest({
1021
- customizationId
1022
- });
1023
- const reqOpts = deleteCustomization(payload);
1024
- sideEffects?.onSiteCall?.();
1025
- try {
1026
- const result = await httpClient.request(reqOpts);
1027
- sideEffects?.onSuccess?.(result);
1028
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1029
- } catch (err) {
1030
- const transformedError = sdkTransformError(
1031
- err,
1032
- {
1033
- spreadPathsToArguments: {},
1034
- explicitPathsToArguments: { customizationId: "$[0]" },
1035
- singleArgumentUnchanged: false
1036
- },
1037
- ["customizationId"]
1038
- );
1039
- sideEffects?.onError?.(err);
1040
- throw transformedError;
1041
- }
1042
- }
1043
- function queryCustomizations2(options) {
1044
- const { httpClient, sideEffects } = arguments[1];
1045
- return queryBuilder({
1046
- func: async (payload) => {
1047
- const reqOpts = queryCustomizations({
1048
- ...payload,
1049
- ...options ?? {}
1050
- });
1051
- sideEffects?.onSiteCall?.();
1052
- try {
1053
- const result = await httpClient.request(reqOpts);
1054
- sideEffects?.onSuccess?.(result);
1055
- return result;
1056
- } catch (err) {
1057
- sideEffects?.onError?.(err);
1058
- throw err;
1059
- }
1060
- },
1061
- requestTransformer: (query) => {
1062
- const args = [query, options];
1063
- return renameKeysFromSDKRequestToRESTRequest({
1064
- ...args?.[1],
1065
- query: args?.[0]
1066
- });
1067
- },
1068
- responseTransformer: ({
1069
- data
1070
- }) => {
1071
- const transformedData = renameKeysFromRESTResponseToSDKResponse(
1072
- transformPaths2(data, [
1073
- {
1074
- transformFn: transformRESTImageToSDKImage,
1075
- paths: [
1076
- { path: "customizations.choicesSettings.choices.image" },
1077
- { path: "customizations.choicesSettings.choices.displayImage" }
1078
- ]
1079
- }
1080
- ])
1081
- );
1082
- return {
1083
- items: transformedData?.customizations,
1084
- pagingMetadata: transformedData?.pagingMetadata
1085
- };
1086
- },
1087
- errorTransformer: (err) => {
1088
- const transformedError = sdkTransformError(err, {
1089
- spreadPathsToArguments: {},
1090
- explicitPathsToArguments: { query: "$[0]" },
1091
- singleArgumentUnchanged: false
1092
- });
1093
- throw transformedError;
1094
- },
1095
- pagingMethod: "CURSOR",
1096
- transformationPaths: {}
1097
- });
1098
- }
1099
- async function typedQueryCustomizations(query, options) {
1100
- const { httpClient, sideEffects } = arguments[2];
1101
- const payload = renameKeysFromSDKRequestToRESTRequest({
1102
- query,
1103
- ...options
1104
- });
1105
- const reqOpts = queryCustomizations(payload);
1106
- sideEffects?.onSiteCall?.();
1107
- try {
1108
- const result = await httpClient.request(reqOpts);
1109
- sideEffects?.onSuccess?.(result);
1110
- return renameKeysFromRESTResponseToSDKResponse(
1111
- transformPaths2(result.data, [
1112
- {
1113
- transformFn: transformRESTImageToSDKImage,
1114
- paths: [
1115
- { path: "customizations.choicesSettings.choices.image" },
1116
- { path: "customizations.choicesSettings.choices.displayImage" }
1117
- ]
1118
- }
1119
- ])
1120
- );
1121
- } catch (err) {
1122
- const transformedError = sdkTransformError(
1123
- err,
1124
- {
1125
- spreadPathsToArguments: {},
1126
- explicitPathsToArguments: { query: "$[0]" },
1127
- singleArgumentUnchanged: false
1128
- },
1129
- ["query", "options"]
1130
- );
1131
- sideEffects?.onError?.(err);
1132
- throw transformedError;
1133
- }
1134
- }
1135
- var utils = {
1136
- query: /* @__PURE__ */ createQueryUtils()
1137
- };
1138
- async function bulkCreateCustomizations2(customizations, options) {
1139
- const { httpClient, sideEffects } = arguments[2];
1140
- const payload = transformPaths2(
1141
- renameKeysFromSDKRequestToRESTRequest({
1142
- customizations,
1143
- returnEntity: options?.returnEntity
1144
- }),
1145
- [
1146
- {
1147
- transformFn: transformSDKImageToRESTImage,
1148
- paths: [
1149
- { path: "customizations.choicesSettings.choices.image" },
1150
- { path: "customizations.choicesSettings.choices.displayImage" }
1151
- ]
1152
- }
1153
- ]
1154
- );
1155
- const reqOpts = bulkCreateCustomizations(payload);
1156
- sideEffects?.onSiteCall?.();
1157
- try {
1158
- const result = await httpClient.request(reqOpts);
1159
- sideEffects?.onSuccess?.(result);
1160
- return renameKeysFromRESTResponseToSDKResponse(
1161
- transformPaths2(result.data, [
1162
- {
1163
- transformFn: transformRESTImageToSDKImage,
1164
- paths: [
1165
- { path: "results.customization.choicesSettings.choices.image" },
1166
- {
1167
- path: "results.customization.choicesSettings.choices.displayImage"
1168
- }
1169
- ]
1170
- }
1171
- ])
1172
- );
1173
- } catch (err) {
1174
- const transformedError = sdkTransformError(
1175
- err,
1176
- {
1177
- spreadPathsToArguments: {},
1178
- explicitPathsToArguments: {
1179
- customizations: "$[0]",
1180
- returnEntity: "$[1].returnEntity"
1181
- },
1182
- singleArgumentUnchanged: false
1183
- },
1184
- ["customizations", "options"]
1185
- );
1186
- sideEffects?.onError?.(err);
1187
- throw transformedError;
1188
- }
1189
- }
1190
- async function addCustomizationChoices2(customizationId, choices, options) {
1191
- const { httpClient, sideEffects } = arguments[3];
1192
- const payload = transformPaths2(
1193
- renameKeysFromSDKRequestToRESTRequest({
1194
- customizationId,
1195
- choices,
1196
- fields: options?.fields
1197
- }),
1198
- [
1199
- {
1200
- transformFn: transformSDKImageToRESTImage,
1201
- paths: [{ path: "choices.image" }, { path: "choices.displayImage" }]
1202
- }
1203
- ]
1204
- );
1205
- const reqOpts = addCustomizationChoices(payload);
1206
- sideEffects?.onSiteCall?.();
1207
- try {
1208
- const result = await httpClient.request(reqOpts);
1209
- sideEffects?.onSuccess?.(result);
1210
- return renameKeysFromRESTResponseToSDKResponse(
1211
- transformPaths2(result.data, [
1212
- {
1213
- transformFn: transformRESTImageToSDKImage,
1214
- paths: [
1215
- { path: "customization.choicesSettings.choices.image" },
1216
- { path: "customization.choicesSettings.choices.displayImage" }
1217
- ]
1218
- }
1219
- ])
1220
- );
1221
- } catch (err) {
1222
- const transformedError = sdkTransformError(
1223
- err,
1224
- {
1225
- spreadPathsToArguments: {},
1226
- explicitPathsToArguments: {
1227
- customizationId: "$[0]",
1228
- choices: "$[1]",
1229
- fields: "$[2].fields"
1230
- },
1231
- singleArgumentUnchanged: false
1232
- },
1233
- ["customizationId", "choices", "options"]
1234
- );
1235
- sideEffects?.onError?.(err);
1236
- throw transformedError;
1237
- }
1238
- }
1239
- async function setCustomizationChoices2(customizationId, choices, options) {
1240
- const { httpClient, sideEffects } = arguments[3];
1241
- const payload = transformPaths2(
1242
- renameKeysFromSDKRequestToRESTRequest({
1243
- customizationId,
1244
- choices,
1245
- fields: options?.fields
1246
- }),
1247
- [
1248
- {
1249
- transformFn: transformSDKImageToRESTImage,
1250
- paths: [{ path: "choices.image" }, { path: "choices.displayImage" }]
1251
- }
1252
- ]
1253
- );
1254
- const reqOpts = setCustomizationChoices(payload);
1255
- sideEffects?.onSiteCall?.();
1256
- try {
1257
- const result = await httpClient.request(reqOpts);
1258
- sideEffects?.onSuccess?.(result);
1259
- return renameKeysFromRESTResponseToSDKResponse(
1260
- transformPaths2(result.data, [
1261
- {
1262
- transformFn: transformRESTImageToSDKImage,
1263
- paths: [
1264
- { path: "customization.choicesSettings.choices.image" },
1265
- { path: "customization.choicesSettings.choices.displayImage" }
1266
- ]
1267
- }
1268
- ])
1269
- );
1270
- } catch (err) {
1271
- const transformedError = sdkTransformError(
1272
- err,
1273
- {
1274
- spreadPathsToArguments: {},
1275
- explicitPathsToArguments: {
1276
- customizationId: "$[0]",
1277
- choices: "$[1]",
1278
- fields: "$[2].fields"
1279
- },
1280
- singleArgumentUnchanged: false
1281
- },
1282
- ["customizationId", "choices", "options"]
1283
- );
1284
- sideEffects?.onError?.(err);
1285
- throw transformedError;
1286
- }
1287
- }
1288
- async function removeCustomizationChoices2(customizationId, choiceIds, options) {
1289
- const { httpClient, sideEffects } = arguments[3];
1290
- const payload = renameKeysFromSDKRequestToRESTRequest({
1291
- customizationId,
1292
- choiceIds,
1293
- revision: options?.revision,
1294
- fields: options?.fields
1295
- });
1296
- const reqOpts = removeCustomizationChoices(
1297
- payload
1298
- );
1299
- sideEffects?.onSiteCall?.();
1300
- try {
1301
- const result = await httpClient.request(reqOpts);
1302
- sideEffects?.onSuccess?.(result);
1303
- return renameKeysFromRESTResponseToSDKResponse(
1304
- transformPaths2(result.data, [
1305
- {
1306
- transformFn: transformRESTImageToSDKImage,
1307
- paths: [
1308
- { path: "customization.choicesSettings.choices.image" },
1309
- { path: "customization.choicesSettings.choices.displayImage" }
1310
- ]
1311
- }
1312
- ])
1313
- );
1314
- } catch (err) {
1315
- const transformedError = sdkTransformError(
1316
- err,
1317
- {
1318
- spreadPathsToArguments: {},
1319
- explicitPathsToArguments: {
1320
- customizationId: "$[0]",
1321
- choiceIds: "$[1]",
1322
- revision: "$[2].revision",
1323
- fields: "$[2].fields"
1324
- },
1325
- singleArgumentUnchanged: false
1326
- },
1327
- ["customizationId", "choiceIds", "options"]
1328
- );
1329
- sideEffects?.onError?.(err);
1330
- throw transformedError;
1331
- }
1332
- }
1333
- async function updateCustomizationChoices2(customizationId, revision, options) {
1334
- const { httpClient, sideEffects } = arguments[3];
1335
- const payload = transformPaths2(
1336
- renameKeysFromSDKRequestToRESTRequest({
1337
- customizationId,
1338
- revision,
1339
- choices: options?.choices,
1340
- fields: options?.fields
1341
- }),
1342
- [
1343
- {
1344
- transformFn: transformSDKImageToRESTImage,
1345
- paths: [
1346
- { path: "choices.choice.image" },
1347
- { path: "choices.choice.displayImage" }
1348
- ]
1349
- }
1350
- ]
1351
- );
1352
- const reqOpts = updateCustomizationChoices(
1353
- payload
1354
- );
1355
- sideEffects?.onSiteCall?.();
1356
- try {
1357
- const result = await httpClient.request(reqOpts);
1358
- sideEffects?.onSuccess?.(result);
1359
- return renameKeysFromRESTResponseToSDKResponse(
1360
- transformPaths2(result.data, [
1361
- {
1362
- transformFn: transformRESTImageToSDKImage,
1363
- paths: [
1364
- { path: "customization.choicesSettings.choices.image" },
1365
- { path: "customization.choicesSettings.choices.displayImage" }
1366
- ]
1367
- }
1368
- ])
1369
- );
1370
- } catch (err) {
1371
- const transformedError = sdkTransformError(
1372
- err,
1373
- {
1374
- spreadPathsToArguments: {},
1375
- explicitPathsToArguments: {
1376
- customizationId: "$[0]",
1377
- revision: "$[1]",
1378
- choices: "$[2].choices",
1379
- fields: "$[2].fields"
1380
- },
1381
- singleArgumentUnchanged: false
1382
- },
1383
- ["customizationId", "revision", "options"]
1384
- );
1385
- sideEffects?.onError?.(err);
1386
- throw transformedError;
1387
- }
1388
- }
1389
- async function reorderCustomizationChoices2(customizationId, revision, options) {
1390
- const { httpClient, sideEffects } = arguments[3];
1391
- const payload = renameKeysFromSDKRequestToRESTRequest({
1392
- customizationId,
1393
- revision,
1394
- choiceIds: options?.choiceIds,
1395
- fields: options?.fields
1396
- });
1397
- const reqOpts = reorderCustomizationChoices(
1398
- payload
1399
- );
1400
- sideEffects?.onSiteCall?.();
1401
- try {
1402
- const result = await httpClient.request(reqOpts);
1403
- sideEffects?.onSuccess?.(result);
1404
- return renameKeysFromRESTResponseToSDKResponse(
1405
- transformPaths2(result.data, [
1406
- {
1407
- transformFn: transformRESTImageToSDKImage,
1408
- paths: [
1409
- { path: "customization.choicesSettings.choices.image" },
1410
- { path: "customization.choicesSettings.choices.displayImage" }
1411
- ]
1412
- }
1413
- ])
1414
- );
1415
- } catch (err) {
1416
- const transformedError = sdkTransformError(
1417
- err,
1418
- {
1419
- spreadPathsToArguments: {},
1420
- explicitPathsToArguments: {
1421
- customizationId: "$[0]",
1422
- revision: "$[1]",
1423
- choiceIds: "$[2].choiceIds",
1424
- fields: "$[2].fields"
1425
- },
1426
- singleArgumentUnchanged: false
1427
- },
1428
- ["customizationId", "revision", "options"]
1429
- );
1430
- sideEffects?.onError?.(err);
1431
- throw transformedError;
1432
- }
1433
- }
1434
- async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1435
- const { httpClient, sideEffects } = arguments[2];
1436
- const payload = transformPaths2(
1437
- renameKeysFromSDKRequestToRESTRequest({
1438
- customizationsChoices,
1439
- returnEntity: options?.returnEntity,
1440
- fields: options?.fields
1441
- }),
1442
- [
1443
- {
1444
- transformFn: transformSDKImageToRESTImage,
1445
- paths: [
1446
- { path: "customizationsChoices.choices.image" },
1447
- { path: "customizationsChoices.choices.displayImage" }
1448
- ]
1449
- }
1450
- ]
1451
- );
1452
- const reqOpts = bulkAddCustomizationChoices(
1453
- payload
1454
- );
1455
- sideEffects?.onSiteCall?.();
1456
- try {
1457
- const result = await httpClient.request(reqOpts);
1458
- sideEffects?.onSuccess?.(result);
1459
- return renameKeysFromRESTResponseToSDKResponse(
1460
- transformPaths2(result.data, [
1461
- {
1462
- transformFn: transformRESTImageToSDKImage,
1463
- paths: [
1464
- { path: "results.customization.choicesSettings.choices.image" },
1465
- {
1466
- path: "results.customization.choicesSettings.choices.displayImage"
1467
- }
1468
- ]
1469
- }
1470
- ])
1471
- );
1472
- } catch (err) {
1473
- const transformedError = sdkTransformError(
1474
- err,
1475
- {
1476
- spreadPathsToArguments: {},
1477
- explicitPathsToArguments: {
1478
- customizationsChoices: "$[0]",
1479
- returnEntity: "$[1].returnEntity",
1480
- fields: "$[1].fields"
1481
- },
1482
- singleArgumentUnchanged: false
1483
- },
1484
- ["customizationsChoices", "options"]
1485
- );
1486
- sideEffects?.onError?.(err);
1487
- throw transformedError;
1488
- }
1489
- }
1490
- async function bulkUpdateCustomizations2(customizations, options) {
1491
- const { httpClient, sideEffects } = arguments[2];
1492
- const payload = transformPaths2(
1493
- renameKeysFromSDKRequestToRESTRequest({
1494
- customizations,
1495
- returnEntity: options?.returnEntity,
1496
- fields: options?.fields
1497
- }),
1498
- [
1499
- {
1500
- transformFn: transformSDKImageToRESTImage,
1501
- paths: [
1502
- {
1503
- path: "customizations.customization.choicesSettings.choices.image"
1504
- },
1505
- {
1506
- path: "customizations.customization.choicesSettings.choices.displayImage"
1507
- }
1508
- ]
1509
- }
1510
- ]
1511
- );
1512
- const reqOpts = bulkUpdateCustomizations(payload);
1513
- sideEffects?.onSiteCall?.();
1514
- try {
1515
- const result = await httpClient.request(reqOpts);
1516
- sideEffects?.onSuccess?.(result);
1517
- return renameKeysFromRESTResponseToSDKResponse(
1518
- transformPaths2(result.data, [
1519
- {
1520
- transformFn: transformRESTImageToSDKImage,
1521
- paths: [
1522
- { path: "results.customization.choicesSettings.choices.image" },
1523
- {
1524
- path: "results.customization.choicesSettings.choices.displayImage"
1525
- }
1526
- ]
1527
- }
1528
- ])
1529
- );
1530
- } catch (err) {
1531
- const transformedError = sdkTransformError(
1532
- err,
1533
- {
1534
- spreadPathsToArguments: {},
1535
- explicitPathsToArguments: {
1536
- customizations: "$[0]",
1537
- returnEntity: "$[1].returnEntity",
1538
- fields: "$[1].fields"
1539
- },
1540
- singleArgumentUnchanged: false
1541
- },
1542
- ["customizations", "options"]
1543
- );
1544
- sideEffects?.onError?.(err);
1545
- throw transformedError;
1546
- }
1547
- }
1548
- export {
1549
- ChoiceSortStrategy,
1550
- ChoiceType,
1551
- CustomizationRenderType,
1552
- CustomizationType,
1553
- RequestedFields,
1554
- SortOrder,
1555
- WebhookIdentityType,
1556
- addCustomizationChoices2 as addCustomizationChoices,
1557
- bulkAddCustomizationChoices2 as bulkAddCustomizationChoices,
1558
- bulkCreateCustomizations2 as bulkCreateCustomizations,
1559
- bulkUpdateCustomizations2 as bulkUpdateCustomizations,
1560
- createCustomization2 as createCustomization,
1561
- deleteCustomization2 as deleteCustomization,
1562
- getCustomization2 as getCustomization,
1563
- queryCustomizations2 as queryCustomizations,
1564
- removeCustomizationChoices2 as removeCustomizationChoices,
1565
- reorderCustomizationChoices2 as reorderCustomizationChoices,
1566
- setCustomizationChoices2 as setCustomizationChoices,
1567
- typedQueryCustomizations,
1568
- updateCustomization2 as updateCustomization,
1569
- updateCustomizationChoices2 as updateCustomizationChoices,
1570
- utils
1571
- };
1572
- //# sourceMappingURL=index.typings.mjs.map