chore(history): import initial web product snapshot
This commit is contained in:
@@ -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`)
|
||||
}
|
||||
Reference in New Issue
Block a user