export enum ConversationStatus { OPEN = 'OPEN', PENDING = 'PENDING', CLOSED = 'CLOSED', BULK_SENT = 'BULK_SENT', } export interface IConversationWithUnread { unreadMessages: number conversation: IConversation lastMessage: { createdAt: number, } } export interface IReadReceiptPayload { messageId: number conversationId: number updatedAt: number recipientType: string recipientId: number status: string } export interface IMessageNewPayload { conversationId: number contentType: string conversationEvent: { type: string, currentParticipantIds: number[], conversationStatus: ConversationStatus; } updatedAt: number } export interface IUnreadConversationsByTimestamp { [conversationId: string]: number } export interface IFetchConversationsByIdOptions { accessToken: string listOfConversationIds: number[] } export interface IGetAllOpenAndPendingConvosOptions { accessToken: string userId: number inbox: number } export interface IGetMessagesForConversationOptions { accessToken: string conversationId: number } export interface IConversation { id: number inboxId: number unreadMessageCount: number updatedAt: number status: string endUserId: number latestActivity: number participantIds: number[] } export interface IConversationsById { [id: number]: IConversation } export interface IInbox { id: number } export interface IMessage { id: number type: string viewerRecipientStatus: string updatedAt: number } export interface IMessagesById { [convoId: string]: IMessage[] } export type IParticipants = number[] export interface IParticipantsById { [convoId: string]: IParticipants } export interface IMessageReadReceipts { [convoId: string]: { [messageId: string]: boolean, } }