feat(webui): persist reviewed automation chat changes
This commit is contained in:
1 parent
707f7eb079
commit
845afe9215
41 files changed
+1210
-626
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import type {
|
||||
ApiServicePayload,
|
||||
AutomationChatsPayload,
|
||||
AutomationChatUpdate,
|
||||
AutomationsPayload,
|
||||
AutomationUpdatePayload,
|
||||
ChannelConfigurePayload,
|
||||
@@ -521,6 +523,14 @@ export async function fetchAutomations(
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchAutomationChats(token: string, id: string, signal?: AbortSignal): Promise<AutomationChatsPayload> {
|
||||
return request(`/api/webui/automations/chats?id=${encodeURIComponent(id)}`, token, { signal }, API_READ_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
export async function changeAutomationChat(transport: WebUIMutationTransport, id: string, values: AutomationChatUpdate): Promise<AutomationsPayload> {
|
||||
return mutation(transport, "automation.change_chat", { id, values });
|
||||
}
|
||||
|
||||
export async function fetchAutomationRunResult(
|
||||
token: string,
|
||||
id: string,
|
||||
|
||||
@@ -220,6 +220,7 @@ interface UISessionMessage {
|
||||
}
|
||||
|
||||
export interface SessionAutomationJob {
|
||||
chat_binding_revision?: string;
|
||||
id: string;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
@@ -268,6 +269,13 @@ export interface SessionAutomationJob {
|
||||
|
||||
export interface SessionAutomationsPayload { jobs: SessionAutomationJob[]; }
|
||||
export interface AutomationsPayload { jobs: SessionAutomationJob[]; }
|
||||
export interface AutomationChat { id: string; title: string; channel: string; unavailable?: boolean; }
|
||||
export interface AutomationChatsPayload {
|
||||
revision: string;
|
||||
current: AutomationChat | null;
|
||||
chats: AutomationChat[];
|
||||
}
|
||||
export interface AutomationChatUpdate { target_id: string; revision: string; message: string; }
|
||||
export interface AutomationUpdatePayload {
|
||||
name?: string;
|
||||
message?: string;
|
||||
|
||||
Reference in new issue
Block a user