feat(history): establish Telegram SaaS platform foundation
This commit is contained in:
@@ -17,6 +17,22 @@ export function connectChannel(payload: {
|
||||
return http.post<ChannelConnection>('/api/channels/connect', payload)
|
||||
}
|
||||
|
||||
export function startTelegramLogin(phone: string) {
|
||||
return http.post<ChannelConnection>('/api/channels/telegram/start', { phone })
|
||||
}
|
||||
|
||||
export function submitTelegramCode(channelId: string, code: string) {
|
||||
return http.post<{ status: string; channel: ChannelConnection }>(`/api/channels/telegram/${channelId}/code`, { code })
|
||||
}
|
||||
|
||||
export function submitTelegramPassword(channelId: string, password: string) {
|
||||
return http.post<{ status: string; channel: ChannelConnection }>(`/api/channels/telegram/${channelId}/password`, { password })
|
||||
}
|
||||
|
||||
export function syncTelegramChannel(channelId: string) {
|
||||
return http.post<{ chats: number; messages: number }>(`/api/channels/${channelId}/sync`)
|
||||
}
|
||||
|
||||
/** POST /api/channels/test */
|
||||
export function testChannel(id: string) {
|
||||
return http.post<{ success: boolean; latencyMs: number; message: string }>('/api/channels/test', { id })
|
||||
|
||||
Reference in New Issue
Block a user