feat(history): complete messaging core before multi-account gateways
This commit is contained in:
@@ -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`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user