/** * **Deprecated.** * This object will be deprecated on March 30, 2026. Replace with the object from [getForm()](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * * > **Migration Instructions** * > * > To stay compatible with future changes, migrate to * > [`getForm()`](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * > * > To migrate to the new method: * > * > 1. Add a backend file to your site. * > * > 2. Write a code so that it replaces the `formData` object from the frontend with the `getForm()` method's object from the backend. Export your backend function so that it can be used in the frontend. * > * > 3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected. * * The returned `FormData` object contains the information you need to create * a custom registration form for the specified event. * * This information includes: * * + The event's registration status, such as whether registration is * open, closed, or guests will be placed on a waitl ist. * + Which statuses guests can RSVP with, such as yes, no, or to be added * to the wait list. * + Whether the event is a ticketed event. * + Information about the registration form's fields, such as their names, * descriptive labels, and whether they're required. * * > **Note:** The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality. * @readonly * @servicePath wix-events-frontend.Form.FormData */ export function formData(): Promise; /** * A registration form for an event. * * You can use a `Form` to create a custom registration form for accepting RSVPs, with the * RSVP APIs ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/events/rsvp/introduction) | [Velo](https://dev.wix.com/docs/velo/apis/wix-events-frontend/rsvp/introduction)), * or when offering tickets, with the Tickets APIs ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/events/tickets/introduction) | [Velo](https://dev.wix.com/docs/velo/apis/wix-events-frontend/tickets/introduction)), * for events. */ export interface Form { /** * **Deprecated.** * This object will be deprecated on March 30, 2026. Replace with the object from [getForm()](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * * > **Migration Instructions** * > * > To stay compatible with future changes, migrate to * > [`getForm()`](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * > * > To migrate to the new method: * > * > 1. Add a backend file to your site. * > * > 2. Write a code so that it replaces the `formData` object from the frontend with the `getForm()` method's object from the backend. Export your backend function so that it can be used in the frontend. * > * > 3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected. * * The returned `FormData` object contains the information you need to create * a custom registration form for the specified event. * * This information includes: * * + The event's registration status, such as whether registration is * open, closed, or guests will be placed on a waitl ist. * + Which statuses guests can RSVP with, such as yes, no, or to be added * to the wait list. * + Whether the event is a ticketed event. * + Information about the registration form's fields, such as their names, * descriptive labels, and whether they're required. * * > **Note:** The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality. * @readonly * @servicePath wix-events-frontend.Form.FormData */ readonly formData: FormData; /** * **Deprecated.** * This method will be deprecated on March 30, 2026. Replace with [getForm()](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * * > **Migration Instructions** * > * > To stay compatible with future changes, migrate to * > [`getForm()`](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). The validation is now performed under the hood by the `getForm()` method. * > * > To migrate to the new method: * > * > 1. Add a backend file to your site. * > * > 2. Write a code so that it replaces the `validate()` method from the frontend with the `getForm()` method from the backend. Export your backend function so that it can be used in the frontend. * > * > 3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected. * * The `validate()` method returns a Promise that resolves to `{valid: true}` * if the fields and values in the registration form are valid or rejects if there are * invalid fields or values. * * When `validate()` is called, `validateInput()` * also runs for all your form fields. * * The following are invalid when checked against the event's registration form * as defined in the site dashboard: * * + The specified form values contain a field that doesn't exist in the event's registration form. * + The specified form values are missing a field that exists in the event's registration form. You * must also include non-required fields even if their values are empty. * * > **Note:** The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality. * @param formValues - Field names and values for a registration form. * @requiredField formValues * @servicePath wix-events-frontend.Form.FormValue * @returns Fulfilled - Validation result when validation passes. * Rejected - `FieldValidationError` when validation fails. * @servicePath wix-events-frontend.Form.ValidationResult */ validate(formValues: FormValue[]): Promise; /** * **Deprecated.** * This method will be deprecated on March 30, 2026. Replace with [getForm()](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * * > **Migration Instructions** * > * > To stay compatible with future changes, migrate to * > [`getForm()`](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). The validation is now performed under the hood by the `getForm()` method. * > * > To migrate to the new method: * > * > 1. Add a backend file to your site. * > * > 2. Write a code so that it replaces the `validateInput()` method from the frontend with the `getForm()` method from the backend. Export your backend function so that it can be used in the frontend. * > * > 3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected. * * `validateInput()` returns `{valid: true}` * if the value in the specified field is valid and throws an error if it's not valid. * * You may want to call `validateInput()` in an input element's * `onCustomValidation()` * to validate an input while the form is being filled out. * * > **Note:** The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality. * @param inputName - Name of the input field to validate. * @requiredField inputName * @param formValues - Field names and values for a registration form. * @requiredField formValues * @servicePath wix-events-frontend.Form.FormValue * @returns An object representing whether the input value is valid. * @servicePath wix-events-frontend.Form.ValidationResult */ validateInput(inputName: string, formValues: FormValue[]): Promise; } /** * An object containing information about a label for a complex input field type. */ export interface AdditionalLabel { /** * Additional label name. * @requiredField name */ name: string; /** * Additional label value. * @requiredField label */ label: string; } /** * An object representing an error that occurred during validation of a registration form's fields. */ export interface FieldValidationError { /** * Error message. * @requiredField message */ message: string; /** * List of fields that caused the error when the form doesn't pass validation. * @requiredField fields */ fields: string[]; } /** * An object representing the details needed to create a registration form for an event. */ export interface FormData { /** * Information about the input fields needed to create a registration form. * @requiredField formInputs * @servicePath wix-events-frontend.Form.InputItem */ formInputs: InputItem[]; /** * Allowed RSVP statuses for an event. * One of: * * + `"YES_AND_NO"`: Guests can RSVP for the event with a "Yes" or "No". * + `"YES_ONLY"`: Guests can only RSVP for the event with a "Yes". * + `"WAITING"`: The guest limit has been reached, but there is an open wait list. * @requiredField rsvpStatusOptions */ rsvpStatusOptions: string; /** * Event registration status. * One of: * * + `"OPEN_RSVP"`: Registration is open and guest limit hasn't been reached. * + `"OPEN_RSVP_WAITLIST"`: Registration is open, guest limit has been reached, * and additional registering guests are added to the wait list. * + `"OPEN_TICKETS"`: Registration is open for a ticketed event and there are still * tickets available. * + `"OPEN_EXTERNAL"`: Registration is open for an event that uses external registration, * not RSVP or ticketed. * + `"CLOSED"`: Registration is closed because the guest limit has been reached. * + `"CLOSED_MANUALLY"`: Registration was closed manually. * @requiredField registrationStatus */ registrationStatus: string; /** * Whether the event is a ticketed event. * @requiredField isTicketed */ isTicketed: boolean; } /** * An object containing information about a form value. */ export interface FormValue { /** * Form field name. * @requiredField name */ name: string; /** * Form field value. * @requiredField value */ value: string; } /** * An object containing information about an input field in a registration form. */ export interface InputItem { /** * Unique input identifier. * @requiredField _id */ _id: string; /** * Whether the input field's value is an array. * @requiredField array */ array: boolean; /** * Input field display label. * @requiredField label */ label: string; /** * Additional field display labels for complex fields. * @requiredField additionalLabels * @servicePath wix-events-frontend.Form.AdditionalLabel */ additionalLabels: AdditionalLabel[]; /** * List of value options where applicable. * @requiredField options */ options: string[]; /** * Maximum length of the input field's value. A value of `0` indicates no maximum length. * @requiredField maxLength */ maxLength: number; /** * Input field name. * @requiredField name */ name: string; /** * Whether the input field is required. * @requiredField required */ required: boolean; /** * The type of the input field. * One of: * * + `"NAME"` * + `"INPUT"` * + `"RADIO"` * + `"CHECKBOX"` * + `"DROPDOWN"` * + `"GUEST_CONTROL"` * + `"ADDRESS_FULL"` * + `"TEXTAREA"` * + `"DATE"` * @requiredField controlType */ controlType: string; } /** * An object representing the result of a validation. */ export interface ValidationResult { /** * Indicates that the registration form fields are valid. * @requiredField valid */ valid: boolean; } /** * An object representing an error that occurred during validation of an RSVP form's values. */ export interface ValueValidationError { /** * Error message. * @requiredField message */ message: string; /** * ID of the input field that failed validation. * @requiredField inputId */ inputId: string; /** * Error type. * One of: * * + `"EMPTY_INPUT"`: A required field is missing its value. * + `"INVALID_INPUT_VALUE"`: The value isn't valid for the field type. * + `"INPUT_TOO_LONG"`: The value is too long. * + `"INVALID_OPTION"`: The value doesn't match one of the defined options for the field. * + `"INVALID_STATUS"`: The status value isn't valid. * + `"INVALID_NUMBER_OF_GUESTS"`: The number of guests doesn't match the number defined for the form. * @requiredField errorType */ errorType: string; } /** * **Deprecated.** * This method will be deprecated on March 30, 2026. Replace with [getForm()](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * * > **Migration Instructions** * > * > To stay compatible with future changes, migrate to * > [`getForm()`](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). The validation is now performed under the hood by the `getForm()` method. * > * > To migrate to the new method: * > * > 1. Add a backend file to your site. * > * > 2. Write a code so that it replaces the `validate()` method from the frontend with the `getForm()` method from the backend. Export your backend function so that it can be used in the frontend. * > * > 3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected. * * The `validate()` method returns a Promise that resolves to `{valid: true}` * if the fields and values in the registration form are valid or rejects if there are * invalid fields or values. * * When `validate()` is called, `validateInput()` * also runs for all your form fields. * * The following are invalid when checked against the event's registration form * as defined in the site dashboard: * * + The specified form values contain a field that doesn't exist in the event's registration form. * + The specified form values are missing a field that exists in the event's registration form. You * must also include non-required fields even if their values are empty. * * > **Note:** The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality. * @param formValues - Field names and values for a registration form. * @requiredField formValues * @servicePath wix-events-frontend.Form.FormValue * @returns Fulfilled - Validation result when validation passes. * Rejected - `FieldValidationError` when validation fails. * @servicePath wix-events-frontend.Form.ValidationResult */ export function validate(formValues: FormValue[]): Promise; /** * **Deprecated.** * This method will be deprecated on March 30, 2026. Replace with [getForm()](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). * * > **Migration Instructions** * > * > To stay compatible with future changes, migrate to * > [`getForm()`](https://dev.wix.com/docs/sdk/backend-modules/events/forms/get-form). The validation is now performed under the hood by the `getForm()` method. * > * > To migrate to the new method: * > * > 1. Add a backend file to your site. * > * > 2. Write a code so that it replaces the `validateInput()` method from the frontend with the `getForm()` method from the backend. Export your backend function so that it can be used in the frontend. * > * > 3. Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected. * * `validateInput()` returns `{valid: true}` * if the value in the specified field is valid and throws an error if it's not valid. * * You may want to call `validateInput()` in an input element's * `onCustomValidation()` * to validate an input while the form is being filled out. * * > **Note:** The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality. * @param inputName - Name of the input field to validate. * @requiredField inputName * @param formValues - Field names and values for a registration form. * @requiredField formValues * @servicePath wix-events-frontend.Form.FormValue * @returns An object representing whether the input value is valid. * @servicePath wix-events-frontend.Form.ValidationResult */ export function validateInput(inputName: string, formValues: FormValue[]): Promise;