import { adminHttp } from "../http.ts"; export type SetupState = { initialized: boolean }; export type UsernameBody = { username: string }; export async function fetchSetupState(): Promise { const { data } = await adminHttp.get("/setup-state"); return data; } export async function setup(body: { username: string; password: string; }): Promise { const { data } = await adminHttp.post("/setup", body); return data; } export async function login(body: { username: string; password: string; }): Promise { const { data } = await adminHttp.post("/session", body); return data; } export async function fetchSession(): Promise { const { data } = await adminHttp.get("/session"); return data; } export async function logout(): Promise { await adminHttp.delete("/session"); } export async function changePassword(body: { old_password: string; new_password: string; }): Promise { await adminHttp.put("/password", body); }