@wix/auto_sdk_stores_customizations-v-3 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +31 -0
  11. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js +40 -0
  12. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +1 -0
  13. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +63 -0
  14. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js +683 -0
  15. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +1 -0
  16. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +35 -0
  17. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js +237 -0
  18. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +1 -0
  19. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +130 -0
  20. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js +126 -0
  21. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +1 -0
  22. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts +736 -0
  23. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js +51 -0
  24. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +1 -0
  25. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +1281 -0
  26. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js +764 -0
  27. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +31 -0
  39. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.js +31 -0
  40. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +1 -0
  41. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +63 -0
  42. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.js +669 -0
  43. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +1 -0
  44. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +35 -0
  45. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js +200 -0
  46. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +1 -0
  47. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +130 -0
  48. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.js +106 -0
  49. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +1 -0
  50. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts +736 -0
  51. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.js +48 -0
  52. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +1 -0
  53. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +1281 -0
  54. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js +727 -0
  55. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +31 -0
  66. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js +40 -0
  67. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +1 -0
  68. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +63 -0
  69. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js +683 -0
  70. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +1 -0
  71. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +35 -0
  72. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js +237 -0
  73. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +1 -0
  74. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +130 -0
  75. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js +126 -0
  76. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +1 -0
  77. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts +736 -0
  78. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js +51 -0
  79. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +1 -0
  80. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +1281 -0
  81. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js +764 -0
  82. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +31 -0
  93. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.js +31 -0
  94. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +1 -0
  95. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +63 -0
  96. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.js +669 -0
  97. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +1 -0
  98. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +35 -0
  99. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js +200 -0
  100. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +1 -0
  101. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +130 -0
  102. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.js +106 -0
  103. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +1 -0
  104. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts +736 -0
  105. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.js +48 -0
  106. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +1 -0
  107. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +1281 -0
  108. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js +727 -0
  109. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,669 @@
1
+ import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';
2
+ import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';
3
+ import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';
4
+ import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
5
+ import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
6
+ import { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';
7
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
8
+ import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
9
+ function resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl(opts) {
10
+ const domainToMappings = {
11
+ 'manage._base_domain_': [
12
+ {
13
+ srcPath: '/customization',
14
+ destPath: '',
15
+ },
16
+ ],
17
+ 'www.wixapis.com': [
18
+ {
19
+ srcPath: '/stores/v3/customizations',
20
+ destPath: '/v3/customizations',
21
+ },
22
+ {
23
+ srcPath: '/stores/v3/bulk/customizations',
24
+ destPath: '/v3/bulk/customizations',
25
+ },
26
+ ],
27
+ 'editor._base_domain_': [
28
+ {
29
+ srcPath: '/_api/customization',
30
+ destPath: '',
31
+ },
32
+ ],
33
+ 'blocks._base_domain_': [
34
+ {
35
+ srcPath: '/_api/customization',
36
+ destPath: '',
37
+ },
38
+ ],
39
+ 'create.editorx': [
40
+ {
41
+ srcPath: '/_api/customization',
42
+ destPath: '',
43
+ },
44
+ ],
45
+ _: [
46
+ {
47
+ srcPath: '/_api/customization',
48
+ destPath: '',
49
+ },
50
+ ],
51
+ '*.dev.wix-code.com': [
52
+ {
53
+ srcPath: '/_api/customization',
54
+ destPath: '',
55
+ },
56
+ ],
57
+ };
58
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
59
+ }
60
+ const PACKAGE_NAME = '@wix/auto_sdk_stores_customizations-v-3';
61
+ /** Creates a customization. */
62
+ export function createCustomization(payload) {
63
+ function __createCustomization({ host }) {
64
+ const serializedData = transformPaths(payload, [
65
+ {
66
+ transformFn: transformSDKTimestampToRESTTimestamp,
67
+ paths: [
68
+ { path: 'customization.createdDate' },
69
+ { path: 'customization.updatedDate' },
70
+ {
71
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
72
+ },
73
+ ],
74
+ },
75
+ {
76
+ transformFn: transformSDKFloatToRESTFloat,
77
+ paths: [
78
+ { path: 'customization.choicesSettings.choices.image.focalPoint.x' },
79
+ { path: 'customization.choicesSettings.choices.image.focalPoint.y' },
80
+ ],
81
+ },
82
+ ]);
83
+ const metadata = {
84
+ entityFqdn: 'wix.stores.catalog.v3.customization',
85
+ method: 'POST',
86
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.CreateCustomization',
87
+ packageName: PACKAGE_NAME,
88
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
89
+ protoPath: '/v3/customizations',
90
+ data: serializedData,
91
+ host,
92
+ }),
93
+ data: serializedData,
94
+ transformResponse: (payload) => transformPaths(payload, [
95
+ {
96
+ transformFn: transformRESTTimestampToSDKTimestamp,
97
+ paths: [
98
+ { path: 'customization.createdDate' },
99
+ { path: 'customization.updatedDate' },
100
+ {
101
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
102
+ },
103
+ ],
104
+ },
105
+ {
106
+ transformFn: transformRESTFloatToSDKFloat,
107
+ paths: [
108
+ {
109
+ path: 'customization.choicesSettings.choices.image.focalPoint.x',
110
+ },
111
+ {
112
+ path: 'customization.choicesSettings.choices.image.focalPoint.y',
113
+ },
114
+ ],
115
+ },
116
+ ]),
117
+ };
118
+ return metadata;
119
+ }
120
+ return __createCustomization;
121
+ }
122
+ /** Retrieves a customization. */
123
+ export function getCustomization(payload) {
124
+ function __getCustomization({ host }) {
125
+ const metadata = {
126
+ entityFqdn: 'wix.stores.catalog.v3.customization',
127
+ method: 'GET',
128
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.GetCustomization',
129
+ packageName: PACKAGE_NAME,
130
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
131
+ protoPath: '/v3/customizations/{customizationId}',
132
+ data: payload,
133
+ host,
134
+ }),
135
+ params: toURLSearchParams(payload),
136
+ transformResponse: (payload) => transformPaths(payload, [
137
+ {
138
+ transformFn: transformRESTTimestampToSDKTimestamp,
139
+ paths: [
140
+ { path: 'customization.createdDate' },
141
+ { path: 'customization.updatedDate' },
142
+ {
143
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
144
+ },
145
+ ],
146
+ },
147
+ {
148
+ transformFn: transformRESTFloatToSDKFloat,
149
+ paths: [
150
+ {
151
+ path: 'customization.choicesSettings.choices.image.focalPoint.x',
152
+ },
153
+ {
154
+ path: 'customization.choicesSettings.choices.image.focalPoint.y',
155
+ },
156
+ ],
157
+ },
158
+ ]),
159
+ };
160
+ return metadata;
161
+ }
162
+ return __getCustomization;
163
+ }
164
+ /**
165
+ * Updates a customization.
166
+ *
167
+ * Each time the customization is updated, `revision` increments by 1.
168
+ * The current `revision` must be passed when updating the customization.
169
+ * This ensures you're working with the latest customization and prevents unintended overwrites.
170
+ */
171
+ export function updateCustomization(payload) {
172
+ function __updateCustomization({ host }) {
173
+ const serializedData = transformPaths(payload, [
174
+ {
175
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
176
+ paths: [{ path: 'fieldMask' }],
177
+ },
178
+ {
179
+ transformFn: transformSDKTimestampToRESTTimestamp,
180
+ paths: [
181
+ { path: 'customization.createdDate' },
182
+ { path: 'customization.updatedDate' },
183
+ {
184
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
185
+ },
186
+ ],
187
+ },
188
+ {
189
+ transformFn: transformSDKFloatToRESTFloat,
190
+ paths: [
191
+ { path: 'customization.choicesSettings.choices.image.focalPoint.x' },
192
+ { path: 'customization.choicesSettings.choices.image.focalPoint.y' },
193
+ ],
194
+ },
195
+ ]);
196
+ const metadata = {
197
+ entityFqdn: 'wix.stores.catalog.v3.customization',
198
+ method: 'PATCH',
199
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomization',
200
+ packageName: PACKAGE_NAME,
201
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
202
+ protoPath: '/v3/customizations/{customization.id}',
203
+ data: serializedData,
204
+ host,
205
+ }),
206
+ data: serializedData,
207
+ transformResponse: (payload) => transformPaths(payload, [
208
+ {
209
+ transformFn: transformRESTTimestampToSDKTimestamp,
210
+ paths: [
211
+ { path: 'customization.createdDate' },
212
+ { path: 'customization.updatedDate' },
213
+ {
214
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
215
+ },
216
+ ],
217
+ },
218
+ {
219
+ transformFn: transformRESTFloatToSDKFloat,
220
+ paths: [
221
+ {
222
+ path: 'customization.choicesSettings.choices.image.focalPoint.x',
223
+ },
224
+ {
225
+ path: 'customization.choicesSettings.choices.image.focalPoint.y',
226
+ },
227
+ ],
228
+ },
229
+ ]),
230
+ };
231
+ return metadata;
232
+ }
233
+ return __updateCustomization;
234
+ }
235
+ /**
236
+ * Deletes a customization.
237
+ *
238
+ * > **Note:** A customization cannot be deleted if it is assigned to one or more products.
239
+ */
240
+ export function deleteCustomization(payload) {
241
+ function __deleteCustomization({ host }) {
242
+ const metadata = {
243
+ entityFqdn: 'wix.stores.catalog.v3.customization',
244
+ method: 'DELETE',
245
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.DeleteCustomization',
246
+ packageName: PACKAGE_NAME,
247
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
248
+ protoPath: '/v3/customizations/{customizationId}',
249
+ data: payload,
250
+ host,
251
+ }),
252
+ params: toURLSearchParams(payload),
253
+ };
254
+ return metadata;
255
+ }
256
+ return __deleteCustomization;
257
+ }
258
+ /**
259
+ * Retrieves a list of up to 100 customizations, given the provided filtering, sorting, and cursor paging.
260
+ * Pass supported values to the `fields` array in the request to include those fields in the response.
261
+ *
262
+ *
263
+ * Query Customizations runs with these defaults, which you can override:
264
+ *
265
+ * - `createdDate` is sorted in `DESC` order
266
+ * - `cursorPaging.limit` is `100`
267
+ *
268
+ * For field support for filters and sorting,
269
+ * see [Customizations: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/customizations-v3/supported-filters-and-sorting).
270
+ *
271
+ * To learn about working with _Query_ endpoints, see
272
+ * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
273
+ * and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
274
+ */
275
+ export function queryCustomizations(payload) {
276
+ function __queryCustomizations({ host }) {
277
+ const metadata = {
278
+ entityFqdn: 'wix.stores.catalog.v3.customization',
279
+ method: 'POST',
280
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations',
281
+ packageName: PACKAGE_NAME,
282
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
283
+ protoPath: '/v3/customizations/query',
284
+ data: payload,
285
+ host,
286
+ }),
287
+ data: payload,
288
+ transformResponse: (payload) => transformPaths(payload, [
289
+ {
290
+ transformFn: transformRESTTimestampToSDKTimestamp,
291
+ paths: [
292
+ { path: 'customizations.createdDate' },
293
+ { path: 'customizations.updatedDate' },
294
+ {
295
+ path: 'customizations.choicesSettings.choices.image.urlExpirationDate',
296
+ },
297
+ ],
298
+ },
299
+ {
300
+ transformFn: transformRESTFloatToSDKFloat,
301
+ paths: [
302
+ {
303
+ path: 'customizations.choicesSettings.choices.image.focalPoint.x',
304
+ },
305
+ {
306
+ path: 'customizations.choicesSettings.choices.image.focalPoint.y',
307
+ },
308
+ ],
309
+ },
310
+ ]),
311
+ };
312
+ return metadata;
313
+ }
314
+ return __queryCustomizations;
315
+ }
316
+ /** Creates multiple brands. */
317
+ export function bulkCreateCustomizations(payload) {
318
+ function __bulkCreateCustomizations({ host }) {
319
+ const serializedData = transformPaths(payload, [
320
+ {
321
+ transformFn: transformSDKTimestampToRESTTimestamp,
322
+ paths: [
323
+ { path: 'customizations.createdDate' },
324
+ { path: 'customizations.updatedDate' },
325
+ {
326
+ path: 'customizations.choicesSettings.choices.image.urlExpirationDate',
327
+ },
328
+ ],
329
+ },
330
+ {
331
+ transformFn: transformSDKFloatToRESTFloat,
332
+ paths: [
333
+ { path: 'customizations.choicesSettings.choices.image.focalPoint.x' },
334
+ { path: 'customizations.choicesSettings.choices.image.focalPoint.y' },
335
+ ],
336
+ },
337
+ ]);
338
+ const metadata = {
339
+ entityFqdn: 'wix.stores.catalog.v3.customization',
340
+ method: 'POST',
341
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations',
342
+ packageName: PACKAGE_NAME,
343
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
344
+ protoPath: '/v3/bulk/customizations/create',
345
+ data: serializedData,
346
+ host,
347
+ }),
348
+ data: serializedData,
349
+ transformResponse: (payload) => transformPaths(payload, [
350
+ {
351
+ transformFn: transformRESTTimestampToSDKTimestamp,
352
+ paths: [
353
+ { path: 'results.customization.createdDate' },
354
+ { path: 'results.customization.updatedDate' },
355
+ {
356
+ path: 'results.customization.choicesSettings.choices.image.urlExpirationDate',
357
+ },
358
+ ],
359
+ },
360
+ {
361
+ transformFn: transformRESTFloatToSDKFloat,
362
+ paths: [
363
+ {
364
+ path: 'results.customization.choicesSettings.choices.image.focalPoint.x',
365
+ },
366
+ {
367
+ path: 'results.customization.choicesSettings.choices.image.focalPoint.y',
368
+ },
369
+ ],
370
+ },
371
+ ]),
372
+ };
373
+ return metadata;
374
+ }
375
+ return __bulkCreateCustomizations;
376
+ }
377
+ /** Adds choices to a customization. */
378
+ export function addCustomizationChoices(payload) {
379
+ function __addCustomizationChoices({ host }) {
380
+ const serializedData = transformPaths(payload, [
381
+ {
382
+ transformFn: transformSDKTimestampToRESTTimestamp,
383
+ paths: [{ path: 'choices.image.urlExpirationDate' }],
384
+ },
385
+ {
386
+ transformFn: transformSDKFloatToRESTFloat,
387
+ paths: [
388
+ { path: 'choices.image.focalPoint.x' },
389
+ { path: 'choices.image.focalPoint.y' },
390
+ ],
391
+ },
392
+ ]);
393
+ const metadata = {
394
+ entityFqdn: 'wix.stores.catalog.v3.customization',
395
+ method: 'POST',
396
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices',
397
+ packageName: PACKAGE_NAME,
398
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
399
+ protoPath: '/v3/customizations/{customizationId}/add-choices',
400
+ data: serializedData,
401
+ host,
402
+ }),
403
+ data: serializedData,
404
+ transformResponse: (payload) => transformPaths(payload, [
405
+ {
406
+ transformFn: transformRESTTimestampToSDKTimestamp,
407
+ paths: [
408
+ { path: 'customization.createdDate' },
409
+ { path: 'customization.updatedDate' },
410
+ {
411
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
412
+ },
413
+ ],
414
+ },
415
+ {
416
+ transformFn: transformRESTFloatToSDKFloat,
417
+ paths: [
418
+ {
419
+ path: 'customization.choicesSettings.choices.image.focalPoint.x',
420
+ },
421
+ {
422
+ path: 'customization.choicesSettings.choices.image.focalPoint.y',
423
+ },
424
+ ],
425
+ },
426
+ ]),
427
+ };
428
+ return metadata;
429
+ }
430
+ return __addCustomizationChoices;
431
+ }
432
+ /**
433
+ * Sets a customization's choices. Any and all existing choices will be overridden.
434
+ *
435
+ * > **Note:** A choice cannot be overridden if it is assigned to one or more products.
436
+ */
437
+ export function setCustomizationChoices(payload) {
438
+ function __setCustomizationChoices({ host }) {
439
+ const serializedData = transformPaths(payload, [
440
+ {
441
+ transformFn: transformSDKTimestampToRESTTimestamp,
442
+ paths: [{ path: 'choices.image.urlExpirationDate' }],
443
+ },
444
+ {
445
+ transformFn: transformSDKFloatToRESTFloat,
446
+ paths: [
447
+ { path: 'choices.image.focalPoint.x' },
448
+ { path: 'choices.image.focalPoint.y' },
449
+ ],
450
+ },
451
+ ]);
452
+ const metadata = {
453
+ entityFqdn: 'wix.stores.catalog.v3.customization',
454
+ method: 'POST',
455
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices',
456
+ packageName: PACKAGE_NAME,
457
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
458
+ protoPath: '/v3/customizations/{customizationId}/set-choices',
459
+ data: serializedData,
460
+ host,
461
+ }),
462
+ data: serializedData,
463
+ transformResponse: (payload) => transformPaths(payload, [
464
+ {
465
+ transformFn: transformRESTTimestampToSDKTimestamp,
466
+ paths: [
467
+ { path: 'customization.createdDate' },
468
+ { path: 'customization.updatedDate' },
469
+ {
470
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
471
+ },
472
+ ],
473
+ },
474
+ {
475
+ transformFn: transformRESTFloatToSDKFloat,
476
+ paths: [
477
+ {
478
+ path: 'customization.choicesSettings.choices.image.focalPoint.x',
479
+ },
480
+ {
481
+ path: 'customization.choicesSettings.choices.image.focalPoint.y',
482
+ },
483
+ ],
484
+ },
485
+ ]),
486
+ };
487
+ return metadata;
488
+ }
489
+ return __setCustomizationChoices;
490
+ }
491
+ /**
492
+ * Removes choices from a customization.
493
+ *
494
+ * +> **Note:** A choice cannot be removed if it is assigned to one or more products.
495
+ */
496
+ export function removeCustomizationChoices(payload) {
497
+ function __removeCustomizationChoices({ host }) {
498
+ const metadata = {
499
+ entityFqdn: 'wix.stores.catalog.v3.customization',
500
+ method: 'POST',
501
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices',
502
+ packageName: PACKAGE_NAME,
503
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
504
+ protoPath: '/v3/customizations/{customizationId}/remove-choices',
505
+ data: payload,
506
+ host,
507
+ }),
508
+ data: payload,
509
+ transformResponse: (payload) => transformPaths(payload, [
510
+ {
511
+ transformFn: transformRESTTimestampToSDKTimestamp,
512
+ paths: [
513
+ { path: 'customization.createdDate' },
514
+ { path: 'customization.updatedDate' },
515
+ {
516
+ path: 'customization.choicesSettings.choices.image.urlExpirationDate',
517
+ },
518
+ ],
519
+ },
520
+ {
521
+ transformFn: transformRESTFloatToSDKFloat,
522
+ paths: [
523
+ {
524
+ path: 'customization.choicesSettings.choices.image.focalPoint.x',
525
+ },
526
+ {
527
+ path: 'customization.choicesSettings.choices.image.focalPoint.y',
528
+ },
529
+ ],
530
+ },
531
+ ]),
532
+ };
533
+ return metadata;
534
+ }
535
+ return __removeCustomizationChoices;
536
+ }
537
+ /** Adds choices to multiple customizations. */
538
+ export function bulkAddCustomizationChoices(payload) {
539
+ function __bulkAddCustomizationChoices({ host }) {
540
+ const serializedData = transformPaths(payload, [
541
+ {
542
+ transformFn: transformSDKTimestampToRESTTimestamp,
543
+ paths: [
544
+ { path: 'customizationsChoices.choices.image.urlExpirationDate' },
545
+ ],
546
+ },
547
+ {
548
+ transformFn: transformSDKFloatToRESTFloat,
549
+ paths: [
550
+ { path: 'customizationsChoices.choices.image.focalPoint.x' },
551
+ { path: 'customizationsChoices.choices.image.focalPoint.y' },
552
+ ],
553
+ },
554
+ ]);
555
+ const metadata = {
556
+ entityFqdn: 'wix.stores.catalog.v3.customization',
557
+ method: 'POST',
558
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices',
559
+ packageName: PACKAGE_NAME,
560
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
561
+ protoPath: '/v3/bulk/customizations/add-choices',
562
+ data: serializedData,
563
+ host,
564
+ }),
565
+ data: serializedData,
566
+ transformResponse: (payload) => transformPaths(payload, [
567
+ {
568
+ transformFn: transformRESTTimestampToSDKTimestamp,
569
+ paths: [
570
+ { path: 'results.customization.createdDate' },
571
+ { path: 'results.customization.updatedDate' },
572
+ {
573
+ path: 'results.customization.choicesSettings.choices.image.urlExpirationDate',
574
+ },
575
+ ],
576
+ },
577
+ {
578
+ transformFn: transformRESTFloatToSDKFloat,
579
+ paths: [
580
+ {
581
+ path: 'results.customization.choicesSettings.choices.image.focalPoint.x',
582
+ },
583
+ {
584
+ path: 'results.customization.choicesSettings.choices.image.focalPoint.y',
585
+ },
586
+ ],
587
+ },
588
+ ]),
589
+ };
590
+ return metadata;
591
+ }
592
+ return __bulkAddCustomizationChoices;
593
+ }
594
+ /**
595
+ * Updates multiple customizations.
596
+ *
597
+ * Each time the customization is updated, `revision` increments by 1.
598
+ * The current `revision` must be passed when updating the customization.
599
+ * This ensures you're working with the latest customization and prevents unintended overwrites.
600
+ */
601
+ export function bulkUpdateCustomizations(payload) {
602
+ function __bulkUpdateCustomizations({ host }) {
603
+ const serializedData = transformPaths(payload, [
604
+ {
605
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
606
+ paths: [{ path: 'customizations.fieldMask' }],
607
+ },
608
+ {
609
+ transformFn: transformSDKTimestampToRESTTimestamp,
610
+ paths: [
611
+ { path: 'customizations.customization.createdDate' },
612
+ { path: 'customizations.customization.updatedDate' },
613
+ {
614
+ path: 'customizations.customization.choicesSettings.choices.image.urlExpirationDate',
615
+ },
616
+ ],
617
+ },
618
+ {
619
+ transformFn: transformSDKFloatToRESTFloat,
620
+ paths: [
621
+ {
622
+ path: 'customizations.customization.choicesSettings.choices.image.focalPoint.x',
623
+ },
624
+ {
625
+ path: 'customizations.customization.choicesSettings.choices.image.focalPoint.y',
626
+ },
627
+ ],
628
+ },
629
+ ]);
630
+ const metadata = {
631
+ entityFqdn: 'wix.stores.catalog.v3.customization',
632
+ method: 'POST',
633
+ methodFqn: 'wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations',
634
+ packageName: PACKAGE_NAME,
635
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
636
+ protoPath: '/v3/bulk/customizations/update',
637
+ data: serializedData,
638
+ host,
639
+ }),
640
+ data: serializedData,
641
+ transformResponse: (payload) => transformPaths(payload, [
642
+ {
643
+ transformFn: transformRESTTimestampToSDKTimestamp,
644
+ paths: [
645
+ { path: 'results.customization.createdDate' },
646
+ { path: 'results.customization.updatedDate' },
647
+ {
648
+ path: 'results.customization.choicesSettings.choices.image.urlExpirationDate',
649
+ },
650
+ ],
651
+ },
652
+ {
653
+ transformFn: transformRESTFloatToSDKFloat,
654
+ paths: [
655
+ {
656
+ path: 'results.customization.choicesSettings.choices.image.focalPoint.x',
657
+ },
658
+ {
659
+ path: 'results.customization.choicesSettings.choices.image.focalPoint.y',
660
+ },
661
+ ],
662
+ },
663
+ ]),
664
+ };
665
+ return metadata;
666
+ }
667
+ return __bulkUpdateCustomizations;
668
+ }
669
+ //# sourceMappingURL=stores-catalog-v3-customization-customizations-v-3.http.js.map