chore(history): import initial web product snapshot

This commit is contained in:
wmq
2026-07-25 00:30:00 +08:00
commit cf0eed46c3
131 changed files with 15693 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
import { http } from './client'
import type { ChannelConnection, ChannelSyncLog, ChannelType } from '@/types'
/** GET /api/channels */
export function getChannels() {
return http.get<ChannelConnection[]>('/api/channels')
}
/** POST /api/channels/connect */
export function connectChannel(payload: {
type: ChannelType
account: string
syncRange?: string
defaultOwnerId?: string
autoReply?: boolean
}) {
return http.post<ChannelConnection>('/api/channels/connect', payload)
}
/** POST /api/channels/test */
export function testChannel(id: string) {
return http.post<{ success: boolean; latencyMs: number; message: string }>('/api/channels/test', { id })
}
/** PATCH /api/channels/:id */
export function updateChannel(id: string, payload: Partial<ChannelConnection>) {
return http.patch<ChannelConnection>(`/api/channels/${id}`, payload)
}
/** DELETE /api/channels/:id */
export function deleteChannel(id: string) {
return http.del<{ success: boolean }>(`/api/channels/${id}`)
}
/** GET /api/channels/:id/logs */
export function getChannelLogs(id: string) {
return http.get<ChannelSyncLog[]>(`/api/channels/${id}/logs`)
}