diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-06 18:11:14 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-06 18:25:52 +0900 |
| commit | e367c698e03c41c292c3dd5c07bad0a870c3ebc4 (patch) | |
| tree | 256c022a03b3f213a75261595ffddc0f87c0475b /src/client/api/types.ts | |
| parent | 17ba3c603e4c522ccca282f6786fff2e0b3f4f6e (diff) | |
| download | kioku-e367c698e03c41c292c3dd5c07bad0a870c3ebc4.tar.gz kioku-e367c698e03c41c292c3dd5c07bad0a870c3ebc4.tar.zst kioku-e367c698e03c41c292c3dd5c07bad0a870c3ebc4.zip | |
feat(client): add API client with auth header support
Implements fetch wrapper that handles JWT authentication, automatic
token refresh on 401 responses, and provides typed methods for REST
operations. Includes comprehensive tests.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'src/client/api/types.ts')
| -rw-r--r-- | src/client/api/types.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/api/types.ts b/src/client/api/types.ts new file mode 100644 index 0000000..1ba3624 --- /dev/null +++ b/src/client/api/types.ts @@ -0,0 +1,24 @@ +export interface User { + id: string; + username: string; +} + +export interface AuthResponse { + accessToken: string; + refreshToken: string; + user: User; +} + +export interface RegisterResponse { + user: User; +} + +export interface ApiError { + error: string; + code?: string; +} + +export interface Tokens { + accessToken: string; + refreshToken: string; +} |
