release: 1.1.0
TallyNote release / linux-x64 (push) Successful in 6m24s

This commit is contained in:
Qiufeng
2026-08-31 20:11:34 +08:00
parent cbe0d65320
commit 12495fb6a4
66 changed files with 4315 additions and 77 deletions
+27
View File
@@ -0,0 +1,27 @@
import { api, apiGet, apiPost } from "./api";
import type { Admin, AuthResponse, AuthStatus, ChangePasswordInput, LoginCredentials } from "../types/auth";
export function getAuthStatus(): Promise<AuthStatus> {
return apiGet<AuthStatus>("/api/auth/status");
}
export function getSession(): Promise<AuthResponse> {
return apiGet<AuthResponse>("/api/auth/session");
}
export function login(credentials: LoginCredentials): Promise<AuthResponse> {
return apiPost<AuthResponse>("/api/auth/login", credentials);
}
export function logout(): Promise<void> {
return apiPost<void>("/api/auth/logout");
}
export function changePassword(input: ChangePasswordInput): Promise<AuthResponse> {
return apiPost<AuthResponse>("/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 };