@wix/auto_sdk_stores_customizations-v-3 1.0.16 → 1.0.17

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