import { api, apiGet, apiPost } from "./api"; import type { Admin, AuthResponse, AuthStatus, ChangePasswordInput, LoginCredentials } from "../types/auth"; export function getAuthStatus(): Promise { return apiGet("/api/auth/status"); } export function getSession(): Promise { return apiGet("/api/auth/session"); } export function login(credentials: LoginCredentials): Promise { return apiPost("/api/auth/login", credentials); } export function logout(): Promise { return apiPost("/api/auth/logout"); } export function changePassword(input: ChangePasswordInput): Promise { return apiPost("/api/auth/change-password", input); } export type { Admin, AuthResponse, AuthStatus, ChangePasswordInput, LoginCredentials }; // Keep a typed escape hatch for future authenticated services without exposing fetch details. export { api };