@wix/auto_sdk_stores_customizations-v-3 1.0.16 → 1.0.18

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 (134) hide show
  1. package/build/index.d.mts +154 -0
  2. package/build/index.d.ts +154 -0
  3. package/build/index.js +1389 -0
  4. package/build/index.js.map +1 -0
  5. package/build/index.mjs +1346 -0
  6. package/build/index.mjs.map +1 -0
  7. package/build/internal/index.d.mts +154 -0
  8. package/build/internal/index.d.ts +154 -0
  9. package/build/internal/index.js +1389 -0
  10. package/build/internal/index.js.map +1 -0
  11. package/build/internal/index.mjs +1346 -0
  12. package/build/internal/index.mjs.map +1 -0
  13. package/build/internal/meta.d.mts +619 -0
  14. package/build/internal/meta.d.ts +619 -0
  15. package/build/internal/meta.js +873 -0
  16. package/build/internal/meta.js.map +1 -0
  17. package/build/internal/meta.mjs +836 -0
  18. package/build/internal/meta.mjs.map +1 -0
  19. package/build/{es/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → internal/stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.mts} +377 -108
  20. package/build/{cjs/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → internal/stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.ts} +377 -108
  21. package/build/meta.d.mts +619 -0
  22. package/build/meta.d.ts +619 -0
  23. package/build/meta.js +873 -0
  24. package/build/meta.js.map +1 -0
  25. package/build/meta.mjs +836 -0
  26. package/build/meta.mjs.map +1 -0
  27. package/build/{internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.mts} +377 -108
  28. package/build/{internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.d.ts → stores-catalog-v3-customization-customizations-v-3.universal-CT4feroB.d.ts} +377 -108
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  40. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -40
  41. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  42. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  43. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -683
  44. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  45. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  46. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -237
  47. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  48. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  49. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -126
  50. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  51. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -54
  52. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  53. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  54. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -819
  55. package/build/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  67. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -31
  68. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  69. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  70. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -669
  71. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  72. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  73. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -200
  74. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  75. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  76. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -106
  77. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  78. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -51
  79. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  80. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  81. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -782
  82. package/build/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  93. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -40
  94. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  95. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  96. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -683
  97. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  98. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  99. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -237
  100. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  101. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  102. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -126
  103. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  104. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -54
  105. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  106. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  107. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -819
  108. package/build/internal/cjs/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.d.ts +0 -31
  119. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.js +0 -31
  120. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.context.js.map +0 -1
  121. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.d.ts +0 -63
  122. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.js +0 -669
  123. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.http.js.map +0 -1
  124. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.d.ts +0 -35
  125. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js +0 -200
  126. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.meta.js.map +0 -1
  127. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.d.ts +0 -130
  128. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.js +0 -106
  129. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.public.js.map +0 -1
  130. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.js +0 -51
  131. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.types.js.map +0 -1
  132. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.d.ts +0 -1588
  133. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js +0 -782
  134. package/build/internal/es/src/stores-catalog-v3-customization-customizations-v-3.universal.js.map +0 -1
@@ -0,0 +1,1346 @@
1
+ // src/stores-catalog-v3-customization-customizations-v-3.public.ts
2
+ import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
+ import { transformRESTImageToSDKImage as transformRESTImageToSDKImage2 } from "@wix/sdk-runtime/transformations/image";
4
+ import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
5
+ import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
6
+ import { EventDefinition } from "@wix/sdk-types";
7
+
8
+ // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
9
+ import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
10
+ import { queryBuilder } from "@wix/sdk-runtime/query-builder";
11
+ import {
12
+ renameKeysFromSDKRequestToRESTRequest,
13
+ renameKeysFromRESTResponseToSDKResponse
14
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
15
+
16
+ // src/stores-catalog-v3-customization-customizations-v-3.http.ts
17
+ import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
18
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
19
+ import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
20
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
21
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
22
+ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
23
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
24
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
25
+ function resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl(opts) {
26
+ const domainToMappings = {
27
+ "manage._base_domain_": [
28
+ {
29
+ srcPath: "/customization",
30
+ destPath: ""
31
+ }
32
+ ],
33
+ "www.wixapis.com": [
34
+ {
35
+ srcPath: "/stores/v3/customizations",
36
+ destPath: "/v3/customizations"
37
+ },
38
+ {
39
+ srcPath: "/stores/v3/bulk/customizations",
40
+ destPath: "/v3/bulk/customizations"
41
+ }
42
+ ],
43
+ "editor._base_domain_": [
44
+ {
45
+ srcPath: "/_api/customization",
46
+ destPath: ""
47
+ }
48
+ ],
49
+ "blocks._base_domain_": [
50
+ {
51
+ srcPath: "/_api/customization",
52
+ destPath: ""
53
+ }
54
+ ],
55
+ "create.editorx": [
56
+ {
57
+ srcPath: "/_api/customization",
58
+ destPath: ""
59
+ }
60
+ ],
61
+ _: [
62
+ {
63
+ srcPath: "/_api/customization",
64
+ destPath: ""
65
+ }
66
+ ],
67
+ "*.dev.wix-code.com": [
68
+ {
69
+ srcPath: "/_api/customization",
70
+ destPath: ""
71
+ }
72
+ ]
73
+ };
74
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
75
+ }
76
+ var PACKAGE_NAME = "@wix/auto_sdk_stores_customizations-v-3";
77
+ function createCustomization(payload) {
78
+ function __createCustomization({ host }) {
79
+ const serializedData = transformPaths(payload, [
80
+ {
81
+ transformFn: transformSDKTimestampToRESTTimestamp,
82
+ paths: [
83
+ { path: "customization.createdDate" },
84
+ { path: "customization.updatedDate" },
85
+ {
86
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ transformFn: transformSDKFloatToRESTFloat,
92
+ paths: [
93
+ { path: "customization.choicesSettings.choices.image.focalPoint.x" },
94
+ { path: "customization.choicesSettings.choices.image.focalPoint.y" }
95
+ ]
96
+ }
97
+ ]);
98
+ const metadata = {
99
+ entityFqdn: "wix.stores.catalog.v3.customization",
100
+ method: "POST",
101
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.CreateCustomization",
102
+ packageName: PACKAGE_NAME,
103
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
104
+ protoPath: "/v3/customizations",
105
+ data: serializedData,
106
+ host
107
+ }),
108
+ data: serializedData,
109
+ transformResponse: (payload2) => transformPaths(payload2, [
110
+ {
111
+ transformFn: transformRESTTimestampToSDKTimestamp,
112
+ paths: [
113
+ { path: "customization.createdDate" },
114
+ { path: "customization.updatedDate" },
115
+ {
116
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ transformFn: transformRESTFloatToSDKFloat,
122
+ paths: [
123
+ {
124
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
125
+ },
126
+ {
127
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
128
+ }
129
+ ]
130
+ }
131
+ ])
132
+ };
133
+ return metadata;
134
+ }
135
+ return __createCustomization;
136
+ }
137
+ function getCustomization(payload) {
138
+ function __getCustomization({ host }) {
139
+ const metadata = {
140
+ entityFqdn: "wix.stores.catalog.v3.customization",
141
+ method: "GET",
142
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.GetCustomization",
143
+ packageName: PACKAGE_NAME,
144
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
145
+ protoPath: "/v3/customizations/{customizationId}",
146
+ data: payload,
147
+ host
148
+ }),
149
+ params: toURLSearchParams(payload),
150
+ transformResponse: (payload2) => transformPaths(payload2, [
151
+ {
152
+ transformFn: transformRESTTimestampToSDKTimestamp,
153
+ paths: [
154
+ { path: "customization.createdDate" },
155
+ { path: "customization.updatedDate" },
156
+ {
157
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ transformFn: transformRESTFloatToSDKFloat,
163
+ paths: [
164
+ {
165
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
166
+ },
167
+ {
168
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
169
+ }
170
+ ]
171
+ }
172
+ ])
173
+ };
174
+ return metadata;
175
+ }
176
+ return __getCustomization;
177
+ }
178
+ function updateCustomization(payload) {
179
+ function __updateCustomization({ host }) {
180
+ const serializedData = transformPaths(payload, [
181
+ {
182
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
183
+ paths: [{ path: "fieldMask" }]
184
+ },
185
+ {
186
+ transformFn: transformSDKTimestampToRESTTimestamp,
187
+ paths: [
188
+ { path: "customization.createdDate" },
189
+ { path: "customization.updatedDate" },
190
+ {
191
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
192
+ }
193
+ ]
194
+ },
195
+ {
196
+ transformFn: transformSDKFloatToRESTFloat,
197
+ paths: [
198
+ { path: "customization.choicesSettings.choices.image.focalPoint.x" },
199
+ { path: "customization.choicesSettings.choices.image.focalPoint.y" }
200
+ ]
201
+ }
202
+ ]);
203
+ const metadata = {
204
+ entityFqdn: "wix.stores.catalog.v3.customization",
205
+ method: "PATCH",
206
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.UpdateCustomization",
207
+ packageName: PACKAGE_NAME,
208
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
209
+ protoPath: "/v3/customizations/{customization.id}",
210
+ data: serializedData,
211
+ host
212
+ }),
213
+ data: serializedData,
214
+ transformResponse: (payload2) => transformPaths(payload2, [
215
+ {
216
+ transformFn: transformRESTTimestampToSDKTimestamp,
217
+ paths: [
218
+ { path: "customization.createdDate" },
219
+ { path: "customization.updatedDate" },
220
+ {
221
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ transformFn: transformRESTFloatToSDKFloat,
227
+ paths: [
228
+ {
229
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
230
+ },
231
+ {
232
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
233
+ }
234
+ ]
235
+ }
236
+ ])
237
+ };
238
+ return metadata;
239
+ }
240
+ return __updateCustomization;
241
+ }
242
+ function deleteCustomization(payload) {
243
+ function __deleteCustomization({ host }) {
244
+ const metadata = {
245
+ entityFqdn: "wix.stores.catalog.v3.customization",
246
+ method: "DELETE",
247
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.DeleteCustomization",
248
+ packageName: PACKAGE_NAME,
249
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
250
+ protoPath: "/v3/customizations/{customizationId}",
251
+ data: payload,
252
+ host
253
+ }),
254
+ params: toURLSearchParams(payload)
255
+ };
256
+ return metadata;
257
+ }
258
+ return __deleteCustomization;
259
+ }
260
+ function queryCustomizations(payload) {
261
+ function __queryCustomizations({ host }) {
262
+ const metadata = {
263
+ entityFqdn: "wix.stores.catalog.v3.customization",
264
+ method: "POST",
265
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations",
266
+ packageName: PACKAGE_NAME,
267
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
268
+ protoPath: "/v3/customizations/query",
269
+ data: payload,
270
+ host
271
+ }),
272
+ data: payload,
273
+ transformResponse: (payload2) => transformPaths(payload2, [
274
+ {
275
+ transformFn: transformRESTTimestampToSDKTimestamp,
276
+ paths: [
277
+ { path: "customizations.createdDate" },
278
+ { path: "customizations.updatedDate" },
279
+ {
280
+ path: "customizations.choicesSettings.choices.image.urlExpirationDate"
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ transformFn: transformRESTFloatToSDKFloat,
286
+ paths: [
287
+ {
288
+ path: "customizations.choicesSettings.choices.image.focalPoint.x"
289
+ },
290
+ {
291
+ path: "customizations.choicesSettings.choices.image.focalPoint.y"
292
+ }
293
+ ]
294
+ }
295
+ ])
296
+ };
297
+ return metadata;
298
+ }
299
+ return __queryCustomizations;
300
+ }
301
+ function bulkCreateCustomizations(payload) {
302
+ function __bulkCreateCustomizations({ host }) {
303
+ const serializedData = transformPaths(payload, [
304
+ {
305
+ transformFn: transformSDKTimestampToRESTTimestamp,
306
+ paths: [
307
+ { path: "customizations.createdDate" },
308
+ { path: "customizations.updatedDate" },
309
+ {
310
+ path: "customizations.choicesSettings.choices.image.urlExpirationDate"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ transformFn: transformSDKFloatToRESTFloat,
316
+ paths: [
317
+ { path: "customizations.choicesSettings.choices.image.focalPoint.x" },
318
+ { path: "customizations.choicesSettings.choices.image.focalPoint.y" }
319
+ ]
320
+ }
321
+ ]);
322
+ const metadata = {
323
+ entityFqdn: "wix.stores.catalog.v3.customization",
324
+ method: "POST",
325
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkCreateCustomizations",
326
+ packageName: PACKAGE_NAME,
327
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
328
+ protoPath: "/v3/bulk/customizations/create",
329
+ data: serializedData,
330
+ host
331
+ }),
332
+ data: serializedData,
333
+ transformResponse: (payload2) => transformPaths(payload2, [
334
+ {
335
+ transformFn: transformRESTTimestampToSDKTimestamp,
336
+ paths: [
337
+ { path: "results.customization.createdDate" },
338
+ { path: "results.customization.updatedDate" },
339
+ {
340
+ path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
341
+ }
342
+ ]
343
+ },
344
+ {
345
+ transformFn: transformRESTFloatToSDKFloat,
346
+ paths: [
347
+ {
348
+ path: "results.customization.choicesSettings.choices.image.focalPoint.x"
349
+ },
350
+ {
351
+ path: "results.customization.choicesSettings.choices.image.focalPoint.y"
352
+ }
353
+ ]
354
+ }
355
+ ])
356
+ };
357
+ return metadata;
358
+ }
359
+ return __bulkCreateCustomizations;
360
+ }
361
+ function addCustomizationChoices(payload) {
362
+ function __addCustomizationChoices({ host }) {
363
+ const serializedData = transformPaths(payload, [
364
+ {
365
+ transformFn: transformSDKTimestampToRESTTimestamp,
366
+ paths: [{ path: "choices.image.urlExpirationDate" }]
367
+ },
368
+ {
369
+ transformFn: transformSDKFloatToRESTFloat,
370
+ paths: [
371
+ { path: "choices.image.focalPoint.x" },
372
+ { path: "choices.image.focalPoint.y" }
373
+ ]
374
+ }
375
+ ]);
376
+ const metadata = {
377
+ entityFqdn: "wix.stores.catalog.v3.customization",
378
+ method: "POST",
379
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.AddCustomizationChoices",
380
+ packageName: PACKAGE_NAME,
381
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
382
+ protoPath: "/v3/customizations/{customizationId}/add-choices",
383
+ data: serializedData,
384
+ host
385
+ }),
386
+ data: serializedData,
387
+ transformResponse: (payload2) => transformPaths(payload2, [
388
+ {
389
+ transformFn: transformRESTTimestampToSDKTimestamp,
390
+ paths: [
391
+ { path: "customization.createdDate" },
392
+ { path: "customization.updatedDate" },
393
+ {
394
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ transformFn: transformRESTFloatToSDKFloat,
400
+ paths: [
401
+ {
402
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
403
+ },
404
+ {
405
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
406
+ }
407
+ ]
408
+ }
409
+ ])
410
+ };
411
+ return metadata;
412
+ }
413
+ return __addCustomizationChoices;
414
+ }
415
+ function setCustomizationChoices(payload) {
416
+ function __setCustomizationChoices({ host }) {
417
+ const serializedData = transformPaths(payload, [
418
+ {
419
+ transformFn: transformSDKTimestampToRESTTimestamp,
420
+ paths: [{ path: "choices.image.urlExpirationDate" }]
421
+ },
422
+ {
423
+ transformFn: transformSDKFloatToRESTFloat,
424
+ paths: [
425
+ { path: "choices.image.focalPoint.x" },
426
+ { path: "choices.image.focalPoint.y" }
427
+ ]
428
+ }
429
+ ]);
430
+ const metadata = {
431
+ entityFqdn: "wix.stores.catalog.v3.customization",
432
+ method: "POST",
433
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.SetCustomizationChoices",
434
+ packageName: PACKAGE_NAME,
435
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
436
+ protoPath: "/v3/customizations/{customizationId}/set-choices",
437
+ data: serializedData,
438
+ host
439
+ }),
440
+ data: serializedData,
441
+ transformResponse: (payload2) => transformPaths(payload2, [
442
+ {
443
+ transformFn: transformRESTTimestampToSDKTimestamp,
444
+ paths: [
445
+ { path: "customization.createdDate" },
446
+ { path: "customization.updatedDate" },
447
+ {
448
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ transformFn: transformRESTFloatToSDKFloat,
454
+ paths: [
455
+ {
456
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
457
+ },
458
+ {
459
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
460
+ }
461
+ ]
462
+ }
463
+ ])
464
+ };
465
+ return metadata;
466
+ }
467
+ return __setCustomizationChoices;
468
+ }
469
+ function removeCustomizationChoices(payload) {
470
+ function __removeCustomizationChoices({ host }) {
471
+ const metadata = {
472
+ entityFqdn: "wix.stores.catalog.v3.customization",
473
+ method: "POST",
474
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.RemoveCustomizationChoices",
475
+ packageName: PACKAGE_NAME,
476
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
477
+ protoPath: "/v3/customizations/{customizationId}/remove-choices",
478
+ data: payload,
479
+ host
480
+ }),
481
+ data: payload,
482
+ transformResponse: (payload2) => transformPaths(payload2, [
483
+ {
484
+ transformFn: transformRESTTimestampToSDKTimestamp,
485
+ paths: [
486
+ { path: "customization.createdDate" },
487
+ { path: "customization.updatedDate" },
488
+ {
489
+ path: "customization.choicesSettings.choices.image.urlExpirationDate"
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ transformFn: transformRESTFloatToSDKFloat,
495
+ paths: [
496
+ {
497
+ path: "customization.choicesSettings.choices.image.focalPoint.x"
498
+ },
499
+ {
500
+ path: "customization.choicesSettings.choices.image.focalPoint.y"
501
+ }
502
+ ]
503
+ }
504
+ ])
505
+ };
506
+ return metadata;
507
+ }
508
+ return __removeCustomizationChoices;
509
+ }
510
+ function bulkAddCustomizationChoices(payload) {
511
+ function __bulkAddCustomizationChoices({ host }) {
512
+ const serializedData = transformPaths(payload, [
513
+ {
514
+ transformFn: transformSDKTimestampToRESTTimestamp,
515
+ paths: [
516
+ { path: "customizationsChoices.choices.image.urlExpirationDate" }
517
+ ]
518
+ },
519
+ {
520
+ transformFn: transformSDKFloatToRESTFloat,
521
+ paths: [
522
+ { path: "customizationsChoices.choices.image.focalPoint.x" },
523
+ { path: "customizationsChoices.choices.image.focalPoint.y" }
524
+ ]
525
+ }
526
+ ]);
527
+ const metadata = {
528
+ entityFqdn: "wix.stores.catalog.v3.customization",
529
+ method: "POST",
530
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkAddCustomizationChoices",
531
+ packageName: PACKAGE_NAME,
532
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
533
+ protoPath: "/v3/bulk/customizations/add-choices",
534
+ data: serializedData,
535
+ host
536
+ }),
537
+ data: serializedData,
538
+ transformResponse: (payload2) => transformPaths(payload2, [
539
+ {
540
+ transformFn: transformRESTTimestampToSDKTimestamp,
541
+ paths: [
542
+ { path: "results.customization.createdDate" },
543
+ { path: "results.customization.updatedDate" },
544
+ {
545
+ path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
546
+ }
547
+ ]
548
+ },
549
+ {
550
+ transformFn: transformRESTFloatToSDKFloat,
551
+ paths: [
552
+ {
553
+ path: "results.customization.choicesSettings.choices.image.focalPoint.x"
554
+ },
555
+ {
556
+ path: "results.customization.choicesSettings.choices.image.focalPoint.y"
557
+ }
558
+ ]
559
+ }
560
+ ])
561
+ };
562
+ return metadata;
563
+ }
564
+ return __bulkAddCustomizationChoices;
565
+ }
566
+ function bulkUpdateCustomizations(payload) {
567
+ function __bulkUpdateCustomizations({ host }) {
568
+ const serializedData = transformPaths(payload, [
569
+ {
570
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
571
+ paths: [{ path: "customizations.fieldMask" }]
572
+ },
573
+ {
574
+ transformFn: transformSDKTimestampToRESTTimestamp,
575
+ paths: [
576
+ { path: "customizations.customization.createdDate" },
577
+ { path: "customizations.customization.updatedDate" },
578
+ {
579
+ path: "customizations.customization.choicesSettings.choices.image.urlExpirationDate"
580
+ }
581
+ ]
582
+ },
583
+ {
584
+ transformFn: transformSDKFloatToRESTFloat,
585
+ paths: [
586
+ {
587
+ path: "customizations.customization.choicesSettings.choices.image.focalPoint.x"
588
+ },
589
+ {
590
+ path: "customizations.customization.choicesSettings.choices.image.focalPoint.y"
591
+ }
592
+ ]
593
+ }
594
+ ]);
595
+ const metadata = {
596
+ entityFqdn: "wix.stores.catalog.v3.customization",
597
+ method: "POST",
598
+ methodFqn: "wix.stores.catalog.customization.v3.CustomizationService.BulkUpdateCustomizations",
599
+ packageName: PACKAGE_NAME,
600
+ url: resolveWixStoresCatalogCustomizationV3CustomizationServiceUrl({
601
+ protoPath: "/v3/bulk/customizations/update",
602
+ data: serializedData,
603
+ host
604
+ }),
605
+ data: serializedData,
606
+ transformResponse: (payload2) => transformPaths(payload2, [
607
+ {
608
+ transformFn: transformRESTTimestampToSDKTimestamp,
609
+ paths: [
610
+ { path: "results.customization.createdDate" },
611
+ { path: "results.customization.updatedDate" },
612
+ {
613
+ path: "results.customization.choicesSettings.choices.image.urlExpirationDate"
614
+ }
615
+ ]
616
+ },
617
+ {
618
+ transformFn: transformRESTFloatToSDKFloat,
619
+ paths: [
620
+ {
621
+ path: "results.customization.choicesSettings.choices.image.focalPoint.x"
622
+ },
623
+ {
624
+ path: "results.customization.choicesSettings.choices.image.focalPoint.y"
625
+ }
626
+ ]
627
+ }
628
+ ])
629
+ };
630
+ return metadata;
631
+ }
632
+ return __bulkUpdateCustomizations;
633
+ }
634
+
635
+ // src/stores-catalog-v3-customization-customizations-v-3.universal.ts
636
+ import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
637
+ import { transformRESTImageToSDKImage } from "@wix/sdk-runtime/transformations/image";
638
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
639
+ var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
640
+ CustomizationType2["UNKNOWN_CUSTOMIZATION_TYPE"] = "UNKNOWN_CUSTOMIZATION_TYPE";
641
+ CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
642
+ CustomizationType2["MODIFIER"] = "MODIFIER";
643
+ return CustomizationType2;
644
+ })(CustomizationType || {});
645
+ var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
646
+ CustomizationRenderType2["UNKNOWN_CUSTOMIZATION_RENDER_TYPE"] = "UNKNOWN_CUSTOMIZATION_RENDER_TYPE";
647
+ CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
648
+ CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
649
+ CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
650
+ return CustomizationRenderType2;
651
+ })(CustomizationRenderType || {});
652
+ var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
653
+ ChoiceType2["UNKNOWN_CHOICE_TYPE"] = "UNKNOWN_CHOICE_TYPE";
654
+ ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
655
+ ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
656
+ ChoiceType2["MULTIPLE_COLORS"] = "MULTIPLE_COLORS";
657
+ ChoiceType2["IMAGE"] = "IMAGE";
658
+ return ChoiceType2;
659
+ })(ChoiceType || {});
660
+ var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
661
+ RequestedFields2["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
662
+ RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
663
+ return RequestedFields2;
664
+ })(RequestedFields || {});
665
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
666
+ SortOrder2["ASC"] = "ASC";
667
+ SortOrder2["DESC"] = "DESC";
668
+ return SortOrder2;
669
+ })(SortOrder || {});
670
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
671
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
672
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
673
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
674
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
675
+ WebhookIdentityType2["APP"] = "APP";
676
+ return WebhookIdentityType2;
677
+ })(WebhookIdentityType || {});
678
+ async function createCustomization2(customization) {
679
+ const { httpClient, sideEffects } = arguments[1];
680
+ const payload = transformPaths2(
681
+ renameKeysFromSDKRequestToRESTRequest({ customization }),
682
+ [
683
+ {
684
+ transformFn: transformSDKImageToRESTImage,
685
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
686
+ }
687
+ ]
688
+ );
689
+ const reqOpts = createCustomization(payload);
690
+ sideEffects?.onSiteCall?.();
691
+ try {
692
+ const result = await httpClient.request(reqOpts);
693
+ sideEffects?.onSuccess?.(result);
694
+ return renameKeysFromRESTResponseToSDKResponse(
695
+ transformPaths2(result.data, [
696
+ {
697
+ transformFn: transformRESTImageToSDKImage,
698
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
699
+ }
700
+ ])
701
+ )?.customization;
702
+ } catch (err) {
703
+ const transformedError = sdkTransformError(
704
+ err,
705
+ {
706
+ spreadPathsToArguments: {},
707
+ explicitPathsToArguments: { customization: "$[0]" },
708
+ singleArgumentUnchanged: false
709
+ },
710
+ ["customization"]
711
+ );
712
+ sideEffects?.onError?.(err);
713
+ throw transformedError;
714
+ }
715
+ }
716
+ async function getCustomization2(customizationId, options) {
717
+ const { httpClient, sideEffects } = arguments[2];
718
+ const payload = renameKeysFromSDKRequestToRESTRequest({
719
+ customizationId,
720
+ fields: options?.fields
721
+ });
722
+ const reqOpts = getCustomization(payload);
723
+ sideEffects?.onSiteCall?.();
724
+ try {
725
+ const result = await httpClient.request(reqOpts);
726
+ sideEffects?.onSuccess?.(result);
727
+ return renameKeysFromRESTResponseToSDKResponse(
728
+ transformPaths2(result.data, [
729
+ {
730
+ transformFn: transformRESTImageToSDKImage,
731
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
732
+ }
733
+ ])
734
+ )?.customization;
735
+ } catch (err) {
736
+ const transformedError = sdkTransformError(
737
+ err,
738
+ {
739
+ spreadPathsToArguments: {},
740
+ explicitPathsToArguments: {
741
+ customizationId: "$[0]",
742
+ fields: "$[1].fields"
743
+ },
744
+ singleArgumentUnchanged: false
745
+ },
746
+ ["customizationId", "options"]
747
+ );
748
+ sideEffects?.onError?.(err);
749
+ throw transformedError;
750
+ }
751
+ }
752
+ async function updateCustomization2(_id, customization, options) {
753
+ const { httpClient, sideEffects } = arguments[3];
754
+ const payload = transformPaths2(
755
+ renameKeysFromSDKRequestToRESTRequest({
756
+ customization: { ...customization, id: _id },
757
+ fields: options?.fields
758
+ }),
759
+ [
760
+ {
761
+ transformFn: transformSDKImageToRESTImage,
762
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
763
+ }
764
+ ]
765
+ );
766
+ const reqOpts = updateCustomization(payload);
767
+ sideEffects?.onSiteCall?.();
768
+ try {
769
+ const result = await httpClient.request(reqOpts);
770
+ sideEffects?.onSuccess?.(result);
771
+ return renameKeysFromRESTResponseToSDKResponse(
772
+ transformPaths2(result.data, [
773
+ {
774
+ transformFn: transformRESTImageToSDKImage,
775
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
776
+ }
777
+ ])
778
+ )?.customization;
779
+ } catch (err) {
780
+ const transformedError = sdkTransformError(
781
+ err,
782
+ {
783
+ spreadPathsToArguments: { customization: "$[1]" },
784
+ explicitPathsToArguments: {
785
+ "customization.id": "$[0]",
786
+ fields: "$[2].fields"
787
+ },
788
+ singleArgumentUnchanged: false
789
+ },
790
+ ["_id", "customization", "options"]
791
+ );
792
+ sideEffects?.onError?.(err);
793
+ throw transformedError;
794
+ }
795
+ }
796
+ async function deleteCustomization2(customizationId) {
797
+ const { httpClient, sideEffects } = arguments[1];
798
+ const payload = renameKeysFromSDKRequestToRESTRequest({
799
+ customizationId
800
+ });
801
+ const reqOpts = deleteCustomization(payload);
802
+ sideEffects?.onSiteCall?.();
803
+ try {
804
+ const result = await httpClient.request(reqOpts);
805
+ sideEffects?.onSuccess?.(result);
806
+ } catch (err) {
807
+ const transformedError = sdkTransformError(
808
+ err,
809
+ {
810
+ spreadPathsToArguments: {},
811
+ explicitPathsToArguments: { customizationId: "$[0]" },
812
+ singleArgumentUnchanged: false
813
+ },
814
+ ["customizationId"]
815
+ );
816
+ sideEffects?.onError?.(err);
817
+ throw transformedError;
818
+ }
819
+ }
820
+ function queryCustomizations2(options) {
821
+ const { httpClient, sideEffects } = arguments[1];
822
+ return queryBuilder({
823
+ func: async (payload) => {
824
+ const reqOpts = queryCustomizations({
825
+ ...payload,
826
+ ...options ?? {}
827
+ });
828
+ sideEffects?.onSiteCall?.();
829
+ try {
830
+ const result = await httpClient.request(reqOpts);
831
+ sideEffects?.onSuccess?.(result);
832
+ return result;
833
+ } catch (err) {
834
+ sideEffects?.onError?.(err);
835
+ throw err;
836
+ }
837
+ },
838
+ requestTransformer: (query) => {
839
+ const args = [query, options];
840
+ return renameKeysFromSDKRequestToRESTRequest({
841
+ ...args?.[1],
842
+ query: args?.[0]
843
+ });
844
+ },
845
+ responseTransformer: ({
846
+ data
847
+ }) => {
848
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(
849
+ transformPaths2(data, [
850
+ {
851
+ transformFn: transformRESTImageToSDKImage,
852
+ paths: [{ path: "customizations.choicesSettings.choices.image" }]
853
+ }
854
+ ])
855
+ );
856
+ return {
857
+ items: transformedData?.customizations,
858
+ pagingMetadata: transformedData?.pagingMetadata
859
+ };
860
+ },
861
+ errorTransformer: (err) => {
862
+ const transformedError = sdkTransformError(err, {
863
+ spreadPathsToArguments: {},
864
+ explicitPathsToArguments: { query: "$[0]" },
865
+ singleArgumentUnchanged: false
866
+ });
867
+ throw transformedError;
868
+ },
869
+ pagingMethod: "CURSOR",
870
+ transformationPaths: {}
871
+ });
872
+ }
873
+ async function bulkCreateCustomizations2(customizations, options) {
874
+ const { httpClient, sideEffects } = arguments[2];
875
+ const payload = transformPaths2(
876
+ renameKeysFromSDKRequestToRESTRequest({
877
+ customizations,
878
+ returnEntity: options?.returnEntity
879
+ }),
880
+ [
881
+ {
882
+ transformFn: transformSDKImageToRESTImage,
883
+ paths: [{ path: "customizations.choicesSettings.choices.image" }]
884
+ }
885
+ ]
886
+ );
887
+ const reqOpts = bulkCreateCustomizations(payload);
888
+ sideEffects?.onSiteCall?.();
889
+ try {
890
+ const result = await httpClient.request(reqOpts);
891
+ sideEffects?.onSuccess?.(result);
892
+ return renameKeysFromRESTResponseToSDKResponse(
893
+ transformPaths2(result.data, [
894
+ {
895
+ transformFn: transformRESTImageToSDKImage,
896
+ paths: [
897
+ { path: "results.customization.choicesSettings.choices.image" }
898
+ ]
899
+ }
900
+ ])
901
+ );
902
+ } catch (err) {
903
+ const transformedError = sdkTransformError(
904
+ err,
905
+ {
906
+ spreadPathsToArguments: {},
907
+ explicitPathsToArguments: {
908
+ customizations: "$[0]",
909
+ returnEntity: "$[1].returnEntity"
910
+ },
911
+ singleArgumentUnchanged: false
912
+ },
913
+ ["customizations", "options"]
914
+ );
915
+ sideEffects?.onError?.(err);
916
+ throw transformedError;
917
+ }
918
+ }
919
+ async function addCustomizationChoices2(customizationId, choices, options) {
920
+ const { httpClient, sideEffects } = arguments[3];
921
+ const payload = transformPaths2(
922
+ renameKeysFromSDKRequestToRESTRequest({
923
+ customizationId,
924
+ choices,
925
+ fields: options?.fields
926
+ }),
927
+ [
928
+ {
929
+ transformFn: transformSDKImageToRESTImage,
930
+ paths: [{ path: "choices.image" }]
931
+ }
932
+ ]
933
+ );
934
+ const reqOpts = addCustomizationChoices(payload);
935
+ sideEffects?.onSiteCall?.();
936
+ try {
937
+ const result = await httpClient.request(reqOpts);
938
+ sideEffects?.onSuccess?.(result);
939
+ return renameKeysFromRESTResponseToSDKResponse(
940
+ transformPaths2(result.data, [
941
+ {
942
+ transformFn: transformRESTImageToSDKImage,
943
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
944
+ }
945
+ ])
946
+ );
947
+ } catch (err) {
948
+ const transformedError = sdkTransformError(
949
+ err,
950
+ {
951
+ spreadPathsToArguments: {},
952
+ explicitPathsToArguments: {
953
+ customizationId: "$[0]",
954
+ choices: "$[1]",
955
+ fields: "$[2].fields"
956
+ },
957
+ singleArgumentUnchanged: false
958
+ },
959
+ ["customizationId", "choices", "options"]
960
+ );
961
+ sideEffects?.onError?.(err);
962
+ throw transformedError;
963
+ }
964
+ }
965
+ async function setCustomizationChoices2(customizationId, choices, options) {
966
+ const { httpClient, sideEffects } = arguments[3];
967
+ const payload = transformPaths2(
968
+ renameKeysFromSDKRequestToRESTRequest({
969
+ customizationId,
970
+ choices,
971
+ fields: options?.fields
972
+ }),
973
+ [
974
+ {
975
+ transformFn: transformSDKImageToRESTImage,
976
+ paths: [{ path: "choices.image" }]
977
+ }
978
+ ]
979
+ );
980
+ const reqOpts = setCustomizationChoices(payload);
981
+ sideEffects?.onSiteCall?.();
982
+ try {
983
+ const result = await httpClient.request(reqOpts);
984
+ sideEffects?.onSuccess?.(result);
985
+ return renameKeysFromRESTResponseToSDKResponse(
986
+ transformPaths2(result.data, [
987
+ {
988
+ transformFn: transformRESTImageToSDKImage,
989
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
990
+ }
991
+ ])
992
+ );
993
+ } catch (err) {
994
+ const transformedError = sdkTransformError(
995
+ err,
996
+ {
997
+ spreadPathsToArguments: {},
998
+ explicitPathsToArguments: {
999
+ customizationId: "$[0]",
1000
+ choices: "$[1]",
1001
+ fields: "$[2].fields"
1002
+ },
1003
+ singleArgumentUnchanged: false
1004
+ },
1005
+ ["customizationId", "choices", "options"]
1006
+ );
1007
+ sideEffects?.onError?.(err);
1008
+ throw transformedError;
1009
+ }
1010
+ }
1011
+ async function removeCustomizationChoices2(customizationId, choiceIds, options) {
1012
+ const { httpClient, sideEffects } = arguments[3];
1013
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1014
+ customizationId,
1015
+ choiceIds,
1016
+ revision: options?.revision,
1017
+ fields: options?.fields
1018
+ });
1019
+ const reqOpts = removeCustomizationChoices(
1020
+ payload
1021
+ );
1022
+ sideEffects?.onSiteCall?.();
1023
+ try {
1024
+ const result = await httpClient.request(reqOpts);
1025
+ sideEffects?.onSuccess?.(result);
1026
+ return renameKeysFromRESTResponseToSDKResponse(
1027
+ transformPaths2(result.data, [
1028
+ {
1029
+ transformFn: transformRESTImageToSDKImage,
1030
+ paths: [{ path: "customization.choicesSettings.choices.image" }]
1031
+ }
1032
+ ])
1033
+ );
1034
+ } catch (err) {
1035
+ const transformedError = sdkTransformError(
1036
+ err,
1037
+ {
1038
+ spreadPathsToArguments: {},
1039
+ explicitPathsToArguments: {
1040
+ customizationId: "$[0]",
1041
+ choiceIds: "$[1]",
1042
+ revision: "$[2].revision",
1043
+ fields: "$[2].fields"
1044
+ },
1045
+ singleArgumentUnchanged: false
1046
+ },
1047
+ ["customizationId", "choiceIds", "options"]
1048
+ );
1049
+ sideEffects?.onError?.(err);
1050
+ throw transformedError;
1051
+ }
1052
+ }
1053
+ async function bulkAddCustomizationChoices2(customizationsChoices, options) {
1054
+ const { httpClient, sideEffects } = arguments[2];
1055
+ const payload = transformPaths2(
1056
+ renameKeysFromSDKRequestToRESTRequest({
1057
+ customizationsChoices,
1058
+ returnEntity: options?.returnEntity,
1059
+ fields: options?.fields
1060
+ }),
1061
+ [
1062
+ {
1063
+ transformFn: transformSDKImageToRESTImage,
1064
+ paths: [{ path: "customizationsChoices.choices.image" }]
1065
+ }
1066
+ ]
1067
+ );
1068
+ const reqOpts = bulkAddCustomizationChoices(
1069
+ payload
1070
+ );
1071
+ sideEffects?.onSiteCall?.();
1072
+ try {
1073
+ const result = await httpClient.request(reqOpts);
1074
+ sideEffects?.onSuccess?.(result);
1075
+ return renameKeysFromRESTResponseToSDKResponse(
1076
+ transformPaths2(result.data, [
1077
+ {
1078
+ transformFn: transformRESTImageToSDKImage,
1079
+ paths: [
1080
+ { path: "results.customization.choicesSettings.choices.image" }
1081
+ ]
1082
+ }
1083
+ ])
1084
+ );
1085
+ } catch (err) {
1086
+ const transformedError = sdkTransformError(
1087
+ err,
1088
+ {
1089
+ spreadPathsToArguments: {},
1090
+ explicitPathsToArguments: {
1091
+ customizationsChoices: "$[0]",
1092
+ returnEntity: "$[1].returnEntity",
1093
+ fields: "$[1].fields"
1094
+ },
1095
+ singleArgumentUnchanged: false
1096
+ },
1097
+ ["customizationsChoices", "options"]
1098
+ );
1099
+ sideEffects?.onError?.(err);
1100
+ throw transformedError;
1101
+ }
1102
+ }
1103
+ async function bulkUpdateCustomizations2(customizations, options) {
1104
+ const { httpClient, sideEffects } = arguments[2];
1105
+ const payload = transformPaths2(
1106
+ renameKeysFromSDKRequestToRESTRequest({
1107
+ customizations,
1108
+ returnEntity: options?.returnEntity,
1109
+ fields: options?.fields
1110
+ }),
1111
+ [
1112
+ {
1113
+ transformFn: transformSDKImageToRESTImage,
1114
+ paths: [
1115
+ {
1116
+ path: "customizations.customization.choicesSettings.choices.image"
1117
+ }
1118
+ ]
1119
+ }
1120
+ ]
1121
+ );
1122
+ const reqOpts = bulkUpdateCustomizations(payload);
1123
+ sideEffects?.onSiteCall?.();
1124
+ try {
1125
+ const result = await httpClient.request(reqOpts);
1126
+ sideEffects?.onSuccess?.(result);
1127
+ return renameKeysFromRESTResponseToSDKResponse(
1128
+ transformPaths2(result.data, [
1129
+ {
1130
+ transformFn: transformRESTImageToSDKImage,
1131
+ paths: [
1132
+ { path: "results.customization.choicesSettings.choices.image" }
1133
+ ]
1134
+ }
1135
+ ])
1136
+ );
1137
+ } catch (err) {
1138
+ const transformedError = sdkTransformError(
1139
+ err,
1140
+ {
1141
+ spreadPathsToArguments: {},
1142
+ explicitPathsToArguments: {
1143
+ customizations: "$[0]",
1144
+ returnEntity: "$[1].returnEntity",
1145
+ fields: "$[1].fields"
1146
+ },
1147
+ singleArgumentUnchanged: false
1148
+ },
1149
+ ["customizations", "options"]
1150
+ );
1151
+ sideEffects?.onError?.(err);
1152
+ throw transformedError;
1153
+ }
1154
+ }
1155
+
1156
+ // src/stores-catalog-v3-customization-customizations-v-3.public.ts
1157
+ function createCustomization3(httpClient) {
1158
+ return (customization) => createCustomization2(
1159
+ customization,
1160
+ // @ts-ignore
1161
+ { httpClient }
1162
+ );
1163
+ }
1164
+ function getCustomization3(httpClient) {
1165
+ return (customizationId, options) => getCustomization2(
1166
+ customizationId,
1167
+ options,
1168
+ // @ts-ignore
1169
+ { httpClient }
1170
+ );
1171
+ }
1172
+ function updateCustomization3(httpClient) {
1173
+ return (_id, customization, options) => updateCustomization2(
1174
+ _id,
1175
+ customization,
1176
+ options,
1177
+ // @ts-ignore
1178
+ { httpClient }
1179
+ );
1180
+ }
1181
+ function deleteCustomization3(httpClient) {
1182
+ return (customizationId) => deleteCustomization2(
1183
+ customizationId,
1184
+ // @ts-ignore
1185
+ { httpClient }
1186
+ );
1187
+ }
1188
+ function queryCustomizations3(httpClient) {
1189
+ return (options) => queryCustomizations2(
1190
+ options,
1191
+ // @ts-ignore
1192
+ { httpClient }
1193
+ );
1194
+ }
1195
+ function bulkCreateCustomizations3(httpClient) {
1196
+ return (customizations, options) => bulkCreateCustomizations2(
1197
+ customizations,
1198
+ options,
1199
+ // @ts-ignore
1200
+ { httpClient }
1201
+ );
1202
+ }
1203
+ function addCustomizationChoices3(httpClient) {
1204
+ return (customizationId, choices, options) => addCustomizationChoices2(
1205
+ customizationId,
1206
+ choices,
1207
+ options,
1208
+ // @ts-ignore
1209
+ { httpClient }
1210
+ );
1211
+ }
1212
+ function setCustomizationChoices3(httpClient) {
1213
+ return (customizationId, choices, options) => setCustomizationChoices2(
1214
+ customizationId,
1215
+ choices,
1216
+ options,
1217
+ // @ts-ignore
1218
+ { httpClient }
1219
+ );
1220
+ }
1221
+ function removeCustomizationChoices3(httpClient) {
1222
+ return (customizationId, choiceIds, options) => removeCustomizationChoices2(
1223
+ customizationId,
1224
+ choiceIds,
1225
+ options,
1226
+ // @ts-ignore
1227
+ { httpClient }
1228
+ );
1229
+ }
1230
+ function bulkAddCustomizationChoices3(httpClient) {
1231
+ return (customizationsChoices, options) => bulkAddCustomizationChoices2(
1232
+ customizationsChoices,
1233
+ options,
1234
+ // @ts-ignore
1235
+ { httpClient }
1236
+ );
1237
+ }
1238
+ function bulkUpdateCustomizations3(httpClient) {
1239
+ return (customizations, options) => bulkUpdateCustomizations2(
1240
+ customizations,
1241
+ options,
1242
+ // @ts-ignore
1243
+ { httpClient }
1244
+ );
1245
+ }
1246
+ var onCustomizationCreated = EventDefinition(
1247
+ "wix.stores.catalog.v3.customization_created",
1248
+ true,
1249
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
1250
+ transformPaths3(event, [
1251
+ {
1252
+ transformFn: transformRESTTimestampToSDKTimestamp2,
1253
+ paths: [
1254
+ { path: "entity.createdDate" },
1255
+ { path: "entity.updatedDate" },
1256
+ { path: "metadata.eventTime" }
1257
+ ]
1258
+ },
1259
+ {
1260
+ transformFn: transformRESTImageToSDKImage2,
1261
+ paths: [{ path: "entity.choicesSettings.choices.image" }]
1262
+ }
1263
+ ])
1264
+ )
1265
+ )();
1266
+ var onCustomizationDeleted = EventDefinition(
1267
+ "wix.stores.catalog.v3.customization_deleted",
1268
+ true,
1269
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
1270
+ transformPaths3(event, [
1271
+ {
1272
+ transformFn: transformRESTTimestampToSDKTimestamp2,
1273
+ paths: [
1274
+ { path: "entity.createdDate" },
1275
+ { path: "entity.updatedDate" },
1276
+ { path: "metadata.eventTime" }
1277
+ ]
1278
+ },
1279
+ {
1280
+ transformFn: transformRESTImageToSDKImage2,
1281
+ paths: [{ path: "entity.choicesSettings.choices.image" }]
1282
+ }
1283
+ ])
1284
+ )
1285
+ )();
1286
+ var onCustomizationUpdated = EventDefinition(
1287
+ "wix.stores.catalog.v3.customization_updated",
1288
+ true,
1289
+ (event) => renameKeysFromRESTResponseToSDKResponse2(
1290
+ transformPaths3(event, [
1291
+ {
1292
+ transformFn: transformRESTTimestampToSDKTimestamp2,
1293
+ paths: [
1294
+ { path: "entity.createdDate" },
1295
+ { path: "entity.updatedDate" },
1296
+ { path: "metadata.eventTime" }
1297
+ ]
1298
+ },
1299
+ {
1300
+ transformFn: transformRESTImageToSDKImage2,
1301
+ paths: [{ path: "entity.choicesSettings.choices.image" }]
1302
+ }
1303
+ ])
1304
+ )
1305
+ )();
1306
+
1307
+ // src/stores-catalog-v3-customization-customizations-v-3.context.ts
1308
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1309
+ import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1310
+ var createCustomization4 = /* @__PURE__ */ createRESTModule(createCustomization3);
1311
+ var getCustomization4 = /* @__PURE__ */ createRESTModule(getCustomization3);
1312
+ var updateCustomization4 = /* @__PURE__ */ createRESTModule(updateCustomization3);
1313
+ var deleteCustomization4 = /* @__PURE__ */ createRESTModule(deleteCustomization3);
1314
+ var queryCustomizations4 = /* @__PURE__ */ createRESTModule(queryCustomizations3);
1315
+ var bulkCreateCustomizations4 = /* @__PURE__ */ createRESTModule(bulkCreateCustomizations3);
1316
+ var addCustomizationChoices4 = /* @__PURE__ */ createRESTModule(addCustomizationChoices3);
1317
+ var setCustomizationChoices4 = /* @__PURE__ */ createRESTModule(setCustomizationChoices3);
1318
+ var removeCustomizationChoices4 = /* @__PURE__ */ createRESTModule(removeCustomizationChoices3);
1319
+ var bulkAddCustomizationChoices4 = /* @__PURE__ */ createRESTModule(bulkAddCustomizationChoices3);
1320
+ var bulkUpdateCustomizations4 = /* @__PURE__ */ createRESTModule(bulkUpdateCustomizations3);
1321
+ var onCustomizationCreated2 = createEventModule(onCustomizationCreated);
1322
+ var onCustomizationDeleted2 = createEventModule(onCustomizationDeleted);
1323
+ var onCustomizationUpdated2 = createEventModule(onCustomizationUpdated);
1324
+ export {
1325
+ ChoiceType,
1326
+ CustomizationRenderType,
1327
+ CustomizationType,
1328
+ RequestedFields,
1329
+ SortOrder,
1330
+ WebhookIdentityType,
1331
+ addCustomizationChoices4 as addCustomizationChoices,
1332
+ bulkAddCustomizationChoices4 as bulkAddCustomizationChoices,
1333
+ bulkCreateCustomizations4 as bulkCreateCustomizations,
1334
+ bulkUpdateCustomizations4 as bulkUpdateCustomizations,
1335
+ createCustomization4 as createCustomization,
1336
+ deleteCustomization4 as deleteCustomization,
1337
+ getCustomization4 as getCustomization,
1338
+ onCustomizationCreated2 as onCustomizationCreated,
1339
+ onCustomizationDeleted2 as onCustomizationDeleted,
1340
+ onCustomizationUpdated2 as onCustomizationUpdated,
1341
+ queryCustomizations4 as queryCustomizations,
1342
+ removeCustomizationChoices4 as removeCustomizationChoices,
1343
+ setCustomizationChoices4 as setCustomizationChoices,
1344
+ updateCustomization4 as updateCustomization
1345
+ };
1346
+ //# sourceMappingURL=index.mjs.map