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
+23
View File
@@ -21,6 +21,23 @@ export function startTelegramLogin(phone: string) {
return http.post<ChannelConnection>('/api/channels/telegram/start', { phone })
}
export function connectEmailChannel(payload: {
name?: string
displayName?: string
account: string
password: string
imapHost: string
imapPort: number
imapSecure: boolean
imapFolder?: string
smtpHost: string
smtpPort: number
smtpSecure: boolean
syncDays?: number
}) {
return http.post<ChannelConnection>('/api/channels/email/connect', payload)
}
export function submitTelegramCode(channelId: string, code: string) {
return http.post<{ status: string; channel: ChannelConnection }>(`/api/channels/telegram/${channelId}/code`, { code })
}
@@ -29,6 +46,12 @@ export function submitTelegramPassword(channelId: string, password: string) {
return http.post<{ status: string; channel: ChannelConnection }>(`/api/channels/telegram/${channelId}/password`, { password })
}
export function getTelegramLoginState(channelId: string) {
return http.post<{ status: string; connectionState?: string; channel: ChannelConnection }>(
`/api/channels/telegram/${channelId}/state`,
)
}
export function syncTelegramChannel(channelId: string) {
return http.post<{ chats: number; messages: number }>(`/api/channels/${channelId}/sync`)
}