mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 19:10:22 +01:00
Monorepo-Setup (pnpm workspaces) mit vier shared Packages und einer TUI-App: Shared Packages: - @effigenix/types: TypeScript-DTOs (UserDTO, RoleDTO, AuthDTO, Enums) - @effigenix/config: API-Konfiguration und Shared Constants - @effigenix/validation: Zod-Schemas für Username, E-Mail und Passwort - @effigenix/api-client: axios-Client mit JWT-Handling (proaktiver + reaktiver Token-Refresh), AuthInterceptor, ErrorInterceptor, Resources für auth/users/roles TUI (apps/cli, Ink 5 / React): - Authentication: Login/Logout, Session-Restore beim Start, JWT-Refresh - User Management: Liste, Anlage (Zod-Inline-Validation), Detailansicht, Passwort ändern, Sperren/Entsperren mit ConfirmDialog - Role Management: Liste, Detailansicht, Zuweisen/Entfernen per RoleSelectList (↑↓) - UX: SuccessDisplay (Auto-Dismiss 3 s), ConfirmDialog (J/N), FormInput mit Inline-Fehlern, StatusBar mit API-URL - Layout: Fullscreen-Modus (alternate screen buffer), Header mit eingeloggtem User - Tests: vitest + ink-testing-library (15 Tests)
34 lines
744 B
TypeScript
34 lines
744 B
TypeScript
/**
|
|
* API client configuration
|
|
*/
|
|
|
|
export interface ApiConfig {
|
|
baseUrl: string;
|
|
timeoutMs: number;
|
|
retries: number;
|
|
}
|
|
|
|
export const DEFAULT_API_CONFIG: ApiConfig = {
|
|
baseUrl: 'http://localhost:8080',
|
|
timeoutMs: 10_000,
|
|
retries: 1,
|
|
};
|
|
|
|
export const API_PATHS = {
|
|
auth: {
|
|
login: '/api/auth/login',
|
|
logout: '/api/auth/logout',
|
|
refresh: '/api/auth/refresh',
|
|
},
|
|
users: {
|
|
base: '/api/users',
|
|
byId: (id: string) => `/api/users/${id}`,
|
|
lock: (id: string) => `/api/users/${id}/lock`,
|
|
unlock: (id: string) => `/api/users/${id}/unlock`,
|
|
roles: (id: string) => `/api/users/${id}/roles`,
|
|
password: (id: string) => `/api/users/${id}/password`,
|
|
},
|
|
roles: {
|
|
base: '/api/roles',
|
|
},
|
|
} as const;
|