feat(frontend): config history and schedule rollback hooks
This commit is contained in:
@@ -17,6 +17,8 @@ import type {
|
||||
ActivityEvent,
|
||||
ProviderConfig,
|
||||
ProviderTestResult,
|
||||
ConfigSnapshot,
|
||||
ScheduleHistoryEntry,
|
||||
} from "@/lib/types";
|
||||
|
||||
const API_BASE =
|
||||
@@ -110,6 +112,34 @@ export const api = {
|
||||
|
||||
delete: (id: string, token: string) =>
|
||||
request<void>(`/channels/${id}`, { method: "DELETE", token }),
|
||||
|
||||
listConfigHistory: (channelId: string, token: string) =>
|
||||
request<ConfigSnapshot[]>(`/channels/${channelId}/config/history`, { token }),
|
||||
|
||||
patchConfigSnapshot: (channelId: string, snapId: string, label: string | null, token: string) =>
|
||||
request<ConfigSnapshot>(`/channels/${channelId}/config/history/${snapId}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({ label }),
|
||||
token,
|
||||
}),
|
||||
|
||||
restoreConfigSnapshot: (channelId: string, snapId: string, token: string) =>
|
||||
request<ChannelResponse>(`/channels/${channelId}/config/history/${snapId}/restore`, {
|
||||
method: "POST",
|
||||
token,
|
||||
}),
|
||||
|
||||
listScheduleHistory: (channelId: string, token: string) =>
|
||||
request<ScheduleHistoryEntry[]>(`/channels/${channelId}/schedule/history`, { token }),
|
||||
|
||||
getScheduleGeneration: (channelId: string, genId: string, token: string) =>
|
||||
request<ScheduleResponse>(`/channels/${channelId}/schedule/history/${genId}`, { token }),
|
||||
|
||||
rollbackSchedule: (channelId: string, genId: string, token: string) =>
|
||||
request<ScheduleResponse>(`/channels/${channelId}/schedule/history/${genId}/rollback`, {
|
||||
method: "POST",
|
||||
token,
|
||||
}),
|
||||
},
|
||||
|
||||
library: {
|
||||
|
||||
Reference in New Issue
Block a user