import { apiGet, apiPost } from "./client"; export interface WebuiConfigResponse { config?: Record; dbPath?: string; key?: string; value?: string | null; } export function fetchWebuiConfig(key?: string): Promise { const query = key ? `?key=${encodeURIComponent(key)}` : ""; return apiGet(`/api/webui/config${query}`); } export function saveWebuiConfig(key: string, value: string): Promise<{ ok?: boolean; key?: string; value?: string }> { return apiPost("/api/webui/config", { key, value }); } export function saveWebuiConfigMany(entries: Record): Promise<{ ok?: boolean; config?: Record }> { return apiPost("/api/webui/config", { entries }); } export function deleteWebuiConfig(key: string): Promise<{ ok?: boolean; deleted?: boolean; key?: string }> { return apiPost("/api/webui/config/delete", { key }); }