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