import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** * A wrapper around a Wix form that adds expiration tracking and submission management. * Intake forms collect information from contacts with time-based validity requirements. */ interface IntakeForm { /** * Intake form ID. Identical to the [Wix Forms form ID](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/form-object). * @format GUID * @readonly */ _id?: string | null; /** * Expiration period in months. If not set, submissions don't expire. * @min 1 * @max 60 */ expirationPeriodInMonths?: number | null; /** * Whether the intake form is archived and disabled from accepting new submissions. * @readonly */ archived?: boolean | null; /** * Intake form name. * @minLength 1 * @maxLength 100 * @readonly */ name?: string | null; /** * Date and time the intake form was created in UTC datetime `YYYY-MM-DDThh:mm:ssZ` format. * @readonly */ _createdDate?: Date | null; /** * Date and time the intake form was updated in UTC datetime `YYYY-MM-DDThh:mm:ssZ` format. * @readonly */ _updatedDate?: Date | null; /** * Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, the current revision must be passed when updating the intake form. * @readonly */ revision?: string | null; } /** A reference to a Wix Forms field that triggers `PENDING_APPROVAL` when filled. */ interface PendingTriggerField { /** * ID of the [Wix Forms field](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/form-object) that drives the trigger. * Must reference a visible checkbox input field. Configuring an unsupported, * hidden, or unknown field via `UpdateIntakeFormSettings` is rejected with `UNSUPPORTED_TRIGGER_FIELD`. * Stored as the stable field ID (not the translatable label). * @format GUID */ formFieldId?: string; } /** How an intake form decides which of its submissions require manual approval before becoming valid. */ declare enum ApprovalMode { } /** @enumType */ type ApprovalModeWithLiterals = ApprovalMode; interface QueryIntakeFormsRequest { /** * Filter object. * See @API Query Language * for more information. * * For a detailed list of supported filters, see * @Supported Filters. */ query?: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** * Cursor paging options. * * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: CursorPaging; /** * Filter object. * * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). */ filter?: Record | null; /** * Sort object. * * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). * @maxSize 5 */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** * Cursor paging options. * * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryIntakeFormsResponse { /** Retrieved intake forms. */ intakeForms?: IntakeForm[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in current page. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface UpdateIntakeFormExpirationPeriodRequest { /** * Intake form ID. * @format GUID */ intakeFormId: string | null; /** * New expiration period in months. If not set, submissions don't expire. * @min 1 * @max 60 */ expirationPeriodInMonths?: number | null; /** * Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. */ formRevision: string | null; } interface UpdateIntakeFormExpirationPeriodResponse { /** Updated intake form. */ intakeForm?: IntakeForm; } interface UpdateIntakeFormSettingsRequest { /** * Intake form ID. * @format GUID */ intakeFormId?: string; /** * Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. */ formRevision?: string; /** * Base expiration period in months. Omit to leave unchanged; explicit null clears it (submissions don't expire). * @min 1 * @max 60 */ expirationPeriodInMonths?: number | null; /** * Expiration period in months applied only to submissions that fire a trigger field. Has no effect when `pending_trigger_fields` is empty. Omit to leave unchanged; explicit null clears it (triggered submissions fall back to the base period). * @min 1 * @max 60 */ triggeredExpirationPeriodInMonths?: number | null; } interface UpdateIntakeFormSettingsResponse { /** Updated intake form. */ intakeForm?: IntakeForm; } interface CreateCustomerSubmissionLinkRequest { /** * Intake form ID. * @format GUID */ intakeFormId: string | null; /** * [Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/introduction) ID to personalize and pre-fill the submission with the contact's information. * @format GUID */ contactId?: string | null; } interface CreateCustomerSubmissionLinkResponse { /** * Generated link URL for the intake form submission. * @minLength 1 * @maxLength 2048 */ intakeFormUrl?: string | null; /** * Encrypted token containing contact details. Available only if you specified `contactId` in request. * @maxLength 2048 */ token?: string | null; } interface DeleteIntakeFormRequest { /** * Intake form ID. * @format GUID */ intakeFormId: string | null; } interface DeleteIntakeFormResponse { } interface ArchiveIntakeFormRequest { /** * Intake form ID. * @format GUID */ intakeFormId: string | null; /** * Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. */ formRevision: string | null; } interface ArchiveIntakeFormResponse { /** Archived intake form. */ intakeForm?: IntakeForm; } interface UnarchiveIntakeFormRequest { /** * Intake form ID. * @format GUID */ intakeFormId: string | null; /** * Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. */ formRevision: string | null; } interface UnarchiveIntakeFormResponse { /** Unarchived intake form. */ intakeForm?: IntakeForm; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface Empty { } interface DecryptContactDetailsFromTokenRequest { /** * Encrypted token containing contact details and creation timestamp. * Generated by [Create Customer Submission Link](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/intake-forms/create-customer-submission-link) when a `contactId` is provided. * @minLength 1 * @maxLength 2048 */ token?: string; } interface DecryptContactDetailsFromTokenResponse { /** Contact details extracted from the token. */ contactDetails?: ContactDetails; } interface ContactDetails { /** * Contact email address. Always present. * @format EMAIL */ email?: string; /** * Contact first name. Present when the contact record has a first name. * @maxLength 200 */ firstName?: string | null; /** * Contact last name. Present when the contact record has a last name. * @maxLength 200 */ lastName?: string | null; } /** @docsIgnore */ type CreateCustomerSubmissionLinkApplicationErrors = { code?: 'MISSING_SITE_URL'; description?: string; data?: Record; }; /** * Retrieves a list of intake forms, with the specified paging, filtering, and sorting. * * Query Intake Forms runs with these defaults, which you can override: * * - `createdDate` is sorted in `DESC` order. * - `paging.limit` is `50`. * - `paging.offset` is `0`. * * Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language). * @public * @permissionId INTAKE_FORM.INTAKE_FORM_READ * @applicableIdentity APP * @fqn wix.intakeforms.v1.IntakeFormsService.QueryIntakeForms */ declare function queryIntakeForms(): IntakeFormsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface IntakeFormsQueryResult extends QueryCursorResult { items: IntakeForm[]; query: IntakeFormsQueryBuilder; next: () => Promise; prev: () => Promise; } interface IntakeFormsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_id' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: '_id' | 'name', value: string) => IntakeFormsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: '_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate', value: any[]) => IntakeFormsQueryBuilder; in: (propertyName: '_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate', value: any) => IntakeFormsQueryBuilder; exists: (propertyName: '_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate', value: boolean) => IntakeFormsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate'>) => IntakeFormsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'_id' | 'archived' | 'name' | '_createdDate' | '_updatedDate'>) => IntakeFormsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => IntakeFormsQueryBuilder; /** @param cursor - A pointer to specific record */ skipTo: (cursor: string) => IntakeFormsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn wix.intakeforms.v1.IntakeFormsService.QueryIntakeForms * @requiredField query */ declare function typedQueryIntakeForms(query: IntakeFormQuery): Promise>; interface IntakeFormQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: ['_createdDate', '_id', '_updatedDate', 'archived', 'name']; operators: '*'; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query; type IntakeFormQuery = { /** Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: { /** Maximum number of items to return in the results. @max: 100 */ limit?: NonNullable['limit'] | null; /** Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. @maxLength: 16000 */ cursor?: NonNullable['cursor'] | null; }; /** Filter object. Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). */ filter?: CommonQueryWithEntityContext['filter'] | null; /** Sort object. Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). @maxSize: 5 */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; }; declare const utils: { query: { QueryBuilder: () => _wix_sdk_types.QueryBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; }; }; /** * Updates the expiration period of a specific intake form. * * When you update the expiration period, the system recalculates expiration for all existing submissions. * @param intakeFormId - Intake form ID. * @public * @requiredField intakeFormId * @requiredField options.formRevision * @permissionId INTAKE_FORM.INTAKE_FORM_UPDATE * @applicableIdentity APP * @fqn wix.intakeforms.v1.IntakeFormsService.UpdateIntakeFormExpirationPeriod */ declare function updateIntakeFormExpirationPeriod(intakeFormId: string, options?: NonNullablePaths): Promise; interface UpdateIntakeFormExpirationPeriodOptions { /** * New expiration period in months. If not set, submissions don't expire. * @min 1 * @max 60 */ expirationPeriodInMonths?: number | null; /** * Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. */ formRevision: string | null; } /** * Creates a shareable link for customers to submit an intake form. * * The link is valid for 72 hours. * @param intakeFormId - Intake form ID. * @public * @requiredField intakeFormId * @permissionId INTAKE_FORMS.CUSTOMER_SUBMISSION_LINK_CREATE * @applicableIdentity APP * @fqn wix.intakeforms.v1.IntakeFormsService.CreateCustomerSubmissionLink */ declare function createCustomerSubmissionLink(intakeFormId: string, options?: CreateCustomerSubmissionLinkOptions): Promise; interface CreateCustomerSubmissionLinkOptions { /** * [Contact](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/introduction) ID to personalize and pre-fill the submission with the contact's information. * @format GUID */ contactId?: string | null; } /** * Deletes an intake form. * * * Also deletes the underlying [Wix form](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/introduction). * * Existing [submissions](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/intake-form-submissions/introduction) for the intake form aren't automatically deleted but become orphaned. * When [querying submissions](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/intake-form-submissions/query-intake-form-submissions), orphaned submissions aren't returned. * @param intakeFormId - Intake form ID. * @public * @requiredField intakeFormId * @permissionId INTAKE_FORM.INTAKE_FORM_DELETE * @applicableIdentity APP * @fqn wix.intakeforms.v1.IntakeFormsService.DeleteIntakeForm */ declare function deleteIntakeForm(intakeFormId: string): Promise; /** * Archives an intake form, disabling it from accepting new submissions. * * Existing submissions remain accessible. You can [unarchive](https://dev.wix.com/docs/api-reference/crm/forms/other-services/intake-forms/intake-forms/unarchive-intake-form) the form later to resume accepting submissions. * @param intakeFormId - Intake form ID. * @param formRevision - Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. * @public * @requiredField formRevision * @requiredField intakeFormId * @permissionId INTAKE_FORM.INTAKE_FORM_UPDATE * @applicableIdentity APP * @fqn wix.intakeforms.v1.IntakeFormsService.ArchiveIntakeForm */ declare function archiveIntakeForm(intakeFormId: string, formRevision: string): Promise; /** * Unarchives an intake form, enabling it to accept new submissions. * @param intakeFormId - Intake form ID. * @param formRevision - Revision number, which increments by 1 each time the intake form is updated. * To prevent conflicting changes, you must specify the current revision when updating the intake form. * @public * @requiredField formRevision * @requiredField intakeFormId * @permissionId INTAKE_FORM.INTAKE_FORM_UPDATE * @applicableIdentity APP * @fqn wix.intakeforms.v1.IntakeFormsService.UnarchiveIntakeForm */ declare function unarchiveIntakeForm(intakeFormId: string, formRevision: string): Promise; export { type ActionEvent, ApprovalMode, type ApprovalModeWithLiterals, type ArchiveIntakeFormRequest, type ArchiveIntakeFormResponse, type CommonQueryWithEntityContext, type ContactDetails, type CreateCustomerSubmissionLinkApplicationErrors, type CreateCustomerSubmissionLinkOptions, type CreateCustomerSubmissionLinkRequest, type CreateCustomerSubmissionLinkResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DecryptContactDetailsFromTokenRequest, type DecryptContactDetailsFromTokenResponse, type DeleteIntakeFormRequest, type DeleteIntakeFormResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IntakeForm, type IntakeFormQuery, type IntakeFormQuerySpec, type IntakeFormsQueryBuilder, type IntakeFormsQueryResult, type PendingTriggerField, type QueryIntakeFormsRequest, type QueryIntakeFormsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type UnarchiveIntakeFormRequest, type UnarchiveIntakeFormResponse, type UpdateIntakeFormExpirationPeriodOptions, type UpdateIntakeFormExpirationPeriodRequest, type UpdateIntakeFormExpirationPeriodResponse, type UpdateIntakeFormSettingsRequest, type UpdateIntakeFormSettingsResponse, archiveIntakeForm, createCustomerSubmissionLink, deleteIntakeForm, queryIntakeForms, typedQueryIntakeForms, unarchiveIntakeForm, updateIntakeFormExpirationPeriod, utils };