feat(history): complete messaging core before multi-account gateways

This commit is contained in:
wmq
2026-07-28 22:36:58 +08:00
parent cd06d049fe
commit 7f09132fad
54 changed files with 4781 additions and 601 deletions
+35
View File
@@ -28,6 +28,8 @@ export interface Message {
type: MessageType
originalText: string
translatedText?: string
/** 发出消息的中文客服备注,不会发送到外部渠道 */
translationCn?: string
translationStatus?: 'pending' | 'completed' | 'failed'
translatedAt?: string
originalLang: string
@@ -43,6 +45,16 @@ export interface Message {
attachmentMimeType?: string
attachmentSize?: number
stickerEmoji?: string
emailUid?: number
emailMessageId?: string
emailSubject?: string
emailAttachments?: Array<{
id: string
name: string
mimeType: string
size: number
available: boolean
}>
}
export interface Conversation {
@@ -58,6 +70,16 @@ export interface Conversation {
lastMessage?: Message
summary: string
updatedAt: string
emailSubject?: string
channelId?: string
telegramChatId?: string
telegramChatType?: string
isPinned?: boolean
archived?: boolean
mutedUntil?: string | null
markedUnread?: boolean
isBlocked?: boolean
leftAt?: string
}
export type ChannelStatus = 'connected' | 'disconnected' | 'error' | 'paused' | 'unconnected'
@@ -72,7 +94,18 @@ export interface ChannelConnection {
todayMessages: number
errorMessage?: string
autoReply: boolean
authState?: string
defaultOwnerId?: string
displayName?: string
imapHost?: string
imapPort?: number
imapSecure?: boolean
imapFolder?: string
smtpHost?: string
smtpPort?: number
smtpSecure?: boolean
syncDays?: number
lastVerifiedAt?: string
}
export interface ChannelSyncLog {
@@ -87,6 +120,8 @@ export interface ChannelSyncLog {
/** 发送消息请求 */
export interface SendMessagePayload {
text: string
/** 已确认的中文参考译文,仅在内部消息记录中保存 */
translationCn?: string
replyToId?: string
replyPreview?: string
type?: MessageType