@wix/auto_sdk_benefit-programs_items 1.0.51 → 1.0.53

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,876 @@
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
+ BulkCreateItemsRequest: () => BulkCreateItemsRequest,
34
+ BulkCreateItemsResponse: () => BulkCreateItemsResponse,
35
+ BulkDeleteItemsByFilterRequest: () => BulkDeleteItemsByFilterRequest,
36
+ BulkDeleteItemsByFilterResponse: () => BulkDeleteItemsByFilterResponse,
37
+ BulkDeleteItemsRequest: () => BulkDeleteItemsRequest,
38
+ BulkDeleteItemsResponse: () => BulkDeleteItemsResponse,
39
+ BulkUpdateItemsRequest: () => BulkUpdateItemsRequest,
40
+ BulkUpdateItemsResponse: () => BulkUpdateItemsResponse,
41
+ CountItemsRequest: () => CountItemsRequest,
42
+ CountItemsResponse: () => CountItemsResponse,
43
+ CreateItemRequest: () => CreateItemRequest,
44
+ CreateItemResponse: () => CreateItemResponse,
45
+ DeleteItemRequest: () => DeleteItemRequest,
46
+ DeleteItemResponse: () => DeleteItemResponse,
47
+ GetItemRequest: () => GetItemRequest,
48
+ GetItemResponse: () => GetItemResponse,
49
+ ListItemsRequest: () => ListItemsRequest,
50
+ ListItemsResponse: () => ListItemsResponse,
51
+ QueryItemsRequest: () => QueryItemsRequest,
52
+ QueryItemsResponse: () => QueryItemsResponse,
53
+ UpdateItemRequest: () => UpdateItemRequest,
54
+ UpdateItemResponse: () => UpdateItemResponse
55
+ });
56
+ module.exports = __toCommonJS(schemas_exports);
57
+
58
+ // src/benefit-programs-v1-item-items.schemas.ts
59
+ var z = __toESM(require("zod"));
60
+ var CreateItemRequest = z.object({
61
+ item: z.object({
62
+ _id: z.string().describe("Benefit item ID.").regex(
63
+ /^[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}$/,
64
+ "Must be a valid GUID"
65
+ ).optional().nullable(),
66
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
67
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
68
+ ).optional().nullable(),
69
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
70
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
71
+ externalId: z.string().describe(
72
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
73
+ ).regex(
74
+ /^[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}$/,
75
+ "Must be a valid GUID"
76
+ ),
77
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
78
+ itemSetId: z.string().describe(
79
+ "Item set ID of the benefit that this benefit item is a part of."
80
+ ).regex(
81
+ /^[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}$/,
82
+ "Must be a valid GUID"
83
+ ),
84
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
85
+ providerAppId: z.string().describe(
86
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
87
+ ).regex(
88
+ /^[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}$/,
89
+ "Must be a valid GUID"
90
+ ),
91
+ extendedFields: z.object({
92
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
93
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
94
+ ).optional()
95
+ }).describe(
96
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
97
+ ).optional(),
98
+ namespace: z.string().describe(
99
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
100
+ ).min(1).max(20)
101
+ }).describe("Item to create.")
102
+ });
103
+ var CreateItemResponse = z.object({
104
+ _id: z.string().describe("Benefit item ID.").regex(
105
+ /^[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}$/,
106
+ "Must be a valid GUID"
107
+ ).optional().nullable(),
108
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
109
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
110
+ ).optional().nullable(),
111
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
112
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
113
+ externalId: z.string().describe(
114
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
115
+ ).regex(
116
+ /^[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}$/,
117
+ "Must be a valid GUID"
118
+ ).optional().nullable(),
119
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
120
+ itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
121
+ /^[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}$/,
122
+ "Must be a valid GUID"
123
+ ).optional().nullable(),
124
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
125
+ providerAppId: z.string().describe(
126
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
127
+ ).regex(
128
+ /^[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}$/,
129
+ "Must be a valid GUID"
130
+ ).optional().nullable(),
131
+ extendedFields: z.object({
132
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
133
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
134
+ ).optional()
135
+ }).describe(
136
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
137
+ ).optional(),
138
+ namespace: z.string().describe(
139
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
140
+ ).min(1).max(20).optional().nullable()
141
+ });
142
+ var BulkCreateItemsRequest = z.object({
143
+ items: z.array(
144
+ z.object({
145
+ _id: z.string().describe("Benefit item ID.").regex(
146
+ /^[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}$/,
147
+ "Must be a valid GUID"
148
+ ).optional().nullable(),
149
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
150
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
151
+ ).optional().nullable(),
152
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
153
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
154
+ externalId: z.string().describe(
155
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
156
+ ).regex(
157
+ /^[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}$/,
158
+ "Must be a valid GUID"
159
+ ),
160
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
161
+ itemSetId: z.string().describe(
162
+ "Item set ID of the benefit that this benefit item is a part of."
163
+ ).regex(
164
+ /^[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}$/,
165
+ "Must be a valid GUID"
166
+ ),
167
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
168
+ providerAppId: z.string().describe(
169
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
170
+ ).regex(
171
+ /^[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}$/,
172
+ "Must be a valid GUID"
173
+ ),
174
+ extendedFields: z.object({
175
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
176
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
177
+ ).optional()
178
+ }).describe(
179
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
180
+ ).optional(),
181
+ namespace: z.string().describe(
182
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
183
+ ).min(1).max(20)
184
+ })
185
+ ).min(1).max(100),
186
+ options: z.object({
187
+ returnEntity: z.boolean().describe(
188
+ "Whether to return the full item entities.\n\nDefault: `false`"
189
+ ).optional()
190
+ }).optional()
191
+ });
192
+ var BulkCreateItemsResponse = z.object({
193
+ results: z.array(
194
+ z.object({
195
+ itemMetadata: z.object({
196
+ _id: z.string().describe(
197
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
198
+ ).regex(
199
+ /^[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}$/,
200
+ "Must be a valid GUID"
201
+ ).optional().nullable(),
202
+ originalIndex: z.number().int().describe(
203
+ "Index of the item within the request array. Allows for correlation between request and response items."
204
+ ).optional(),
205
+ success: z.boolean().describe(
206
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
207
+ ).optional(),
208
+ error: z.object({
209
+ code: z.string().describe("Error code.").optional(),
210
+ description: z.string().describe("Description of the error.").optional(),
211
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
212
+ }).describe("Details about the error in case of failure.").optional()
213
+ }).describe("Item metadata.").optional(),
214
+ item: z.object({
215
+ _id: z.string().describe("Benefit item ID.").regex(
216
+ /^[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}$/,
217
+ "Must be a valid GUID"
218
+ ).optional().nullable(),
219
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
220
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
221
+ ).optional().nullable(),
222
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
223
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
224
+ externalId: z.string().describe(
225
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
226
+ ).regex(
227
+ /^[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}$/,
228
+ "Must be a valid GUID"
229
+ ).optional().nullable(),
230
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
231
+ itemSetId: z.string().describe(
232
+ "Item set ID of the benefit that this benefit item is a part of."
233
+ ).regex(
234
+ /^[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}$/,
235
+ "Must be a valid GUID"
236
+ ).optional().nullable(),
237
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
238
+ providerAppId: z.string().describe(
239
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
240
+ ).regex(
241
+ /^[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}$/,
242
+ "Must be a valid GUID"
243
+ ).optional().nullable(),
244
+ extendedFields: z.object({
245
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
246
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
247
+ ).optional()
248
+ }).describe(
249
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
250
+ ).optional(),
251
+ namespace: z.string().describe(
252
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
253
+ ).min(1).max(20).optional().nullable()
254
+ }).describe("Item.").optional()
255
+ })
256
+ ).min(1).max(100).optional(),
257
+ bulkActionMetadata: z.object({
258
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
259
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
260
+ undetailedFailures: z.number().int().describe(
261
+ "Number of failures without details because detailed failure threshold was exceeded."
262
+ ).optional()
263
+ }).describe("Bulk action metadata.").optional()
264
+ });
265
+ var DeleteItemRequest = z.object({
266
+ itemId: z.string().describe("Item ID.").regex(
267
+ /^[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}$/,
268
+ "Must be a valid GUID"
269
+ )
270
+ });
271
+ var DeleteItemResponse = z.object({});
272
+ var BulkDeleteItemsRequest = z.object({
273
+ itemIds: z.array(z.string()).min(1).max(100)
274
+ });
275
+ var BulkDeleteItemsResponse = z.object({
276
+ results: z.array(
277
+ z.object({
278
+ itemMetadata: z.object({
279
+ _id: z.string().describe(
280
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
281
+ ).regex(
282
+ /^[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}$/,
283
+ "Must be a valid GUID"
284
+ ).optional().nullable(),
285
+ originalIndex: z.number().int().describe(
286
+ "Index of the item within the request array. Allows for correlation between request and response items."
287
+ ).optional(),
288
+ success: z.boolean().describe(
289
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
290
+ ).optional(),
291
+ error: z.object({
292
+ code: z.string().describe("Error code.").optional(),
293
+ description: z.string().describe("Description of the error.").optional(),
294
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
295
+ }).describe("Details about the error in case of failure.").optional()
296
+ }).describe("Item metadata.").optional(),
297
+ item: z.object({
298
+ _id: z.string().describe("Benefit item ID.").regex(
299
+ /^[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}$/,
300
+ "Must be a valid GUID"
301
+ ).optional().nullable(),
302
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
303
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
304
+ ).optional().nullable(),
305
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
306
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
307
+ externalId: z.string().describe(
308
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
309
+ ).regex(
310
+ /^[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}$/,
311
+ "Must be a valid GUID"
312
+ ).optional().nullable(),
313
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
314
+ itemSetId: z.string().describe(
315
+ "Item set ID of the benefit that this benefit item is a part of."
316
+ ).regex(
317
+ /^[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}$/,
318
+ "Must be a valid GUID"
319
+ ).optional().nullable(),
320
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
321
+ providerAppId: z.string().describe(
322
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
323
+ ).regex(
324
+ /^[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}$/,
325
+ "Must be a valid GUID"
326
+ ).optional().nullable(),
327
+ extendedFields: z.object({
328
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
329
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
330
+ ).optional()
331
+ }).describe(
332
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
333
+ ).optional(),
334
+ namespace: z.string().describe(
335
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
336
+ ).min(1).max(20).optional().nullable()
337
+ }).describe("Item.").optional()
338
+ })
339
+ ).min(1).max(100).optional(),
340
+ bulkActionMetadata: z.object({
341
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
342
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
343
+ undetailedFailures: z.number().int().describe(
344
+ "Number of failures without details because detailed failure threshold was exceeded."
345
+ ).optional()
346
+ }).describe("Bulk action metadata.").optional()
347
+ });
348
+ var BulkDeleteItemsByFilterRequest = z.object({
349
+ namespace: z.string().describe(
350
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
351
+ ).min(1).max(20),
352
+ options: z.object({
353
+ filter: z.record(z.string(), z.any()).describe(
354
+ "Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
355
+ ).optional().nullable()
356
+ }).optional()
357
+ });
358
+ var BulkDeleteItemsByFilterResponse = z.object({
359
+ jobId: z.string().describe(
360
+ "Job ID for item deletion. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
361
+ ).regex(
362
+ /^[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}$/,
363
+ "Must be a valid GUID"
364
+ ).optional()
365
+ });
366
+ var UpdateItemRequest = z.object({
367
+ _id: z.string().describe("Benefit item ID.").regex(
368
+ /^[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}$/,
369
+ "Must be a valid GUID"
370
+ ),
371
+ item: z.object({
372
+ _id: z.string().describe("Benefit item ID.").regex(
373
+ /^[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}$/,
374
+ "Must be a valid GUID"
375
+ ).optional().nullable(),
376
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
377
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
378
+ ),
379
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
380
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
381
+ externalId: z.string().describe(
382
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
383
+ ).regex(
384
+ /^[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}$/,
385
+ "Must be a valid GUID"
386
+ ).optional().nullable(),
387
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
388
+ itemSetId: z.string().describe(
389
+ "Item set ID of the benefit that this benefit item is a part of."
390
+ ).regex(
391
+ /^[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}$/,
392
+ "Must be a valid GUID"
393
+ ).optional().nullable(),
394
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
395
+ providerAppId: z.string().describe(
396
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
397
+ ).regex(
398
+ /^[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}$/,
399
+ "Must be a valid GUID"
400
+ ).optional().nullable(),
401
+ extendedFields: z.object({
402
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
403
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
404
+ ).optional()
405
+ }).describe(
406
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
407
+ ).optional(),
408
+ namespace: z.string().describe(
409
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
410
+ ).min(1).max(20).optional().nullable()
411
+ }).describe("Item to update.")
412
+ });
413
+ var UpdateItemResponse = z.object({
414
+ _id: z.string().describe("Benefit item ID.").regex(
415
+ /^[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}$/,
416
+ "Must be a valid GUID"
417
+ ).optional().nullable(),
418
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
419
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
420
+ ).optional().nullable(),
421
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
422
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
423
+ externalId: z.string().describe(
424
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
425
+ ).regex(
426
+ /^[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}$/,
427
+ "Must be a valid GUID"
428
+ ).optional().nullable(),
429
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
430
+ itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
431
+ /^[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}$/,
432
+ "Must be a valid GUID"
433
+ ).optional().nullable(),
434
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
435
+ providerAppId: z.string().describe(
436
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
437
+ ).regex(
438
+ /^[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}$/,
439
+ "Must be a valid GUID"
440
+ ).optional().nullable(),
441
+ extendedFields: z.object({
442
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
443
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
444
+ ).optional()
445
+ }).describe(
446
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
447
+ ).optional(),
448
+ namespace: z.string().describe(
449
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
450
+ ).min(1).max(20).optional().nullable()
451
+ });
452
+ var BulkUpdateItemsRequest = z.object({
453
+ options: z.object({
454
+ items: z.array(
455
+ z.object({
456
+ item: z.object({
457
+ _id: z.string().describe("Benefit item ID.").regex(
458
+ /^[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}$/,
459
+ "Must be a valid GUID"
460
+ ),
461
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
462
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
463
+ ),
464
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
465
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
466
+ externalId: z.string().describe(
467
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
468
+ ).regex(
469
+ /^[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}$/,
470
+ "Must be a valid GUID"
471
+ ).optional().nullable(),
472
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
473
+ itemSetId: z.string().describe(
474
+ "Item set ID of the benefit that this benefit item is a part of."
475
+ ).regex(
476
+ /^[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}$/,
477
+ "Must be a valid GUID"
478
+ ).optional().nullable(),
479
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
480
+ providerAppId: z.string().describe(
481
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
482
+ ).regex(
483
+ /^[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}$/,
484
+ "Must be a valid GUID"
485
+ ).optional().nullable(),
486
+ extendedFields: z.object({
487
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
488
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
489
+ ).optional()
490
+ }).describe(
491
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
492
+ ).optional(),
493
+ namespace: z.string().describe(
494
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
495
+ ).min(1).max(20).optional().nullable()
496
+ }).describe("Item to update."),
497
+ fieldMask: z.array(z.string()).optional()
498
+ })
499
+ ).min(1).max(100).optional(),
500
+ returnEntity: z.boolean().describe(
501
+ "Whether to return the full item entities.\n\nDefault: `false`"
502
+ ).optional()
503
+ }).optional()
504
+ });
505
+ var BulkUpdateItemsResponse = z.object({
506
+ results: z.array(
507
+ z.object({
508
+ itemMetadata: z.object({
509
+ _id: z.string().describe(
510
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
511
+ ).regex(
512
+ /^[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}$/,
513
+ "Must be a valid GUID"
514
+ ).optional().nullable(),
515
+ originalIndex: z.number().int().describe(
516
+ "Index of the item within the request array. Allows for correlation between request and response items."
517
+ ).optional(),
518
+ success: z.boolean().describe(
519
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
520
+ ).optional(),
521
+ error: z.object({
522
+ code: z.string().describe("Error code.").optional(),
523
+ description: z.string().describe("Description of the error.").optional(),
524
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
525
+ }).describe("Details about the error in case of failure.").optional()
526
+ }).describe("Item metadata.").optional(),
527
+ item: z.object({
528
+ _id: z.string().describe("Benefit item ID.").regex(
529
+ /^[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}$/,
530
+ "Must be a valid GUID"
531
+ ).optional().nullable(),
532
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
533
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
534
+ ).optional().nullable(),
535
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
536
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
537
+ externalId: z.string().describe(
538
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
539
+ ).regex(
540
+ /^[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}$/,
541
+ "Must be a valid GUID"
542
+ ).optional().nullable(),
543
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
544
+ itemSetId: z.string().describe(
545
+ "Item set ID of the benefit that this benefit item is a part of."
546
+ ).regex(
547
+ /^[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}$/,
548
+ "Must be a valid GUID"
549
+ ).optional().nullable(),
550
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
551
+ providerAppId: z.string().describe(
552
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
553
+ ).regex(
554
+ /^[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}$/,
555
+ "Must be a valid GUID"
556
+ ).optional().nullable(),
557
+ extendedFields: z.object({
558
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
559
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
560
+ ).optional()
561
+ }).describe(
562
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
563
+ ).optional(),
564
+ namespace: z.string().describe(
565
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
566
+ ).min(1).max(20).optional().nullable()
567
+ }).describe("Item.").optional()
568
+ })
569
+ ).min(1).max(100).optional(),
570
+ bulkActionMetadata: z.object({
571
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
572
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
573
+ undetailedFailures: z.number().int().describe(
574
+ "Number of failures without details because detailed failure threshold was exceeded."
575
+ ).optional()
576
+ }).describe("Bulk action metadata.").optional()
577
+ });
578
+ var GetItemRequest = z.object({
579
+ itemId: z.string().describe("ID of the item to retrieve.").regex(
580
+ /^[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}$/,
581
+ "Must be a valid GUID"
582
+ )
583
+ });
584
+ var GetItemResponse = z.object({
585
+ _id: z.string().describe("Benefit item ID.").regex(
586
+ /^[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}$/,
587
+ "Must be a valid GUID"
588
+ ).optional().nullable(),
589
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
590
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
591
+ ).optional().nullable(),
592
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
593
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
594
+ externalId: z.string().describe(
595
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
596
+ ).regex(
597
+ /^[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}$/,
598
+ "Must be a valid GUID"
599
+ ).optional().nullable(),
600
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
601
+ itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
602
+ /^[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}$/,
603
+ "Must be a valid GUID"
604
+ ).optional().nullable(),
605
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
606
+ providerAppId: z.string().describe(
607
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
608
+ ).regex(
609
+ /^[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}$/,
610
+ "Must be a valid GUID"
611
+ ).optional().nullable(),
612
+ extendedFields: z.object({
613
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
614
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
615
+ ).optional()
616
+ }).describe(
617
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
618
+ ).optional(),
619
+ namespace: z.string().describe(
620
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
621
+ ).min(1).max(20).optional().nullable()
622
+ });
623
+ var ListItemsRequest = z.object({
624
+ options: z.object({
625
+ filter: z.intersection(
626
+ z.object({
627
+ type: z.enum(["BY_ITEM_SET_ID_AND_REFERENCE", "BY_REFERENCE"]).optional(),
628
+ namespace: z.string().describe("Filter by namespace.").min(1).max(20).optional()
629
+ }),
630
+ z.xor([
631
+ z.object({
632
+ byItemSetIdAndReferenceOptions: z.never().optional(),
633
+ byReferenceOptions: z.never().optional()
634
+ }),
635
+ z.object({
636
+ byReferenceOptions: z.never().optional(),
637
+ byItemSetIdAndReferenceOptions: z.object({
638
+ filters: z.array(
639
+ z.object({
640
+ itemSetId: z.string().describe("ID set ID.").regex(
641
+ /^[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}$/,
642
+ "Must be a valid GUID"
643
+ ).optional(),
644
+ externalId: z.string().describe("External item ID.").regex(
645
+ /^[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}$/,
646
+ "Must be a valid GUID"
647
+ ).optional(),
648
+ category: z.string().describe("Item category.").max(20).optional(),
649
+ providerAppId: z.string().describe(
650
+ "*Required**. ID of the app providing the item."
651
+ ).regex(
652
+ /^[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}$/,
653
+ "Must be a valid GUID"
654
+ ).optional()
655
+ })
656
+ ).min(1).max(100).optional()
657
+ }).describe(
658
+ "Filter the request by `itemSetId` and item reference."
659
+ )
660
+ }),
661
+ z.object({
662
+ byItemSetIdAndReferenceOptions: z.never().optional(),
663
+ byReferenceOptions: z.object({
664
+ filters: z.array(
665
+ z.object({
666
+ externalId: z.string().describe("External item ID.").regex(
667
+ /^[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}$/,
668
+ "Must be a valid GUID"
669
+ ).optional(),
670
+ category: z.string().describe("Item category.").max(20).optional(),
671
+ providerAppId: z.string().describe(
672
+ "*Required**. ID of the app providing the item."
673
+ ).regex(
674
+ /^[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}$/,
675
+ "Must be a valid GUID"
676
+ ).optional()
677
+ })
678
+ ).min(1).max(100).optional()
679
+ }).describe("Filter the request item reference.")
680
+ })
681
+ ])
682
+ ).describe("Filter.").optional(),
683
+ cursorPaging: z.object({
684
+ limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
685
+ cursor: z.string().describe(
686
+ "Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
687
+ ).max(16e3).optional().nullable()
688
+ }).describe("Cursor paging").optional()
689
+ }).optional()
690
+ });
691
+ var ListItemsResponse = z.object({
692
+ items: z.array(
693
+ z.object({
694
+ _id: z.string().describe("Benefit item ID.").regex(
695
+ /^[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}$/,
696
+ "Must be a valid GUID"
697
+ ).optional().nullable(),
698
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
699
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
700
+ ).optional().nullable(),
701
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
702
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
703
+ externalId: z.string().describe(
704
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
705
+ ).regex(
706
+ /^[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}$/,
707
+ "Must be a valid GUID"
708
+ ).optional().nullable(),
709
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
710
+ itemSetId: z.string().describe(
711
+ "Item set ID of the benefit that this benefit item is a part of."
712
+ ).regex(
713
+ /^[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}$/,
714
+ "Must be a valid GUID"
715
+ ).optional().nullable(),
716
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
717
+ providerAppId: z.string().describe(
718
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
719
+ ).regex(
720
+ /^[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}$/,
721
+ "Must be a valid GUID"
722
+ ).optional().nullable(),
723
+ extendedFields: z.object({
724
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
725
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
726
+ ).optional()
727
+ }).describe(
728
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
729
+ ).optional(),
730
+ namespace: z.string().describe(
731
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
732
+ ).min(1).max(20).optional().nullable()
733
+ })
734
+ ).optional(),
735
+ metadata: z.object({
736
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
737
+ cursors: z.object({
738
+ next: z.string().describe(
739
+ "Cursor string pointing to the next page in the list of results."
740
+ ).max(16e3).optional().nullable(),
741
+ prev: z.string().describe(
742
+ "Cursor pointing to the previous page in the list of results."
743
+ ).max(16e3).optional().nullable()
744
+ }).describe(
745
+ "Cursor strings that point to the next page, previous page, or both."
746
+ ).optional(),
747
+ hasNext: z.boolean().describe(
748
+ "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."
749
+ ).optional().nullable()
750
+ }).describe("Metadata for paginated results.").optional()
751
+ });
752
+ var QueryItemsRequest = z.object({
753
+ query: z.intersection(
754
+ z.object({
755
+ filter: z.record(z.string(), z.any()).describe(
756
+ 'Filter object in the following format:\n`"filter" : {\n"fieldName1": "value1",\n"fieldName2":{"$operator":"value2"}\n}`\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'
757
+ ).optional().nullable(),
758
+ sort: z.array(
759
+ z.object({
760
+ fieldName: z.string().describe("Field to sort by.").max(512).optional(),
761
+ order: z.enum(["ASC", "DESC"]).optional()
762
+ })
763
+ ).max(5).optional()
764
+ }),
765
+ z.xor([
766
+ z.object({ cursorPaging: z.never().optional() }),
767
+ z.object({
768
+ cursorPaging: z.object({
769
+ limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
770
+ cursor: z.string().describe(
771
+ "Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
772
+ ).max(16e3).optional().nullable()
773
+ }).describe(
774
+ "Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`."
775
+ )
776
+ })
777
+ ])
778
+ ).describe("Filter, sort, and paging to apply to the query.")
779
+ });
780
+ var QueryItemsResponse = z.object({
781
+ items: z.array(
782
+ z.object({
783
+ _id: z.string().describe("Benefit item ID.").regex(
784
+ /^[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}$/,
785
+ "Must be a valid GUID"
786
+ ).optional().nullable(),
787
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
788
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
789
+ ).optional().nullable(),
790
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
791
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
792
+ externalId: z.string().describe(
793
+ "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
794
+ ).regex(
795
+ /^[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}$/,
796
+ "Must be a valid GUID"
797
+ ).optional().nullable(),
798
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
799
+ itemSetId: z.string().describe(
800
+ "Item set ID of the benefit that this benefit item is a part of."
801
+ ).regex(
802
+ /^[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}$/,
803
+ "Must be a valid GUID"
804
+ ).optional().nullable(),
805
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
806
+ providerAppId: z.string().describe(
807
+ "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
808
+ ).regex(
809
+ /^[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}$/,
810
+ "Must be a valid GUID"
811
+ ).optional().nullable(),
812
+ extendedFields: z.object({
813
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
814
+ "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
815
+ ).optional()
816
+ }).describe(
817
+ "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
818
+ ).optional(),
819
+ namespace: z.string().describe(
820
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
821
+ ).min(1).max(20).optional().nullable()
822
+ })
823
+ ).optional(),
824
+ metadata: z.object({
825
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
826
+ cursors: z.object({
827
+ next: z.string().describe(
828
+ "Cursor string pointing to the next page in the list of results."
829
+ ).max(16e3).optional().nullable(),
830
+ prev: z.string().describe(
831
+ "Cursor pointing to the previous page in the list of results."
832
+ ).max(16e3).optional().nullable()
833
+ }).describe(
834
+ "Cursor strings that point to the next page, previous page, or both."
835
+ ).optional(),
836
+ hasNext: z.boolean().describe(
837
+ "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."
838
+ ).optional().nullable()
839
+ }).describe("Metadata for paginated results.").optional()
840
+ });
841
+ var CountItemsRequest = z.object({
842
+ options: z.object({
843
+ filter: z.record(z.string(), z.any()).describe(
844
+ "Items to count.\n\nFilter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
845
+ ).optional().nullable()
846
+ }).optional()
847
+ });
848
+ var CountItemsResponse = z.object({
849
+ count: z.number().int().describe("Number of items fulfilling the specified filter conditions.").optional()
850
+ });
851
+ // Annotate the CommonJS export names for ESM import in node:
852
+ 0 && (module.exports = {
853
+ BulkCreateItemsRequest,
854
+ BulkCreateItemsResponse,
855
+ BulkDeleteItemsByFilterRequest,
856
+ BulkDeleteItemsByFilterResponse,
857
+ BulkDeleteItemsRequest,
858
+ BulkDeleteItemsResponse,
859
+ BulkUpdateItemsRequest,
860
+ BulkUpdateItemsResponse,
861
+ CountItemsRequest,
862
+ CountItemsResponse,
863
+ CreateItemRequest,
864
+ CreateItemResponse,
865
+ DeleteItemRequest,
866
+ DeleteItemResponse,
867
+ GetItemRequest,
868
+ GetItemResponse,
869
+ ListItemsRequest,
870
+ ListItemsResponse,
871
+ QueryItemsRequest,
872
+ QueryItemsResponse,
873
+ UpdateItemRequest,
874
+ UpdateItemResponse
875
+ });
876
+ //# sourceMappingURL=schemas.js.map