import type { PluginApiClient } from "@termix/plugin-sdk/frontend"; export type SessionLogRecord = { id: number; hostId: number; userId: string | null; startedAt: string; endedAt: string | null; duration: number | null; recordingPath: string | null; hostName: string | null; hostIp: string | null; sizeBytes: number | null; protocol: "ssh" | "rdp" | "vnc" | "telnet"; format: "text" | "asciicast" | "guacamole"; username: string | null; }; export function createSessionRecordingApi(api: PluginApiClient) { return { async list(): Promise { const response = await api.get<{ logs: SessionLogRecord[] }>("/"); return response.data.logs; }, async getBlob(id: number): Promise { const response = await api.get(`/${id}/content`, { responseType: "blob", }); return response.data; }, async getContent(id: number): Promise { const response = await api.get(`/${id}/content`, { responseType: "text", }); return response.data; }, async delete(id: number): Promise { await api.delete(`/${id}`); }, }; }