From e367c698e03c41c292c3dd5c07bad0a870c3ebc4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 6 Dec 2025 18:11:14 +0900 Subject: feat(client): add API client with auth header support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/client/api/types.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/client/api/types.ts (limited to 'src/client/api/types.ts') 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; +} -- cgit v1.2.3-70-g09d2