Initial commit

This commit is contained in:
2025-12-04 22:24:47 +01:00
commit 453ce10494
106 changed files with 17145 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
export type UserPermissions = Record<string, boolean>;
export interface User {
id: string;
username: string;
email: string;
is_active: boolean;
is_superuser: boolean;
permissions: UserPermissions;
created_at: string;
updated_at: string;
last_login: string | null;
}
export interface LoginRequest {
username: string;
password: string;
}
export interface RegisterRequest {
username: string;
email: string;
password: string;
}
export interface UserCreate {
username: string;
email: string;
password: string;
is_active?: boolean;
is_superuser?: boolean;
permissions?: UserPermissions;
}
export interface UserUpdatePayload {
username?: string;
email?: string;
password?: string;
is_active?: boolean;
is_superuser?: boolean;
permissions?: UserPermissions;
}
export interface Token {
access_token: string;
token_type: string;
}
export interface AuthContextType {
user: User | null;
token: string | null;
login: (username: string, password: string) => Promise<void>;
register: (username: string, email: string, password: string) => Promise<void>;
logout: () => void;
isLoading: boolean;
}