export interface Message { /** Message ID. */ id?: string; /** Conversation ID. */ conversationId?: string; /** Message sender type. */ sender?: Sender; /** Feedback attached to the message. Only relevant for messages sent by the AI assistant. */ feedback?: Feedback; /** * Date and time the message was created. * @readonly */ createdDate?: Date | null; /** * Date and time the message was updated. * @readonly */ updatedDate?: Date | null; /** * Revision number, which increments by 1 each time the message is updated. To prevent conflicting changes, the current revision must be passed when updating the message. * * Ignored when creating a message. * @readonly */ revision?: string | null; /** Message body. */ body?: Body; /** ID of the message that this message is answering. */ answerTo?: string | null; /** Extended fields. */ extendedFields?: ExtendedFields; /** Tags. */ tags?: Tags; } export declare enum Sender { /** Unknown sender type. */ UNKNOWN_SENDER = "UNKNOWN_SENDER", /** Wix user. For example, a site admin. */ USER = "USER", /** AI assistant. */ ASSISTANT = "ASSISTANT" } export interface Feedback { /** Feedback text. */ text?: string | null; /** * Document attached to the feedback. * @readonly */ document?: Document; /** * Defined if there's an error attaching the document. * @readonly */ error?: string | null; /** Feedback type. */ type?: FeedbackType; } export interface Document { /** ID of the external document. */ id?: string; /** Title of the external document. */ title?: string; /** Description of the external document. */ description?: string; /** Tags of the external document. */ tags?: string[]; /** URL of the external document. */ url?: string; /** Category of the external document. */ category?: Category; /** Action to be taken when the external document is presented to the user. */ action?: Action; /** Whether the external document is generated from a feedback. */ isFeedback?: boolean | null; /** Whether the external document is published. */ isPublished?: boolean | null; /** Timestamp of the last update of the external document. */ updateTs?: Date | null; /** Relevance of the external document. */ relevance?: number | null; /** Usage of the external document. */ usage?: number | null; } /** Category of the external document. */ export declare enum Category { NO_CATEGORY = "NO_CATEGORY", ENRICHMENT = "ENRICHMENT", /** FEEDBACK = 2; */ RESTRICTION = "RESTRICTION" } /** Action to be taken when the external document is presented to the user. */ export declare enum Action { NO_ACTION = "NO_ACTION", NO_ANSWER = "NO_ANSWER", CONTACT = "CONTACT" } export declare enum FeedbackType { /** Unknown feedback type. */ UNKNOWN = "UNKNOWN", /** AI assistant provided relevant and correct information. */ THUMBS_UP = "THUMBS_UP", /** AI assistant didn't answer the question. */ IRRELEVANT = "IRRELEVANT", /** AI assistant provided incorrect information. */ INCORRECT = "INCORRECT", /** AI Assistant should not answer the question asked. */ SHOULD_NOT_ANSWER = "SHOULD_NOT_ANSWER", /** AI Assistant answered the question, but could be improved. */ OK_BUT = "OK_BUT", /** Other. */ OTHER = "OTHER" } export interface Body { /** Main text of the message. */ mainText?: string | null; /** Footer text of the message. */ footerText?: string | null; /** Additional data. */ 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>; } /** * Common object for tags. * Should be use as in this example: * message Foo { * string id = 1; * ... * Tags tags = 5 * } * * example of taggable entity * { * id: "123" * tags: { * tags: { * tag_ids:["11","22"] * }, * private_tags: { * tag_ids: ["33", "44"] * } * } * } */ export interface Tags { /** Tags that require an additional permission in order to access them, normally not given to site members or visitors. */ privateTags?: TagList; /** Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. */ tags?: TagList; } export interface TagList { /** List of tag IDs */ tagIds?: string[]; } export interface QueryMessagesRequest { /** WQL expression. */ query?: CursorQuery; } export 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). */ sort?: Sorting[]; } /** @oneof */ export 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; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } 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 QueryMessagesResponse { /** List of messages. */ messages?: Message[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } export 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; } 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 AskQuestionRequest { /** Question message. */ question: Message; } export interface AskQuestionResponse { /** Answer message. */ answer?: Message; } export interface AddFeedbackRequest { /** ID of the message to add feedback to. */ messageId: string; /** Feedback to add to the message. */ feedback: Feedback; /** Latest message revision. */ revision: string; } export interface AddFeedbackResponse { /** Updated message. */ message?: Message; } export interface BulkUpdateMessageTagsRequest { /** Message IDs. Tags are updated for messages included in this list. */ ids: string[] | null; /** Tags to assign. */ assignTags: Tags; /** Tags to unassign. */ unassignTags?: Tags; } export interface BulkUpdateMessageTagsResponse { /** List of metadata for each message updated. */ results?: BulkUpdateMessageTagsResult[]; /** Metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } export interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } export interface BulkUpdateMessageTagsResult { /** Individual message metadata. */ itemMetadata?: ItemMetadata; } export interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } export interface BulkUpdateMessageTagsByFilterRequest { /** Filter to apply to the messages. Tags are updated for messages included in this filter. */ filter: Record | null; /** Tags to assign. */ assignTags: Tags; /** Tags to unassign. */ unassignTags?: Tags; } export interface BulkUpdateMessageTagsByFilterResponse { /** Job ID. */ jobId?: string; } export interface UpdateExtendedFieldsRequest { /** ID of the entity to update. */ id: string; /** Identifier for the app whose extended fields are being updated. */ namespace: string; /** 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. */ namespaceData: Record | null; } export interface UpdateExtendedFieldsResponse { /** Updated message. */ message?: Message; } export interface Empty { } 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 DocumentNonNullableFields { id: string; title: string; description: string; tags: string[]; url: string; category: Category; action: Action; } interface FeedbackNonNullableFields { document?: DocumentNonNullableFields; type: FeedbackType; } interface TagListNonNullableFields { tagIds: string[]; } interface TagsNonNullableFields { privateTags?: TagListNonNullableFields; tags?: TagListNonNullableFields; } interface MessageNonNullableFields { id: string; conversationId: string; sender: Sender; feedback?: FeedbackNonNullableFields; tags?: TagsNonNullableFields; } export interface QueryMessagesResponseNonNullableFields { messages: MessageNonNullableFields[]; } export interface AskQuestionResponseNonNullableFields { answer?: MessageNonNullableFields; } export interface AddFeedbackResponseNonNullableFields { message?: MessageNonNullableFields; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface BulkUpdateMessageTagsResultNonNullableFields { itemMetadata?: ItemMetadataNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; undetailedFailures: number; } export interface BulkUpdateMessageTagsResponseNonNullableFields { results: BulkUpdateMessageTagsResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface BulkUpdateMessageTagsByFilterResponseNonNullableFields { jobId: string; } export interface UpdateExtendedFieldsResponseNonNullableFields { message?: MessageNonNullableFields; } export {};