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