@wix/auto_sdk_forms_submissions 1.0.109 → 1.0.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/cjs/{forms-v4-submission-submissions.universal-DmrA9Uxi.d.ts → forms-v4-submission-submissions.universal-B2-JQqx2.d.ts} +55 -30
  2. package/build/cjs/index.d.ts +2 -2
  3. package/build/cjs/index.js +10 -0
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/index.typings.d.ts +2 -2
  6. package/build/cjs/index.typings.js +10 -0
  7. package/build/cjs/index.typings.js.map +1 -1
  8. package/build/cjs/meta.d.ts +56 -31
  9. package/build/cjs/meta.js +10 -0
  10. package/build/cjs/meta.js.map +1 -1
  11. package/build/cjs/schemas.d.ts +1351 -0
  12. package/build/cjs/schemas.js +2318 -0
  13. package/build/cjs/schemas.js.map +1 -0
  14. package/build/es/{forms-v4-submission-submissions.universal-DmrA9Uxi.d.mts → forms-v4-submission-submissions.universal-B2-JQqx2.d.mts} +55 -30
  15. package/build/es/index.d.mts +2 -2
  16. package/build/es/index.mjs +9 -0
  17. package/build/es/index.mjs.map +1 -1
  18. package/build/es/index.typings.d.mts +2 -2
  19. package/build/es/index.typings.mjs +9 -0
  20. package/build/es/index.typings.mjs.map +1 -1
  21. package/build/es/meta.d.mts +56 -31
  22. package/build/es/meta.mjs +9 -0
  23. package/build/es/meta.mjs.map +1 -1
  24. package/build/es/schemas.d.mts +1351 -0
  25. package/build/es/schemas.mjs +2232 -0
  26. package/build/es/schemas.mjs.map +1 -0
  27. package/build/internal/cjs/{forms-v4-submission-submissions.universal-DH6N9f2_.d.ts → forms-v4-submission-submissions.universal-CoYDEhLi.d.ts} +55 -30
  28. package/build/internal/cjs/index.d.ts +2 -2
  29. package/build/internal/cjs/index.js +10 -0
  30. package/build/internal/cjs/index.js.map +1 -1
  31. package/build/internal/cjs/index.typings.d.ts +2 -2
  32. package/build/internal/cjs/index.typings.js +10 -0
  33. package/build/internal/cjs/index.typings.js.map +1 -1
  34. package/build/internal/cjs/meta.d.ts +56 -31
  35. package/build/internal/cjs/meta.js +10 -0
  36. package/build/internal/cjs/meta.js.map +1 -1
  37. package/build/internal/cjs/schemas.d.ts +1351 -0
  38. package/build/internal/cjs/schemas.js +2318 -0
  39. package/build/internal/cjs/schemas.js.map +1 -0
  40. package/build/internal/es/{forms-v4-submission-submissions.universal-DH6N9f2_.d.mts → forms-v4-submission-submissions.universal-CoYDEhLi.d.mts} +55 -30
  41. package/build/internal/es/index.d.mts +2 -2
  42. package/build/internal/es/index.mjs +9 -0
  43. package/build/internal/es/index.mjs.map +1 -1
  44. package/build/internal/es/index.typings.d.mts +2 -2
  45. package/build/internal/es/index.typings.mjs +9 -0
  46. package/build/internal/es/index.typings.mjs.map +1 -1
  47. package/build/internal/es/meta.d.mts +56 -31
  48. package/build/internal/es/meta.mjs +9 -0
  49. package/build/internal/es/meta.mjs.map +1 -1
  50. package/build/internal/es/schemas.d.mts +1351 -0
  51. package/build/internal/es/schemas.mjs +2232 -0
  52. package/build/internal/es/schemas.mjs.map +1 -0
  53. package/package.json +11 -4
  54. package/schemas/package.json +3 -0
@@ -0,0 +1,2232 @@
1
+ // src/forms-v4-submission-submissions.schemas.ts
2
+ import * as z from "zod";
3
+ var UpsertContactFromSubmissionRequest = z.object({
4
+ submissionId: z.string().describe("Submission from which contact needs to be upserted.").regex(
5
+ /^[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}$/,
6
+ "Must be a valid GUID"
7
+ ),
8
+ options: z.object({
9
+ contactId: z.string().describe("Optional contact id to which submission should be mapped.").regex(
10
+ /^[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}$/,
11
+ "Must be a valid GUID"
12
+ ).optional().nullable(),
13
+ emailVerified: z.boolean().describe("Indicates contact has verified primary email.").optional()
14
+ }).optional()
15
+ });
16
+ var UpsertContactFromSubmissionResponse = z.object({
17
+ submitContactResponse: z.object({
18
+ contactId: z.string().describe("ID of the contact that was found or created.").regex(
19
+ /^[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}$/,
20
+ "Must be a valid GUID"
21
+ ).optional(),
22
+ identityType: z.enum(["UNKNOWN", "CONTACT", "MEMBER", "NOT_AUTHENTICATED_MEMBER"]).describe(
23
+ "Identity type of the returned contact.\n\n- `CONTACT`: The returned contact ID belongs to a new or existing contact.\n- `MEMBER`: The returned contact ID belongs to the currently logged-in site member.\n- `NOT_AUTHENTICATED_MEMBER`: The returned contact ID belongs to a site member who is not currently logged in."
24
+ ).optional(),
25
+ newContact: z.boolean().describe(
26
+ "Indicates whether the contact was just created or already existed.\n\nIf the contact was just created, returns `true`.\nIf it already existed, returns `false`."
27
+ ).optional()
28
+ }).describe("Submit contact response.").optional()
29
+ });
30
+ var CreateSubmissionRequest = z.object({
31
+ submission: z.object({
32
+ _id: z.string().describe("Submission ID.").regex(
33
+ /^[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}$/,
34
+ "Must be a valid GUID"
35
+ ).optional().nullable(),
36
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
37
+ /^[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}$/,
38
+ "Must be a valid GUID"
39
+ ),
40
+ namespace: z.string().describe(
41
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
42
+ ).min(10).max(50).optional(),
43
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).optional(),
44
+ submissions: z.record(z.string(), z.any()).describe(
45
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
46
+ ).optional(),
47
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
48
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
49
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
50
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
51
+ ).optional().nullable(),
52
+ submitter: z.intersection(
53
+ z.object({}),
54
+ z.xor([
55
+ z.object({
56
+ memberId: z.never().optional(),
57
+ visitorId: z.never().optional(),
58
+ applicationId: z.never().optional(),
59
+ userId: z.never().optional()
60
+ }),
61
+ z.object({
62
+ visitorId: z.never().optional(),
63
+ applicationId: z.never().optional(),
64
+ userId: z.never().optional(),
65
+ memberId: z.string().describe("Member ID.").regex(
66
+ /^[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}$/,
67
+ "Must be a valid GUID"
68
+ )
69
+ }),
70
+ z.object({
71
+ memberId: z.never().optional(),
72
+ applicationId: z.never().optional(),
73
+ userId: z.never().optional(),
74
+ visitorId: z.string().describe("Visitor ID.").regex(
75
+ /^[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}$/,
76
+ "Must be a valid GUID"
77
+ )
78
+ }),
79
+ z.object({
80
+ memberId: z.never().optional(),
81
+ visitorId: z.never().optional(),
82
+ userId: z.never().optional(),
83
+ applicationId: z.string().describe("Application ID.").max(36)
84
+ }),
85
+ z.object({
86
+ memberId: z.never().optional(),
87
+ visitorId: z.never().optional(),
88
+ applicationId: z.never().optional(),
89
+ userId: z.string().describe("User ID.").regex(
90
+ /^[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}$/,
91
+ "Must be a valid GUID"
92
+ )
93
+ })
94
+ ])
95
+ ).describe("ID of the visitor that submitted the form.").optional(),
96
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
97
+ extendedFields: z.object({
98
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
99
+ "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)."
100
+ ).optional()
101
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
102
+ orderDetails: z.object({
103
+ orderId: z.string().describe(
104
+ "ID of the order related to submission (only applicable if a form has payments)."
105
+ ).regex(
106
+ /^[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}$/,
107
+ "Must be a valid GUID"
108
+ ).optional().nullable(),
109
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
110
+ currency: z.string().describe("Currency.").optional().nullable(),
111
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
112
+ checkoutId: z.string().describe(
113
+ "ID of the checkout related to submission (only applicable if a form has payments)."
114
+ ).regex(
115
+ /^[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}$/,
116
+ "Must be a valid GUID"
117
+ ).optional()
118
+ }).describe(
119
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
120
+ ).optional(),
121
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
122
+ /^[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}$/,
123
+ "Must be a valid GUID"
124
+ ).optional().nullable(),
125
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
126
+ /^[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}$/,
127
+ "Must be a valid GUID"
128
+ ).optional().nullable(),
129
+ tags: z.object({
130
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
131
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
132
+ ).optional()
133
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
134
+ appointmentDetails: z.object({
135
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
136
+ /^[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}$/,
137
+ "Must be a valid GUID"
138
+ ).optional().nullable(),
139
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
140
+ }).describe(
141
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
142
+ ).optional()
143
+ }).describe("Submission to create."),
144
+ options: z.object({
145
+ captchaToken: z.string().describe("Captcha token.").min(1).max(3e3).optional().nullable(),
146
+ additionalMetadata: z.record(z.string(), z.any()).describe(
147
+ "Optional metadata passed to SPI implementer, allowing clients to include additional business-specific data."
148
+ ).optional().nullable()
149
+ }).describe("Optional fields.").optional()
150
+ });
151
+ var CreateSubmissionResponse = z.object({
152
+ _id: z.string().describe("Submission ID.").regex(
153
+ /^[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}$/,
154
+ "Must be a valid GUID"
155
+ ).optional().nullable(),
156
+ formId: z.string().describe("ID of the form which the submission belongs to.").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
+ ).optional(),
160
+ namespace: z.string().describe(
161
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
162
+ ).min(10).max(50).optional(),
163
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
164
+ submissions: z.record(z.string(), z.any()).describe(
165
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
166
+ ).optional(),
167
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
168
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
169
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
170
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
171
+ ).optional().nullable(),
172
+ submitter: z.intersection(
173
+ z.object({}),
174
+ z.xor([
175
+ z.object({
176
+ memberId: z.never().optional(),
177
+ visitorId: z.never().optional(),
178
+ applicationId: z.never().optional(),
179
+ userId: z.never().optional()
180
+ }),
181
+ z.object({
182
+ visitorId: z.never().optional(),
183
+ applicationId: z.never().optional(),
184
+ userId: z.never().optional(),
185
+ memberId: z.string().describe("Member ID.").regex(
186
+ /^[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}$/,
187
+ "Must be a valid GUID"
188
+ )
189
+ }),
190
+ z.object({
191
+ memberId: z.never().optional(),
192
+ applicationId: z.never().optional(),
193
+ userId: z.never().optional(),
194
+ visitorId: z.string().describe("Visitor ID.").regex(
195
+ /^[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}$/,
196
+ "Must be a valid GUID"
197
+ )
198
+ }),
199
+ z.object({
200
+ memberId: z.never().optional(),
201
+ visitorId: z.never().optional(),
202
+ userId: z.never().optional(),
203
+ applicationId: z.string().describe("Application ID.").max(36)
204
+ }),
205
+ z.object({
206
+ memberId: z.never().optional(),
207
+ visitorId: z.never().optional(),
208
+ applicationId: z.never().optional(),
209
+ userId: z.string().describe("User ID.").regex(
210
+ /^[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}$/,
211
+ "Must be a valid GUID"
212
+ )
213
+ })
214
+ ])
215
+ ).describe("ID of the visitor that submitted the form.").optional(),
216
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
217
+ extendedFields: z.object({
218
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
219
+ "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)."
220
+ ).optional()
221
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
222
+ orderDetails: z.object({
223
+ orderId: z.string().describe(
224
+ "ID of the order related to submission (only applicable if a form has payments)."
225
+ ).regex(
226
+ /^[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}$/,
227
+ "Must be a valid GUID"
228
+ ).optional().nullable(),
229
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
230
+ currency: z.string().describe("Currency.").optional().nullable(),
231
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
232
+ checkoutId: z.string().describe(
233
+ "ID of the checkout related to submission (only applicable if a form has payments)."
234
+ ).regex(
235
+ /^[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}$/,
236
+ "Must be a valid GUID"
237
+ ).optional()
238
+ }).describe(
239
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
240
+ ).optional(),
241
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
242
+ /^[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}$/,
243
+ "Must be a valid GUID"
244
+ ).optional().nullable(),
245
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
246
+ /^[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}$/,
247
+ "Must be a valid GUID"
248
+ ).optional().nullable(),
249
+ tags: z.object({
250
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
251
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
252
+ ).optional()
253
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
254
+ appointmentDetails: z.object({
255
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
256
+ /^[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}$/,
257
+ "Must be a valid GUID"
258
+ ).optional().nullable(),
259
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
260
+ }).describe(
261
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
262
+ ).optional()
263
+ });
264
+ var GetSubmissionRequest = z.object({
265
+ submissionId: z.string().describe("ID of the submission to retrieve.").regex(
266
+ /^[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}$/,
267
+ "Must be a valid GUID"
268
+ )
269
+ });
270
+ var GetSubmissionResponse = z.object({
271
+ _id: z.string().describe("Submission ID.").regex(
272
+ /^[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}$/,
273
+ "Must be a valid GUID"
274
+ ).optional().nullable(),
275
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
276
+ /^[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}$/,
277
+ "Must be a valid GUID"
278
+ ).optional(),
279
+ namespace: z.string().describe(
280
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
281
+ ).min(10).max(50).optional(),
282
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
283
+ submissions: z.record(z.string(), z.any()).describe(
284
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
285
+ ).optional(),
286
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
287
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
288
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
289
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
290
+ ).optional().nullable(),
291
+ submitter: z.intersection(
292
+ z.object({}),
293
+ z.xor([
294
+ z.object({
295
+ memberId: z.never().optional(),
296
+ visitorId: z.never().optional(),
297
+ applicationId: z.never().optional(),
298
+ userId: z.never().optional()
299
+ }),
300
+ z.object({
301
+ visitorId: z.never().optional(),
302
+ applicationId: z.never().optional(),
303
+ userId: z.never().optional(),
304
+ memberId: z.string().describe("Member ID.").regex(
305
+ /^[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}$/,
306
+ "Must be a valid GUID"
307
+ )
308
+ }),
309
+ z.object({
310
+ memberId: z.never().optional(),
311
+ applicationId: z.never().optional(),
312
+ userId: z.never().optional(),
313
+ visitorId: z.string().describe("Visitor ID.").regex(
314
+ /^[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}$/,
315
+ "Must be a valid GUID"
316
+ )
317
+ }),
318
+ z.object({
319
+ memberId: z.never().optional(),
320
+ visitorId: z.never().optional(),
321
+ userId: z.never().optional(),
322
+ applicationId: z.string().describe("Application ID.").max(36)
323
+ }),
324
+ z.object({
325
+ memberId: z.never().optional(),
326
+ visitorId: z.never().optional(),
327
+ applicationId: z.never().optional(),
328
+ userId: z.string().describe("User ID.").regex(
329
+ /^[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}$/,
330
+ "Must be a valid GUID"
331
+ )
332
+ })
333
+ ])
334
+ ).describe("ID of the visitor that submitted the form.").optional(),
335
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
336
+ extendedFields: z.object({
337
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
338
+ "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)."
339
+ ).optional()
340
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
341
+ orderDetails: z.object({
342
+ orderId: z.string().describe(
343
+ "ID of the order related to submission (only applicable if a form has payments)."
344
+ ).regex(
345
+ /^[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}$/,
346
+ "Must be a valid GUID"
347
+ ).optional().nullable(),
348
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
349
+ currency: z.string().describe("Currency.").optional().nullable(),
350
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
351
+ checkoutId: z.string().describe(
352
+ "ID of the checkout related to submission (only applicable if a form has payments)."
353
+ ).regex(
354
+ /^[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}$/,
355
+ "Must be a valid GUID"
356
+ ).optional()
357
+ }).describe(
358
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
359
+ ).optional(),
360
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").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
+ ).optional().nullable(),
364
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
365
+ /^[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}$/,
366
+ "Must be a valid GUID"
367
+ ).optional().nullable(),
368
+ tags: z.object({
369
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
370
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
371
+ ).optional()
372
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
373
+ appointmentDetails: z.object({
374
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
375
+ /^[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}$/,
376
+ "Must be a valid GUID"
377
+ ).optional().nullable(),
378
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
379
+ }).describe(
380
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
381
+ ).optional()
382
+ });
383
+ var UpdateSubmissionRequest = z.object({
384
+ _id: z.string().describe("Submission ID.").regex(
385
+ /^[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}$/,
386
+ "Must be a valid GUID"
387
+ ),
388
+ submission: z.object({
389
+ _id: z.string().describe("Submission ID.").regex(
390
+ /^[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}$/,
391
+ "Must be a valid GUID"
392
+ ).optional().nullable(),
393
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
394
+ /^[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}$/,
395
+ "Must be a valid GUID"
396
+ ),
397
+ namespace: z.string().describe(
398
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
399
+ ).min(10).max(50).optional(),
400
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).optional(),
401
+ submissions: z.record(z.string(), z.any()).describe(
402
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
403
+ ).optional(),
404
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
405
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
406
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
407
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
408
+ ),
409
+ submitter: z.intersection(
410
+ z.object({}),
411
+ z.xor([
412
+ z.object({
413
+ memberId: z.never().optional(),
414
+ visitorId: z.never().optional(),
415
+ applicationId: z.never().optional(),
416
+ userId: z.never().optional()
417
+ }),
418
+ z.object({
419
+ visitorId: z.never().optional(),
420
+ applicationId: z.never().optional(),
421
+ userId: z.never().optional(),
422
+ memberId: z.string().describe("Member ID.").regex(
423
+ /^[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}$/,
424
+ "Must be a valid GUID"
425
+ )
426
+ }),
427
+ z.object({
428
+ memberId: z.never().optional(),
429
+ applicationId: z.never().optional(),
430
+ userId: z.never().optional(),
431
+ visitorId: z.string().describe("Visitor ID.").regex(
432
+ /^[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}$/,
433
+ "Must be a valid GUID"
434
+ )
435
+ }),
436
+ z.object({
437
+ memberId: z.never().optional(),
438
+ visitorId: z.never().optional(),
439
+ userId: z.never().optional(),
440
+ applicationId: z.string().describe("Application ID.").max(36)
441
+ }),
442
+ z.object({
443
+ memberId: z.never().optional(),
444
+ visitorId: z.never().optional(),
445
+ applicationId: z.never().optional(),
446
+ userId: z.string().describe("User ID.").regex(
447
+ /^[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}$/,
448
+ "Must be a valid GUID"
449
+ )
450
+ })
451
+ ])
452
+ ).describe("ID of the visitor that submitted the form.").optional(),
453
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
454
+ extendedFields: z.object({
455
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
456
+ "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)."
457
+ ).optional()
458
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
459
+ orderDetails: z.object({
460
+ orderId: z.string().describe(
461
+ "ID of the order related to submission (only applicable if a form has payments)."
462
+ ).regex(
463
+ /^[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}$/,
464
+ "Must be a valid GUID"
465
+ ).optional().nullable(),
466
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
467
+ currency: z.string().describe("Currency.").optional().nullable(),
468
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
469
+ checkoutId: z.string().describe(
470
+ "ID of the checkout related to submission (only applicable if a form has payments)."
471
+ ).regex(
472
+ /^[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}$/,
473
+ "Must be a valid GUID"
474
+ ).optional()
475
+ }).describe(
476
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
477
+ ).optional(),
478
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
479
+ /^[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}$/,
480
+ "Must be a valid GUID"
481
+ ).optional().nullable(),
482
+ accessRestriction: z.string().describe("Authorized viewer ID.").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
+ tags: z.object({
487
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
488
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
489
+ ).optional()
490
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
491
+ appointmentDetails: z.object({
492
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
493
+ /^[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}$/,
494
+ "Must be a valid GUID"
495
+ ).optional().nullable(),
496
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
497
+ }).describe(
498
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
499
+ ).optional()
500
+ }).describe("Submission to update. ")
501
+ });
502
+ var UpdateSubmissionResponse = z.object({
503
+ _id: z.string().describe("Submission ID.").regex(
504
+ /^[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}$/,
505
+ "Must be a valid GUID"
506
+ ).optional().nullable(),
507
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
508
+ /^[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}$/,
509
+ "Must be a valid GUID"
510
+ ).optional(),
511
+ namespace: z.string().describe(
512
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
513
+ ).min(10).max(50).optional(),
514
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
515
+ submissions: z.record(z.string(), z.any()).describe(
516
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
517
+ ).optional(),
518
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
519
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
520
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
521
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
522
+ ).optional().nullable(),
523
+ submitter: z.intersection(
524
+ z.object({}),
525
+ z.xor([
526
+ z.object({
527
+ memberId: z.never().optional(),
528
+ visitorId: z.never().optional(),
529
+ applicationId: z.never().optional(),
530
+ userId: z.never().optional()
531
+ }),
532
+ z.object({
533
+ visitorId: z.never().optional(),
534
+ applicationId: z.never().optional(),
535
+ userId: z.never().optional(),
536
+ memberId: z.string().describe("Member ID.").regex(
537
+ /^[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}$/,
538
+ "Must be a valid GUID"
539
+ )
540
+ }),
541
+ z.object({
542
+ memberId: z.never().optional(),
543
+ applicationId: z.never().optional(),
544
+ userId: z.never().optional(),
545
+ visitorId: z.string().describe("Visitor ID.").regex(
546
+ /^[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}$/,
547
+ "Must be a valid GUID"
548
+ )
549
+ }),
550
+ z.object({
551
+ memberId: z.never().optional(),
552
+ visitorId: z.never().optional(),
553
+ userId: z.never().optional(),
554
+ applicationId: z.string().describe("Application ID.").max(36)
555
+ }),
556
+ z.object({
557
+ memberId: z.never().optional(),
558
+ visitorId: z.never().optional(),
559
+ applicationId: z.never().optional(),
560
+ userId: z.string().describe("User ID.").regex(
561
+ /^[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}$/,
562
+ "Must be a valid GUID"
563
+ )
564
+ })
565
+ ])
566
+ ).describe("ID of the visitor that submitted the form.").optional(),
567
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
568
+ extendedFields: z.object({
569
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
570
+ "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)."
571
+ ).optional()
572
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
573
+ orderDetails: z.object({
574
+ orderId: z.string().describe(
575
+ "ID of the order related to submission (only applicable if a form has payments)."
576
+ ).regex(
577
+ /^[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}$/,
578
+ "Must be a valid GUID"
579
+ ).optional().nullable(),
580
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
581
+ currency: z.string().describe("Currency.").optional().nullable(),
582
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
583
+ checkoutId: z.string().describe(
584
+ "ID of the checkout related to submission (only applicable if a form has payments)."
585
+ ).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()
589
+ }).describe(
590
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
591
+ ).optional(),
592
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
593
+ /^[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}$/,
594
+ "Must be a valid GUID"
595
+ ).optional().nullable(),
596
+ accessRestriction: z.string().describe("Authorized viewer ID.").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
+ tags: z.object({
601
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
602
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
603
+ ).optional()
604
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
605
+ appointmentDetails: z.object({
606
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
607
+ /^[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}$/,
608
+ "Must be a valid GUID"
609
+ ).optional().nullable(),
610
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
611
+ }).describe(
612
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
613
+ ).optional()
614
+ });
615
+ var ConfirmSubmissionRequest = z.object({
616
+ submissionId: z.string().describe("Submission ID to confirm.").regex(
617
+ /^[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}$/,
618
+ "Must be a valid GUID"
619
+ )
620
+ });
621
+ var ConfirmSubmissionResponse = z.object({
622
+ submission: z.object({
623
+ _id: z.string().describe("Submission ID.").regex(
624
+ /^[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}$/,
625
+ "Must be a valid GUID"
626
+ ).optional().nullable(),
627
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
628
+ /^[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}$/,
629
+ "Must be a valid GUID"
630
+ ).optional(),
631
+ namespace: z.string().describe(
632
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
633
+ ).min(10).max(50).optional(),
634
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
635
+ submissions: z.record(z.string(), z.any()).describe(
636
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
637
+ ).optional(),
638
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
639
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
640
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
641
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
642
+ ).optional().nullable(),
643
+ submitter: z.intersection(
644
+ z.object({}),
645
+ z.xor([
646
+ z.object({
647
+ memberId: z.never().optional(),
648
+ visitorId: z.never().optional(),
649
+ applicationId: z.never().optional(),
650
+ userId: z.never().optional()
651
+ }),
652
+ z.object({
653
+ visitorId: z.never().optional(),
654
+ applicationId: z.never().optional(),
655
+ userId: z.never().optional(),
656
+ memberId: z.string().describe("Member ID.").regex(
657
+ /^[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}$/,
658
+ "Must be a valid GUID"
659
+ )
660
+ }),
661
+ z.object({
662
+ memberId: z.never().optional(),
663
+ applicationId: z.never().optional(),
664
+ userId: z.never().optional(),
665
+ visitorId: z.string().describe("Visitor ID.").regex(
666
+ /^[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}$/,
667
+ "Must be a valid GUID"
668
+ )
669
+ }),
670
+ z.object({
671
+ memberId: z.never().optional(),
672
+ visitorId: z.never().optional(),
673
+ userId: z.never().optional(),
674
+ applicationId: z.string().describe("Application ID.").max(36)
675
+ }),
676
+ z.object({
677
+ memberId: z.never().optional(),
678
+ visitorId: z.never().optional(),
679
+ applicationId: z.never().optional(),
680
+ userId: z.string().describe("User ID.").regex(
681
+ /^[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}$/,
682
+ "Must be a valid GUID"
683
+ )
684
+ })
685
+ ])
686
+ ).describe("ID of the visitor that submitted the form.").optional(),
687
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
688
+ extendedFields: z.object({
689
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
690
+ "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)."
691
+ ).optional()
692
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
693
+ orderDetails: z.object({
694
+ orderId: z.string().describe(
695
+ "ID of the order related to submission (only applicable if a form has payments)."
696
+ ).regex(
697
+ /^[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}$/,
698
+ "Must be a valid GUID"
699
+ ).optional().nullable(),
700
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
701
+ currency: z.string().describe("Currency.").optional().nullable(),
702
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
703
+ checkoutId: z.string().describe(
704
+ "ID of the checkout related to submission (only applicable if a form has payments)."
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()
709
+ }).describe(
710
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
711
+ ).optional(),
712
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").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
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
717
+ /^[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}$/,
718
+ "Must be a valid GUID"
719
+ ).optional().nullable(),
720
+ tags: z.object({
721
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
722
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
723
+ ).optional()
724
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
725
+ appointmentDetails: z.object({
726
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
727
+ /^[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}$/,
728
+ "Must be a valid GUID"
729
+ ).optional().nullable(),
730
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
731
+ }).describe(
732
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
733
+ ).optional()
734
+ }).describe("The confirmed submission.").optional()
735
+ });
736
+ var DeleteSubmissionRequest = z.object({
737
+ submissionId: z.string().describe("ID of the submission to delete.").regex(
738
+ /^[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}$/,
739
+ "Must be a valid GUID"
740
+ ),
741
+ options: z.object({
742
+ permanent: z.boolean().describe(
743
+ "Whether to permanently delete a submission bypassing the trash bin.\n\nDefault: `false`"
744
+ ).optional(),
745
+ preserveFiles: z.boolean().describe(
746
+ "Whether to preserve files, associated with the submission. If the value is `false`, then the files are deleted after 210 days."
747
+ ).optional()
748
+ }).describe("Optional fields.").optional()
749
+ });
750
+ var DeleteSubmissionResponse = z.object({});
751
+ var BulkDeleteSubmissionRequest = z.object({
752
+ formId: z.string().describe("Form ID.").regex(
753
+ /^[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}$/,
754
+ "Must be a valid GUID"
755
+ ),
756
+ options: z.object({
757
+ submissionIds: z.array(z.string()).min(1).max(100).optional(),
758
+ permanent: z.boolean().describe("Delete submission bypassing trash-bin\nDefault: false").optional(),
759
+ preserveFiles: z.boolean().describe("Preserve files.").optional()
760
+ }).optional()
761
+ });
762
+ var BulkDeleteSubmissionResponse = z.object({
763
+ results: z.array(
764
+ z.object({
765
+ itemMetadata: z.object({
766
+ _id: z.string().describe(
767
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
768
+ ).regex(
769
+ /^[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}$/,
770
+ "Must be a valid GUID"
771
+ ).optional().nullable(),
772
+ originalIndex: z.number().int().describe(
773
+ "Index of the item within the request array. Allows for correlation between request and response items."
774
+ ).optional(),
775
+ success: z.boolean().describe(
776
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
777
+ ).optional(),
778
+ error: z.object({
779
+ code: z.string().describe("Error code.").optional(),
780
+ description: z.string().describe("Description of the error.").optional(),
781
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
782
+ }).describe("Details about the error in case of failure.").optional()
783
+ }).describe("Deleted item metadata").optional()
784
+ })
785
+ ).min(1).max(100).optional(),
786
+ bulkActionMetadata: z.object({
787
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
788
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
789
+ undetailedFailures: z.number().int().describe(
790
+ "Number of failures without details because detailed failure threshold was exceeded."
791
+ ).optional()
792
+ }).describe("Metadata of request").optional()
793
+ });
794
+ var RestoreSubmissionFromTrashBinRequest = z.object({
795
+ submissionId: z.string().describe("ID of the submission to restore.").regex(
796
+ /^[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}$/,
797
+ "Must be a valid GUID"
798
+ )
799
+ });
800
+ var RestoreSubmissionFromTrashBinResponse = z.object({
801
+ submission: z.object({
802
+ _id: z.string().describe("Submission ID.").regex(
803
+ /^[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}$/,
804
+ "Must be a valid GUID"
805
+ ).optional().nullable(),
806
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
807
+ /^[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}$/,
808
+ "Must be a valid GUID"
809
+ ).optional(),
810
+ namespace: z.string().describe(
811
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
812
+ ).min(10).max(50).optional(),
813
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
814
+ submissions: z.record(z.string(), z.any()).describe(
815
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
816
+ ).optional(),
817
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
818
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
819
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
820
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
821
+ ).optional().nullable(),
822
+ submitter: z.intersection(
823
+ z.object({}),
824
+ z.xor([
825
+ z.object({
826
+ memberId: z.never().optional(),
827
+ visitorId: z.never().optional(),
828
+ applicationId: z.never().optional(),
829
+ userId: z.never().optional()
830
+ }),
831
+ z.object({
832
+ visitorId: z.never().optional(),
833
+ applicationId: z.never().optional(),
834
+ userId: z.never().optional(),
835
+ memberId: z.string().describe("Member ID.").regex(
836
+ /^[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}$/,
837
+ "Must be a valid GUID"
838
+ )
839
+ }),
840
+ z.object({
841
+ memberId: z.never().optional(),
842
+ applicationId: z.never().optional(),
843
+ userId: z.never().optional(),
844
+ visitorId: z.string().describe("Visitor ID.").regex(
845
+ /^[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}$/,
846
+ "Must be a valid GUID"
847
+ )
848
+ }),
849
+ z.object({
850
+ memberId: z.never().optional(),
851
+ visitorId: z.never().optional(),
852
+ userId: z.never().optional(),
853
+ applicationId: z.string().describe("Application ID.").max(36)
854
+ }),
855
+ z.object({
856
+ memberId: z.never().optional(),
857
+ visitorId: z.never().optional(),
858
+ applicationId: z.never().optional(),
859
+ userId: z.string().describe("User ID.").regex(
860
+ /^[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}$/,
861
+ "Must be a valid GUID"
862
+ )
863
+ })
864
+ ])
865
+ ).describe("ID of the visitor that submitted the form.").optional(),
866
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
867
+ extendedFields: z.object({
868
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
869
+ "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)."
870
+ ).optional()
871
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
872
+ orderDetails: z.object({
873
+ orderId: z.string().describe(
874
+ "ID of the order related to submission (only applicable if a form has payments)."
875
+ ).regex(
876
+ /^[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}$/,
877
+ "Must be a valid GUID"
878
+ ).optional().nullable(),
879
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
880
+ currency: z.string().describe("Currency.").optional().nullable(),
881
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
882
+ checkoutId: z.string().describe(
883
+ "ID of the checkout related to submission (only applicable if a form has payments)."
884
+ ).regex(
885
+ /^[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}$/,
886
+ "Must be a valid GUID"
887
+ ).optional()
888
+ }).describe(
889
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
890
+ ).optional(),
891
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
892
+ /^[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}$/,
893
+ "Must be a valid GUID"
894
+ ).optional().nullable(),
895
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
896
+ /^[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}$/,
897
+ "Must be a valid GUID"
898
+ ).optional().nullable(),
899
+ tags: z.object({
900
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
901
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
902
+ ).optional()
903
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
904
+ appointmentDetails: z.object({
905
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
906
+ /^[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}$/,
907
+ "Must be a valid GUID"
908
+ ).optional().nullable(),
909
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
910
+ }).describe(
911
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
912
+ ).optional()
913
+ }).describe("The restored submission.").optional()
914
+ });
915
+ var RemoveSubmissionFromTrashBinRequest = z.object({
916
+ submissionId: z.string().describe("ID of the submission to restore.").regex(
917
+ /^[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}$/,
918
+ "Must be a valid GUID"
919
+ )
920
+ });
921
+ var RemoveSubmissionFromTrashBinResponse = z.object({});
922
+ var BulkRemoveSubmissionFromTrashBinRequest = z.object({
923
+ formId: z.string().describe("Form ID.").regex(
924
+ /^[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}$/,
925
+ "Must be a valid GUID"
926
+ ),
927
+ options: z.object({ submissionIds: z.array(z.string()).min(1).max(100).optional() }).optional()
928
+ });
929
+ var BulkRemoveSubmissionFromTrashBinResponse = z.object({
930
+ results: z.array(
931
+ z.object({
932
+ itemMetadata: z.object({
933
+ _id: z.string().describe(
934
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
935
+ ).regex(
936
+ /^[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}$/,
937
+ "Must be a valid GUID"
938
+ ).optional().nullable(),
939
+ originalIndex: z.number().int().describe(
940
+ "Index of the item within the request array. Allows for correlation between request and response items."
941
+ ).optional(),
942
+ success: z.boolean().describe(
943
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
944
+ ).optional(),
945
+ error: z.object({
946
+ code: z.string().describe("Error code.").optional(),
947
+ description: z.string().describe("Description of the error.").optional(),
948
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
949
+ }).describe("Details about the error in case of failure.").optional()
950
+ }).describe("Deleted item metadata").optional()
951
+ })
952
+ ).max(100).optional(),
953
+ bulkActionMetadata: z.object({
954
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
955
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
956
+ undetailedFailures: z.number().int().describe(
957
+ "Number of failures without details because detailed failure threshold was exceeded."
958
+ ).optional()
959
+ }).describe("Metadata of request").optional()
960
+ });
961
+ var ListDeletedSubmissionsRequest = z.object({
962
+ formId: z.string().describe("Form ID.").regex(
963
+ /^[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}$/,
964
+ "Must be a valid GUID"
965
+ ),
966
+ options: z.object({
967
+ submissionIds: z.array(z.string()).max(10).optional(),
968
+ paging: z.object({
969
+ limit: z.number().int().describe("Number of items to load.").min(0).max(100).optional().nullable(),
970
+ cursor: z.string().describe(
971
+ "Pointer to the next or previous page in the list of results.\n\nYou can get the relevant cursor token\nfrom the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
972
+ ).max(16e3).optional().nullable()
973
+ }).describe(
974
+ "Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not filter or `order`."
975
+ ).optional(),
976
+ statuses: z.array(
977
+ z.enum([
978
+ "PENDING",
979
+ "CONFIRMED",
980
+ "PAYMENT_WAITING",
981
+ "PAYMENT_CANCELED"
982
+ ])
983
+ ).max(4).optional()
984
+ }).optional()
985
+ });
986
+ var ListDeletedSubmissionsResponse = z.object({
987
+ submissions: z.array(
988
+ z.object({
989
+ _id: z.string().describe("Submission ID.").regex(
990
+ /^[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}$/,
991
+ "Must be a valid GUID"
992
+ ).optional().nullable(),
993
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
994
+ /^[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}$/,
995
+ "Must be a valid GUID"
996
+ ).optional(),
997
+ namespace: z.string().describe(
998
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
999
+ ).min(10).max(50).optional(),
1000
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
1001
+ submissions: z.record(z.string(), z.any()).describe(
1002
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
1003
+ ).optional(),
1004
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
1005
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
1006
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1007
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
1008
+ ).optional().nullable(),
1009
+ submitter: z.intersection(
1010
+ z.object({}),
1011
+ z.xor([
1012
+ z.object({
1013
+ memberId: z.never().optional(),
1014
+ visitorId: z.never().optional(),
1015
+ applicationId: z.never().optional(),
1016
+ userId: z.never().optional()
1017
+ }),
1018
+ z.object({
1019
+ visitorId: z.never().optional(),
1020
+ applicationId: z.never().optional(),
1021
+ userId: z.never().optional(),
1022
+ memberId: z.string().describe("Member ID.").regex(
1023
+ /^[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}$/,
1024
+ "Must be a valid GUID"
1025
+ )
1026
+ }),
1027
+ z.object({
1028
+ memberId: z.never().optional(),
1029
+ applicationId: z.never().optional(),
1030
+ userId: z.never().optional(),
1031
+ visitorId: z.string().describe("Visitor ID.").regex(
1032
+ /^[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}$/,
1033
+ "Must be a valid GUID"
1034
+ )
1035
+ }),
1036
+ z.object({
1037
+ memberId: z.never().optional(),
1038
+ visitorId: z.never().optional(),
1039
+ userId: z.never().optional(),
1040
+ applicationId: z.string().describe("Application ID.").max(36)
1041
+ }),
1042
+ z.object({
1043
+ memberId: z.never().optional(),
1044
+ visitorId: z.never().optional(),
1045
+ applicationId: z.never().optional(),
1046
+ userId: z.string().describe("User ID.").regex(
1047
+ /^[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}$/,
1048
+ "Must be a valid GUID"
1049
+ )
1050
+ })
1051
+ ])
1052
+ ).describe("ID of the visitor that submitted the form.").optional(),
1053
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
1054
+ extendedFields: z.object({
1055
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1056
+ "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)."
1057
+ ).optional()
1058
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
1059
+ orderDetails: z.object({
1060
+ orderId: z.string().describe(
1061
+ "ID of the order related to submission (only applicable if a form has payments)."
1062
+ ).regex(
1063
+ /^[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}$/,
1064
+ "Must be a valid GUID"
1065
+ ).optional().nullable(),
1066
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
1067
+ currency: z.string().describe("Currency.").optional().nullable(),
1068
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
1069
+ checkoutId: z.string().describe(
1070
+ "ID of the checkout related to submission (only applicable if a form has payments)."
1071
+ ).regex(
1072
+ /^[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}$/,
1073
+ "Must be a valid GUID"
1074
+ ).optional()
1075
+ }).describe(
1076
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
1077
+ ).optional(),
1078
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
1079
+ /^[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}$/,
1080
+ "Must be a valid GUID"
1081
+ ).optional().nullable(),
1082
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
1083
+ /^[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}$/,
1084
+ "Must be a valid GUID"
1085
+ ).optional().nullable(),
1086
+ tags: z.object({
1087
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
1088
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
1089
+ ).optional()
1090
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
1091
+ appointmentDetails: z.object({
1092
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
1093
+ /^[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}$/,
1094
+ "Must be a valid GUID"
1095
+ ).optional().nullable(),
1096
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
1097
+ }).describe(
1098
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
1099
+ ).optional()
1100
+ })
1101
+ ).optional(),
1102
+ pagingMetadata: z.object({
1103
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1104
+ cursors: z.object({
1105
+ next: z.string().describe("Cursor pointing to next page in the list of results.").max(16e3).optional().nullable(),
1106
+ prev: z.string().describe(
1107
+ "Cursor pointing to previous page in the list of results."
1108
+ ).max(16e3).optional().nullable()
1109
+ }).describe("Offset that was requested.").optional(),
1110
+ hasNext: z.boolean().describe(
1111
+ "Indicates if there are more results after the current page.\nIf `true`, another page of results can be retrieved.\nIf `false`, this is the last page."
1112
+ ).optional().nullable()
1113
+ }).describe("Paging metadata.").optional()
1114
+ });
1115
+ var GetDeletedSubmissionRequest = z.object({
1116
+ submissionId: z.string().describe("Submission id.").regex(
1117
+ /^[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}$/,
1118
+ "Must be a valid GUID"
1119
+ )
1120
+ });
1121
+ var GetDeletedSubmissionResponse = z.object({
1122
+ submission: z.object({
1123
+ _id: z.string().describe("Submission 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
+ ).optional().nullable(),
1127
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
1128
+ /^[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}$/,
1129
+ "Must be a valid GUID"
1130
+ ).optional(),
1131
+ namespace: z.string().describe(
1132
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
1133
+ ).min(10).max(50).optional(),
1134
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
1135
+ submissions: z.record(z.string(), z.any()).describe(
1136
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
1137
+ ).optional(),
1138
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
1139
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
1140
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1141
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
1142
+ ).optional().nullable(),
1143
+ submitter: z.intersection(
1144
+ z.object({}),
1145
+ z.xor([
1146
+ z.object({
1147
+ memberId: z.never().optional(),
1148
+ visitorId: z.never().optional(),
1149
+ applicationId: z.never().optional(),
1150
+ userId: z.never().optional()
1151
+ }),
1152
+ z.object({
1153
+ visitorId: z.never().optional(),
1154
+ applicationId: z.never().optional(),
1155
+ userId: z.never().optional(),
1156
+ memberId: z.string().describe("Member ID.").regex(
1157
+ /^[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}$/,
1158
+ "Must be a valid GUID"
1159
+ )
1160
+ }),
1161
+ z.object({
1162
+ memberId: z.never().optional(),
1163
+ applicationId: z.never().optional(),
1164
+ userId: z.never().optional(),
1165
+ visitorId: z.string().describe("Visitor ID.").regex(
1166
+ /^[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}$/,
1167
+ "Must be a valid GUID"
1168
+ )
1169
+ }),
1170
+ z.object({
1171
+ memberId: z.never().optional(),
1172
+ visitorId: z.never().optional(),
1173
+ userId: z.never().optional(),
1174
+ applicationId: z.string().describe("Application ID.").max(36)
1175
+ }),
1176
+ z.object({
1177
+ memberId: z.never().optional(),
1178
+ visitorId: z.never().optional(),
1179
+ applicationId: z.never().optional(),
1180
+ userId: z.string().describe("User ID.").regex(
1181
+ /^[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}$/,
1182
+ "Must be a valid GUID"
1183
+ )
1184
+ })
1185
+ ])
1186
+ ).describe("ID of the visitor that submitted the form.").optional(),
1187
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
1188
+ extendedFields: z.object({
1189
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1190
+ "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)."
1191
+ ).optional()
1192
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
1193
+ orderDetails: z.object({
1194
+ orderId: z.string().describe(
1195
+ "ID of the order related to submission (only applicable if a form has payments)."
1196
+ ).regex(
1197
+ /^[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}$/,
1198
+ "Must be a valid GUID"
1199
+ ).optional().nullable(),
1200
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
1201
+ currency: z.string().describe("Currency.").optional().nullable(),
1202
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
1203
+ checkoutId: z.string().describe(
1204
+ "ID of the checkout related to submission (only applicable if a form has payments)."
1205
+ ).regex(
1206
+ /^[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}$/,
1207
+ "Must be a valid GUID"
1208
+ ).optional()
1209
+ }).describe(
1210
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
1211
+ ).optional(),
1212
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
1213
+ /^[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}$/,
1214
+ "Must be a valid GUID"
1215
+ ).optional().nullable(),
1216
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
1217
+ /^[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}$/,
1218
+ "Must be a valid GUID"
1219
+ ).optional().nullable(),
1220
+ tags: z.object({
1221
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
1222
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
1223
+ ).optional()
1224
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
1225
+ appointmentDetails: z.object({
1226
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
1227
+ /^[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}$/,
1228
+ "Must be a valid GUID"
1229
+ ).optional().nullable(),
1230
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
1231
+ }).describe(
1232
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
1233
+ ).optional()
1234
+ }).describe("The retrieved Submission.").optional()
1235
+ });
1236
+ var QuerySubmissionRequest = z.object({
1237
+ query: z.intersection(
1238
+ z.object({
1239
+ filter: z.record(z.string(), z.any()).describe(
1240
+ '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`'
1241
+ ).optional().nullable(),
1242
+ sort: z.array(
1243
+ z.object({
1244
+ fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
1245
+ order: z.enum(["ASC", "DESC"]).optional()
1246
+ })
1247
+ ).max(3).optional()
1248
+ }),
1249
+ z.xor([
1250
+ z.object({ cursorPaging: z.never().optional() }),
1251
+ z.object({
1252
+ cursorPaging: z.object({
1253
+ limit: z.number().int().describe("Number of items to load.").min(0).max(100).optional().nullable(),
1254
+ cursor: z.string().describe(
1255
+ "Pointer to the next or previous page in the list of results.\n\nYou can get the relevant cursor token\nfrom the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
1256
+ ).max(16e3).optional().nullable()
1257
+ }).describe(
1258
+ "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`."
1259
+ )
1260
+ })
1261
+ ])
1262
+ ).describe("Query options."),
1263
+ options: z.object({
1264
+ onlyYourOwn: z.boolean().describe(
1265
+ "Whether to return only your own submissions. If `false`, returns all submissions based on query filters."
1266
+ ).optional()
1267
+ }).optional()
1268
+ });
1269
+ var QuerySubmissionResponse = z.object({
1270
+ submissions: z.array(
1271
+ z.object({
1272
+ _id: z.string().describe("Submission ID.").regex(
1273
+ /^[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}$/,
1274
+ "Must be a valid GUID"
1275
+ ).optional().nullable(),
1276
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
1277
+ /^[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}$/,
1278
+ "Must be a valid GUID"
1279
+ ).optional(),
1280
+ namespace: z.string().describe(
1281
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
1282
+ ).min(10).max(50).optional(),
1283
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
1284
+ submissions: z.record(z.string(), z.any()).describe(
1285
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
1286
+ ).optional(),
1287
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
1288
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
1289
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1290
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
1291
+ ).optional().nullable(),
1292
+ submitter: z.intersection(
1293
+ z.object({}),
1294
+ z.xor([
1295
+ z.object({
1296
+ memberId: z.never().optional(),
1297
+ visitorId: z.never().optional(),
1298
+ applicationId: z.never().optional(),
1299
+ userId: z.never().optional()
1300
+ }),
1301
+ z.object({
1302
+ visitorId: z.never().optional(),
1303
+ applicationId: z.never().optional(),
1304
+ userId: z.never().optional(),
1305
+ memberId: z.string().describe("Member ID.").regex(
1306
+ /^[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}$/,
1307
+ "Must be a valid GUID"
1308
+ )
1309
+ }),
1310
+ z.object({
1311
+ memberId: z.never().optional(),
1312
+ applicationId: z.never().optional(),
1313
+ userId: z.never().optional(),
1314
+ visitorId: z.string().describe("Visitor ID.").regex(
1315
+ /^[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}$/,
1316
+ "Must be a valid GUID"
1317
+ )
1318
+ }),
1319
+ z.object({
1320
+ memberId: z.never().optional(),
1321
+ visitorId: z.never().optional(),
1322
+ userId: z.never().optional(),
1323
+ applicationId: z.string().describe("Application ID.").max(36)
1324
+ }),
1325
+ z.object({
1326
+ memberId: z.never().optional(),
1327
+ visitorId: z.never().optional(),
1328
+ applicationId: z.never().optional(),
1329
+ userId: z.string().describe("User ID.").regex(
1330
+ /^[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}$/,
1331
+ "Must be a valid GUID"
1332
+ )
1333
+ })
1334
+ ])
1335
+ ).describe("ID of the visitor that submitted the form.").optional(),
1336
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
1337
+ extendedFields: z.object({
1338
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1339
+ "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)."
1340
+ ).optional()
1341
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
1342
+ orderDetails: z.object({
1343
+ orderId: z.string().describe(
1344
+ "ID of the order related to submission (only applicable if a form has payments)."
1345
+ ).regex(
1346
+ /^[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}$/,
1347
+ "Must be a valid GUID"
1348
+ ).optional().nullable(),
1349
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
1350
+ currency: z.string().describe("Currency.").optional().nullable(),
1351
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
1352
+ checkoutId: z.string().describe(
1353
+ "ID of the checkout related to submission (only applicable if a form has payments)."
1354
+ ).regex(
1355
+ /^[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}$/,
1356
+ "Must be a valid GUID"
1357
+ ).optional()
1358
+ }).describe(
1359
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
1360
+ ).optional(),
1361
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
1362
+ /^[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}$/,
1363
+ "Must be a valid GUID"
1364
+ ).optional().nullable(),
1365
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
1366
+ /^[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}$/,
1367
+ "Must be a valid GUID"
1368
+ ).optional().nullable(),
1369
+ tags: z.object({
1370
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
1371
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
1372
+ ).optional()
1373
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
1374
+ appointmentDetails: z.object({
1375
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
1376
+ /^[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}$/,
1377
+ "Must be a valid GUID"
1378
+ ).optional().nullable(),
1379
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
1380
+ }).describe(
1381
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
1382
+ ).optional()
1383
+ })
1384
+ ).optional(),
1385
+ metadata: z.object({
1386
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1387
+ cursors: z.object({
1388
+ next: z.string().describe("Cursor pointing to next page in the list of results.").max(16e3).optional().nullable(),
1389
+ prev: z.string().describe(
1390
+ "Cursor pointing to previous page in the list of results."
1391
+ ).max(16e3).optional().nullable()
1392
+ }).describe("Offset that was requested.").optional(),
1393
+ hasNext: z.boolean().describe(
1394
+ "Indicates if there are more results after the current page.\nIf `true`, another page of results can be retrieved.\nIf `false`, this is the last page."
1395
+ ).optional().nullable()
1396
+ }).describe("Paging metadata.").optional()
1397
+ });
1398
+ var SearchSubmissionsByNamespaceRequest = z.object({
1399
+ search: z.object({
1400
+ filter: z.object({
1401
+ _id: z.object({
1402
+ $eq: z.string(),
1403
+ $in: z.array(z.string()),
1404
+ $ne: z.string(),
1405
+ $nin: z.array(z.string())
1406
+ }).partial().strict().optional(),
1407
+ formId: z.object({
1408
+ $eq: z.string(),
1409
+ $in: z.array(z.string()),
1410
+ $ne: z.string(),
1411
+ $nin: z.array(z.string())
1412
+ }).partial().strict().optional(),
1413
+ namespace: z.union([
1414
+ z.string(),
1415
+ z.object({ $eq: z.string() }).partial().strict()
1416
+ ]).optional(),
1417
+ status: z.object({
1418
+ $eq: z.string(),
1419
+ $in: z.array(z.string()),
1420
+ $ne: z.string(),
1421
+ $nin: z.array(z.string())
1422
+ }).partial().strict().optional(),
1423
+ _createdDate: z.object({
1424
+ $eq: z.string(),
1425
+ $gt: z.string(),
1426
+ $gte: z.string(),
1427
+ $in: z.array(z.string()),
1428
+ $lt: z.string(),
1429
+ $lte: z.string(),
1430
+ $ne: z.string(),
1431
+ $nin: z.array(z.string())
1432
+ }).partial().strict().optional(),
1433
+ $and: z.array(z.any()).optional(),
1434
+ $or: z.array(z.any()).optional(),
1435
+ $not: z.any().optional()
1436
+ }).strict().optional(),
1437
+ sort: z.array(
1438
+ z.object({
1439
+ fieldName: z.enum(["_id", "formId", "status", "_createdDate"]).optional(),
1440
+ order: z.enum(["ASC", "DESC"]).optional()
1441
+ })
1442
+ ).optional()
1443
+ }).catchall(z.any()).describe("Query options.")
1444
+ });
1445
+ var SearchSubmissionsByNamespaceResponse = z.object({
1446
+ submissions: z.array(
1447
+ z.object({
1448
+ _id: z.string().describe("Submission ID.").regex(
1449
+ /^[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}$/,
1450
+ "Must be a valid GUID"
1451
+ ).optional().nullable(),
1452
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
1453
+ /^[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}$/,
1454
+ "Must be a valid GUID"
1455
+ ).optional(),
1456
+ namespace: z.string().describe(
1457
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
1458
+ ).min(10).max(50).optional(),
1459
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
1460
+ submissions: z.record(z.string(), z.any()).describe(
1461
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
1462
+ ).optional(),
1463
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
1464
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
1465
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1466
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
1467
+ ).optional().nullable(),
1468
+ submitter: z.intersection(
1469
+ z.object({}),
1470
+ z.xor([
1471
+ z.object({
1472
+ memberId: z.never().optional(),
1473
+ visitorId: z.never().optional(),
1474
+ applicationId: z.never().optional(),
1475
+ userId: z.never().optional()
1476
+ }),
1477
+ z.object({
1478
+ visitorId: z.never().optional(),
1479
+ applicationId: z.never().optional(),
1480
+ userId: z.never().optional(),
1481
+ memberId: z.string().describe("Member ID.").regex(
1482
+ /^[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}$/,
1483
+ "Must be a valid GUID"
1484
+ )
1485
+ }),
1486
+ z.object({
1487
+ memberId: z.never().optional(),
1488
+ applicationId: z.never().optional(),
1489
+ userId: z.never().optional(),
1490
+ visitorId: z.string().describe("Visitor ID.").regex(
1491
+ /^[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}$/,
1492
+ "Must be a valid GUID"
1493
+ )
1494
+ }),
1495
+ z.object({
1496
+ memberId: z.never().optional(),
1497
+ visitorId: z.never().optional(),
1498
+ userId: z.never().optional(),
1499
+ applicationId: z.string().describe("Application ID.").max(36)
1500
+ }),
1501
+ z.object({
1502
+ memberId: z.never().optional(),
1503
+ visitorId: z.never().optional(),
1504
+ applicationId: z.never().optional(),
1505
+ userId: z.string().describe("User ID.").regex(
1506
+ /^[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}$/,
1507
+ "Must be a valid GUID"
1508
+ )
1509
+ })
1510
+ ])
1511
+ ).describe("ID of the visitor that submitted the form.").optional(),
1512
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
1513
+ extendedFields: z.object({
1514
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1515
+ "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)."
1516
+ ).optional()
1517
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
1518
+ orderDetails: z.object({
1519
+ orderId: z.string().describe(
1520
+ "ID of the order related to submission (only applicable if a form has payments)."
1521
+ ).regex(
1522
+ /^[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}$/,
1523
+ "Must be a valid GUID"
1524
+ ).optional().nullable(),
1525
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
1526
+ currency: z.string().describe("Currency.").optional().nullable(),
1527
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
1528
+ checkoutId: z.string().describe(
1529
+ "ID of the checkout related to submission (only applicable if a form has payments)."
1530
+ ).regex(
1531
+ /^[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}$/,
1532
+ "Must be a valid GUID"
1533
+ ).optional()
1534
+ }).describe(
1535
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
1536
+ ).optional(),
1537
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
1538
+ /^[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}$/,
1539
+ "Must be a valid GUID"
1540
+ ).optional().nullable(),
1541
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
1542
+ /^[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}$/,
1543
+ "Must be a valid GUID"
1544
+ ).optional().nullable(),
1545
+ tags: z.object({
1546
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
1547
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
1548
+ ).optional()
1549
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
1550
+ appointmentDetails: z.object({
1551
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
1552
+ /^[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}$/,
1553
+ "Must be a valid GUID"
1554
+ ).optional().nullable(),
1555
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
1556
+ }).describe(
1557
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
1558
+ ).optional()
1559
+ })
1560
+ ).optional(),
1561
+ metadata: z.object({
1562
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1563
+ cursors: z.object({
1564
+ next: z.string().describe("Cursor pointing to next page in the list of results.").max(16e3).optional().nullable(),
1565
+ prev: z.string().describe(
1566
+ "Cursor pointing to previous page in the list of results."
1567
+ ).max(16e3).optional().nullable()
1568
+ }).describe("Offset that was requested.").optional(),
1569
+ hasNext: z.boolean().describe(
1570
+ "Indicates if there are more results after the current page.\nIf `true`, another page of results can be retrieved.\nIf `false`, this is the last page."
1571
+ ).optional().nullable()
1572
+ }).describe("Paging metadata.").optional()
1573
+ });
1574
+ var QuerySubmissionsByNamespaceRequest = z.object({
1575
+ query: z.object({
1576
+ filter: z.object({
1577
+ _id: z.object({
1578
+ $eq: z.string(),
1579
+ $in: z.array(z.string()),
1580
+ $ne: z.string(),
1581
+ $nin: z.array(z.string())
1582
+ }).partial().strict().optional(),
1583
+ formId: z.object({
1584
+ $eq: z.string(),
1585
+ $in: z.array(z.string()),
1586
+ $ne: z.string(),
1587
+ $nin: z.array(z.string())
1588
+ }).partial().strict().optional(),
1589
+ contactId: z.object({
1590
+ $eq: z.string(),
1591
+ $in: z.array(z.string()),
1592
+ $ne: z.string(),
1593
+ $nin: z.array(z.string())
1594
+ }).partial().strict().optional(),
1595
+ namespace: z.union([
1596
+ z.string(),
1597
+ z.object({ $eq: z.string() }).partial().strict()
1598
+ ]).optional(),
1599
+ status: z.object({
1600
+ $eq: z.string(),
1601
+ $in: z.array(z.string()),
1602
+ $ne: z.string(),
1603
+ $nin: z.array(z.string())
1604
+ }).partial().strict().optional(),
1605
+ seen: z.object({ $eq: z.boolean(), $ne: z.boolean() }).partial().strict().optional(),
1606
+ _createdDate: z.object({
1607
+ $eq: z.string(),
1608
+ $gt: z.string(),
1609
+ $gte: z.string(),
1610
+ $in: z.array(z.string()),
1611
+ $lt: z.string(),
1612
+ $lte: z.string(),
1613
+ $ne: z.string(),
1614
+ $nin: z.array(z.string())
1615
+ }).partial().strict().optional(),
1616
+ _updatedDate: z.object({
1617
+ $eq: z.string(),
1618
+ $gt: z.string(),
1619
+ $gte: z.string(),
1620
+ $in: z.array(z.string()),
1621
+ $lt: z.string(),
1622
+ $lte: z.string(),
1623
+ $ne: z.string(),
1624
+ $nin: z.array(z.string())
1625
+ }).partial().strict().optional(),
1626
+ "submitter.memberId": z.object({
1627
+ $eq: z.any(),
1628
+ $in: z.array(z.any()),
1629
+ $ne: z.any(),
1630
+ $nin: z.array(z.any())
1631
+ }).partial().strict().optional(),
1632
+ "submitter.visitorId": z.object({
1633
+ $eq: z.any(),
1634
+ $in: z.array(z.any()),
1635
+ $ne: z.any(),
1636
+ $nin: z.array(z.any())
1637
+ }).partial().strict().optional(),
1638
+ "submitter.applicationId": z.object({
1639
+ $eq: z.any(),
1640
+ $in: z.array(z.any()),
1641
+ $ne: z.any(),
1642
+ $nin: z.array(z.any())
1643
+ }).partial().strict().optional(),
1644
+ "submitter.userId": z.object({
1645
+ $eq: z.any(),
1646
+ $in: z.array(z.any()),
1647
+ $ne: z.any(),
1648
+ $nin: z.array(z.any())
1649
+ }).partial().strict().optional(),
1650
+ "orderDetails.checkoutId": z.object({
1651
+ $eq: z.string(),
1652
+ $in: z.array(z.string()),
1653
+ $ne: z.string(),
1654
+ $nin: z.array(z.string())
1655
+ }).partial().strict().optional(),
1656
+ $and: z.array(z.any()).optional(),
1657
+ $or: z.array(z.any()).optional(),
1658
+ $not: z.any().optional()
1659
+ }).strict().optional(),
1660
+ sort: z.array(
1661
+ z.object({
1662
+ fieldName: z.enum([
1663
+ "_id",
1664
+ "formId",
1665
+ "contactId",
1666
+ "status",
1667
+ "seen",
1668
+ "_createdDate",
1669
+ "_updatedDate",
1670
+ "submitter.memberId",
1671
+ "submitter.visitorId",
1672
+ "submitter.applicationId",
1673
+ "submitter.userId",
1674
+ "orderDetails.checkoutId"
1675
+ ]).optional(),
1676
+ order: z.enum(["ASC", "DESC"]).optional()
1677
+ })
1678
+ ).optional()
1679
+ }).catchall(z.any()).describe("Query options."),
1680
+ options: z.object({
1681
+ onlyYourOwn: z.boolean().describe(
1682
+ "Whether to return only your own submissions. If `false`, returns all submissions based on query filters."
1683
+ ).optional()
1684
+ }).describe("Query options.").optional()
1685
+ });
1686
+ var QuerySubmissionsByNamespaceResponse = z.object({
1687
+ submissions: z.array(
1688
+ z.object({
1689
+ _id: z.string().describe("Submission ID.").regex(
1690
+ /^[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}$/,
1691
+ "Must be a valid GUID"
1692
+ ).optional().nullable(),
1693
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
1694
+ /^[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}$/,
1695
+ "Must be a valid GUID"
1696
+ ).optional(),
1697
+ namespace: z.string().describe(
1698
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
1699
+ ).min(10).max(50).optional(),
1700
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).describe("Status of the submission.").optional(),
1701
+ submissions: z.record(z.string(), z.any()).describe(
1702
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
1703
+ ).optional(),
1704
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
1705
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
1706
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1707
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
1708
+ ).optional().nullable(),
1709
+ submitter: z.intersection(
1710
+ z.object({}),
1711
+ z.xor([
1712
+ z.object({
1713
+ memberId: z.never().optional(),
1714
+ visitorId: z.never().optional(),
1715
+ applicationId: z.never().optional(),
1716
+ userId: z.never().optional()
1717
+ }),
1718
+ z.object({
1719
+ visitorId: z.never().optional(),
1720
+ applicationId: z.never().optional(),
1721
+ userId: z.never().optional(),
1722
+ memberId: z.string().describe("Member ID.").regex(
1723
+ /^[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}$/,
1724
+ "Must be a valid GUID"
1725
+ )
1726
+ }),
1727
+ z.object({
1728
+ memberId: z.never().optional(),
1729
+ applicationId: z.never().optional(),
1730
+ userId: z.never().optional(),
1731
+ visitorId: z.string().describe("Visitor ID.").regex(
1732
+ /^[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}$/,
1733
+ "Must be a valid GUID"
1734
+ )
1735
+ }),
1736
+ z.object({
1737
+ memberId: z.never().optional(),
1738
+ visitorId: z.never().optional(),
1739
+ userId: z.never().optional(),
1740
+ applicationId: z.string().describe("Application ID.").max(36)
1741
+ }),
1742
+ z.object({
1743
+ memberId: z.never().optional(),
1744
+ visitorId: z.never().optional(),
1745
+ applicationId: z.never().optional(),
1746
+ userId: z.string().describe("User ID.").regex(
1747
+ /^[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}$/,
1748
+ "Must be a valid GUID"
1749
+ )
1750
+ })
1751
+ ])
1752
+ ).describe("ID of the visitor that submitted the form.").optional(),
1753
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
1754
+ extendedFields: z.object({
1755
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1756
+ "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)."
1757
+ ).optional()
1758
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
1759
+ orderDetails: z.object({
1760
+ orderId: z.string().describe(
1761
+ "ID of the order related to submission (only applicable if a form has payments)."
1762
+ ).regex(
1763
+ /^[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}$/,
1764
+ "Must be a valid GUID"
1765
+ ).optional().nullable(),
1766
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
1767
+ currency: z.string().describe("Currency.").optional().nullable(),
1768
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
1769
+ checkoutId: z.string().describe(
1770
+ "ID of the checkout related to submission (only applicable if a form has payments)."
1771
+ ).regex(
1772
+ /^[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}$/,
1773
+ "Must be a valid GUID"
1774
+ ).optional()
1775
+ }).describe(
1776
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
1777
+ ).optional(),
1778
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
1779
+ /^[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}$/,
1780
+ "Must be a valid GUID"
1781
+ ).optional().nullable(),
1782
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
1783
+ /^[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}$/,
1784
+ "Must be a valid GUID"
1785
+ ).optional().nullable(),
1786
+ tags: z.object({
1787
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
1788
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
1789
+ ).optional()
1790
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
1791
+ appointmentDetails: z.object({
1792
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
1793
+ /^[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}$/,
1794
+ "Must be a valid GUID"
1795
+ ).optional().nullable(),
1796
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
1797
+ }).describe(
1798
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
1799
+ ).optional()
1800
+ })
1801
+ ).optional(),
1802
+ metadata: z.object({
1803
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1804
+ cursors: z.object({
1805
+ next: z.string().describe("Cursor pointing to next page in the list of results.").max(16e3).optional().nullable(),
1806
+ prev: z.string().describe(
1807
+ "Cursor pointing to previous page in the list of results."
1808
+ ).max(16e3).optional().nullable()
1809
+ }).describe("Offset that was requested.").optional(),
1810
+ hasNext: z.boolean().describe(
1811
+ "Indicates if there are more results after the current page.\nIf `true`, another page of results can be retrieved.\nIf `false`, this is the last page."
1812
+ ).optional().nullable()
1813
+ }).describe("Paging metadata.").optional()
1814
+ });
1815
+ var CountSubmissionsByFilterRequest = z.object({
1816
+ filter: z.record(z.string(), z.any()).describe("A filter object. Must filter by namespace."),
1817
+ options: z.object({
1818
+ search: z.object({
1819
+ mode: z.enum(["OR", "AND"]).optional(),
1820
+ expression: z.string().describe("Search term or expression").max(100).optional().nullable(),
1821
+ fuzzy: z.boolean().describe(
1822
+ "Flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm)"
1823
+ ).optional()
1824
+ }).describe("Free text to match in searchable fields.").optional()
1825
+ }).optional()
1826
+ });
1827
+ var CountSubmissionsByFilterResponse = z.object({
1828
+ formsSubmissionsCount: z.array(
1829
+ z.object({
1830
+ formId: z.string().describe("Form ID.").regex(
1831
+ /^[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}$/,
1832
+ "Must be a valid GUID"
1833
+ ).optional(),
1834
+ totalCount: z.number().int().describe("Total number of submissions.").optional(),
1835
+ unseenCount: z.number().int().describe(
1836
+ "Number of submissions that haven't yet been seen by site Extensions with manage submission permissions."
1837
+ ).optional()
1838
+ })
1839
+ ).optional()
1840
+ });
1841
+ var CountSubmissionsRequest = z.object({
1842
+ formIds: z.array(z.string()).min(1).max(100),
1843
+ namespace: z.string().describe(
1844
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `getSubmission()` to retrieve the namespace."
1845
+ ).min(10).max(50),
1846
+ options: z.object({
1847
+ statuses: z.array(
1848
+ z.enum([
1849
+ "PENDING",
1850
+ "CONFIRMED",
1851
+ "PAYMENT_WAITING",
1852
+ "PAYMENT_CANCELED"
1853
+ ])
1854
+ ).max(4).optional()
1855
+ }).optional()
1856
+ });
1857
+ var CountSubmissionsResponse = z.object({
1858
+ formsSubmissionsCount: z.array(
1859
+ z.object({
1860
+ formId: z.string().describe("Form ID.").regex(
1861
+ /^[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}$/,
1862
+ "Must be a valid GUID"
1863
+ ).optional(),
1864
+ totalCount: z.number().int().describe("Total number of submissions.").optional(),
1865
+ unseenCount: z.number().int().describe(
1866
+ "Number of submissions that haven't yet been seen by site Extensions with manage submission permissions."
1867
+ ).optional()
1868
+ })
1869
+ ).optional()
1870
+ });
1871
+ var CountDeletedSubmissionsRequest = z.object({
1872
+ formIds: z.array(z.string()).min(1).max(100),
1873
+ namespace: z.string().describe(
1874
+ 'Identifies the app which the form submissions belong to. For example, the namespace for the Wix Forms App is `"wix.form_app.form"`. The namespace of a submission can be retrieved using the Get Submission endpoint.'
1875
+ ).min(10).max(50),
1876
+ options: z.object({
1877
+ statuses: z.array(
1878
+ z.enum([
1879
+ "PENDING",
1880
+ "CONFIRMED",
1881
+ "PAYMENT_WAITING",
1882
+ "PAYMENT_CANCELED"
1883
+ ])
1884
+ ).max(4).optional()
1885
+ }).optional()
1886
+ });
1887
+ var CountDeletedSubmissionsResponse = z.object({
1888
+ formsDeletedSubmissionsCount: z.array(
1889
+ z.object({
1890
+ formId: z.string().describe("Form ID.").regex(
1891
+ /^[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}$/,
1892
+ "Must be a valid GUID"
1893
+ ).optional(),
1894
+ totalCount: z.number().int().describe("Total number of submissions.").optional()
1895
+ })
1896
+ ).optional()
1897
+ });
1898
+ var GetMediaUploadUrlRequest = z.object({
1899
+ formId: z.string().describe("Form ID.").regex(
1900
+ /^[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}$/,
1901
+ "Must be a valid GUID"
1902
+ ),
1903
+ filename: z.string().describe("Name of file to upload.").max(300),
1904
+ mimeType: z.string().describe(
1905
+ "[Mime type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#) of file to upload.\n\nFor example, `'image/png'`"
1906
+ ).max(100)
1907
+ });
1908
+ var GetMediaUploadUrlResponse = z.object({
1909
+ uploadUrl: z.string().describe("Url to upload file.").max(500).optional()
1910
+ });
1911
+ var BulkMarkSubmissionsAsSeenRequest = z.object({
1912
+ ids: z.array(z.string()).min(0).max(100),
1913
+ formId: z.string().describe("ID of the form which the submissions belong to.").regex(
1914
+ /^[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}$/,
1915
+ "Must be a valid GUID"
1916
+ )
1917
+ });
1918
+ var BulkMarkSubmissionsAsSeenResponse = z.object({
1919
+ jobId: z.string().describe("Job id for the bulk update operation").regex(
1920
+ /^[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}$/,
1921
+ "Must be a valid GUID"
1922
+ ).optional()
1923
+ });
1924
+ var GetSubmissionDownloadUrlRequest = z.object({
1925
+ submissionId: z.string().describe("Submission ID.").regex(
1926
+ /^[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}$/,
1927
+ "Must be a valid GUID"
1928
+ )
1929
+ });
1930
+ var GetSubmissionDownloadUrlResponse = z.object({
1931
+ document: z.intersection(
1932
+ z.object({
1933
+ _id: z.string().describe("Document ID.").max(50).optional().nullable(),
1934
+ status: z.enum(["UNKNOWN_STATUS", "READY", "PENDING", "FAILED"]).describe("Document status.").optional()
1935
+ }),
1936
+ z.xor([
1937
+ z.object({ readyDetails: z.never().optional() }),
1938
+ z.object({
1939
+ readyDetails: z.object({
1940
+ downloadUrl: z.string().describe("Document download URL.").max(300).optional()
1941
+ }).describe("Data of ready to download document")
1942
+ })
1943
+ ])
1944
+ ).describe("The retrieved submission document.").optional()
1945
+ });
1946
+ var DownloadSubmissionRequest = z.object({
1947
+ submissionId: z.string().describe("Submission id for which the document is generated.").regex(
1948
+ /^[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}$/,
1949
+ "Must be a valid GUID"
1950
+ ),
1951
+ accessToken: z.string().describe("Access token to download the document.").max(1e4)
1952
+ });
1953
+ var DownloadSubmissionResponse = z.object({
1954
+ body: z.string().optional(),
1955
+ statusCode: z.number().int().optional().nullable(),
1956
+ headers: z.array(
1957
+ z.object({ key: z.string().optional(), value: z.string().optional() })
1958
+ ).optional()
1959
+ });
1960
+ var GetFormattedSubmissionRequest = z.object({
1961
+ submissionId: z.string().describe("Submission ID.").regex(
1962
+ /^[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}$/,
1963
+ "Must be a valid GUID"
1964
+ )
1965
+ });
1966
+ var GetFormattedSubmissionResponse = z.object({
1967
+ submissionId: z.string().describe("Submission ID.").regex(
1968
+ /^[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}$/,
1969
+ "Must be a valid GUID"
1970
+ ).optional(),
1971
+ submissions: z.array(
1972
+ z.object({
1973
+ label: z.string().describe("Label of form field").max(500).optional().nullable(),
1974
+ key: z.string().describe("Key of the submission, and target of a form field").max(200).optional(),
1975
+ value: z.string().describe("Value of the submission, formatted as a string").max(500).optional(),
1976
+ fieldId: z.string().describe("Id of the form field").regex(
1977
+ /^[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}$/,
1978
+ "Must be a valid GUID"
1979
+ ).optional()
1980
+ })
1981
+ ).max(100).optional()
1982
+ });
1983
+ var UpdateExtendedFieldsRequest = z.object({
1984
+ _id: z.string().describe("ID of the entity to update."),
1985
+ namespace: z.string().describe(
1986
+ "Identifier for the app whose extended fields are being updated."
1987
+ ),
1988
+ options: z.object({
1989
+ namespaceData: z.record(z.string(), z.any()).describe(
1990
+ "Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured."
1991
+ )
1992
+ })
1993
+ });
1994
+ var UpdateExtendedFieldsResponse = z.object({
1995
+ namespace: z.string().describe("namespace that was updated").min(10).max(50).optional(),
1996
+ namespaceData: z.record(z.string(), z.any()).describe("only data from UpdateExtendedFieldsRequest namespace_data").optional().nullable()
1997
+ });
1998
+ var ValidateFormSubmissionRequest = z.object({
1999
+ submission: z.object({
2000
+ _id: z.string().describe("Submission ID.").regex(
2001
+ /^[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}$/,
2002
+ "Must be a valid GUID"
2003
+ ).optional().nullable(),
2004
+ formId: z.string().describe("ID of the form which the submission belongs to.").regex(
2005
+ /^[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}$/,
2006
+ "Must be a valid GUID"
2007
+ ).optional(),
2008
+ namespace: z.string().describe(
2009
+ "The app which the form submissions belong to. For example, the namespace for the Wix Forms app is `wix.form_app.form`. Call `Get Submission` to retrieve the namespace."
2010
+ ).min(10).max(50).optional(),
2011
+ status: z.enum(["PENDING", "CONFIRMED", "PAYMENT_WAITING", "PAYMENT_CANCELED"]).optional(),
2012
+ submissions: z.record(z.string(), z.any()).describe(
2013
+ "Submission values where `key` is the form field and `value` is the data submitted for the given field."
2014
+ ).optional(),
2015
+ _createdDate: z.date().describe("Date and time the form submission was created.").optional().nullable(),
2016
+ _updatedDate: z.date().describe("Date and time the form submission was updated.").optional().nullable(),
2017
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
2018
+ "Revision number, which increments by 1 each time the form submission is updated. To prevent conflicting changes, the existing revision must be used when updating a form submission."
2019
+ ).optional().nullable(),
2020
+ submitter: z.intersection(
2021
+ z.object({}),
2022
+ z.xor([
2023
+ z.object({
2024
+ memberId: z.never().optional(),
2025
+ visitorId: z.never().optional(),
2026
+ applicationId: z.never().optional(),
2027
+ userId: z.never().optional()
2028
+ }),
2029
+ z.object({
2030
+ visitorId: z.never().optional(),
2031
+ applicationId: z.never().optional(),
2032
+ userId: z.never().optional(),
2033
+ memberId: z.string().describe("Member ID.").regex(
2034
+ /^[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}$/,
2035
+ "Must be a valid GUID"
2036
+ )
2037
+ }),
2038
+ z.object({
2039
+ memberId: z.never().optional(),
2040
+ applicationId: z.never().optional(),
2041
+ userId: z.never().optional(),
2042
+ visitorId: z.string().describe("Visitor ID.").regex(
2043
+ /^[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}$/,
2044
+ "Must be a valid GUID"
2045
+ )
2046
+ }),
2047
+ z.object({
2048
+ memberId: z.never().optional(),
2049
+ visitorId: z.never().optional(),
2050
+ userId: z.never().optional(),
2051
+ applicationId: z.string().describe("Application ID.").max(36)
2052
+ }),
2053
+ z.object({
2054
+ memberId: z.never().optional(),
2055
+ visitorId: z.never().optional(),
2056
+ applicationId: z.never().optional(),
2057
+ userId: z.string().describe("User ID.").regex(
2058
+ /^[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}$/,
2059
+ "Must be a valid GUID"
2060
+ )
2061
+ })
2062
+ ])
2063
+ ).describe("ID of the visitor that submitted the form.").optional(),
2064
+ seen: z.boolean().describe('Whether a site owner marked a submission as "seen".').optional(),
2065
+ extendedFields: z.object({
2066
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
2067
+ "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)."
2068
+ ).optional()
2069
+ }).describe("Data extension object that holds users' and apps' fields.").optional(),
2070
+ orderDetails: z.object({
2071
+ orderId: z.string().describe(
2072
+ "ID of the order related to submission (only applicable if a form has payments)."
2073
+ ).regex(
2074
+ /^[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}$/,
2075
+ "Must be a valid GUID"
2076
+ ).optional().nullable(),
2077
+ number: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Order number.").optional().nullable(),
2078
+ currency: z.string().describe("Currency.").optional().nullable(),
2079
+ itemSubtotal: z.string().describe("Item subtotal.").optional(),
2080
+ checkoutId: z.string().describe(
2081
+ "ID of the checkout related to submission (only applicable if a form has payments)."
2082
+ ).regex(
2083
+ /^[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}$/,
2084
+ "Must be a valid GUID"
2085
+ ).optional()
2086
+ }).describe(
2087
+ "Order details. <br>\n<b>Note</b>: This object is only applicable when submitting a form in the Wix Payments app."
2088
+ ).optional(),
2089
+ contactId: z.string().describe("Contact ID of a site visitor who created the submission.").regex(
2090
+ /^[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}$/,
2091
+ "Must be a valid GUID"
2092
+ ).optional().nullable(),
2093
+ accessRestriction: z.string().describe("Authorized viewer ID.").regex(
2094
+ /^[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}$/,
2095
+ "Must be a valid GUID"
2096
+ ).optional().nullable(),
2097
+ tags: z.object({
2098
+ tags: z.object({ tagIds: z.array(z.string()).max(100).optional() }).describe(
2099
+ "Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors."
2100
+ ).optional()
2101
+ }).describe("Tag IDs collections associated with the current entity.").optional(),
2102
+ appointmentDetails: z.object({
2103
+ staffMemberId: z.string().describe("ID of the staff member assigned to the appointment.").regex(
2104
+ /^[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}$/,
2105
+ "Must be a valid GUID"
2106
+ ).optional().nullable(),
2107
+ staffMemberName: z.string().describe("Name of the staff member assigned to the appointment.").min(1).max(40).optional().nullable()
2108
+ }).describe(
2109
+ "Appointment details.\nThis object is only applicable when submitting a form that creates a booking appointment."
2110
+ ).optional()
2111
+ }).describe("Submission to validate."),
2112
+ options: z.object({
2113
+ additionalMetadata: z.record(z.string(), z.any()).describe(
2114
+ "Optional metadata passed to SPI implementer, allowing clients to include additional business-specific data."
2115
+ ).optional().nullable(),
2116
+ fieldsToValidate: z.array(z.string()).max(200).optional()
2117
+ }).optional()
2118
+ });
2119
+ var ValidateFormSubmissionResponse = z.object({
2120
+ valid: z.boolean().describe("Flag indicating if the submission is valid\nDefault: true").optional().nullable(),
2121
+ violationErrors: z.array(
2122
+ z.intersection(
2123
+ z.object({
2124
+ name: z.string().describe("Name of violated entity").max(50).optional(),
2125
+ description: z.string().describe("Description of the error").max(512).optional(),
2126
+ ruleName: z.string().describe("Rule name").max(50).optional()
2127
+ }),
2128
+ z.xor([
2129
+ z.object({ submissionValidationErrors: z.never().optional() }),
2130
+ z.object({
2131
+ submissionValidationErrors: z.object({
2132
+ errors: z.array(
2133
+ z.intersection(
2134
+ z.object({
2135
+ errorPath: z.string().describe(
2136
+ "Path indicating the source of the error, such as `form.fields.target`."
2137
+ ).max(500).optional(),
2138
+ params: z.record(z.string(), z.any()).describe("Additional error parameters.").optional().nullable()
2139
+ }),
2140
+ z.xor([
2141
+ z.object({
2142
+ errorType: z.never().optional(),
2143
+ customErrorMessage: z.never().optional()
2144
+ }),
2145
+ z.object({
2146
+ customErrorMessage: z.never().optional(),
2147
+ errorType: z.enum([
2148
+ "UNKNOWN_ERROR",
2149
+ "TYPE_ERROR",
2150
+ "REQUIRED_VALUE_ERROR",
2151
+ "UNKNOWN_VALUE_ERROR",
2152
+ "MAX_LENGTH_ERROR",
2153
+ "MIN_LENGTH_ERROR",
2154
+ "PATTERN_ERROR",
2155
+ "FORMAT_ERROR",
2156
+ "MAX_VALUE_ERROR",
2157
+ "MIN_VALUE_ERROR",
2158
+ "MULTIPLE_OF_VALUE_ERROR",
2159
+ "MIN_ITEMS_ERROR",
2160
+ "MAX_ITEMS_ERROR",
2161
+ "NOT_ALLOWED_VALUE_ERROR",
2162
+ "DISABLED_FORM_ERROR"
2163
+ ]).describe("Predefined error type.")
2164
+ }),
2165
+ z.object({
2166
+ errorType: z.never().optional(),
2167
+ customErrorMessage: z.string().describe(
2168
+ "Custom error message. The message is displayed instead of an error type."
2169
+ ).max(500)
2170
+ })
2171
+ ])
2172
+ )
2173
+ ).max(100).optional()
2174
+ }).describe("Validation errors")
2175
+ })
2176
+ ])
2177
+ )
2178
+ ).max(100).optional()
2179
+ });
2180
+ export {
2181
+ BulkDeleteSubmissionRequest,
2182
+ BulkDeleteSubmissionResponse,
2183
+ BulkMarkSubmissionsAsSeenRequest,
2184
+ BulkMarkSubmissionsAsSeenResponse,
2185
+ BulkRemoveSubmissionFromTrashBinRequest,
2186
+ BulkRemoveSubmissionFromTrashBinResponse,
2187
+ ConfirmSubmissionRequest,
2188
+ ConfirmSubmissionResponse,
2189
+ CountDeletedSubmissionsRequest,
2190
+ CountDeletedSubmissionsResponse,
2191
+ CountSubmissionsByFilterRequest,
2192
+ CountSubmissionsByFilterResponse,
2193
+ CountSubmissionsRequest,
2194
+ CountSubmissionsResponse,
2195
+ CreateSubmissionRequest,
2196
+ CreateSubmissionResponse,
2197
+ DeleteSubmissionRequest,
2198
+ DeleteSubmissionResponse,
2199
+ DownloadSubmissionRequest,
2200
+ DownloadSubmissionResponse,
2201
+ GetDeletedSubmissionRequest,
2202
+ GetDeletedSubmissionResponse,
2203
+ GetFormattedSubmissionRequest,
2204
+ GetFormattedSubmissionResponse,
2205
+ GetMediaUploadUrlRequest,
2206
+ GetMediaUploadUrlResponse,
2207
+ GetSubmissionDownloadUrlRequest,
2208
+ GetSubmissionDownloadUrlResponse,
2209
+ GetSubmissionRequest,
2210
+ GetSubmissionResponse,
2211
+ ListDeletedSubmissionsRequest,
2212
+ ListDeletedSubmissionsResponse,
2213
+ QuerySubmissionRequest,
2214
+ QuerySubmissionResponse,
2215
+ QuerySubmissionsByNamespaceRequest,
2216
+ QuerySubmissionsByNamespaceResponse,
2217
+ RemoveSubmissionFromTrashBinRequest,
2218
+ RemoveSubmissionFromTrashBinResponse,
2219
+ RestoreSubmissionFromTrashBinRequest,
2220
+ RestoreSubmissionFromTrashBinResponse,
2221
+ SearchSubmissionsByNamespaceRequest,
2222
+ SearchSubmissionsByNamespaceResponse,
2223
+ UpdateExtendedFieldsRequest,
2224
+ UpdateExtendedFieldsResponse,
2225
+ UpdateSubmissionRequest,
2226
+ UpdateSubmissionResponse,
2227
+ UpsertContactFromSubmissionRequest,
2228
+ UpsertContactFromSubmissionResponse,
2229
+ ValidateFormSubmissionRequest,
2230
+ ValidateFormSubmissionResponse
2231
+ };
2232
+ //# sourceMappingURL=schemas.mjs.map