export interface Conversation { /** * Conversation ID. * @readonly */ id?: string; /** * ID of the visitor, contact, or member who is chatting with the business. * @readonly */ participant?: IdentificationData; /** * List of communication channels where the visitor, contact, or member can receive messages. * @readonly */ channels?: ChannelType[]; /** Display name and avatar for the business. */ businessDisplayData?: ConversationDisplayData; /** Display name and avatar for the visitor, contact, or member. */ participantDisplayData?: ConversationDisplayData; } export interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site * [contact](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fcontacts). * @readonly */ contactId?: string | null; /** ID of an anonymous site visitor. */ anonymousVisitorId?: string; /** * ID of a site * [member](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/members). */ memberId?: string; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of an anonymous site visitor. */ anonymousVisitorId?: string; /** * ID of a site * [member](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/members). */ memberId?: string; } export declare enum ChannelType { UNKNOWN_CHANNEL_TYPE = "UNKNOWN_CHANNEL_TYPE", CHAT = "CHAT", EMAIL = "EMAIL", SMS = "SMS", FACEBOOK = "FACEBOOK", INSTAGRAM = "INSTAGRAM", WHATSAPP = "WHATSAPP" } export interface ConversationDisplayData { /** * Display name. * @readonly */ name?: string; /** * Avatar image URL. * @readonly */ imageUrl?: string | null; } export interface ConversationsMerged { /** List of old conversation IDs. */ oldConversationIds?: string[]; /** New conversation ID. */ targetConversationId?: string; } export interface GetConversationRequest { /** Conversation ID. */ conversationId: string; } export interface GetConversationResponse { /** Retrieved conversation. */ conversation?: Conversation; } export interface GetOrCreateConversationRequest { /** * ID of the visitor, contact, or member chatting with the business. * * Required for 3rd-party apps. */ participantId?: ParticipantId; } export interface ParticipantId extends ParticipantIdIdOneOf { /** * ID of a site * [contact](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fcontacts). */ contactId?: string; /** ID of an anonymous site visitor. */ anonymousVisitorId?: string; /** * ID of a site * [member](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/members). */ memberId?: string; } /** @oneof */ export interface ParticipantIdIdOneOf { /** * ID of a site * [contact](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fcontacts). */ contactId?: string; /** ID of an anonymous site visitor. */ anonymousVisitorId?: string; /** * ID of a site * [member](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/members). */ memberId?: string; } export interface GetOrCreateConversationResponse { /** Created or retrieved conversation. */ conversation?: Conversation; /** * Indicates whether the conversation was just created. * * If `true`, the conversation was just created. * If `false`, the conversation already existed. */ newConversation?: boolean; } export interface ListConversationsRequest { paging?: CursorPaging; /** only message time is supported for field name */ sorting?: Sorting; } export interface CursorPaging { /** Number of items to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get 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 Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface ListConversationsResponse { conversations?: Conversation[]; 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 pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface DeleteConversationRequest { conversationId?: string; } export interface DeleteConversationResponse { } export interface AddConversationChannelsRequest { conversationId?: string; conversationChannels?: ConversationChannel[]; } export interface ConversationChannel { channel?: ChannelType; /** TODO rename? - Shalom */ recipients?: string[]; } export interface AddConversationChannelsResponse { } export interface ChatroomsMerged { /** old chatroom ids */ oldChatroomIds?: string[]; /** new chatroom id */ targetChatroomId?: string; } export interface Empty { }