@wix/auto_sdk_stores_customizations-v-3 1.0.74 → 1.0.75

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.
@@ -0,0 +1,1597 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // schemas.ts
31
+ var schemas_exports = {};
32
+ __export(schemas_exports, {
33
+ AddCustomizationChoicesRequest: () => AddCustomizationChoicesRequest,
34
+ AddCustomizationChoicesResponse: () => AddCustomizationChoicesResponse,
35
+ BulkAddCustomizationChoicesRequest: () => BulkAddCustomizationChoicesRequest,
36
+ BulkAddCustomizationChoicesResponse: () => BulkAddCustomizationChoicesResponse,
37
+ BulkCreateCustomizationsRequest: () => BulkCreateCustomizationsRequest,
38
+ BulkCreateCustomizationsResponse: () => BulkCreateCustomizationsResponse,
39
+ BulkUpdateCustomizationsRequest: () => BulkUpdateCustomizationsRequest,
40
+ BulkUpdateCustomizationsResponse: () => BulkUpdateCustomizationsResponse,
41
+ CreateCustomizationRequest: () => CreateCustomizationRequest,
42
+ CreateCustomizationResponse: () => CreateCustomizationResponse,
43
+ DeleteCustomizationRequest: () => DeleteCustomizationRequest,
44
+ DeleteCustomizationResponse: () => DeleteCustomizationResponse,
45
+ GetCustomizationRequest: () => GetCustomizationRequest,
46
+ GetCustomizationResponse: () => GetCustomizationResponse,
47
+ QueryCustomizationsRequest: () => QueryCustomizationsRequest,
48
+ QueryCustomizationsResponse: () => QueryCustomizationsResponse,
49
+ RemoveCustomizationChoicesRequest: () => RemoveCustomizationChoicesRequest,
50
+ RemoveCustomizationChoicesResponse: () => RemoveCustomizationChoicesResponse,
51
+ SetCustomizationChoicesRequest: () => SetCustomizationChoicesRequest,
52
+ SetCustomizationChoicesResponse: () => SetCustomizationChoicesResponse,
53
+ UpdateCustomizationRequest: () => UpdateCustomizationRequest,
54
+ UpdateCustomizationResponse: () => UpdateCustomizationResponse
55
+ });
56
+ module.exports = __toCommonJS(schemas_exports);
57
+
58
+ // src/stores-catalog-v3-customization-customizations-v-3.schemas.ts
59
+ var z = __toESM(require("zod"));
60
+ var CreateCustomizationRequest = z.object({
61
+ customization: z.intersection(
62
+ z.object({
63
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
64
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
65
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
66
+ ).optional().nullable(),
67
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
68
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
69
+ key: z.string().describe(
70
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
71
+ ).min(1).max(50).optional().nullable(),
72
+ name: z.string().describe(
73
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
74
+ ).min(1).max(50),
75
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]),
76
+ customizationRenderType: z.enum([
77
+ "FREE_TEXT",
78
+ "TEXT_CHOICES",
79
+ "SWATCH_CHOICES"
80
+ ]),
81
+ assignedProductsCount: z.number().int().describe(
82
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
83
+ ).optional().nullable()
84
+ }),
85
+ z.xor([
86
+ z.object({
87
+ choicesSettings: z.never().optional(),
88
+ freeTextInput: z.object({
89
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
90
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
91
+ defaultAddedPrice: z.string().describe(
92
+ "Default amount added to a product's price when this choice is assigned to a modifier."
93
+ ).optional().nullable(),
94
+ title: z.string().describe(
95
+ "Title to display to customer for their free-text input."
96
+ ).min(1).max(100),
97
+ key: z.string().describe(
98
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
99
+ ).min(1).max(150).optional().nullable()
100
+ }).describe(
101
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
102
+ )
103
+ }),
104
+ z.object({
105
+ freeTextInput: z.never().optional(),
106
+ choicesSettings: z.object({
107
+ choices: z.array(
108
+ z.intersection(
109
+ z.object({
110
+ _id: z.string().describe("Choice ID.").regex(
111
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
112
+ "Must be a valid GUID"
113
+ ).optional(),
114
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
115
+ key: z.string().describe(
116
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
117
+ ).min(1).max(50).optional().nullable(),
118
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
119
+ defaultAddedPrice: z.string().describe(
120
+ "Default amount added to a product's price when this customization is assigned to a modifier."
121
+ ).optional().nullable()
122
+ }),
123
+ z.xor([
124
+ z.object({ colorCode: z.never().optional() }),
125
+ z.object({
126
+ colorCode: z.string().describe(
127
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
128
+ ).min(3).max(20)
129
+ })
130
+ ])
131
+ )
132
+ ).min(1).max(200)
133
+ }).describe(
134
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
135
+ )
136
+ })
137
+ ])
138
+ ).describe("Customization to create.")
139
+ });
140
+ var CreateCustomizationResponse = z.intersection(
141
+ z.object({
142
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
143
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
144
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
145
+ ).optional().nullable(),
146
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
147
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
148
+ key: z.string().describe(
149
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
150
+ ).min(1).max(50).optional().nullable(),
151
+ name: z.string().describe(
152
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
153
+ ).min(1).max(50).optional(),
154
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
155
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
156
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
157
+ ).optional(),
158
+ assignedProductsCount: z.number().int().describe(
159
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
160
+ ).optional().nullable()
161
+ }),
162
+ z.xor([
163
+ z.object({
164
+ freeTextInput: z.never().optional(),
165
+ choicesSettings: z.never().optional()
166
+ }),
167
+ z.object({
168
+ choicesSettings: z.never().optional(),
169
+ freeTextInput: z.object({
170
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
171
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
172
+ defaultAddedPrice: z.string().describe(
173
+ "Default amount added to a product's price when this choice is assigned to a modifier."
174
+ ).optional().nullable(),
175
+ title: z.string().describe("Title to display to customer for their free-text input.").min(1).max(100).optional(),
176
+ key: z.string().describe(
177
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
178
+ ).min(1).max(150).optional().nullable()
179
+ }).describe(
180
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
181
+ )
182
+ }),
183
+ z.object({
184
+ freeTextInput: z.never().optional(),
185
+ choicesSettings: z.object({
186
+ choices: z.array(
187
+ z.intersection(
188
+ z.object({
189
+ _id: z.string().describe("Choice ID.").regex(
190
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
191
+ "Must be a valid GUID"
192
+ ).optional(),
193
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
194
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
195
+ ).optional(),
196
+ key: z.string().describe(
197
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
198
+ ).min(1).max(50).optional().nullable(),
199
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
200
+ defaultAddedPrice: z.string().describe(
201
+ "Default amount added to a product's price when this customization is assigned to a modifier."
202
+ ).optional().nullable()
203
+ }),
204
+ z.xor([
205
+ z.object({ colorCode: z.never().optional() }),
206
+ z.object({
207
+ colorCode: z.string().describe(
208
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
209
+ ).min(3).max(20)
210
+ })
211
+ ])
212
+ )
213
+ ).min(1).max(200).optional()
214
+ }).describe(
215
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
216
+ )
217
+ })
218
+ ])
219
+ );
220
+ var GetCustomizationRequest = z.object({
221
+ customizationId: z.string().describe("Customization ID.").regex(
222
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
223
+ "Must be a valid GUID"
224
+ ),
225
+ options: z.object({
226
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
227
+ }).optional()
228
+ });
229
+ var GetCustomizationResponse = z.intersection(
230
+ z.object({
231
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
232
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
233
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
234
+ ).optional().nullable(),
235
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
236
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
237
+ key: z.string().describe(
238
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
239
+ ).min(1).max(50).optional().nullable(),
240
+ name: z.string().describe(
241
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
242
+ ).min(1).max(50).optional(),
243
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
244
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
245
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
246
+ ).optional(),
247
+ assignedProductsCount: z.number().int().describe(
248
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
249
+ ).optional().nullable()
250
+ }),
251
+ z.xor([
252
+ z.object({
253
+ freeTextInput: z.never().optional(),
254
+ choicesSettings: z.never().optional()
255
+ }),
256
+ z.object({
257
+ choicesSettings: z.never().optional(),
258
+ freeTextInput: z.object({
259
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
260
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
261
+ defaultAddedPrice: z.string().describe(
262
+ "Default amount added to a product's price when this choice is assigned to a modifier."
263
+ ).optional().nullable(),
264
+ title: z.string().describe("Title to display to customer for their free-text input.").min(1).max(100).optional(),
265
+ key: z.string().describe(
266
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
267
+ ).min(1).max(150).optional().nullable()
268
+ }).describe(
269
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
270
+ )
271
+ }),
272
+ z.object({
273
+ freeTextInput: z.never().optional(),
274
+ choicesSettings: z.object({
275
+ choices: z.array(
276
+ z.intersection(
277
+ z.object({
278
+ _id: z.string().describe("Choice ID.").regex(
279
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
280
+ "Must be a valid GUID"
281
+ ).optional(),
282
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
283
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
284
+ ).optional(),
285
+ key: z.string().describe(
286
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
287
+ ).min(1).max(50).optional().nullable(),
288
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
289
+ defaultAddedPrice: z.string().describe(
290
+ "Default amount added to a product's price when this customization is assigned to a modifier."
291
+ ).optional().nullable()
292
+ }),
293
+ z.xor([
294
+ z.object({ colorCode: z.never().optional() }),
295
+ z.object({
296
+ colorCode: z.string().describe(
297
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
298
+ ).min(3).max(20)
299
+ })
300
+ ])
301
+ )
302
+ ).min(1).max(200).optional()
303
+ }).describe(
304
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
305
+ )
306
+ })
307
+ ])
308
+ );
309
+ var UpdateCustomizationRequest = z.object({
310
+ _id: z.string().describe("Customization ID.").min(1).max(36),
311
+ customization: z.intersection(
312
+ z.object({
313
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
314
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
315
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
316
+ ),
317
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
318
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
319
+ key: z.string().describe(
320
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
321
+ ).min(1).max(50).optional().nullable(),
322
+ name: z.string().describe(
323
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
324
+ ).min(1).max(50).optional(),
325
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).optional(),
326
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).optional(),
327
+ assignedProductsCount: z.number().int().describe(
328
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
329
+ ).optional().nullable()
330
+ }),
331
+ z.xor([
332
+ z.object({
333
+ freeTextInput: z.never().optional(),
334
+ choicesSettings: z.never().optional()
335
+ }),
336
+ z.object({
337
+ choicesSettings: z.never().optional(),
338
+ freeTextInput: z.object({
339
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
340
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
341
+ defaultAddedPrice: z.string().describe(
342
+ "Default amount added to a product's price when this choice is assigned to a modifier."
343
+ ).optional().nullable(),
344
+ title: z.string().describe(
345
+ "Title to display to customer for their free-text input."
346
+ ).min(1).max(100).optional(),
347
+ key: z.string().describe(
348
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
349
+ ).min(1).max(150).optional().nullable()
350
+ }).describe(
351
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
352
+ )
353
+ }),
354
+ z.object({
355
+ freeTextInput: z.never().optional(),
356
+ choicesSettings: z.object({
357
+ choices: z.array(
358
+ z.intersection(
359
+ z.object({
360
+ _id: z.string().describe("Choice ID.").regex(
361
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
362
+ "Must be a valid GUID"
363
+ ),
364
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
365
+ key: z.string().describe(
366
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
367
+ ).min(1).max(50).optional().nullable(),
368
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
369
+ defaultAddedPrice: z.string().describe(
370
+ "Default amount added to a product's price when this customization is assigned to a modifier."
371
+ ).optional().nullable()
372
+ }),
373
+ z.xor([
374
+ z.object({ colorCode: z.never().optional() }),
375
+ z.object({
376
+ colorCode: z.string().describe(
377
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
378
+ ).min(3).max(20)
379
+ })
380
+ ])
381
+ )
382
+ ).min(1).max(200).optional()
383
+ }).describe(
384
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
385
+ )
386
+ })
387
+ ])
388
+ ).describe("Customization to update."),
389
+ options: z.object({
390
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
391
+ }).optional()
392
+ });
393
+ var UpdateCustomizationResponse = z.intersection(
394
+ z.object({
395
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
396
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
397
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
398
+ ).optional().nullable(),
399
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
400
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
401
+ key: z.string().describe(
402
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
403
+ ).min(1).max(50).optional().nullable(),
404
+ name: z.string().describe(
405
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
406
+ ).min(1).max(50).optional(),
407
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
408
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
409
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
410
+ ).optional(),
411
+ assignedProductsCount: z.number().int().describe(
412
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
413
+ ).optional().nullable()
414
+ }),
415
+ z.xor([
416
+ z.object({
417
+ freeTextInput: z.never().optional(),
418
+ choicesSettings: z.never().optional()
419
+ }),
420
+ z.object({
421
+ choicesSettings: z.never().optional(),
422
+ freeTextInput: z.object({
423
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
424
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
425
+ defaultAddedPrice: z.string().describe(
426
+ "Default amount added to a product's price when this choice is assigned to a modifier."
427
+ ).optional().nullable(),
428
+ title: z.string().describe("Title to display to customer for their free-text input.").min(1).max(100).optional(),
429
+ key: z.string().describe(
430
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
431
+ ).min(1).max(150).optional().nullable()
432
+ }).describe(
433
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
434
+ )
435
+ }),
436
+ z.object({
437
+ freeTextInput: z.never().optional(),
438
+ choicesSettings: z.object({
439
+ choices: z.array(
440
+ z.intersection(
441
+ z.object({
442
+ _id: z.string().describe("Choice ID.").regex(
443
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
444
+ "Must be a valid GUID"
445
+ ).optional(),
446
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
447
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
448
+ ).optional(),
449
+ key: z.string().describe(
450
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
451
+ ).min(1).max(50).optional().nullable(),
452
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
453
+ defaultAddedPrice: z.string().describe(
454
+ "Default amount added to a product's price when this customization is assigned to a modifier."
455
+ ).optional().nullable()
456
+ }),
457
+ z.xor([
458
+ z.object({ colorCode: z.never().optional() }),
459
+ z.object({
460
+ colorCode: z.string().describe(
461
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
462
+ ).min(3).max(20)
463
+ })
464
+ ])
465
+ )
466
+ ).min(1).max(200).optional()
467
+ }).describe(
468
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
469
+ )
470
+ })
471
+ ])
472
+ );
473
+ var DeleteCustomizationRequest = z.object({
474
+ customizationId: z.string().describe("Customization ID.").regex(
475
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
476
+ "Must be a valid GUID"
477
+ )
478
+ });
479
+ var DeleteCustomizationResponse = z.object({});
480
+ var QueryCustomizationsRequest = z.object({
481
+ query: z.object({
482
+ filter: z.object({
483
+ _id: z.object({
484
+ $eq: z.string(),
485
+ $exists: z.boolean(),
486
+ $gt: z.string(),
487
+ $gte: z.string(),
488
+ $hasAll: z.array(z.string()),
489
+ $hasSome: z.array(z.string()),
490
+ $in: z.array(z.string()),
491
+ $lt: z.string(),
492
+ $lte: z.string(),
493
+ $ne: z.string(),
494
+ $nin: z.array(z.string()),
495
+ $startsWith: z.string()
496
+ }).partial().strict().optional(),
497
+ _createdDate: z.object({
498
+ $eq: z.string(),
499
+ $exists: z.boolean(),
500
+ $gt: z.string(),
501
+ $gte: z.string(),
502
+ $hasAll: z.array(z.string()),
503
+ $hasSome: z.array(z.string()),
504
+ $in: z.array(z.string()),
505
+ $lt: z.string(),
506
+ $lte: z.string(),
507
+ $ne: z.string(),
508
+ $nin: z.array(z.string()),
509
+ $startsWith: z.string()
510
+ }).partial().strict().optional(),
511
+ _updatedDate: z.object({
512
+ $eq: z.string(),
513
+ $exists: z.boolean(),
514
+ $gt: z.string(),
515
+ $gte: z.string(),
516
+ $hasAll: z.array(z.string()),
517
+ $hasSome: z.array(z.string()),
518
+ $in: z.array(z.string()),
519
+ $lt: z.string(),
520
+ $lte: z.string(),
521
+ $ne: z.string(),
522
+ $nin: z.array(z.string()),
523
+ $startsWith: z.string()
524
+ }).partial().strict().optional(),
525
+ name: z.object({
526
+ $eq: z.string(),
527
+ $exists: z.boolean(),
528
+ $gt: z.string(),
529
+ $gte: z.string(),
530
+ $hasAll: z.array(z.string()),
531
+ $hasSome: z.array(z.string()),
532
+ $in: z.array(z.string()),
533
+ $lt: z.string(),
534
+ $lte: z.string(),
535
+ $ne: z.string(),
536
+ $nin: z.array(z.string()),
537
+ $startsWith: z.string()
538
+ }).partial().strict().optional(),
539
+ customizationType: z.object({
540
+ $eq: z.string(),
541
+ $exists: z.boolean(),
542
+ $gt: z.string(),
543
+ $gte: z.string(),
544
+ $hasAll: z.array(z.string()),
545
+ $hasSome: z.array(z.string()),
546
+ $in: z.array(z.string()),
547
+ $lt: z.string(),
548
+ $lte: z.string(),
549
+ $ne: z.string(),
550
+ $nin: z.array(z.string()),
551
+ $startsWith: z.string()
552
+ }).partial().strict().optional(),
553
+ customizationRenderType: z.object({
554
+ $eq: z.string(),
555
+ $exists: z.boolean(),
556
+ $gt: z.string(),
557
+ $gte: z.string(),
558
+ $hasAll: z.array(z.string()),
559
+ $hasSome: z.array(z.string()),
560
+ $in: z.array(z.string()),
561
+ $lt: z.string(),
562
+ $lte: z.string(),
563
+ $ne: z.string(),
564
+ $nin: z.array(z.string()),
565
+ $startsWith: z.string()
566
+ }).partial().strict().optional(),
567
+ $and: z.array(z.any()).optional(),
568
+ $or: z.array(z.any()).optional(),
569
+ $not: z.any().optional()
570
+ }).strict().optional(),
571
+ sort: z.array(
572
+ z.object({
573
+ fieldName: z.enum(["_id", "_createdDate", "_updatedDate", "name"]).optional(),
574
+ order: z.enum(["ASC", "DESC"]).optional()
575
+ })
576
+ ).optional()
577
+ }).catchall(z.any()).describe("Query options."),
578
+ options: z.object({
579
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
580
+ }).optional()
581
+ });
582
+ var QueryCustomizationsResponse = z.object({
583
+ customizations: z.array(
584
+ z.intersection(
585
+ z.object({
586
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
587
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
588
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
589
+ ).optional().nullable(),
590
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
591
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
592
+ key: z.string().describe(
593
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
594
+ ).min(1).max(50).optional().nullable(),
595
+ name: z.string().describe(
596
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
597
+ ).min(1).max(50).optional(),
598
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
599
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
600
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
601
+ ).optional(),
602
+ assignedProductsCount: z.number().int().describe(
603
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
604
+ ).optional().nullable()
605
+ }),
606
+ z.xor([
607
+ z.object({
608
+ freeTextInput: z.never().optional(),
609
+ choicesSettings: z.never().optional()
610
+ }),
611
+ z.object({
612
+ choicesSettings: z.never().optional(),
613
+ freeTextInput: z.object({
614
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
615
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
616
+ defaultAddedPrice: z.string().describe(
617
+ "Default amount added to a product's price when this choice is assigned to a modifier."
618
+ ).optional().nullable(),
619
+ title: z.string().describe(
620
+ "Title to display to customer for their free-text input."
621
+ ).min(1).max(100).optional(),
622
+ key: z.string().describe(
623
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
624
+ ).min(1).max(150).optional().nullable()
625
+ }).describe(
626
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
627
+ )
628
+ }),
629
+ z.object({
630
+ freeTextInput: z.never().optional(),
631
+ choicesSettings: z.object({
632
+ choices: z.array(
633
+ z.intersection(
634
+ z.object({
635
+ _id: z.string().describe("Choice ID.").regex(
636
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
637
+ "Must be a valid GUID"
638
+ ).optional(),
639
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
640
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
641
+ ).optional(),
642
+ key: z.string().describe(
643
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
644
+ ).min(1).max(50).optional().nullable(),
645
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
646
+ defaultAddedPrice: z.string().describe(
647
+ "Default amount added to a product's price when this customization is assigned to a modifier."
648
+ ).optional().nullable()
649
+ }),
650
+ z.xor([
651
+ z.object({ colorCode: z.never().optional() }),
652
+ z.object({
653
+ colorCode: z.string().describe(
654
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
655
+ ).min(3).max(20)
656
+ })
657
+ ])
658
+ )
659
+ ).min(1).max(200).optional()
660
+ }).describe(
661
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
662
+ )
663
+ })
664
+ ])
665
+ )
666
+ ).min(1).max(200).optional(),
667
+ pagingMetadata: z.object({
668
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
669
+ cursors: z.object({
670
+ next: z.string().describe(
671
+ "Cursor string pointing to the next page in the list of results."
672
+ ).max(16e3).optional().nullable(),
673
+ prev: z.string().describe(
674
+ "Cursor pointing to the previous page in the list of results."
675
+ ).max(16e3).optional().nullable()
676
+ }).describe(
677
+ "Cursor strings that point to the next page, previous page, or both."
678
+ ).optional(),
679
+ hasNext: z.boolean().describe(
680
+ "Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
681
+ ).optional().nullable()
682
+ }).describe("Details on the paged set of results returned.").optional()
683
+ });
684
+ var BulkCreateCustomizationsRequest = z.object({
685
+ customizations: z.array(
686
+ z.intersection(
687
+ z.object({
688
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
689
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
690
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
691
+ ).optional().nullable(),
692
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
693
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
694
+ key: z.string().describe(
695
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
696
+ ).min(1).max(50).optional().nullable(),
697
+ name: z.string().describe(
698
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
699
+ ).min(1).max(50).optional(),
700
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).optional(),
701
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).optional(),
702
+ assignedProductsCount: z.number().int().describe(
703
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
704
+ ).optional().nullable()
705
+ }),
706
+ z.xor([
707
+ z.object({
708
+ freeTextInput: z.never().optional(),
709
+ choicesSettings: z.never().optional()
710
+ }),
711
+ z.object({
712
+ choicesSettings: z.never().optional(),
713
+ freeTextInput: z.object({
714
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
715
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
716
+ defaultAddedPrice: z.string().describe(
717
+ "Default amount added to a product's price when this choice is assigned to a modifier."
718
+ ).optional().nullable(),
719
+ title: z.string().describe(
720
+ "Title to display to customer for their free-text input."
721
+ ).min(1).max(100).optional(),
722
+ key: z.string().describe(
723
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
724
+ ).min(1).max(150).optional().nullable()
725
+ }).describe(
726
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
727
+ )
728
+ }),
729
+ z.object({
730
+ freeTextInput: z.never().optional(),
731
+ choicesSettings: z.object({
732
+ choices: z.array(
733
+ z.intersection(
734
+ z.object({
735
+ _id: z.string().describe("Choice ID.").regex(
736
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
737
+ "Must be a valid GUID"
738
+ ).optional(),
739
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
740
+ key: z.string().describe(
741
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
742
+ ).min(1).max(50).optional().nullable(),
743
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
744
+ defaultAddedPrice: z.string().describe(
745
+ "Default amount added to a product's price when this customization is assigned to a modifier."
746
+ ).optional().nullable()
747
+ }),
748
+ z.xor([
749
+ z.object({ colorCode: z.never().optional() }),
750
+ z.object({
751
+ colorCode: z.string().describe(
752
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
753
+ ).min(3).max(20)
754
+ })
755
+ ])
756
+ )
757
+ ).min(1).max(200).optional()
758
+ }).describe(
759
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
760
+ )
761
+ })
762
+ ])
763
+ )
764
+ ).min(1).max(100),
765
+ options: z.object({
766
+ returnEntity: z.boolean().describe(
767
+ "Whether to return the full customization entities in the response.\n\nDefault: `false`"
768
+ ).optional()
769
+ }).optional()
770
+ });
771
+ var BulkCreateCustomizationsResponse = z.object({
772
+ results: z.array(
773
+ z.object({
774
+ itemMetadata: z.object({
775
+ _id: z.string().describe(
776
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
777
+ ).min(1).max(36).optional().nullable(),
778
+ originalIndex: z.number().int().describe(
779
+ "Index of the item within the request array. Allows for correlation between request and response items."
780
+ ).optional(),
781
+ success: z.boolean().describe(
782
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
783
+ ).optional(),
784
+ error: z.object({
785
+ code: z.string().describe("Error code.").optional(),
786
+ description: z.string().describe("Description of the error.").optional(),
787
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
788
+ }).describe("Details about the error in case of failure.").optional()
789
+ }).describe("Bulk action metadata for customization.").optional(),
790
+ customization: z.intersection(
791
+ z.object({
792
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
793
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
794
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
795
+ ).optional().nullable(),
796
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
797
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
798
+ key: z.string().describe(
799
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
800
+ ).min(1).max(50).optional().nullable(),
801
+ name: z.string().describe(
802
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
803
+ ).min(1).max(50).optional(),
804
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
805
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
806
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
807
+ ).optional(),
808
+ assignedProductsCount: z.number().int().describe(
809
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
810
+ ).optional().nullable()
811
+ }),
812
+ z.xor([
813
+ z.object({
814
+ freeTextInput: z.never().optional(),
815
+ choicesSettings: z.never().optional()
816
+ }),
817
+ z.object({
818
+ choicesSettings: z.never().optional(),
819
+ freeTextInput: z.object({
820
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
821
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
822
+ defaultAddedPrice: z.string().describe(
823
+ "Default amount added to a product's price when this choice is assigned to a modifier."
824
+ ).optional().nullable(),
825
+ title: z.string().describe(
826
+ "Title to display to customer for their free-text input."
827
+ ).min(1).max(100).optional(),
828
+ key: z.string().describe(
829
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
830
+ ).min(1).max(150).optional().nullable()
831
+ }).describe(
832
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
833
+ )
834
+ }),
835
+ z.object({
836
+ freeTextInput: z.never().optional(),
837
+ choicesSettings: z.object({
838
+ choices: z.array(
839
+ z.intersection(
840
+ z.object({
841
+ _id: z.string().describe("Choice ID.").regex(
842
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
843
+ "Must be a valid GUID"
844
+ ).optional(),
845
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
846
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
847
+ ).optional(),
848
+ key: z.string().describe(
849
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
850
+ ).min(1).max(50).optional().nullable(),
851
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
852
+ defaultAddedPrice: z.string().describe(
853
+ "Default amount added to a product's price when this customization is assigned to a modifier."
854
+ ).optional().nullable()
855
+ }),
856
+ z.xor([
857
+ z.object({ colorCode: z.never().optional() }),
858
+ z.object({
859
+ colorCode: z.string().describe(
860
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
861
+ ).min(3).max(20)
862
+ })
863
+ ])
864
+ )
865
+ ).min(1).max(200).optional()
866
+ }).describe(
867
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
868
+ )
869
+ })
870
+ ])
871
+ ).describe(
872
+ "Full customization entity.\n\nReturned only if `returnEntity: true` is passed in the request."
873
+ ).optional()
874
+ })
875
+ ).min(1).max(100).optional(),
876
+ bulkActionMetadata: z.object({
877
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
878
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
879
+ undetailedFailures: z.number().int().describe(
880
+ "Number of failures without details because detailed failure threshold was exceeded."
881
+ ).optional()
882
+ }).describe("Bulk action metadata.").optional()
883
+ });
884
+ var AddCustomizationChoicesRequest = z.object({
885
+ customizationId: z.string().describe("Customization ID.").regex(
886
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
887
+ "Must be a valid GUID"
888
+ ),
889
+ choices: z.array(
890
+ z.intersection(
891
+ z.object({
892
+ _id: z.string().describe("Choice ID.").regex(
893
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
894
+ "Must be a valid GUID"
895
+ ).optional(),
896
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
897
+ key: z.string().describe(
898
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
899
+ ).min(1).max(50).optional().nullable(),
900
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
901
+ defaultAddedPrice: z.string().describe(
902
+ "Default amount added to a product's price when this customization is assigned to a modifier."
903
+ ).optional().nullable()
904
+ }),
905
+ z.xor([
906
+ z.object({ colorCode: z.never().optional() }),
907
+ z.object({
908
+ colorCode: z.string().describe(
909
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
910
+ ).min(3).max(20)
911
+ })
912
+ ])
913
+ )
914
+ ).min(1).max(100),
915
+ options: z.object({
916
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
917
+ }).optional()
918
+ });
919
+ var AddCustomizationChoicesResponse = z.object({
920
+ customization: z.intersection(
921
+ z.object({
922
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
923
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
924
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
925
+ ).optional().nullable(),
926
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
927
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
928
+ key: z.string().describe(
929
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
930
+ ).min(1).max(50).optional().nullable(),
931
+ name: z.string().describe(
932
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
933
+ ).min(1).max(50).optional(),
934
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
935
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
936
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
937
+ ).optional(),
938
+ assignedProductsCount: z.number().int().describe(
939
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
940
+ ).optional().nullable()
941
+ }),
942
+ z.xor([
943
+ z.object({
944
+ freeTextInput: z.never().optional(),
945
+ choicesSettings: z.never().optional()
946
+ }),
947
+ z.object({
948
+ choicesSettings: z.never().optional(),
949
+ freeTextInput: z.object({
950
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
951
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
952
+ defaultAddedPrice: z.string().describe(
953
+ "Default amount added to a product's price when this choice is assigned to a modifier."
954
+ ).optional().nullable(),
955
+ title: z.string().describe(
956
+ "Title to display to customer for their free-text input."
957
+ ).min(1).max(100).optional(),
958
+ key: z.string().describe(
959
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
960
+ ).min(1).max(150).optional().nullable()
961
+ }).describe(
962
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
963
+ )
964
+ }),
965
+ z.object({
966
+ freeTextInput: z.never().optional(),
967
+ choicesSettings: z.object({
968
+ choices: z.array(
969
+ z.intersection(
970
+ z.object({
971
+ _id: z.string().describe("Choice ID.").regex(
972
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
973
+ "Must be a valid GUID"
974
+ ).optional(),
975
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
976
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
977
+ ).optional(),
978
+ key: z.string().describe(
979
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
980
+ ).min(1).max(50).optional().nullable(),
981
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
982
+ defaultAddedPrice: z.string().describe(
983
+ "Default amount added to a product's price when this customization is assigned to a modifier."
984
+ ).optional().nullable()
985
+ }),
986
+ z.xor([
987
+ z.object({ colorCode: z.never().optional() }),
988
+ z.object({
989
+ colorCode: z.string().describe(
990
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
991
+ ).min(3).max(20)
992
+ })
993
+ ])
994
+ )
995
+ ).min(1).max(200).optional()
996
+ }).describe(
997
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
998
+ )
999
+ })
1000
+ ])
1001
+ ).describe("Updated customization.").optional()
1002
+ });
1003
+ var SetCustomizationChoicesRequest = z.object({
1004
+ customizationId: z.string().describe("Customization ID.").regex(
1005
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1006
+ "Must be a valid GUID"
1007
+ ),
1008
+ choices: z.array(
1009
+ z.intersection(
1010
+ z.object({
1011
+ _id: z.string().describe("Choice ID.").regex(
1012
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1013
+ "Must be a valid GUID"
1014
+ ).optional(),
1015
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
1016
+ key: z.string().describe(
1017
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1018
+ ).min(1).max(50).optional().nullable(),
1019
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1020
+ defaultAddedPrice: z.string().describe(
1021
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1022
+ ).optional().nullable()
1023
+ }),
1024
+ z.xor([
1025
+ z.object({ colorCode: z.never().optional() }),
1026
+ z.object({
1027
+ colorCode: z.string().describe(
1028
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1029
+ ).min(3).max(20)
1030
+ })
1031
+ ])
1032
+ )
1033
+ ).min(1).max(200),
1034
+ options: z.object({
1035
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
1036
+ }).optional()
1037
+ });
1038
+ var SetCustomizationChoicesResponse = z.object({
1039
+ customization: z.intersection(
1040
+ z.object({
1041
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
1042
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1043
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
1044
+ ).optional().nullable(),
1045
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
1046
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
1047
+ key: z.string().describe(
1048
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1049
+ ).min(1).max(50).optional().nullable(),
1050
+ name: z.string().describe(
1051
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
1052
+ ).min(1).max(50).optional(),
1053
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
1054
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
1055
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
1056
+ ).optional(),
1057
+ assignedProductsCount: z.number().int().describe(
1058
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
1059
+ ).optional().nullable()
1060
+ }),
1061
+ z.xor([
1062
+ z.object({
1063
+ freeTextInput: z.never().optional(),
1064
+ choicesSettings: z.never().optional()
1065
+ }),
1066
+ z.object({
1067
+ choicesSettings: z.never().optional(),
1068
+ freeTextInput: z.object({
1069
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
1070
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
1071
+ defaultAddedPrice: z.string().describe(
1072
+ "Default amount added to a product's price when this choice is assigned to a modifier."
1073
+ ).optional().nullable(),
1074
+ title: z.string().describe(
1075
+ "Title to display to customer for their free-text input."
1076
+ ).min(1).max(100).optional(),
1077
+ key: z.string().describe(
1078
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1079
+ ).min(1).max(150).optional().nullable()
1080
+ }).describe(
1081
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
1082
+ )
1083
+ }),
1084
+ z.object({
1085
+ freeTextInput: z.never().optional(),
1086
+ choicesSettings: z.object({
1087
+ choices: z.array(
1088
+ z.intersection(
1089
+ z.object({
1090
+ _id: z.string().describe("Choice ID.").regex(
1091
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1092
+ "Must be a valid GUID"
1093
+ ).optional(),
1094
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
1095
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
1096
+ ).optional(),
1097
+ key: z.string().describe(
1098
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1099
+ ).min(1).max(50).optional().nullable(),
1100
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1101
+ defaultAddedPrice: z.string().describe(
1102
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1103
+ ).optional().nullable()
1104
+ }),
1105
+ z.xor([
1106
+ z.object({ colorCode: z.never().optional() }),
1107
+ z.object({
1108
+ colorCode: z.string().describe(
1109
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1110
+ ).min(3).max(20)
1111
+ })
1112
+ ])
1113
+ )
1114
+ ).min(1).max(200).optional()
1115
+ }).describe(
1116
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
1117
+ )
1118
+ })
1119
+ ])
1120
+ ).describe("Updated customization.").optional()
1121
+ });
1122
+ var RemoveCustomizationChoicesRequest = z.object({
1123
+ customizationId: z.string().describe("Customization ID.").regex(
1124
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1125
+ "Must be a valid GUID"
1126
+ ),
1127
+ choiceIds: z.array(z.string()).min(1).max(100),
1128
+ options: z.object({
1129
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Customization revision.").optional(),
1130
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
1131
+ }).optional()
1132
+ });
1133
+ var RemoveCustomizationChoicesResponse = z.object({
1134
+ customization: z.intersection(
1135
+ z.object({
1136
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
1137
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1138
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
1139
+ ).optional().nullable(),
1140
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
1141
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
1142
+ key: z.string().describe(
1143
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1144
+ ).min(1).max(50).optional().nullable(),
1145
+ name: z.string().describe(
1146
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
1147
+ ).min(1).max(50).optional(),
1148
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
1149
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
1150
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
1151
+ ).optional(),
1152
+ assignedProductsCount: z.number().int().describe(
1153
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
1154
+ ).optional().nullable()
1155
+ }),
1156
+ z.xor([
1157
+ z.object({
1158
+ freeTextInput: z.never().optional(),
1159
+ choicesSettings: z.never().optional()
1160
+ }),
1161
+ z.object({
1162
+ choicesSettings: z.never().optional(),
1163
+ freeTextInput: z.object({
1164
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
1165
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
1166
+ defaultAddedPrice: z.string().describe(
1167
+ "Default amount added to a product's price when this choice is assigned to a modifier."
1168
+ ).optional().nullable(),
1169
+ title: z.string().describe(
1170
+ "Title to display to customer for their free-text input."
1171
+ ).min(1).max(100).optional(),
1172
+ key: z.string().describe(
1173
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1174
+ ).min(1).max(150).optional().nullable()
1175
+ }).describe(
1176
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
1177
+ )
1178
+ }),
1179
+ z.object({
1180
+ freeTextInput: z.never().optional(),
1181
+ choicesSettings: z.object({
1182
+ choices: z.array(
1183
+ z.intersection(
1184
+ z.object({
1185
+ _id: z.string().describe("Choice ID.").regex(
1186
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1187
+ "Must be a valid GUID"
1188
+ ).optional(),
1189
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
1190
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
1191
+ ).optional(),
1192
+ key: z.string().describe(
1193
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1194
+ ).min(1).max(50).optional().nullable(),
1195
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1196
+ defaultAddedPrice: z.string().describe(
1197
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1198
+ ).optional().nullable()
1199
+ }),
1200
+ z.xor([
1201
+ z.object({ colorCode: z.never().optional() }),
1202
+ z.object({
1203
+ colorCode: z.string().describe(
1204
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1205
+ ).min(3).max(20)
1206
+ })
1207
+ ])
1208
+ )
1209
+ ).min(1).max(200).optional()
1210
+ }).describe(
1211
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
1212
+ )
1213
+ })
1214
+ ])
1215
+ ).describe("Updated customization.").optional()
1216
+ });
1217
+ var BulkAddCustomizationChoicesRequest = z.object({
1218
+ customizationsChoices: z.array(
1219
+ z.object({
1220
+ customizationId: z.string().describe("Customization ID.").min(1).max(36),
1221
+ choices: z.array(
1222
+ z.intersection(
1223
+ z.object({
1224
+ _id: z.string().describe("Choice ID.").regex(
1225
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1226
+ "Must be a valid GUID"
1227
+ ).optional(),
1228
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
1229
+ key: z.string().describe(
1230
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1231
+ ).min(1).max(50).optional().nullable(),
1232
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1233
+ defaultAddedPrice: z.string().describe(
1234
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1235
+ ).optional().nullable()
1236
+ }),
1237
+ z.xor([
1238
+ z.object({ colorCode: z.never().optional() }),
1239
+ z.object({
1240
+ colorCode: z.string().describe(
1241
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1242
+ ).min(3).max(20)
1243
+ })
1244
+ ])
1245
+ )
1246
+ ).min(1).max(100)
1247
+ })
1248
+ ).min(1).max(100),
1249
+ options: z.object({
1250
+ returnEntity: z.boolean().describe(
1251
+ "Whether to return the full customization entities in the response.\n\nDefault: `false`"
1252
+ ).optional(),
1253
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
1254
+ }).optional()
1255
+ });
1256
+ var BulkAddCustomizationChoicesResponse = z.object({
1257
+ results: z.array(
1258
+ z.object({
1259
+ itemMetadata: z.object({
1260
+ _id: z.string().describe(
1261
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
1262
+ ).min(1).max(36).optional().nullable(),
1263
+ originalIndex: z.number().int().describe(
1264
+ "Index of the item within the request array. Allows for correlation between request and response items."
1265
+ ).optional(),
1266
+ success: z.boolean().describe(
1267
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
1268
+ ).optional(),
1269
+ error: z.object({
1270
+ code: z.string().describe("Error code.").optional(),
1271
+ description: z.string().describe("Description of the error.").optional(),
1272
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
1273
+ }).describe("Details about the error in case of failure.").optional()
1274
+ }).describe("Bulk action metadata for customization.").optional(),
1275
+ customization: z.intersection(
1276
+ z.object({
1277
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
1278
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1279
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
1280
+ ).optional().nullable(),
1281
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
1282
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
1283
+ key: z.string().describe(
1284
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1285
+ ).min(1).max(50).optional().nullable(),
1286
+ name: z.string().describe(
1287
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
1288
+ ).min(1).max(50).optional(),
1289
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
1290
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
1291
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
1292
+ ).optional(),
1293
+ assignedProductsCount: z.number().int().describe(
1294
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
1295
+ ).optional().nullable()
1296
+ }),
1297
+ z.xor([
1298
+ z.object({
1299
+ freeTextInput: z.never().optional(),
1300
+ choicesSettings: z.never().optional()
1301
+ }),
1302
+ z.object({
1303
+ choicesSettings: z.never().optional(),
1304
+ freeTextInput: z.object({
1305
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
1306
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
1307
+ defaultAddedPrice: z.string().describe(
1308
+ "Default amount added to a product's price when this choice is assigned to a modifier."
1309
+ ).optional().nullable(),
1310
+ title: z.string().describe(
1311
+ "Title to display to customer for their free-text input."
1312
+ ).min(1).max(100).optional(),
1313
+ key: z.string().describe(
1314
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1315
+ ).min(1).max(150).optional().nullable()
1316
+ }).describe(
1317
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
1318
+ )
1319
+ }),
1320
+ z.object({
1321
+ freeTextInput: z.never().optional(),
1322
+ choicesSettings: z.object({
1323
+ choices: z.array(
1324
+ z.intersection(
1325
+ z.object({
1326
+ _id: z.string().describe("Choice ID.").regex(
1327
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1328
+ "Must be a valid GUID"
1329
+ ).optional(),
1330
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
1331
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
1332
+ ).optional(),
1333
+ key: z.string().describe(
1334
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1335
+ ).min(1).max(50).optional().nullable(),
1336
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1337
+ defaultAddedPrice: z.string().describe(
1338
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1339
+ ).optional().nullable()
1340
+ }),
1341
+ z.xor([
1342
+ z.object({ colorCode: z.never().optional() }),
1343
+ z.object({
1344
+ colorCode: z.string().describe(
1345
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1346
+ ).min(3).max(20)
1347
+ })
1348
+ ])
1349
+ )
1350
+ ).min(1).max(200).optional()
1351
+ }).describe(
1352
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
1353
+ )
1354
+ })
1355
+ ])
1356
+ ).describe(
1357
+ "Full customization entity.\n\nReturned only if `returnEntity: true` is passed in the request."
1358
+ ).optional()
1359
+ })
1360
+ ).min(1).max(100).optional(),
1361
+ bulkActionMetadata: z.object({
1362
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
1363
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
1364
+ undetailedFailures: z.number().int().describe(
1365
+ "Number of failures without details because detailed failure threshold was exceeded."
1366
+ ).optional()
1367
+ }).describe("Bulk action metadata.").optional()
1368
+ });
1369
+ var BulkUpdateCustomizationsRequest = z.object({
1370
+ customizations: z.array(
1371
+ z.object({
1372
+ customization: z.intersection(
1373
+ z.object({
1374
+ _id: z.string().describe("Customization ID.").min(1).max(36),
1375
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1376
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
1377
+ ),
1378
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
1379
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
1380
+ key: z.string().describe(
1381
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1382
+ ).min(1).max(50).optional().nullable(),
1383
+ name: z.string().describe(
1384
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
1385
+ ).min(1).max(50),
1386
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).optional(),
1387
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).optional(),
1388
+ assignedProductsCount: z.number().int().describe(
1389
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
1390
+ ).optional().nullable()
1391
+ }),
1392
+ z.xor([
1393
+ z.object({
1394
+ freeTextInput: z.never().optional(),
1395
+ choicesSettings: z.never().optional()
1396
+ }),
1397
+ z.object({
1398
+ choicesSettings: z.never().optional(),
1399
+ freeTextInput: z.object({
1400
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
1401
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
1402
+ defaultAddedPrice: z.string().describe(
1403
+ "Default amount added to a product's price when this choice is assigned to a modifier."
1404
+ ).optional().nullable(),
1405
+ title: z.string().describe(
1406
+ "Title to display to customer for their free-text input."
1407
+ ).min(1).max(100).optional(),
1408
+ key: z.string().describe(
1409
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1410
+ ).min(1).max(150).optional().nullable()
1411
+ }).describe(
1412
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
1413
+ )
1414
+ }),
1415
+ z.object({
1416
+ freeTextInput: z.never().optional(),
1417
+ choicesSettings: z.object({
1418
+ choices: z.array(
1419
+ z.intersection(
1420
+ z.object({
1421
+ _id: z.string().describe("Choice ID.").regex(
1422
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1423
+ "Must be a valid GUID"
1424
+ ).optional(),
1425
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
1426
+ key: z.string().describe(
1427
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1428
+ ).min(1).max(50).optional().nullable(),
1429
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1430
+ defaultAddedPrice: z.string().describe(
1431
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1432
+ ).optional().nullable()
1433
+ }),
1434
+ z.xor([
1435
+ z.object({ colorCode: z.never().optional() }),
1436
+ z.object({
1437
+ colorCode: z.string().describe(
1438
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1439
+ ).min(3).max(20)
1440
+ })
1441
+ ])
1442
+ )
1443
+ ).min(1).max(200).optional()
1444
+ }).describe(
1445
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
1446
+ )
1447
+ })
1448
+ ])
1449
+ ).describe("Customization to update.").optional()
1450
+ })
1451
+ ).min(1).max(100),
1452
+ options: z.object({
1453
+ returnEntity: z.boolean().describe(
1454
+ "Whether to return the full customization entities in the response.\n\nDefault: `false`"
1455
+ ).optional(),
1456
+ fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
1457
+ }).optional()
1458
+ });
1459
+ var BulkUpdateCustomizationsResponse = z.object({
1460
+ results: z.array(
1461
+ z.object({
1462
+ itemMetadata: z.object({
1463
+ _id: z.string().describe(
1464
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
1465
+ ).min(1).max(36).optional().nullable(),
1466
+ originalIndex: z.number().int().describe(
1467
+ "Index of the item within the request array. Allows for correlation between request and response items."
1468
+ ).optional(),
1469
+ success: z.boolean().describe(
1470
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
1471
+ ).optional(),
1472
+ error: z.object({
1473
+ code: z.string().describe("Error code.").optional(),
1474
+ description: z.string().describe("Description of the error.").optional(),
1475
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
1476
+ }).describe("Details about the error in case of failure.").optional()
1477
+ }).describe("Bulk action metadata for customization.").optional(),
1478
+ customization: z.intersection(
1479
+ z.object({
1480
+ _id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
1481
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1482
+ "Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
1483
+ ).optional().nullable(),
1484
+ _createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
1485
+ _updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
1486
+ key: z.string().describe(
1487
+ "A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1488
+ ).min(1).max(50).optional().nullable(),
1489
+ name: z.string().describe(
1490
+ 'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
1491
+ ).min(1).max(50).optional(),
1492
+ customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
1493
+ customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
1494
+ "Customization render type.\n\nDefines how the customization will be displayed in the storefront."
1495
+ ).optional(),
1496
+ assignedProductsCount: z.number().int().describe(
1497
+ 'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
1498
+ ).optional().nullable()
1499
+ }),
1500
+ z.xor([
1501
+ z.object({
1502
+ freeTextInput: z.never().optional(),
1503
+ choicesSettings: z.never().optional()
1504
+ }),
1505
+ z.object({
1506
+ choicesSettings: z.never().optional(),
1507
+ freeTextInput: z.object({
1508
+ minCharCount: z.number().int().describe("Minimum text character length.").optional(),
1509
+ maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
1510
+ defaultAddedPrice: z.string().describe(
1511
+ "Default amount added to a product's price when this choice is assigned to a modifier."
1512
+ ).optional().nullable(),
1513
+ title: z.string().describe(
1514
+ "Title to display to customer for their free-text input."
1515
+ ).min(1).max(100).optional(),
1516
+ key: z.string().describe(
1517
+ "A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1518
+ ).min(1).max(150).optional().nullable()
1519
+ }).describe(
1520
+ "Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
1521
+ )
1522
+ }),
1523
+ z.object({
1524
+ freeTextInput: z.never().optional(),
1525
+ choicesSettings: z.object({
1526
+ choices: z.array(
1527
+ z.intersection(
1528
+ z.object({
1529
+ _id: z.string().describe("Choice ID.").regex(
1530
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1531
+ "Must be a valid GUID"
1532
+ ).optional(),
1533
+ choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
1534
+ "Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
1535
+ ).optional(),
1536
+ key: z.string().describe(
1537
+ "A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
1538
+ ).min(1).max(50).optional().nullable(),
1539
+ name: z.string().describe("Choice name.").min(1).max(50).optional(),
1540
+ defaultAddedPrice: z.string().describe(
1541
+ "Default amount added to a product's price when this customization is assigned to a modifier."
1542
+ ).optional().nullable()
1543
+ }),
1544
+ z.xor([
1545
+ z.object({ colorCode: z.never().optional() }),
1546
+ z.object({
1547
+ colorCode: z.string().describe(
1548
+ "Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
1549
+ ).min(3).max(20)
1550
+ })
1551
+ ])
1552
+ )
1553
+ ).min(1).max(200).optional()
1554
+ }).describe(
1555
+ "Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
1556
+ )
1557
+ })
1558
+ ])
1559
+ ).describe(
1560
+ "Full customization entity.\n\nReturned only if `returnEntity: true` is passed in the request."
1561
+ ).optional()
1562
+ })
1563
+ ).min(1).max(100).optional(),
1564
+ bulkActionMetadata: z.object({
1565
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
1566
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
1567
+ undetailedFailures: z.number().int().describe(
1568
+ "Number of failures without details because detailed failure threshold was exceeded."
1569
+ ).optional()
1570
+ }).describe("Bulk action metadata.").optional()
1571
+ });
1572
+ // Annotate the CommonJS export names for ESM import in node:
1573
+ 0 && (module.exports = {
1574
+ AddCustomizationChoicesRequest,
1575
+ AddCustomizationChoicesResponse,
1576
+ BulkAddCustomizationChoicesRequest,
1577
+ BulkAddCustomizationChoicesResponse,
1578
+ BulkCreateCustomizationsRequest,
1579
+ BulkCreateCustomizationsResponse,
1580
+ BulkUpdateCustomizationsRequest,
1581
+ BulkUpdateCustomizationsResponse,
1582
+ CreateCustomizationRequest,
1583
+ CreateCustomizationResponse,
1584
+ DeleteCustomizationRequest,
1585
+ DeleteCustomizationResponse,
1586
+ GetCustomizationRequest,
1587
+ GetCustomizationResponse,
1588
+ QueryCustomizationsRequest,
1589
+ QueryCustomizationsResponse,
1590
+ RemoveCustomizationChoicesRequest,
1591
+ RemoveCustomizationChoicesResponse,
1592
+ SetCustomizationChoicesRequest,
1593
+ SetCustomizationChoicesResponse,
1594
+ UpdateCustomizationRequest,
1595
+ UpdateCustomizationResponse
1596
+ });
1597
+ //# sourceMappingURL=schemas.js.map