export interface Message { /** * Message ID. * @readonly */ id?: string | null; /** * Date and time the message was created. * @readonly */ createdDate?: Date | null; /** Message sender type. */ sender?: Sender; /** * Conversation ID. * @readonly */ conversationId?: string | null; /** ID of the message that this message is answering. */ answerTo?: string | null; /** Message type. */ messageType?: MessageType; /** Message body. */ body?: Body; /** Extended fields. */ extendedFields?: ExtendedFields; } export declare enum Sender { /** Unknown sender type. */ UNKNOWN = "UNKNOWN", /** AI assistant. */ ASSISTANT = "ASSISTANT", /** Wix user. For example, a site admin. */ USER = "USER", /** Message was sent automatically due to widget settings. For example, a contact form. */ SYSTEM = "SYSTEM", /** Site visitor. */ SITE_VISITOR = "SITE_VISITOR" } export declare enum MessageType { /** Unknown message type. */ UNKNOWN_MESSAGE_TYPE = "UNKNOWN_MESSAGE_TYPE", /** Question. */ QUESTION = "QUESTION", /** Answer. */ ANSWER = "ANSWER", /** Intro message, as defined in the widget settings. */ INTRO = "INTRO", /** Legal disclaimer, as defined in the widget settings. */ LEGAL = "LEGAL", /** Contact form. */ CONTACT_FORM = "CONTACT_FORM", /** Message confirms that a contact form was successfully submitted. */ CONTACT_FORM_SUBMITTED = "CONTACT_FORM_SUBMITTED", /** Notification for the site owner. */ SITE_OWNER_NOTIFICATION = "SITE_OWNER_NOTIFICATION", /** Message informing the site visitor that the AI assistant is offline, as defined in the widget settings. */ OFFLINE = "OFFLINE", /** Message that informs the Wix user that they have reached the maximum number of messages on their current plan. */ OUT_OF_QUOTA = "OUT_OF_QUOTA" } export interface Body { /** Main text of the message. */ mainText?: string | null; /** Footer text of the message. */ footerText?: string | null; /** Additional data for the message. */ additionalData?: Record[] | null; } export interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } export interface BulkCreateMessagesRequest { /** Messages to be created. */ messages?: Message[]; } export interface BulkCreateMessagesResponse { /** Created messages. */ messages?: Message[]; } export interface ListMessagesRequest { /** 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`. */ cursorPaging?: CursorPaging; } export interface CursorPaging { /** Maximum number of items to return in the results. */ 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. */ cursor?: string | null; } export interface ListMessagesResponse { /** Retrieved messages. */ messages?: Message[]; /** Paging metadata. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface Cursors { /** Cursor string pointing to the next page in the list of results. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export 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. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface MessageNonNullableFields { sender: Sender; messageType: MessageType; } export interface BulkCreateMessagesResponseNonNullableFields { messages: MessageNonNullableFields[]; } export interface ListMessagesResponseNonNullableFields { messages: MessageNonNullableFields[]; } export {};