@djangocfg/api 2.1.99 → 2.1.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-server.cjs +333 -313
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +333 -313
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +441 -383
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +36 -1
- package/dist/auth.d.ts +36 -1
- package/dist/auth.mjs +441 -383
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +458 -383
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +55 -1
- package/dist/clients.d.ts +55 -1
- package/dist/clients.mjs +458 -383
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +184 -111
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +48 -1
- package/dist/hooks.d.ts +48 -1
- package/dist/hooks.mjs +184 -111
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +382 -313
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.mjs +382 -313
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/hooks/index.ts +7 -0
- package/src/auth/hooks/useDeleteAccount.ts +90 -0
- package/src/generated/cfg_accounts/CLAUDE.md +4 -3
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +58 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +19 -0
- package/src/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts +20 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +14 -0
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +12 -0
- package/src/generated/cfg_accounts/schema.json +69 -0
package/dist/auth-server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/middlewares/proxy.ts","../src/generated/cfg_accounts/accounts__auth/client.ts","../src/generated/cfg_accounts/accounts__oauth/client.ts","../src/generated/cfg_accounts/accounts__user_profile/client.ts","../src/generated/cfg_accounts/accounts/client.ts","../src/generated/cfg_accounts/http.ts","../src/generated/cfg_accounts/errors.ts","../src/generated/cfg_accounts/logger.ts","../src/generated/cfg_accounts/retry.ts","../src/generated/cfg_accounts/client.ts","../src/generated/cfg_accounts/storage.ts","../src/generated/cfg_accounts/enums.ts","../src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts","../src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/User.schema.ts","../src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts","../src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts","../src/generated/cfg_accounts/index.ts","../src/generated/cfg_centrifugo/logger.ts","../src/generated/cfg_centrifugo/retry.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts","../src/generated/cfg_webpush/logger.ts","../src/generated/cfg_webpush/retry.ts","../src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts","../src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts","../src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts","../src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts","../src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts","../src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts","../src/index.ts","../src/auth/utils/logger.ts","../src/auth/middlewares/tokenRefresh.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\n\n/**\n * Proxy middleware for media and API endpoints\n * Use this in your middleware.ts file\n */\nexport function proxyMiddleware(request: NextRequest) {\n const { pathname, search } = request.nextUrl;\n const apiUrl = process.env.NEXT_PUBLIC_API_URL;\n\n // Proxy /media/* - Images and static files\n if (pathname.startsWith('/media/')) {\n const targetUrl = `${apiUrl}${pathname}${search}`;\n return NextResponse.rewrite(targetUrl, { request: { headers: request.headers } });\n }\n\n // Proxy /api/* - API endpoints\n if (pathname.startsWith('/api/')) {\n const targetUrl = `${apiUrl}${pathname}${search}`;\n return NextResponse.rewrite(targetUrl, { request: { headers: request.headers } });\n }\n\n return NextResponse.next();\n}\n\n/**\n * Recommended matcher config for proxy middleware\n * Add this to your middleware.ts config\n */\nexport const proxyMiddlewareConfig = {\n matcher: ['/media/:path*', '/api/:path*'],\n};\n","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for Auth.\n */\nexport class Auth {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Refresh JWT token.\n */\n async accountsTokenRefreshCreate(data: Models.TokenRefreshRequest): Promise<Models.TokenRefresh> {\n const response = await this.client.request('POST', \"/cfg/accounts/token/refresh/\", { body: data });\n return response;\n }\n\n}","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for Oauth.\n */\nexport class Oauth {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * List OAuth connections\n * \n * Get all OAuth connections for the current user.\n */\n async accountsOauthConnectionsList(): Promise<any> {\n const response = await this.client.request('GET', \"/cfg/accounts/oauth/connections/\");\n return response;\n }\n\n /**\n * Disconnect OAuth provider\n * \n * Remove OAuth connection for the specified provider.\n */\n async accountsOauthDisconnectCreate(data: Models.OAuthDisconnectRequestRequest): Promise<any> {\n const response = await this.client.request('POST', \"/cfg/accounts/oauth/disconnect/\", { body: data });\n return response;\n }\n\n /**\n * Start GitHub OAuth\n * \n * Generate GitHub OAuth authorization URL. Redirect user to this URL to\n * start authentication.\n */\n async accountsOauthGithubAuthorizeCreate(data: Models.OAuthAuthorizeRequestRequest): Promise<Models.OAuthAuthorizeResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/oauth/github/authorize/\", { body: data });\n return response;\n }\n\n /**\n * Complete GitHub OAuth\n * \n * Exchange authorization code for JWT tokens. Call this after GitHub\n * redirects back with code.\n */\n async accountsOauthGithubCallbackCreate(data: Models.OAuthCallbackRequestRequest): Promise<Models.OAuthTokenResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/oauth/github/callback/\", { body: data });\n return response;\n }\n\n /**\n * List OAuth providers\n * \n * Get list of available OAuth providers for authentication.\n */\n async accountsOauthProvidersRetrieve(): Promise<Models.OAuthProvidersResponse> {\n const response = await this.client.request('GET', \"/cfg/accounts/oauth/providers/\");\n return response;\n }\n\n}","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for User Profile.\n */\nexport class UserProfile {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Get current user profile\n * \n * Retrieve the current authenticated user's profile information.\n */\n async accountsProfileRetrieve(): Promise<Models.User> {\n const response = await this.client.request('GET', \"/cfg/accounts/profile/\");\n return response;\n }\n\n /**\n * Upload user avatar\n * \n * Upload avatar image for the current authenticated user. Accepts\n * multipart/form-data with 'avatar' field.\n */\n async accountsProfileAvatarCreate(data: Models.CfgAccountsProfileAvatarCreateRequest): Promise<Models.User> {\n const formData = new FormData();\n formData.append('avatar', data.avatar);\n const response = await this.client.request('POST', \"/cfg/accounts/profile/avatar/\", { formData });\n return response;\n }\n\n /**\n * Partial update user profile\n * \n * Partially update the current authenticated user's profile information.\n * Supports avatar upload.\n */\n async accountsProfilePartialUpdate(data: Models.UserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PUT', \"/cfg/accounts/profile/partial/\", { body: data });\n return response;\n }\n\n /**\n * Partial update user profile\n * \n * Partially update the current authenticated user's profile information.\n * Supports avatar upload.\n */\n async accountsProfilePartialPartialUpdate(data?: Models.PatchedUserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PATCH', \"/cfg/accounts/profile/partial/\", { body: data });\n return response;\n }\n\n /**\n * Update user profile\n * \n * Update the current authenticated user's profile information.\n */\n async accountsProfileUpdateUpdate(data: Models.UserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PUT', \"/cfg/accounts/profile/update/\", { body: data });\n return response;\n }\n\n /**\n * Update user profile\n * \n * Update the current authenticated user's profile information.\n */\n async accountsProfileUpdatePartialUpdate(data?: Models.PatchedUserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PATCH', \"/cfg/accounts/profile/update/\", { body: data });\n return response;\n }\n\n}","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for Accounts.\n */\nexport class Accounts {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Request OTP code to email or phone.\n */\n async otpRequestCreate(data: Models.OTPRequestRequest): Promise<Models.OTPRequestResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/otp/request/\", { body: data });\n return response;\n }\n\n /**\n * Verify OTP code and return JWT tokens or 2FA session. If user has 2FA\n * enabled: - Returns requires_2fa=True with session_id - Client must\n * complete 2FA verification at /cfg/totp/verify/ If user has no 2FA: -\n * Returns JWT tokens and user data directly\n */\n async otpVerifyCreate(data: Models.OTPVerifyRequest): Promise<Models.OTPVerifyResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/otp/verify/\", { body: data });\n return response;\n }\n\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * HTTP Client Adapter Pattern\n *\n * Allows switching between fetch/axios/httpx without changing generated code.\n * Provides unified interface for making HTTP requests.\n */\n\nexport interface HttpRequest {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n params?: Record<string, any>;\n /** FormData for file uploads (multipart/form-data) */\n formData?: FormData;\n /** Binary data for octet-stream uploads */\n binaryBody?: Blob | ArrayBuffer;\n}\n\nexport interface HttpResponse<T = any> {\n data: T;\n status: number;\n statusText: string;\n headers: Record<string, string>;\n}\n\n/**\n * HTTP Client Adapter Interface.\n * Implement this to use custom HTTP clients (axios, httpx, etc.)\n */\nexport interface HttpClientAdapter {\n request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;\n}\n\n/**\n * Default Fetch API adapter.\n * Uses native browser fetch() with proper error handling.\n */\nexport class FetchAdapter implements HttpClientAdapter {\n async request<T = any>(request: HttpRequest): Promise<HttpResponse<T>> {\n const { method, url, headers, body, params, formData, binaryBody } = request;\n\n // Build URL with query params\n let finalUrl = url;\n if (params) {\n const searchParams = new URLSearchParams();\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n searchParams.append(key, String(value));\n }\n });\n const queryString = searchParams.toString();\n if (queryString) {\n finalUrl = url.includes('?') ? `${url}&${queryString}` : `${url}?${queryString}`;\n }\n }\n\n // Build headers\n const finalHeaders: Record<string, string> = { ...headers };\n\n // Determine body and content-type\n let requestBody: string | FormData | Blob | ArrayBuffer | undefined;\n\n if (formData) {\n // For multipart/form-data, let browser set Content-Type with boundary\n requestBody = formData;\n // Don't set Content-Type - browser will set it with boundary\n } else if (binaryBody) {\n // Binary upload (application/octet-stream)\n finalHeaders['Content-Type'] = 'application/octet-stream';\n requestBody = binaryBody;\n } else if (body) {\n // JSON request\n finalHeaders['Content-Type'] = 'application/json';\n requestBody = JSON.stringify(body);\n }\n\n // Make request\n const response = await fetch(finalUrl, {\n method,\n headers: finalHeaders,\n body: requestBody,\n credentials: 'include', // Include Django session cookies\n });\n\n // Parse response\n let data: any = null;\n const contentType = response.headers.get('content-type');\n\n if (response.status !== 204 && contentType?.includes('application/json')) {\n data = await response.json();\n } else if (response.status !== 204) {\n data = await response.text();\n }\n\n // Convert Headers to plain object\n const responseHeaders: Record<string, string> = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n\n return {\n data,\n status: response.status,\n statusText: response.statusText,\n headers: responseHeaders,\n };\n }\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Error Classes\n *\n * Typed error classes with Django REST Framework support.\n */\n\n/**\n * HTTP API Error with DRF field-specific validation errors.\n *\n * Usage:\n * ```typescript\n * try {\n * await api.users.create(userData);\n * } catch (error) {\n * if (error instanceof APIError) {\n * if (error.isValidationError) {\n * console.log('Field errors:', error.fieldErrors);\n * // { \"email\": [\"Email already exists\"], \"username\": [\"Required\"] }\n * }\n * }\n * }\n * ```\n */\nexport class APIError extends Error {\n constructor(\n public statusCode: number,\n public statusText: string,\n public response: any,\n public url: string,\n message?: string\n ) {\n super(message || `HTTP ${statusCode}: ${statusText}`);\n this.name = 'APIError';\n }\n\n /**\n * Get error details from response.\n * DRF typically returns: { \"detail\": \"Error message\" } or { \"field\": [\"error1\", \"error2\"] }\n */\n get details(): Record<string, any> | null {\n if (typeof this.response === 'object' && this.response !== null) {\n return this.response;\n }\n return null;\n }\n\n /**\n * Get field-specific validation errors from DRF.\n * Returns: { \"field_name\": [\"error1\", \"error2\"], ... }\n */\n get fieldErrors(): Record<string, string[]> | null {\n const details = this.details;\n if (!details) return null;\n\n // DRF typically returns: { \"field\": [\"error1\", \"error2\"] }\n const fieldErrors: Record<string, string[]> = {};\n for (const [key, value] of Object.entries(details)) {\n if (Array.isArray(value)) {\n fieldErrors[key] = value;\n }\n }\n\n return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;\n }\n\n /**\n * Get single error message from DRF.\n * Checks for \"detail\", \"message\", or first field error.\n */\n get errorMessage(): string {\n const details = this.details;\n if (!details) return this.message;\n\n // Check for \"detail\" field (common in DRF)\n if (details.detail) {\n return Array.isArray(details.detail) ? details.detail.join(', ') : String(details.detail);\n }\n\n // Check for \"message\" field\n if (details.message) {\n return String(details.message);\n }\n\n // Return first field error\n const fieldErrors = this.fieldErrors;\n if (fieldErrors) {\n const firstField = Object.keys(fieldErrors)[0];\n if (firstField) {\n return `${firstField}: ${fieldErrors[firstField]?.join(', ')}`;\n }\n }\n\n return this.message;\n }\n\n // Helper methods for common HTTP status codes\n get isValidationError(): boolean { return this.statusCode === 400; }\n get isAuthError(): boolean { return this.statusCode === 401; }\n get isPermissionError(): boolean { return this.statusCode === 403; }\n get isNotFoundError(): boolean { return this.statusCode === 404; }\n get isServerError(): boolean { return this.statusCode >= 500 && this.statusCode < 600; }\n}\n\n/**\n * Network Error (connection failed, timeout, etc.)\n */\nexport class NetworkError extends Error {\n constructor(\n message: string,\n public url: string,\n public originalError?: Error\n ) {\n super(message);\n this.name = 'NetworkError';\n }\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Logger with Consola\n * Beautiful console logging for API requests and responses\n *\n * Installation:\n * npm install consola\n */\n\nimport { type ConsolaInstance, createConsola } from 'consola';\n\n/**\n * Request log data\n */\nexport interface RequestLog {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n timestamp: number;\n}\n\n/**\n * Response log data\n */\nexport interface ResponseLog {\n status: number;\n statusText: string;\n data?: any;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Error log data\n */\nexport interface ErrorLog {\n message: string;\n statusCode?: number;\n fieldErrors?: Record<string, string[]>;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Logger configuration\n */\nexport interface LoggerConfig {\n /** Enable logging */\n enabled: boolean;\n /** Log requests */\n logRequests: boolean;\n /** Log responses */\n logResponses: boolean;\n /** Log errors */\n logErrors: boolean;\n /** Log request/response bodies */\n logBodies: boolean;\n /** Log headers (excluding sensitive ones) */\n logHeaders: boolean;\n /** Custom consola instance */\n consola?: ConsolaInstance;\n}\n\n/**\n * Default logger configuration\n */\nconst DEFAULT_CONFIG: LoggerConfig = {\n enabled: process.env.NODE_ENV !== 'production',\n logRequests: true,\n logResponses: true,\n logErrors: true,\n logBodies: true,\n logHeaders: false,\n};\n\n/**\n * Sensitive header names to filter out\n */\nconst SENSITIVE_HEADERS = [\n 'authorization',\n 'cookie',\n 'set-cookie',\n 'x-api-key',\n 'x-csrf-token',\n];\n\n/**\n * API Logger class\n */\nexport class APILogger {\n private config: LoggerConfig;\n private consola: ConsolaInstance;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.consola = config.consola || createConsola({\n level: this.config.enabled ? 4 : 0,\n });\n }\n\n /**\n * Enable logging\n */\n enable(): void {\n this.config.enabled = true;\n }\n\n /**\n * Disable logging\n */\n disable(): void {\n this.config.enabled = false;\n }\n\n /**\n * Update configuration\n */\n setConfig(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Filter sensitive headers\n */\n private filterHeaders(headers?: Record<string, string>): Record<string, string> {\n if (!headers) return {};\n\n const filtered: Record<string, string> = {};\n Object.keys(headers).forEach((key) => {\n const lowerKey = key.toLowerCase();\n if (SENSITIVE_HEADERS.includes(lowerKey)) {\n filtered[key] = '***';\n } else {\n filtered[key] = headers[key] || '';\n }\n });\n\n return filtered;\n }\n\n /**\n * Log request\n */\n logRequest(request: RequestLog): void {\n if (!this.config.enabled || !this.config.logRequests) return;\n\n const { method, url, headers, body } = request;\n\n this.consola.start(`${method} ${url}`);\n\n if (this.config.logHeaders && headers) {\n this.consola.debug('Headers:', this.filterHeaders(headers));\n }\n\n if (this.config.logBodies && body) {\n this.consola.debug('Body:', body);\n }\n }\n\n /**\n * Log response\n */\n logResponse(request: RequestLog, response: ResponseLog): void {\n if (!this.config.enabled || !this.config.logResponses) return;\n\n const { method, url } = request;\n const { status, statusText, data, duration } = response;\n\n const statusColor = status >= 500 ? 'red'\n : status >= 400 ? 'yellow'\n : status >= 300 ? 'cyan'\n : 'green';\n\n this.consola.success(\n `${method} ${url} ${status} ${statusText} (${duration}ms)`\n );\n\n if (this.config.logBodies && data) {\n this.consola.debug('Response:', data);\n }\n }\n\n /**\n * Log error\n */\n logError(request: RequestLog, error: ErrorLog): void {\n if (!this.config.enabled || !this.config.logErrors) return;\n\n const { method, url } = request;\n const { message, statusCode, fieldErrors, duration } = error;\n\n this.consola.error(\n `${method} ${url} ${statusCode || 'Network'} Error (${duration}ms)`\n );\n\n this.consola.error('Message:', message);\n\n if (fieldErrors && Object.keys(fieldErrors).length > 0) {\n this.consola.error('Field Errors:');\n Object.entries(fieldErrors).forEach(([field, errors]) => {\n errors.forEach((err) => {\n this.consola.error(` • ${field}: ${err}`);\n });\n });\n }\n }\n\n /**\n * Log general info\n */\n info(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.info(message, ...args);\n }\n\n /**\n * Log warning\n */\n warn(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.warn(message, ...args);\n }\n\n /**\n * Log error\n */\n error(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.error(message, ...args);\n }\n\n /**\n * Log debug\n */\n debug(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.debug(message, ...args);\n }\n\n /**\n * Log success\n */\n success(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.success(message, ...args);\n }\n\n /**\n * Create a sub-logger with prefix\n */\n withTag(tag: string): ConsolaInstance {\n return this.consola.withTag(tag);\n }\n}\n\n/**\n * Default logger instance\n */\nexport const defaultLogger = new APILogger();","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Retry Configuration and Utilities\n *\n * Provides automatic retry logic for failed HTTP requests using p-retry.\n * Retries only on network errors and server errors (5xx), not client errors (4xx).\n */\n\nimport pRetry, { AbortError } from 'p-retry';\nimport { APIError, NetworkError } from './errors';\n\n/**\n * Information about a failed retry attempt.\n */\nexport interface FailedAttemptInfo {\n /** The error that caused the failure */\n error: Error;\n /** The attempt number (1-indexed) */\n attemptNumber: number;\n /** Number of retries left */\n retriesLeft: number;\n}\n\n/**\n * Retry configuration options.\n *\n * Uses exponential backoff with jitter by default to avoid thundering herd.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of retry attempts.\n * @default 3\n */\n retries?: number;\n\n /**\n * Exponential backoff factor.\n * @default 2\n */\n factor?: number;\n\n /**\n * Minimum wait time between retries (ms).\n * @default 1000\n */\n minTimeout?: number;\n\n /**\n * Maximum wait time between retries (ms).\n * @default 60000\n */\n maxTimeout?: number;\n\n /**\n * Add randomness to wait times (jitter).\n * Helps avoid thundering herd problem.\n * @default true\n */\n randomize?: boolean;\n\n /**\n * Callback called on each failed attempt.\n */\n onFailedAttempt?: (info: FailedAttemptInfo) => void;\n}\n\n/**\n * Default retry configuration.\n */\nexport const DEFAULT_RETRY_CONFIG: Required<RetryConfig> = {\n retries: 3,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 60000,\n randomize: true,\n onFailedAttempt: () => {},\n};\n\n/**\n * Determine if an error should trigger a retry.\n *\n * Retries on:\n * - Network errors (connection refused, timeout, etc.)\n * - Server errors (5xx status codes)\n * - Rate limiting (429 status code)\n *\n * Does NOT retry on:\n * - Client errors (4xx except 429)\n * - Authentication errors (401, 403)\n * - Not found (404)\n *\n * @param error - The error to check\n * @returns true if should retry, false otherwise\n */\nexport function shouldRetry(error: any): boolean {\n // Always retry network errors\n if (error instanceof NetworkError) {\n return true;\n }\n\n // For API errors, check status code\n if (error instanceof APIError) {\n const status = error.statusCode;\n\n // Retry on 5xx server errors\n if (status >= 500 && status < 600) {\n return true;\n }\n\n // Retry on 429 (rate limit)\n if (status === 429) {\n return true;\n }\n\n // Do NOT retry on 4xx client errors\n return false;\n }\n\n // Retry on unknown errors (might be network issues)\n return true;\n}\n\n/**\n * Wrap a function with retry logic.\n *\n * @param fn - Async function to retry\n * @param config - Retry configuration\n * @returns Result of the function\n *\n * @example\n * ```typescript\n * const result = await withRetry(\n * async () => fetch('https://api.example.com/users'),\n * { retries: 5, minTimeout: 2000 }\n * );\n * ```\n */\nexport async function withRetry<T>(\n fn: () => Promise<T>,\n config?: RetryConfig\n): Promise<T> {\n const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };\n\n return pRetry(\n async () => {\n try {\n return await fn();\n } catch (error) {\n // Check if we should retry this error\n if (!shouldRetry(error)) {\n // Abort retry immediately for non-retryable errors\n throw new AbortError(error as Error);\n }\n\n // Re-throw error to trigger retry\n throw error;\n }\n },\n {\n retries: finalConfig.retries,\n factor: finalConfig.factor,\n minTimeout: finalConfig.minTimeout,\n maxTimeout: finalConfig.maxTimeout,\n randomize: finalConfig.randomize,\n onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {\n // Adapt p-retry's FailedAttemptError to our FailedAttemptInfo\n const pRetryError = error as any; // p-retry's internal type\n finalConfig.onFailedAttempt!({\n error: pRetryError as Error,\n attemptNumber: pRetryError.attemptNumber,\n retriesLeft: pRetryError.retriesLeft,\n });\n } : undefined,\n }\n );\n}","import { Auth } from \"./accounts__auth\";\nimport { Oauth } from \"./accounts__oauth\";\nimport { UserProfile } from \"./accounts__user_profile\";\nimport { Accounts } from \"./accounts\";\nimport { HttpClientAdapter, FetchAdapter } from \"./http\";\nimport { APIError, NetworkError } from \"./errors\";\nimport { APILogger, type LoggerConfig } from \"./logger\";\nimport { withRetry, type RetryConfig } from \"./retry\";\n\n\n/**\n * Async API client for Django CFG API.\n *\n * Usage:\n * ```typescript\n * const client = new APIClient('https://api.example.com');\n * const users = await client.users.list();\n * const post = await client.posts.create(newPost);\n *\n * // Custom HTTP adapter (e.g., Axios)\n * const client = new APIClient('https://api.example.com', {\n * httpClient: new AxiosAdapter()\n * });\n * ```\n */\nexport class APIClient {\n private baseUrl: string;\n private httpClient: HttpClientAdapter;\n private logger: APILogger | null = null;\n private retryConfig: RetryConfig | null = null;\n private tokenGetter: (() => string | null) | null = null;\n\n // Sub-clients\n public auth: Auth;\n public oauth: Oauth;\n public user_profile: UserProfile;\n public accounts: Accounts;\n\n constructor(\n baseUrl: string,\n options?: {\n httpClient?: HttpClientAdapter;\n loggerConfig?: Partial<LoggerConfig>;\n retryConfig?: RetryConfig;\n tokenGetter?: () => string | null;\n }\n ) {\n this.baseUrl = baseUrl.replace(/\\/$/, '');\n this.httpClient = options?.httpClient || new FetchAdapter();\n this.tokenGetter = options?.tokenGetter || null;\n\n // Initialize logger if config provided\n if (options?.loggerConfig !== undefined) {\n this.logger = new APILogger(options.loggerConfig);\n }\n\n // Store retry configuration\n if (options?.retryConfig !== undefined) {\n this.retryConfig = options.retryConfig;\n }\n\n // Initialize sub-clients\n this.auth = new Auth(this);\n this.oauth = new Oauth(this);\n this.user_profile = new UserProfile(this);\n this.accounts = new Accounts(this);\n }\n\n /**\n * Get CSRF token from cookies (for SessionAuthentication).\n *\n * Returns null if cookie doesn't exist (JWT-only auth).\n */\n getCsrfToken(): string | null {\n const name = 'csrftoken';\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n return parts.pop()?.split(';').shift() || null;\n }\n return null;\n }\n\n /**\n * Get the base URL for building streaming/download URLs.\n */\n getBaseUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Get JWT token for URL authentication (used in streaming endpoints).\n * Returns null if no token getter is configured or no token is available.\n */\n getToken(): string | null {\n return this.tokenGetter ? this.tokenGetter() : null;\n }\n\n /**\n * Make HTTP request with Django CSRF and session handling.\n * Automatically retries on network errors and 5xx server errors.\n */\n async request<T>(\n method: string,\n path: string,\n options?: {\n params?: Record<string, any>;\n body?: any;\n formData?: FormData;\n binaryBody?: Blob | ArrayBuffer;\n headers?: Record<string, string>;\n }\n ): Promise<T> {\n // Wrap request in retry logic if configured\n if (this.retryConfig) {\n return withRetry(() => this._makeRequest<T>(method, path, options), {\n ...this.retryConfig,\n onFailedAttempt: (info) => {\n // Log retry attempts\n if (this.logger) {\n this.logger.warn(\n `Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} ` +\n `for ${method} ${path}: ${info.error.message}`\n );\n }\n // Call user's onFailedAttempt if provided\n this.retryConfig?.onFailedAttempt?.(info);\n },\n });\n }\n\n // No retry configured, make request directly\n return this._makeRequest<T>(method, path, options);\n }\n\n /**\n * Internal request method (without retry wrapper).\n * Used by request() method with optional retry logic.\n */\n private async _makeRequest<T>(\n method: string,\n path: string,\n options?: {\n params?: Record<string, any>;\n body?: any;\n formData?: FormData;\n binaryBody?: Blob | ArrayBuffer;\n headers?: Record<string, string>;\n }\n ): Promise<T> {\n // Build URL - handle both absolute and relative paths\n // When baseUrl is empty (static builds), path is used as-is (relative to current origin)\n const url = this.baseUrl ? `${this.baseUrl}${path}` : path;\n const startTime = Date.now();\n\n // Build headers - start with custom headers from options\n const headers: Record<string, string> = {\n ...(options?.headers || {})\n };\n\n // Don't set Content-Type for FormData/binaryBody (browser will set it with boundary)\n if (!options?.formData && !options?.binaryBody && !headers['Content-Type']) {\n headers['Content-Type'] = 'application/json';\n }\n\n // CSRF not needed - SessionAuthentication not enabled in DRF config\n // Your API uses JWT/Token authentication (no CSRF required)\n\n // Log request\n if (this.logger) {\n this.logger.logRequest({\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n });\n }\n\n try {\n // Make request via HTTP adapter\n const response = await this.httpClient.request<T>({\n method,\n url: url,\n headers,\n params: options?.params,\n body: options?.body,\n formData: options?.formData,\n binaryBody: options?.binaryBody,\n });\n\n const duration = Date.now() - startTime;\n\n // Check for HTTP errors\n if (response.status >= 400) {\n const error = new APIError(\n response.status,\n response.statusText,\n response.data,\n url\n );\n\n // Log error\n if (this.logger) {\n this.logger.logError(\n {\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n },\n {\n message: error.message,\n statusCode: response.status,\n duration,\n timestamp: Date.now(),\n }\n );\n }\n\n throw error;\n }\n\n // Log successful response\n if (this.logger) {\n this.logger.logResponse(\n {\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n },\n {\n status: response.status,\n statusText: response.statusText,\n data: response.data,\n duration,\n timestamp: Date.now(),\n }\n );\n }\n\n return response.data as T;\n } catch (error) {\n const duration = Date.now() - startTime;\n\n // Re-throw APIError as-is\n if (error instanceof APIError) {\n throw error;\n }\n\n // Detect CORS errors and dispatch event\n const isCORSError = error instanceof TypeError &&\n (error.message.toLowerCase().includes('cors') ||\n error.message.toLowerCase().includes('failed to fetch') ||\n error.message.toLowerCase().includes('network request failed'));\n\n // Log specific error type first\n if (this.logger) {\n if (isCORSError) {\n this.logger.error(`🚫 CORS Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n this.logger.error(` → Configure security_domains parameter on the server`);\n } else {\n this.logger.error(`⚠️ Network Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n // Dispatch browser events\n if (typeof window !== 'undefined') {\n try {\n if (isCORSError) {\n // Dispatch CORS-specific error event\n window.dispatchEvent(new CustomEvent('cors-error', {\n detail: {\n url: url,\n method: method,\n error: error instanceof Error ? error.message : String(error),\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n } else {\n // Dispatch generic network error event\n window.dispatchEvent(new CustomEvent('network-error', {\n detail: {\n url: url,\n method: method,\n error: error instanceof Error ? error.message : String(error),\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n }\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n }\n }\n\n // Wrap other errors as NetworkError\n const networkError = error instanceof Error\n ? new NetworkError(error.message, url, error)\n : new NetworkError('Unknown error', url);\n\n // Detailed logging via logger.logError\n if (this.logger) {\n this.logger.logError(\n {\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n },\n {\n message: networkError.message,\n duration,\n timestamp: Date.now(),\n }\n );\n }\n\n throw networkError;\n }\n }\n}\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Storage adapters for cross-platform token storage.\n *\n * Supports:\n * - LocalStorage (browser)\n * - Cookies (SSR/browser)\n * - Memory (Node.js/Electron/testing)\n */\n\nimport type { APILogger } from './logger';\n\n/**\n * Storage adapter interface for cross-platform token storage.\n */\nexport interface StorageAdapter {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\n/**\n * LocalStorage adapter with safe try-catch for browser environments.\n * Works in modern browsers with localStorage support.\n * \n * Note: This adapter uses window.localStorage and should only be used in browser/client environments.\n * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.\n */\nexport class LocalStorageAdapter implements StorageAdapter {\n private logger?: APILogger;\n\n constructor(logger?: APILogger) {\n this.logger = logger;\n }\n\n getItem(key: string): string | null {\n try {\n if (typeof window !== 'undefined' && window.localStorage) {\n const value = localStorage.getItem(key);\n this.logger?.debug(`LocalStorage.getItem(\"${key}\"): ${value ? 'found' : 'not found'}`);\n return value;\n }\n this.logger?.warn('LocalStorage not available: window.localStorage is undefined');\n } catch (error) {\n this.logger?.error('LocalStorage.getItem failed:', error);\n }\n return null;\n }\n\n setItem(key: string, value: string): void {\n try {\n if (typeof window !== 'undefined' && window.localStorage) {\n localStorage.setItem(key, value);\n this.logger?.debug(`LocalStorage.setItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('LocalStorage not available: window.localStorage is undefined');\n }\n } catch (error) {\n this.logger?.error('LocalStorage.setItem failed:', error);\n }\n }\n\n removeItem(key: string): void {\n try {\n if (typeof window !== 'undefined' && window.localStorage) {\n localStorage.removeItem(key);\n this.logger?.debug(`LocalStorage.removeItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('LocalStorage not available: window.localStorage is undefined');\n }\n } catch (error) {\n this.logger?.error('LocalStorage.removeItem failed:', error);\n }\n }\n}\n\n/**\n * Cookie-based storage adapter for SSR and browser environments.\n * Useful for Next.js, Nuxt.js, and other SSR frameworks.\n */\nexport class CookieStorageAdapter implements StorageAdapter {\n private logger?: APILogger;\n\n constructor(logger?: APILogger) {\n this.logger = logger;\n }\n\n getItem(key: string): string | null {\n try {\n if (typeof document === 'undefined') {\n this.logger?.warn('Cookies not available: document is undefined (SSR context?)');\n return null;\n }\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${key}=`);\n if (parts.length === 2) {\n const result = parts.pop()?.split(';').shift() || null;\n this.logger?.debug(`CookieStorage.getItem(\"${key}\"): ${result ? 'found' : 'not found'}`);\n return result;\n }\n this.logger?.debug(`CookieStorage.getItem(\"${key}\"): not found`);\n } catch (error) {\n this.logger?.error('CookieStorage.getItem failed:', error);\n }\n return null;\n }\n\n setItem(key: string, value: string): void {\n try {\n if (typeof document !== 'undefined') {\n document.cookie = `${key}=${value}; path=/; max-age=31536000`;\n this.logger?.debug(`CookieStorage.setItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('Cookies not available: document is undefined (SSR context?)');\n }\n } catch (error) {\n this.logger?.error('CookieStorage.setItem failed:', error);\n }\n }\n\n removeItem(key: string): void {\n try {\n if (typeof document !== 'undefined') {\n document.cookie = `${key}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;\n this.logger?.debug(`CookieStorage.removeItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('Cookies not available: document is undefined (SSR context?)');\n }\n } catch (error) {\n this.logger?.error('CookieStorage.removeItem failed:', error);\n }\n }\n}\n\n/**\n * In-memory storage adapter for Node.js, Electron, and testing environments.\n * Data is stored in RAM and cleared when process exits.\n */\nexport class MemoryStorageAdapter implements StorageAdapter {\n private storage: Map<string, string> = new Map();\n private logger?: APILogger;\n\n constructor(logger?: APILogger) {\n this.logger = logger;\n }\n\n getItem(key: string): string | null {\n const value = this.storage.get(key) || null;\n this.logger?.debug(`MemoryStorage.getItem(\"${key}\"): ${value ? 'found' : 'not found'}`);\n return value;\n }\n\n setItem(key: string, value: string): void {\n this.storage.set(key, value);\n this.logger?.debug(`MemoryStorage.setItem(\"${key}\"): success`);\n }\n\n removeItem(key: string): void {\n this.storage.delete(key);\n this.logger?.debug(`MemoryStorage.removeItem(\"${key}\"): success`);\n }\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * OAuth provider name (github, google, etc.)\n * * `github` - GitHub\n */\nexport enum OAuthConnectionProvider {\n GITHUB = \"github\",\n}\n\n/**\n * OAuth provider to disconnect\n * * `github` - GitHub\n */\nexport enum OAuthDisconnectRequestRequestProvider {\n GITHUB = \"github\",\n}\n\n/**\n * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.\n * * `email` - Email\n * * `phone` - Phone\n */\nexport enum OTPRequestRequestChannel {\n EMAIL = \"email\",\n PHONE = \"phone\",\n}\n\n/**\n * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.\n * * `email` - Email\n * * `phone` - Phone\n */\nexport enum OTPVerifyRequestChannel {\n EMAIL = \"email\",\n PHONE = \"phone\",\n}\n\n","/**\n * Zod schema for CentrifugoToken\n *\n * This schema provides runtime validation and type inference.\n * * Nested serializer for Centrifugo WebSocket connection token.\n * */\nimport { z } from 'zod'\n\n/**\n * Nested serializer for Centrifugo WebSocket connection token.\n */\nexport const CentrifugoTokenSchema = z.object({\n token: z.string(),\n centrifugo_url: z.union([z.url(), z.literal('')]),\n expires_at: z.iso.datetime(),\n channels: z.array(z.string()),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoToken = z.infer<typeof CentrifugoTokenSchema>","/**\n * Zod schema for CfgAccountsProfileAvatarCreateRequest\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\n\nexport const CfgAccountsProfileAvatarCreateRequestSchema = z.object({\n avatar: z.union([z.instanceof(File), z.instanceof(Blob)]),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>","/**\n * Zod schema for OAuthAuthorizeRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to start OAuth flow.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to start OAuth flow.\n */\nexport const OAuthAuthorizeRequestRequestSchema = z.object({\n redirect_uri: z.union([z.url(), z.literal('')]).optional(),\n source_url: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthAuthorizeRequestRequest = z.infer<typeof OAuthAuthorizeRequestRequestSchema>","/**\n * Zod schema for OAuthAuthorizeResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response with OAuth authorization URL.\n * */\nimport { z } from 'zod'\n\n/**\n * Response with OAuth authorization URL.\n */\nexport const OAuthAuthorizeResponseSchema = z.object({\n authorization_url: z.union([z.url(), z.literal('')]),\n state: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthAuthorizeResponse = z.infer<typeof OAuthAuthorizeResponseSchema>","/**\n * Zod schema for OAuthCallbackRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to complete OAuth flow (callback handler).\n * */\nimport { z } from 'zod'\n\n/**\n * Request to complete OAuth flow (callback handler).\n */\nexport const OAuthCallbackRequestRequestSchema = z.object({\n code: z.string().min(10).max(500),\n state: z.string().min(20).max(100),\n redirect_uri: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSchema>","/**\n * Zod schema for OAuthConnection\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for OAuth connection info (user-facing).\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Serializer for OAuth connection info (user-facing).\n */\nexport const OAuthConnectionSchema = z.object({\n id: z.int(),\n provider: z.nativeEnum(Enums.OAuthConnectionProvider),\n provider_display: z.string(),\n provider_username: z.string(),\n provider_email: z.email(),\n provider_avatar_url: z.union([z.url(), z.literal('')]),\n connected_at: z.iso.datetime(),\n last_login_at: z.iso.datetime(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthConnection = z.infer<typeof OAuthConnectionSchema>","/**\n * Zod schema for OAuthDisconnectRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to disconnect OAuth provider.\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Request to disconnect OAuth provider.\n */\nexport const OAuthDisconnectRequestRequestSchema = z.object({\n provider: z.nativeEnum(Enums.OAuthDisconnectRequestRequestProvider),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthDisconnectRequestRequest = z.infer<typeof OAuthDisconnectRequestRequestSchema>","/**\n * Zod schema for OAuthError\n *\n * This schema provides runtime validation and type inference.\n * * Error response for OAuth endpoints.\n * */\nimport { z } from 'zod'\n\n/**\n * Error response for OAuth endpoints.\n */\nexport const OAuthErrorSchema = z.object({\n error: z.string(),\n error_description: z.string().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthError = z.infer<typeof OAuthErrorSchema>","/**\n * Zod schema for OAuthProvidersResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response with available OAuth providers.\n * */\nimport { z } from 'zod'\n\n/**\n * Response with available OAuth providers.\n */\nexport const OAuthProvidersResponseSchema = z.object({\n providers: z.array(z.record(z.string(), z.any())),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthProvidersResponse = z.infer<typeof OAuthProvidersResponseSchema>","/**\n * Zod schema for OAuthTokenResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response with JWT tokens after OAuth authentication.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- access/refresh/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- access/refresh/user: populated\n * */\nimport { z } from 'zod'\n\n/**\n * Response with JWT tokens after OAuth authentication.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- access/refresh/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- access/refresh/user: populated\n */\nexport const OAuthTokenResponseSchema = z.object({\n requires_2fa: z.boolean().optional(),\n session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),\n access: z.string().nullable().optional(),\n refresh: z.string().nullable().optional(),\n user: z.record(z.string(), z.any()).nullable().optional(),\n is_new_user: z.boolean(),\n is_new_connection: z.boolean(),\n should_prompt_2fa: z.boolean().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>","/**\n * Zod schema for OTPErrorResponse\n *\n * This schema provides runtime validation and type inference.\n * * Error response for OTP operations.\n * */\nimport { z } from 'zod'\n\n/**\n * Error response for OTP operations.\n */\nexport const OTPErrorResponseSchema = z.object({\n error: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPErrorResponse = z.infer<typeof OTPErrorResponseSchema>","/**\n * Zod schema for OTPRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for OTP request.\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Serializer for OTP request.\n */\nexport const OTPRequestRequestSchema = z.object({\n identifier: z.string().min(1),\n channel: z.nativeEnum(Enums.OTPRequestRequestChannel).optional(),\n source_url: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPRequestRequest = z.infer<typeof OTPRequestRequestSchema>","/**\n * Zod schema for OTPRequestResponse\n *\n * This schema provides runtime validation and type inference.\n * * OTP request response.\n * */\nimport { z } from 'zod'\n\n/**\n * OTP request response.\n */\nexport const OTPRequestResponseSchema = z.object({\n message: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>","/**\n * Zod schema for OTPVerifyRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for OTP verification.\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Serializer for OTP verification.\n */\nexport const OTPVerifyRequestSchema = z.object({\n identifier: z.string().min(1),\n otp: z.string().min(6).max(6),\n channel: z.nativeEnum(Enums.OTPVerifyRequestChannel).optional(),\n source_url: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPVerifyRequest = z.infer<typeof OTPVerifyRequestSchema>","/**\n * Zod schema for OTPVerifyResponse\n *\n * This schema provides runtime validation and type inference.\n * * OTP verification response.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- refresh/access/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- refresh/access/user: populated\n * */\nimport { z } from 'zod'\nimport { UserSchema } from './User.schema'\n\n/**\n * OTP verification response.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- refresh/access/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- refresh/access/user: populated\n */\nexport const OTPVerifyResponseSchema = z.object({\n requires_2fa: z.boolean().optional(),\n session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),\n refresh: z.string().nullable().optional(),\n access: z.string().nullable().optional(),\n user: UserSchema.nullable().optional(),\n should_prompt_2fa: z.boolean().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPVerifyResponse = z.infer<typeof OTPVerifyResponseSchema>","/**\n * Zod schema for User\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for user details.\n * */\nimport { z } from 'zod'\nimport { CentrifugoTokenSchema } from './CentrifugoToken.schema'\n\n/**\n * Serializer for user details.\n */\nexport const UserSchema = z.object({\n id: z.int(),\n email: z.email(),\n first_name: z.string().max(50).optional(),\n last_name: z.string().max(50).optional(),\n full_name: z.string(),\n initials: z.string(),\n display_username: z.string(),\n company: z.string().max(100).optional(),\n phone: z.string().max(20).optional(),\n position: z.string().max(100).optional(),\n avatar: z.union([z.url(), z.literal('')]).nullable(),\n is_staff: z.boolean(),\n is_superuser: z.boolean(),\n date_joined: z.iso.datetime(),\n last_login: z.iso.datetime().nullable(),\n unanswered_messages_count: z.int(),\n centrifugo: CentrifugoTokenSchema.nullable(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type User = z.infer<typeof UserSchema>","/**\n * Zod schema for PatchedUserProfileUpdateRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for updating user profile.\n * */\nimport { z } from 'zod'\n\n/**\n * Serializer for updating user profile.\n */\nexport const PatchedUserProfileUpdateRequestSchema = z.object({\n first_name: z.string().max(50).optional(),\n last_name: z.string().max(50).optional(),\n company: z.string().max(100).optional(),\n phone: z.string().max(20).optional(),\n position: z.string().max(100).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PatchedUserProfileUpdateRequest = z.infer<typeof PatchedUserProfileUpdateRequestSchema>","/**\n * Zod schema for TokenRefresh\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\n\nexport const TokenRefreshSchema = z.object({\n access: z.string(),\n refresh: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TokenRefresh = z.infer<typeof TokenRefreshSchema>","/**\n * Zod schema for TokenRefreshRequest\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\n\nexport const TokenRefreshRequestSchema = z.object({\n refresh: z.string().min(1),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TokenRefreshRequest = z.infer<typeof TokenRefreshRequestSchema>","/**\n * Zod schema for UserProfileUpdateRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for updating user profile.\n * */\nimport { z } from 'zod'\n\n/**\n * Serializer for updating user profile.\n */\nexport const UserProfileUpdateRequestSchema = z.object({\n first_name: z.string().max(50).optional(),\n last_name: z.string().max(50).optional(),\n company: z.string().max(100).optional(),\n phone: z.string().max(20).optional(),\n position: z.string().max(100).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type UserProfileUpdateRequest = z.infer<typeof UserProfileUpdateRequestSchema>","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Accounts\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { OTPRequestRequestSchema, type OTPRequestRequest } from '../schemas/OTPRequestRequest.schema'\nimport { OTPRequestResponseSchema, type OTPRequestResponse } from '../schemas/OTPRequestResponse.schema'\nimport { OTPVerifyRequestSchema, type OTPVerifyRequest } from '../schemas/OTPVerifyRequest.schema'\nimport { OTPVerifyResponseSchema, type OTPVerifyResponse } from '../schemas/OTPVerifyResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * API operation\n *\n * @method POST\n * @path /cfg/accounts/otp/request/\n */\nexport async function createAccountsOtpRequestCreate( data: OTPRequestRequest, client?: any\n): Promise<OTPRequestResponse> {\n const api = client || getAPIInstance()\n const response = await api.accounts.otpRequestCreate(data)\n try {\n return OTPRequestResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOtpRequestCreate\\nPath: /cfg/accounts/otp/request/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOtpRequestCreate',\n path: '/cfg/accounts/otp/request/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * API operation\n *\n * @method POST\n * @path /cfg/accounts/otp/verify/\n */\nexport async function createAccountsOtpVerifyCreate( data: OTPVerifyRequest, client?: any\n): Promise<OTPVerifyResponse> {\n const api = client || getAPIInstance()\n const response = await api.accounts.otpVerifyCreate(data)\n try {\n return OTPVerifyResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOtpVerifyCreate\\nPath: /cfg/accounts/otp/verify/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOtpVerifyCreate',\n path: '/cfg/accounts/otp/verify/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Auth\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { TokenRefreshSchema, type TokenRefresh } from '../schemas/TokenRefresh.schema'\nimport { TokenRefreshRequestSchema, type TokenRefreshRequest } from '../schemas/TokenRefreshRequest.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * API operation\n *\n * @method POST\n * @path /cfg/accounts/token/refresh/\n */\nexport async function createAccountsTokenRefreshCreate( data: TokenRefreshRequest, client?: any\n): Promise<TokenRefresh> {\n const api = client || getAPIInstance()\n const response = await api.auth.accountsTokenRefreshCreate(data)\n try {\n return TokenRefreshSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsTokenRefreshCreate\\nPath: /cfg/accounts/token/refresh/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsTokenRefreshCreate',\n path: '/cfg/accounts/token/refresh/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Oauth\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeRequestRequest } from '../schemas/OAuthAuthorizeRequestRequest.schema'\nimport { OAuthAuthorizeResponseSchema, type OAuthAuthorizeResponse } from '../schemas/OAuthAuthorizeResponse.schema'\nimport { OAuthCallbackRequestRequestSchema, type OAuthCallbackRequestRequest } from '../schemas/OAuthCallbackRequestRequest.schema'\nimport { OAuthDisconnectRequestRequestSchema, type OAuthDisconnectRequestRequest } from '../schemas/OAuthDisconnectRequestRequest.schema'\nimport { OAuthProvidersResponseSchema, type OAuthProvidersResponse } from '../schemas/OAuthProvidersResponse.schema'\nimport { OAuthTokenResponseSchema, type OAuthTokenResponse } from '../schemas/OAuthTokenResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * List OAuth connections\n *\n * @method GET\n * @path /cfg/accounts/oauth/connections/\n */\nexport async function getAccountsOauthConnectionsList( client?: any\n): Promise<any> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthConnectionsList()\n return response\n}\n\n\n/**\n * Disconnect OAuth provider\n *\n * @method POST\n * @path /cfg/accounts/oauth/disconnect/\n */\nexport async function createAccountsOauthDisconnectCreate( data: OAuthDisconnectRequestRequest, client?: any\n): Promise<any> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthDisconnectCreate(data)\n return response\n}\n\n\n/**\n * Start GitHub OAuth\n *\n * @method POST\n * @path /cfg/accounts/oauth/github/authorize/\n */\nexport async function createAccountsOauthGithubAuthorizeCreate( data: OAuthAuthorizeRequestRequest, client?: any\n): Promise<OAuthAuthorizeResponse> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthGithubAuthorizeCreate(data)\n try {\n return OAuthAuthorizeResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOauthGithubAuthorizeCreate\\nPath: /cfg/accounts/oauth/github/authorize/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOauthGithubAuthorizeCreate',\n path: '/cfg/accounts/oauth/github/authorize/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Complete GitHub OAuth\n *\n * @method POST\n * @path /cfg/accounts/oauth/github/callback/\n */\nexport async function createAccountsOauthGithubCallbackCreate( data: OAuthCallbackRequestRequest, client?: any\n): Promise<OAuthTokenResponse> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthGithubCallbackCreate(data)\n try {\n return OAuthTokenResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOauthGithubCallbackCreate\\nPath: /cfg/accounts/oauth/github/callback/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOauthGithubCallbackCreate',\n path: '/cfg/accounts/oauth/github/callback/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * List OAuth providers\n *\n * @method GET\n * @path /cfg/accounts/oauth/providers/\n */\nexport async function getAccountsOauthProvidersRetrieve( client?: any\n): Promise<OAuthProvidersResponse> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthProvidersRetrieve()\n try {\n return OAuthProvidersResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getAccountsOauthProvidersRetrieve\\nPath: /cfg/accounts/oauth/providers/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getAccountsOauthProvidersRetrieve',\n path: '/cfg/accounts/oauth/providers/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for User Profile\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { CfgAccountsProfileAvatarCreateRequestSchema, type CfgAccountsProfileAvatarCreateRequest } from '../schemas/CfgAccountsProfileAvatarCreateRequest.schema'\nimport { PatchedUserProfileUpdateRequestSchema, type PatchedUserProfileUpdateRequest } from '../schemas/PatchedUserProfileUpdateRequest.schema'\nimport { UserSchema, type User } from '../schemas/User.schema'\nimport { UserProfileUpdateRequestSchema, type UserProfileUpdateRequest } from '../schemas/UserProfileUpdateRequest.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get current user profile\n *\n * @method GET\n * @path /cfg/accounts/profile/\n */\nexport async function getAccountsProfileRetrieve( client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileRetrieve()\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getAccountsProfileRetrieve\\nPath: /cfg/accounts/profile/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getAccountsProfileRetrieve',\n path: '/cfg/accounts/profile/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Upload user avatar\n *\n * @method POST\n * @path /cfg/accounts/profile/avatar/\n */\nexport async function createAccountsProfileAvatarCreate( data: CfgAccountsProfileAvatarCreateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileAvatarCreate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsProfileAvatarCreate\\nPath: /cfg/accounts/profile/avatar/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsProfileAvatarCreate',\n path: '/cfg/accounts/profile/avatar/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Partial update user profile\n *\n * @method PUT\n * @path /cfg/accounts/profile/partial/\n */\nexport async function partialUpdateAccountsProfilePartialUpdate( data: UserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfilePartialUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`partialUpdateAccountsProfilePartialUpdate\\nPath: /cfg/accounts/profile/partial/\\nMethod: PUT`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'partialUpdateAccountsProfilePartialUpdate',\n path: '/cfg/accounts/profile/partial/',\n method: 'PUT',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Partial update user profile\n *\n * @method PATCH\n * @path /cfg/accounts/profile/partial/\n */\nexport async function partialUpdateAccountsProfilePartialPartialUpdate( data?: PatchedUserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfilePartialPartialUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`partialUpdateAccountsProfilePartialPartialUpdate\\nPath: /cfg/accounts/profile/partial/\\nMethod: PATCH`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'partialUpdateAccountsProfilePartialPartialUpdate',\n path: '/cfg/accounts/profile/partial/',\n method: 'PATCH',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Update user profile\n *\n * @method PUT\n * @path /cfg/accounts/profile/update/\n */\nexport async function updateAccountsProfileUpdateUpdate( data: UserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileUpdateUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`updateAccountsProfileUpdateUpdate\\nPath: /cfg/accounts/profile/update/\\nMethod: PUT`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'updateAccountsProfileUpdateUpdate',\n path: '/cfg/accounts/profile/update/',\n method: 'PUT',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Update user profile\n *\n * @method PATCH\n * @path /cfg/accounts/profile/update/\n */\nexport async function partialUpdateAccountsProfileUpdatePartialUpdate( data?: PatchedUserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileUpdatePartialUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`partialUpdateAccountsProfileUpdatePartialUpdate\\nPath: /cfg/accounts/profile/update/\\nMethod: PATCH`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'partialUpdateAccountsProfileUpdatePartialUpdate',\n path: '/cfg/accounts/profile/update/',\n method: 'PATCH',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Django CFG API - API Client with JWT Management\n *\n * Usage:\n * ```typescript\n * import { API } from './api';\n *\n * const api = new API('https://api.example.com');\n *\n * // Set JWT token\n * api.setToken('your-jwt-token', 'refresh-token');\n *\n * // Use API\n * const posts = await api.posts.list();\n * const user = await api.users.retrieve(1);\n *\n * // Check authentication\n * if (api.isAuthenticated()) {\n * // ...\n * }\n *\n * // Custom storage with logging (for Electron/Node.js)\n * import { MemoryStorageAdapter, APILogger } from './storage';\n * const logger = new APILogger({ enabled: true, logLevel: 'debug' });\n * const api = new API('https://api.example.com', {\n * storage: new MemoryStorageAdapter(logger),\n * loggerConfig: { enabled: true, logLevel: 'debug' }\n * });\n *\n * // Get OpenAPI schema\n * const schema = api.getSchema();\n * ```\n */\n\nimport { APIClient } from \"./client\";\nimport {\n StorageAdapter,\n LocalStorageAdapter,\n CookieStorageAdapter,\n MemoryStorageAdapter\n} from \"./storage\";\nimport type { RetryConfig } from \"./retry\";\nimport type { LoggerConfig } from \"./logger\";\nimport { APILogger } from \"./logger\";\nimport { Auth } from \"./accounts__auth/client\";\nimport { Oauth } from \"./accounts__oauth/client\";\nimport { UserProfile } from \"./accounts__user_profile/client\";\nimport { Accounts } from \"./accounts/client\";\nexport * as AuthTypes from \"./accounts__auth/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as OauthTypes from \"./accounts__oauth/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as UserProfileTypes from \"./accounts__user_profile/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as AccountsTypes from \"./accounts/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as Enums from \"./enums\";\n\n// Re-export Zod schemas for runtime validation\nexport * as Schemas from \"./_utils/schemas\";\n// Also export all schemas directly for convenience\nexport * from \"./_utils/schemas\";\n\n// Re-export Zod validation events for browser integration\nexport type { ValidationErrorDetail, ValidationErrorEvent } from \"./validation-events\";\nexport { dispatchValidationError, onValidationError, formatZodError } from \"./validation-events\";\n\n// Re-export typed fetchers for universal usage\nexport * as Fetchers from \"./_utils/fetchers\";\nexport * from \"./_utils/fetchers\";\n\n// Re-export API instance configuration functions\nexport {\n configureAPI,\n getAPIInstance,\n reconfigureAPI,\n clearAPITokens,\n resetAPI,\n isAPIConfigured\n} from \"./api-instance\";\n// NOTE: SWR hooks are generated in ./_utils/hooks/ but NOT exported here to keep\n// the main bundle server-safe. Import hooks directly from the hooks directory:\n// import { useUsers } from './_utils/hooks';\n// Or use a separate entry point like '@djangocfg/api/hooks' for client components.\n\n// Re-export core client\nexport { APIClient };\n\n// Re-export storage adapters for convenience\nexport type { StorageAdapter };\nexport { LocalStorageAdapter, CookieStorageAdapter, MemoryStorageAdapter };\n\n// Re-export error classes for convenience\nexport { APIError, NetworkError } from \"./errors\";\n\n// Re-export HTTP adapters for custom implementations\nexport type { HttpClientAdapter, HttpRequest, HttpResponse } from \"./http\";\nexport { FetchAdapter } from \"./http\";\n\n// Re-export logger types and classes\nexport type { LoggerConfig, RequestLog, ResponseLog, ErrorLog } from \"./logger\";\nexport { APILogger } from \"./logger\";\n\n// Re-export retry configuration and utilities\nexport type { RetryConfig, FailedAttemptInfo } from \"./retry\";\nexport { withRetry, shouldRetry, DEFAULT_RETRY_CONFIG } from \"./retry\";\n\nexport const TOKEN_KEY = \"auth_token\";\nexport const REFRESH_TOKEN_KEY = \"refresh_token\";\n\nexport interface APIOptions {\n /** Custom storage adapter (defaults to LocalStorageAdapter) */\n storage?: StorageAdapter;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** Logger configuration */\n loggerConfig?: Partial<LoggerConfig>;\n}\n\nexport class API {\n private baseUrl: string;\n private _client: APIClient;\n private _token: string | null = null;\n private _refreshToken: string | null = null;\n private storage: StorageAdapter;\n private options?: APIOptions;\n\n // Sub-clients\n public auth!: Auth;\n public oauth!: Oauth;\n public user_profile!: UserProfile;\n public accounts!: Accounts;\n\n constructor(baseUrl: string, options?: APIOptions) {\n this.baseUrl = baseUrl;\n this.options = options;\n\n // Create logger if config provided\n const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : undefined;\n\n // Initialize storage with logger\n this.storage = options?.storage || new LocalStorageAdapter(logger);\n\n this._loadTokensFromStorage();\n\n // Initialize APIClient with token getter for URL authentication\n this._client = new APIClient(this.baseUrl, {\n retryConfig: this.options?.retryConfig,\n loggerConfig: this.options?.loggerConfig,\n tokenGetter: () => this.getToken(),\n });\n\n // Always inject auth header wrapper (reads token dynamically from storage)\n this._injectAuthHeader();\n\n // Initialize sub-clients from APIClient\n this.auth = this._client.auth;\n this.oauth = this._client.oauth;\n this.user_profile = this._client.user_profile;\n this.accounts = this._client.accounts;\n }\n\n private _loadTokensFromStorage(): void {\n this._token = this.storage.getItem(TOKEN_KEY);\n this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);\n }\n\n private _reinitClients(): void {\n this._client = new APIClient(this.baseUrl, {\n retryConfig: this.options?.retryConfig,\n loggerConfig: this.options?.loggerConfig,\n tokenGetter: () => this.getToken(),\n });\n\n // Always inject auth header wrapper (reads token dynamically from storage)\n this._injectAuthHeader();\n\n // Reinitialize sub-clients\n this.auth = this._client.auth;\n this.oauth = this._client.oauth;\n this.user_profile = this._client.user_profile;\n this.accounts = this._client.accounts;\n }\n\n private _injectAuthHeader(): void {\n // Override request method to inject auth header\n const originalRequest = this._client.request.bind(this._client);\n this._client.request = async <T>(\n method: string,\n path: string,\n options?: { params?: Record<string, any>; body?: any; formData?: FormData; headers?: Record<string, string> }\n ): Promise<T> => {\n // Read token from storage dynamically (supports JWT injection after instantiation)\n const token = this.getToken();\n const mergedOptions = {\n ...options,\n headers: {\n ...(options?.headers || {}),\n ...(token ? { 'Authorization': `Bearer ${token}` } : {}),\n },\n };\n\n return originalRequest(method, path, mergedOptions);\n };\n }\n\n /**\n * Get current JWT token\n */\n getToken(): string | null {\n return this.storage.getItem(TOKEN_KEY);\n }\n\n /**\n * Get current refresh token\n */\n getRefreshToken(): string | null {\n return this.storage.getItem(REFRESH_TOKEN_KEY);\n }\n\n /**\n * Set JWT token and refresh token\n * @param token - JWT access token\n * @param refreshToken - JWT refresh token (optional)\n */\n setToken(token: string, refreshToken?: string): void {\n this._token = token;\n this.storage.setItem(TOKEN_KEY, token);\n\n if (refreshToken) {\n this._refreshToken = refreshToken;\n this.storage.setItem(REFRESH_TOKEN_KEY, refreshToken);\n }\n\n // Reinitialize clients with new token\n this._reinitClients();\n }\n\n /**\n * Clear all tokens\n */\n clearTokens(): void {\n this._token = null;\n this._refreshToken = null;\n this.storage.removeItem(TOKEN_KEY);\n this.storage.removeItem(REFRESH_TOKEN_KEY);\n\n // Reinitialize clients without token\n this._reinitClients();\n }\n\n /**\n * Check if user is authenticated\n */\n isAuthenticated(): boolean {\n return !!this.getToken();\n }\n\n /**\n * Update base URL and reinitialize clients\n * @param url - New base URL\n */\n setBaseUrl(url: string): void {\n this.baseUrl = url;\n this._reinitClients();\n }\n\n /**\n * Get current base URL\n */\n getBaseUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Get OpenAPI schema path\n * @returns Path to the OpenAPI schema JSON file\n *\n * Note: The OpenAPI schema is available in the schema.json file.\n * You can load it dynamically using:\n * ```typescript\n * const schema = await fetch('./schema.json').then(r => r.json());\n * // or using fs in Node.js:\n * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));\n * ```\n */\n getSchemaPath(): string {\n return './schema.json';\n }\n}\n\nexport default API;","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Logger with Consola\n * Beautiful console logging for API requests and responses\n *\n * Installation:\n * npm install consola\n */\n\nimport { type ConsolaInstance, createConsola } from 'consola';\n\n/**\n * Request log data\n */\nexport interface RequestLog {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n timestamp: number;\n}\n\n/**\n * Response log data\n */\nexport interface ResponseLog {\n status: number;\n statusText: string;\n data?: any;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Error log data\n */\nexport interface ErrorLog {\n message: string;\n statusCode?: number;\n fieldErrors?: Record<string, string[]>;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Logger configuration\n */\nexport interface LoggerConfig {\n /** Enable logging */\n enabled: boolean;\n /** Log requests */\n logRequests: boolean;\n /** Log responses */\n logResponses: boolean;\n /** Log errors */\n logErrors: boolean;\n /** Log request/response bodies */\n logBodies: boolean;\n /** Log headers (excluding sensitive ones) */\n logHeaders: boolean;\n /** Custom consola instance */\n consola?: ConsolaInstance;\n}\n\n/**\n * Default logger configuration\n */\nconst DEFAULT_CONFIG: LoggerConfig = {\n enabled: process.env.NODE_ENV !== 'production',\n logRequests: true,\n logResponses: true,\n logErrors: true,\n logBodies: true,\n logHeaders: false,\n};\n\n/**\n * Sensitive header names to filter out\n */\nconst SENSITIVE_HEADERS = [\n 'authorization',\n 'cookie',\n 'set-cookie',\n 'x-api-key',\n 'x-csrf-token',\n];\n\n/**\n * API Logger class\n */\nexport class APILogger {\n private config: LoggerConfig;\n private consola: ConsolaInstance;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.consola = config.consola || createConsola({\n level: this.config.enabled ? 4 : 0,\n });\n }\n\n /**\n * Enable logging\n */\n enable(): void {\n this.config.enabled = true;\n }\n\n /**\n * Disable logging\n */\n disable(): void {\n this.config.enabled = false;\n }\n\n /**\n * Update configuration\n */\n setConfig(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Filter sensitive headers\n */\n private filterHeaders(headers?: Record<string, string>): Record<string, string> {\n if (!headers) return {};\n\n const filtered: Record<string, string> = {};\n Object.keys(headers).forEach((key) => {\n const lowerKey = key.toLowerCase();\n if (SENSITIVE_HEADERS.includes(lowerKey)) {\n filtered[key] = '***';\n } else {\n filtered[key] = headers[key] || '';\n }\n });\n\n return filtered;\n }\n\n /**\n * Log request\n */\n logRequest(request: RequestLog): void {\n if (!this.config.enabled || !this.config.logRequests) return;\n\n const { method, url, headers, body } = request;\n\n this.consola.start(`${method} ${url}`);\n\n if (this.config.logHeaders && headers) {\n this.consola.debug('Headers:', this.filterHeaders(headers));\n }\n\n if (this.config.logBodies && body) {\n this.consola.debug('Body:', body);\n }\n }\n\n /**\n * Log response\n */\n logResponse(request: RequestLog, response: ResponseLog): void {\n if (!this.config.enabled || !this.config.logResponses) return;\n\n const { method, url } = request;\n const { status, statusText, data, duration } = response;\n\n const statusColor = status >= 500 ? 'red'\n : status >= 400 ? 'yellow'\n : status >= 300 ? 'cyan'\n : 'green';\n\n this.consola.success(\n `${method} ${url} ${status} ${statusText} (${duration}ms)`\n );\n\n if (this.config.logBodies && data) {\n this.consola.debug('Response:', data);\n }\n }\n\n /**\n * Log error\n */\n logError(request: RequestLog, error: ErrorLog): void {\n if (!this.config.enabled || !this.config.logErrors) return;\n\n const { method, url } = request;\n const { message, statusCode, fieldErrors, duration } = error;\n\n this.consola.error(\n `${method} ${url} ${statusCode || 'Network'} Error (${duration}ms)`\n );\n\n this.consola.error('Message:', message);\n\n if (fieldErrors && Object.keys(fieldErrors).length > 0) {\n this.consola.error('Field Errors:');\n Object.entries(fieldErrors).forEach(([field, errors]) => {\n errors.forEach((err) => {\n this.consola.error(` • ${field}: ${err}`);\n });\n });\n }\n }\n\n /**\n * Log general info\n */\n info(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.info(message, ...args);\n }\n\n /**\n * Log warning\n */\n warn(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.warn(message, ...args);\n }\n\n /**\n * Log error\n */\n error(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.error(message, ...args);\n }\n\n /**\n * Log debug\n */\n debug(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.debug(message, ...args);\n }\n\n /**\n * Log success\n */\n success(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.success(message, ...args);\n }\n\n /**\n * Create a sub-logger with prefix\n */\n withTag(tag: string): ConsolaInstance {\n return this.consola.withTag(tag);\n }\n}\n\n/**\n * Default logger instance\n */\nexport const defaultLogger = new APILogger();","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Retry Configuration and Utilities\n *\n * Provides automatic retry logic for failed HTTP requests using p-retry.\n * Retries only on network errors and server errors (5xx), not client errors (4xx).\n */\n\nimport pRetry, { AbortError } from 'p-retry';\nimport { APIError, NetworkError } from './errors';\n\n/**\n * Information about a failed retry attempt.\n */\nexport interface FailedAttemptInfo {\n /** The error that caused the failure */\n error: Error;\n /** The attempt number (1-indexed) */\n attemptNumber: number;\n /** Number of retries left */\n retriesLeft: number;\n}\n\n/**\n * Retry configuration options.\n *\n * Uses exponential backoff with jitter by default to avoid thundering herd.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of retry attempts.\n * @default 3\n */\n retries?: number;\n\n /**\n * Exponential backoff factor.\n * @default 2\n */\n factor?: number;\n\n /**\n * Minimum wait time between retries (ms).\n * @default 1000\n */\n minTimeout?: number;\n\n /**\n * Maximum wait time between retries (ms).\n * @default 60000\n */\n maxTimeout?: number;\n\n /**\n * Add randomness to wait times (jitter).\n * Helps avoid thundering herd problem.\n * @default true\n */\n randomize?: boolean;\n\n /**\n * Callback called on each failed attempt.\n */\n onFailedAttempt?: (info: FailedAttemptInfo) => void;\n}\n\n/**\n * Default retry configuration.\n */\nexport const DEFAULT_RETRY_CONFIG: Required<RetryConfig> = {\n retries: 3,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 60000,\n randomize: true,\n onFailedAttempt: () => {},\n};\n\n/**\n * Determine if an error should trigger a retry.\n *\n * Retries on:\n * - Network errors (connection refused, timeout, etc.)\n * - Server errors (5xx status codes)\n * - Rate limiting (429 status code)\n *\n * Does NOT retry on:\n * - Client errors (4xx except 429)\n * - Authentication errors (401, 403)\n * - Not found (404)\n *\n * @param error - The error to check\n * @returns true if should retry, false otherwise\n */\nexport function shouldRetry(error: any): boolean {\n // Always retry network errors\n if (error instanceof NetworkError) {\n return true;\n }\n\n // For API errors, check status code\n if (error instanceof APIError) {\n const status = error.statusCode;\n\n // Retry on 5xx server errors\n if (status >= 500 && status < 600) {\n return true;\n }\n\n // Retry on 429 (rate limit)\n if (status === 429) {\n return true;\n }\n\n // Do NOT retry on 4xx client errors\n return false;\n }\n\n // Retry on unknown errors (might be network issues)\n return true;\n}\n\n/**\n * Wrap a function with retry logic.\n *\n * @param fn - Async function to retry\n * @param config - Retry configuration\n * @returns Result of the function\n *\n * @example\n * ```typescript\n * const result = await withRetry(\n * async () => fetch('https://api.example.com/users'),\n * { retries: 5, minTimeout: 2000 }\n * );\n * ```\n */\nexport async function withRetry<T>(\n fn: () => Promise<T>,\n config?: RetryConfig\n): Promise<T> {\n const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };\n\n return pRetry(\n async () => {\n try {\n return await fn();\n } catch (error) {\n // Check if we should retry this error\n if (!shouldRetry(error)) {\n // Abort retry immediately for non-retryable errors\n throw new AbortError(error as Error);\n }\n\n // Re-throw error to trigger retry\n throw error;\n }\n },\n {\n retries: finalConfig.retries,\n factor: finalConfig.factor,\n minTimeout: finalConfig.minTimeout,\n maxTimeout: finalConfig.maxTimeout,\n randomize: finalConfig.randomize,\n onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {\n // Adapt p-retry's FailedAttemptError to our FailedAttemptInfo\n const pRetryError = error as any; // p-retry's internal type\n finalConfig.onFailedAttempt!({\n error: pRetryError as Error,\n attemptNumber: pRetryError.attemptNumber,\n retriesLeft: pRetryError.retriesLeft,\n });\n } : undefined,\n }\n );\n}","/**\n * Zod schema for CentrifugoChannelInfo\n *\n * This schema provides runtime validation and type inference.\n * * Information about a single channel.\n * */\nimport { z } from 'zod'\n\n/**\n * Information about a single channel.\n */\nexport const CentrifugoChannelInfoSchema = z.object({\n num_clients: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelInfo = z.infer<typeof CentrifugoChannelInfoSchema>","/**\n * Zod schema for CentrifugoChannelsRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to list active channels.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to list active channels.\n */\nexport const CentrifugoChannelsRequestRequestSchema = z.object({\n pattern: z.string().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelsRequestRequest = z.infer<typeof CentrifugoChannelsRequestRequestSchema>","/**\n * Zod schema for CentrifugoChannelsResponse\n *\n * This schema provides runtime validation and type inference.\n * * List of active channels response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoChannelsResultSchema } from './CentrifugoChannelsResult.schema'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\n\n/**\n * List of active channels response.\n */\nexport const CentrifugoChannelsResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoChannelsResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelsResponse = z.infer<typeof CentrifugoChannelsResponseSchema>","/**\n * Zod schema for CentrifugoChannelsResult\n *\n * This schema provides runtime validation and type inference.\n * * Channels result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoChannelInfoSchema } from './CentrifugoChannelInfo.schema'\n\n/**\n * Channels result wrapper.\n */\nexport const CentrifugoChannelsResultSchema = z.object({\n channels: z.record(z.string(), CentrifugoChannelInfoSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelsResult = z.infer<typeof CentrifugoChannelsResultSchema>","/**\n * Zod schema for CentrifugoError\n *\n * This schema provides runtime validation and type inference.\n * * Centrifugo API error structure.\n * */\nimport { z } from 'zod'\n\n/**\n * Centrifugo API error structure.\n */\nexport const CentrifugoErrorSchema = z.object({\n code: z.int().optional(),\n message: z.string().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoError = z.infer<typeof CentrifugoErrorSchema>","/**\n * Zod schema for CentrifugoClientInfo\n *\n * This schema provides runtime validation and type inference.\n * * Information about connected client.\n * */\nimport { z } from 'zod'\n\n/**\n * Information about connected client.\n */\nexport const CentrifugoClientInfoSchema = z.object({\n user: z.string(),\n client: z.string(),\n conn_info: z.record(z.string(), z.any()).nullable().optional(),\n chan_info: z.record(z.string(), z.any()).nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoClientInfo = z.infer<typeof CentrifugoClientInfoSchema>","/**\n * Zod schema for CentrifugoHealthCheck\n *\n * This schema provides runtime validation and type inference.\n * * Health check response.\n * */\nimport { z } from 'zod'\n\n/**\n * Health check response.\n */\nexport const CentrifugoHealthCheckSchema = z.object({\n status: z.string(),\n wrapper_url: z.string(),\n has_api_key: z.boolean(),\n timestamp: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHealthCheck = z.infer<typeof CentrifugoHealthCheckSchema>","/**\n * Zod schema for CentrifugoHistoryRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to get channel history.\n * */\nimport { z } from 'zod'\nimport { CentrifugoStreamPositionSchema } from './CentrifugoStreamPosition.schema'\n\n/**\n * Request to get channel history.\n */\nexport const CentrifugoHistoryRequestRequestSchema = z.object({\n channel: z.string(),\n limit: z.int().nullable().optional(),\n since: CentrifugoStreamPositionSchema.optional(),\n reverse: z.boolean().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHistoryRequestRequest = z.infer<typeof CentrifugoHistoryRequestRequestSchema>","/**\n * Zod schema for CentrifugoStreamPosition\n *\n * This schema provides runtime validation and type inference.\n * * Stream position for pagination.\n * */\nimport { z } from 'zod'\n\n/**\n * Stream position for pagination.\n */\nexport const CentrifugoStreamPositionSchema = z.object({\n offset: z.int(),\n epoch: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoStreamPosition = z.infer<typeof CentrifugoStreamPositionSchema>","/**\n * Zod schema for CentrifugoHistoryResponse\n *\n * This schema provides runtime validation and type inference.\n * * Channel history response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoHistoryResultSchema } from './CentrifugoHistoryResult.schema'\n\n/**\n * Channel history response.\n */\nexport const CentrifugoHistoryResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoHistoryResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHistoryResponse = z.infer<typeof CentrifugoHistoryResponseSchema>","/**\n * Zod schema for CentrifugoHistoryResult\n *\n * This schema provides runtime validation and type inference.\n * * History result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoPublicationSchema } from './CentrifugoPublication.schema'\n\n/**\n * History result wrapper.\n */\nexport const CentrifugoHistoryResultSchema = z.object({\n publications: z.array(CentrifugoPublicationSchema),\n epoch: z.string(),\n offset: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHistoryResult = z.infer<typeof CentrifugoHistoryResultSchema>","/**\n * Zod schema for CentrifugoPublication\n *\n * This schema provides runtime validation and type inference.\n * * Single publication (message) in channel history.\n * */\nimport { z } from 'zod'\nimport { CentrifugoClientInfoSchema } from './CentrifugoClientInfo.schema'\n\n/**\n * Single publication (message) in channel history.\n */\nexport const CentrifugoPublicationSchema = z.object({\n data: z.record(z.string(), z.any()),\n info: CentrifugoClientInfoSchema.optional(),\n offset: z.int(),\n tags: z.record(z.string(), z.any()).nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPublication = z.infer<typeof CentrifugoPublicationSchema>","/**\n * Zod schema for CentrifugoInfoResponse\n *\n * This schema provides runtime validation and type inference.\n * * Server info response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoInfoResultSchema } from './CentrifugoInfoResult.schema'\n\n/**\n * Server info response.\n */\nexport const CentrifugoInfoResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoInfoResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoInfoResponse = z.infer<typeof CentrifugoInfoResponseSchema>","/**\n * Zod schema for CentrifugoInfoResult\n *\n * This schema provides runtime validation and type inference.\n * * Info result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoNodeInfoSchema } from './CentrifugoNodeInfo.schema'\n\n/**\n * Info result wrapper.\n */\nexport const CentrifugoInfoResultSchema = z.object({\n nodes: z.array(CentrifugoNodeInfoSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoInfoResult = z.infer<typeof CentrifugoInfoResultSchema>","/**\n * Zod schema for CentrifugoNodeInfo\n *\n * This schema provides runtime validation and type inference.\n * * Information about a single Centrifugo node.\n * */\nimport { z } from 'zod'\nimport { CentrifugoMetricsSchema } from './CentrifugoMetrics.schema'\nimport { CentrifugoProcessSchema } from './CentrifugoProcess.schema'\n\n/**\n * Information about a single Centrifugo node.\n */\nexport const CentrifugoNodeInfoSchema = z.object({\n uid: z.string(),\n name: z.string(),\n version: z.string(),\n num_clients: z.int(),\n num_users: z.int(),\n num_channels: z.int(),\n uptime: z.int(),\n num_subs: z.int(),\n metrics: CentrifugoMetricsSchema.optional(),\n process: CentrifugoProcessSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoNodeInfo = z.infer<typeof CentrifugoNodeInfoSchema>","/**\n * Zod schema for CentrifugoMetrics\n *\n * This schema provides runtime validation and type inference.\n * * Server metrics.\n * */\nimport { z } from 'zod'\n\n/**\n * Server metrics.\n */\nexport const CentrifugoMetricsSchema = z.object({\n interval: z.number(),\n items: z.record(z.string(), z.number()),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoMetrics = z.infer<typeof CentrifugoMetricsSchema>","/**\n * Zod schema for CentrifugoProcess\n *\n * This schema provides runtime validation and type inference.\n * * Process information.\n * */\nimport { z } from 'zod'\n\n/**\n * Process information.\n */\nexport const CentrifugoProcessSchema = z.object({\n cpu: z.number(),\n rss: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoProcess = z.infer<typeof CentrifugoProcessSchema>","/**\n * Zod schema for CentrifugoOverviewStats\n *\n * This schema provides runtime validation and type inference.\n * * Overview statistics for Centrifugo publishes.\n * */\nimport { z } from 'zod'\n\n/**\n * Overview statistics for Centrifugo publishes.\n */\nexport const CentrifugoOverviewStatsSchema = z.object({\n total: z.int(),\n successful: z.int(),\n failed: z.int(),\n timeout: z.int(),\n success_rate: z.number(),\n avg_duration_ms: z.number(),\n avg_acks_received: z.number(),\n period_hours: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoOverviewStats = z.infer<typeof CentrifugoOverviewStatsSchema>","/**\n * Zod schema for CentrifugoPresenceRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to get channel presence.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to get channel presence.\n */\nexport const CentrifugoPresenceRequestRequestSchema = z.object({\n channel: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceRequestRequest = z.infer<typeof CentrifugoPresenceRequestRequestSchema>","/**\n * Zod schema for CentrifugoPresenceResponse\n *\n * This schema provides runtime validation and type inference.\n * * Channel presence response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoPresenceResultSchema } from './CentrifugoPresenceResult.schema'\n\n/**\n * Channel presence response.\n */\nexport const CentrifugoPresenceResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoPresenceResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceResponse = z.infer<typeof CentrifugoPresenceResponseSchema>","/**\n * Zod schema for CentrifugoPresenceResult\n *\n * This schema provides runtime validation and type inference.\n * * Presence result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoClientInfoSchema } from './CentrifugoClientInfo.schema'\n\n/**\n * Presence result wrapper.\n */\nexport const CentrifugoPresenceResultSchema = z.object({\n presence: z.record(z.string(), CentrifugoClientInfoSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceResult = z.infer<typeof CentrifugoPresenceResultSchema>","/**\n * Zod schema for CentrifugoPresenceStatsRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to get channel presence statistics.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to get channel presence statistics.\n */\nexport const CentrifugoPresenceStatsRequestRequestSchema = z.object({\n channel: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceStatsRequestRequest = z.infer<typeof CentrifugoPresenceStatsRequestRequestSchema>","/**\n * Zod schema for CentrifugoPresenceStatsResponse\n *\n * This schema provides runtime validation and type inference.\n * * Channel presence stats response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoPresenceStatsResultSchema } from './CentrifugoPresenceStatsResult.schema'\n\n/**\n * Channel presence stats response.\n */\nexport const CentrifugoPresenceStatsResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoPresenceStatsResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceStatsResponse = z.infer<typeof CentrifugoPresenceStatsResponseSchema>","/**\n * Zod schema for CentrifugoPresenceStatsResult\n *\n * This schema provides runtime validation and type inference.\n * * Presence stats result.\n * */\nimport { z } from 'zod'\n\n/**\n * Presence stats result.\n */\nexport const CentrifugoPresenceStatsResultSchema = z.object({\n num_clients: z.int(),\n num_users: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceStatsResult = z.infer<typeof CentrifugoPresenceStatsResultSchema>","/**\n * Zod schema for ChannelList\n *\n * This schema provides runtime validation and type inference.\n * * List of channel statistics.\n * */\nimport { z } from 'zod'\nimport { ChannelStatsSchema } from './ChannelStats.schema'\n\n/**\n * List of channel statistics.\n */\nexport const ChannelListSchema = z.object({\n channels: z.array(ChannelStatsSchema),\n total_channels: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ChannelList = z.infer<typeof ChannelListSchema>","/**\n * Zod schema for ChannelStats\n *\n * This schema provides runtime validation and type inference.\n * * Statistics per channel.\n * */\nimport { z } from 'zod'\n\n/**\n * Statistics per channel.\n */\nexport const ChannelStatsSchema = z.object({\n channel: z.string(),\n total: z.int(),\n successful: z.int(),\n failed: z.int(),\n avg_duration_ms: z.number(),\n avg_acks: z.number(),\n last_activity_at: z.string().nullable(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ChannelStats = z.infer<typeof ChannelStatsSchema>","/**\n * Zod schema for ConnectionTokenResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response model for Centrifugo connection token.\n * */\nimport { z } from 'zod'\n\n/**\n * Response model for Centrifugo connection token.\n */\nexport const ConnectionTokenResponseSchema = z.object({\n token: z.string(),\n centrifugo_url: z.string(),\n expires_at: z.string(),\n channels: z.array(z.string()),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ConnectionTokenResponse = z.infer<typeof ConnectionTokenResponseSchema>","/**\n * Zod schema for ManualAckRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request model for manual ACK sending.\n * */\nimport { z } from 'zod'\n\n/**\n * Request model for manual ACK sending.\n */\nexport const ManualAckRequestRequestSchema = z.object({\n message_id: z.string(),\n client_id: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ManualAckRequestRequest = z.infer<typeof ManualAckRequestRequestSchema>","/**\n * Zod schema for ManualAckResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response model for manual ACK.\n * */\nimport { z } from 'zod'\n\n/**\n * Response model for manual ACK.\n */\nexport const ManualAckResponseSchema = z.object({\n success: z.boolean(),\n message_id: z.string(),\n error: z.string().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ManualAckResponse = z.infer<typeof ManualAckResponseSchema>","/**\n * Zod schema for PaginatedPublishList\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\nimport { PublishSchema } from './Publish.schema'\n\nexport const PaginatedPublishListSchema = z.object({\n count: z.int(),\n page: z.int(),\n pages: z.int(),\n page_size: z.int(),\n has_next: z.boolean(),\n has_previous: z.boolean(),\n next_page: z.int().nullable().optional(),\n previous_page: z.int().nullable().optional(),\n results: z.array(PublishSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PaginatedPublishList = z.infer<typeof PaginatedPublishListSchema>","/**\n * Zod schema for Publish\n *\n * This schema provides runtime validation and type inference.\n * * Single publish item for DRF pagination.\n * */\nimport { z } from 'zod'\n\n/**\n * Single publish item for DRF pagination.\n */\nexport const PublishSchema = z.object({\n message_id: z.string(),\n channel: z.string(),\n status: z.string(),\n wait_for_ack: z.boolean(),\n acks_received: z.int(),\n acks_expected: z.int().nullable(),\n duration_ms: z.number().nullable(),\n created_at: z.iso.datetime(),\n completed_at: z.iso.datetime().nullable(),\n error_code: z.string().nullable(),\n error_message: z.string().nullable(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type Publish = z.infer<typeof PublishSchema>","/**\n * Zod schema for PublishTestRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request model for test message publishing.\n * */\nimport { z } from 'zod'\n\n/**\n * Request model for test message publishing.\n */\nexport const PublishTestRequestRequestSchema = z.object({\n channel: z.string(),\n data: z.record(z.string(), z.any()),\n wait_for_ack: z.boolean().optional(),\n ack_timeout: z.int().min(1.0).max(60.0).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PublishTestRequestRequest = z.infer<typeof PublishTestRequestRequestSchema>","/**\n * Zod schema for PublishTestResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response model for test message publishing.\n * */\nimport { z } from 'zod'\n\n/**\n * Response model for test message publishing.\n */\nexport const PublishTestResponseSchema = z.object({\n success: z.boolean(),\n message_id: z.string(),\n channel: z.string(),\n acks_received: z.int().optional(),\n delivered: z.boolean().optional(),\n error: z.string().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PublishTestResponse = z.infer<typeof PublishTestResponseSchema>","/**\n * Zod schema for TimelineItem\n *\n * This schema provides runtime validation and type inference.\n * * Single timeline data point for DRF.\n * */\nimport { z } from 'zod'\n\n/**\n * Single timeline data point for DRF.\n */\nexport const TimelineItemSchema = z.object({\n timestamp: z.string(),\n count: z.int(),\n successful: z.int(),\n failed: z.int(),\n timeout: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TimelineItem = z.infer<typeof TimelineItemSchema>","/**\n * Zod schema for TimelineResponse\n *\n * This schema provides runtime validation and type inference.\n * * Timeline response with hourly/daily breakdown for DRF.\n * */\nimport { z } from 'zod'\nimport { TimelineItemSchema } from './TimelineItem.schema'\n\n/**\n * Timeline response with hourly/daily breakdown for DRF.\n */\nexport const TimelineResponseSchema = z.object({\n timeline: z.array(TimelineItemSchema),\n period_hours: z.int(),\n interval: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TimelineResponse = z.infer<typeof TimelineResponseSchema>","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Admin API\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { CentrifugoChannelsRequestRequestSchema, type CentrifugoChannelsRequestRequest } from '../schemas/CentrifugoChannelsRequestRequest.schema'\nimport { CentrifugoChannelsResponseSchema, type CentrifugoChannelsResponse } from '../schemas/CentrifugoChannelsResponse.schema'\nimport { CentrifugoHistoryRequestRequestSchema, type CentrifugoHistoryRequestRequest } from '../schemas/CentrifugoHistoryRequestRequest.schema'\nimport { CentrifugoHistoryResponseSchema, type CentrifugoHistoryResponse } from '../schemas/CentrifugoHistoryResponse.schema'\nimport { CentrifugoInfoResponseSchema, type CentrifugoInfoResponse } from '../schemas/CentrifugoInfoResponse.schema'\nimport { CentrifugoPresenceRequestRequestSchema, type CentrifugoPresenceRequestRequest } from '../schemas/CentrifugoPresenceRequestRequest.schema'\nimport { CentrifugoPresenceResponseSchema, type CentrifugoPresenceResponse } from '../schemas/CentrifugoPresenceResponse.schema'\nimport { CentrifugoPresenceStatsRequestRequestSchema, type CentrifugoPresenceStatsRequestRequest } from '../schemas/CentrifugoPresenceStatsRequestRequest.schema'\nimport { CentrifugoPresenceStatsResponseSchema, type CentrifugoPresenceStatsResponse } from '../schemas/CentrifugoPresenceStatsResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get connection token for dashboard\n *\n * @method POST\n * @path /cfg/centrifugo/server/auth/token/\n */\nexport async function createCentrifugoServerAuthTokenCreate( client?: any\n): Promise<any> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerAuthTokenCreate()\n return response\n}\n\n\n/**\n * List active channels\n *\n * @method POST\n * @path /cfg/centrifugo/server/channels/\n */\nexport async function createCentrifugoServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?: any\n): Promise<CentrifugoChannelsResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerChannelsCreate(data)\n try {\n return CentrifugoChannelsResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerChannelsCreate\\nPath: /cfg/centrifugo/server/channels/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerChannelsCreate',\n path: '/cfg/centrifugo/server/channels/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get channel history\n *\n * @method POST\n * @path /cfg/centrifugo/server/history/\n */\nexport async function createCentrifugoServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?: any\n): Promise<CentrifugoHistoryResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerHistoryCreate(data)\n try {\n return CentrifugoHistoryResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerHistoryCreate\\nPath: /cfg/centrifugo/server/history/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerHistoryCreate',\n path: '/cfg/centrifugo/server/history/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get Centrifugo server info\n *\n * @method POST\n * @path /cfg/centrifugo/server/info/\n */\nexport async function createCentrifugoServerInfoCreate( client?: any\n): Promise<CentrifugoInfoResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerInfoCreate()\n try {\n return CentrifugoInfoResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerInfoCreate\\nPath: /cfg/centrifugo/server/info/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerInfoCreate',\n path: '/cfg/centrifugo/server/info/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get channel presence\n *\n * @method POST\n * @path /cfg/centrifugo/server/presence/\n */\nexport async function createCentrifugoServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?: any\n): Promise<CentrifugoPresenceResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerPresenceCreate(data)\n try {\n return CentrifugoPresenceResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerPresenceCreate\\nPath: /cfg/centrifugo/server/presence/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerPresenceCreate',\n path: '/cfg/centrifugo/server/presence/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get channel presence statistics\n *\n * @method POST\n * @path /cfg/centrifugo/server/presence-stats/\n */\nexport async function createCentrifugoServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?: any\n): Promise<CentrifugoPresenceStatsResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerPresenceStatsCreate(data)\n try {\n return CentrifugoPresenceStatsResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerPresenceStatsCreate\\nPath: /cfg/centrifugo/server/presence-stats/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerPresenceStatsCreate',\n path: '/cfg/centrifugo/server/presence-stats/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Auth\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { ConnectionTokenResponseSchema, type ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get Centrifugo connection token\n *\n * @method GET\n * @path /cfg/centrifugo/auth/token/\n */\nexport async function getCentrifugoAuthTokenRetrieve( client?: any\n): Promise<ConnectionTokenResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_auth.tokenRetrieve()\n try {\n return ConnectionTokenResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoAuthTokenRetrieve\\nPath: /cfg/centrifugo/auth/token/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoAuthTokenRetrieve',\n path: '/cfg/centrifugo/auth/token/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Monitoring\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { CentrifugoHealthCheckSchema, type CentrifugoHealthCheck } from '../schemas/CentrifugoHealthCheck.schema'\nimport { CentrifugoOverviewStatsSchema, type CentrifugoOverviewStats } from '../schemas/CentrifugoOverviewStats.schema'\nimport { ChannelListSchema, type ChannelList } from '../schemas/ChannelList.schema'\nimport { PaginatedPublishListSchema, type PaginatedPublishList } from '../schemas/PaginatedPublishList.schema'\nimport { TimelineResponseSchema, type TimelineResponse } from '../schemas/TimelineResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get channel statistics\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/channels/\n */\nexport async function getCentrifugoMonitorChannelsRetrieve( params?: { hours?: number }, client?: any\n): Promise<ChannelList> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorChannelsRetrieve(params?.hours)\n try {\n return ChannelListSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorChannelsRetrieve\\nPath: /cfg/centrifugo/monitor/channels/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorChannelsRetrieve',\n path: '/cfg/centrifugo/monitor/channels/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get Centrifugo health status\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/health/\n */\nexport async function getCentrifugoMonitorHealthRetrieve( client?: any\n): Promise<CentrifugoHealthCheck> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorHealthRetrieve()\n try {\n return CentrifugoHealthCheckSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorHealthRetrieve\\nPath: /cfg/centrifugo/monitor/health/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorHealthRetrieve',\n path: '/cfg/centrifugo/monitor/health/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get overview statistics\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/overview/\n */\nexport async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?: number }, client?: any\n): Promise<CentrifugoOverviewStats> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours)\n try {\n return CentrifugoOverviewStatsSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorOverviewRetrieve\\nPath: /cfg/centrifugo/monitor/overview/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorOverviewRetrieve',\n path: '/cfg/centrifugo/monitor/overview/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get recent publishes\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/publishes/\n */\nexport async function getCentrifugoMonitorPublishesList( params?: { channel?: string; page?: number; page_size?: number; status?: string }, client?: any\n): Promise<PaginatedPublishList> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorPublishesList(params?.channel, params?.page, params?.page_size, params?.status)\n try {\n return PaginatedPublishListSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorPublishesList\\nPath: /cfg/centrifugo/monitor/publishes/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorPublishesList',\n path: '/cfg/centrifugo/monitor/publishes/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get publish timeline\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/timeline/\n */\nexport async function getCentrifugoMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any\n): Promise<TimelineResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval)\n try {\n return TimelineResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorTimelineRetrieve\\nPath: /cfg/centrifugo/monitor/timeline/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorTimelineRetrieve',\n path: '/cfg/centrifugo/monitor/timeline/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Testing\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { ManualAckRequestRequestSchema, type ManualAckRequestRequest } from '../schemas/ManualAckRequestRequest.schema'\nimport { ManualAckResponseSchema, type ManualAckResponse } from '../schemas/ManualAckResponse.schema'\nimport { PublishTestRequestRequestSchema, type PublishTestRequestRequest } from '../schemas/PublishTestRequestRequest.schema'\nimport { PublishTestResponseSchema, type PublishTestResponse } from '../schemas/PublishTestResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Publish test message\n *\n * @method POST\n * @path /cfg/centrifugo/testing/publish-test/\n */\nexport async function createCentrifugoTestingPublishTestCreate( data: PublishTestRequestRequest, client?: any\n): Promise<PublishTestResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_testing.publishTestCreate(data)\n try {\n return PublishTestResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoTestingPublishTestCreate\\nPath: /cfg/centrifugo/testing/publish-test/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoTestingPublishTestCreate',\n path: '/cfg/centrifugo/testing/publish-test/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Publish with database logging\n *\n * @method POST\n * @path /cfg/centrifugo/testing/publish-with-logging/\n */\nexport async function createCentrifugoTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: any\n): Promise<PublishTestResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_testing.publishWithLoggingCreate(data)\n try {\n return PublishTestResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoTestingPublishWithLoggingCreate\\nPath: /cfg/centrifugo/testing/publish-with-logging/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoTestingPublishWithLoggingCreate',\n path: '/cfg/centrifugo/testing/publish-with-logging/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Send manual ACK\n *\n * @method POST\n * @path /cfg/centrifugo/testing/send-ack/\n */\nexport async function createCentrifugoTestingSendAckCreate( data: ManualAckRequestRequest, client?: any\n): Promise<ManualAckResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_testing.sendAckCreate(data)\n try {\n return ManualAckResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoTestingSendAckCreate\\nPath: /cfg/centrifugo/testing/send-ack/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoTestingSendAckCreate',\n path: '/cfg/centrifugo/testing/send-ack/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Logger with Consola\n * Beautiful console logging for API requests and responses\n *\n * Installation:\n * npm install consola\n */\n\nimport { type ConsolaInstance, createConsola } from 'consola';\n\n/**\n * Request log data\n */\nexport interface RequestLog {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n timestamp: number;\n}\n\n/**\n * Response log data\n */\nexport interface ResponseLog {\n status: number;\n statusText: string;\n data?: any;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Error log data\n */\nexport interface ErrorLog {\n message: string;\n statusCode?: number;\n fieldErrors?: Record<string, string[]>;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Logger configuration\n */\nexport interface LoggerConfig {\n /** Enable logging */\n enabled: boolean;\n /** Log requests */\n logRequests: boolean;\n /** Log responses */\n logResponses: boolean;\n /** Log errors */\n logErrors: boolean;\n /** Log request/response bodies */\n logBodies: boolean;\n /** Log headers (excluding sensitive ones) */\n logHeaders: boolean;\n /** Custom consola instance */\n consola?: ConsolaInstance;\n}\n\n/**\n * Default logger configuration\n */\nconst DEFAULT_CONFIG: LoggerConfig = {\n enabled: process.env.NODE_ENV !== 'production',\n logRequests: true,\n logResponses: true,\n logErrors: true,\n logBodies: true,\n logHeaders: false,\n};\n\n/**\n * Sensitive header names to filter out\n */\nconst SENSITIVE_HEADERS = [\n 'authorization',\n 'cookie',\n 'set-cookie',\n 'x-api-key',\n 'x-csrf-token',\n];\n\n/**\n * API Logger class\n */\nexport class APILogger {\n private config: LoggerConfig;\n private consola: ConsolaInstance;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.consola = config.consola || createConsola({\n level: this.config.enabled ? 4 : 0,\n });\n }\n\n /**\n * Enable logging\n */\n enable(): void {\n this.config.enabled = true;\n }\n\n /**\n * Disable logging\n */\n disable(): void {\n this.config.enabled = false;\n }\n\n /**\n * Update configuration\n */\n setConfig(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Filter sensitive headers\n */\n private filterHeaders(headers?: Record<string, string>): Record<string, string> {\n if (!headers) return {};\n\n const filtered: Record<string, string> = {};\n Object.keys(headers).forEach((key) => {\n const lowerKey = key.toLowerCase();\n if (SENSITIVE_HEADERS.includes(lowerKey)) {\n filtered[key] = '***';\n } else {\n filtered[key] = headers[key] || '';\n }\n });\n\n return filtered;\n }\n\n /**\n * Log request\n */\n logRequest(request: RequestLog): void {\n if (!this.config.enabled || !this.config.logRequests) return;\n\n const { method, url, headers, body } = request;\n\n this.consola.start(`${method} ${url}`);\n\n if (this.config.logHeaders && headers) {\n this.consola.debug('Headers:', this.filterHeaders(headers));\n }\n\n if (this.config.logBodies && body) {\n this.consola.debug('Body:', body);\n }\n }\n\n /**\n * Log response\n */\n logResponse(request: RequestLog, response: ResponseLog): void {\n if (!this.config.enabled || !this.config.logResponses) return;\n\n const { method, url } = request;\n const { status, statusText, data, duration } = response;\n\n const statusColor = status >= 500 ? 'red'\n : status >= 400 ? 'yellow'\n : status >= 300 ? 'cyan'\n : 'green';\n\n this.consola.success(\n `${method} ${url} ${status} ${statusText} (${duration}ms)`\n );\n\n if (this.config.logBodies && data) {\n this.consola.debug('Response:', data);\n }\n }\n\n /**\n * Log error\n */\n logError(request: RequestLog, error: ErrorLog): void {\n if (!this.config.enabled || !this.config.logErrors) return;\n\n const { method, url } = request;\n const { message, statusCode, fieldErrors, duration } = error;\n\n this.consola.error(\n `${method} ${url} ${statusCode || 'Network'} Error (${duration}ms)`\n );\n\n this.consola.error('Message:', message);\n\n if (fieldErrors && Object.keys(fieldErrors).length > 0) {\n this.consola.error('Field Errors:');\n Object.entries(fieldErrors).forEach(([field, errors]) => {\n errors.forEach((err) => {\n this.consola.error(` • ${field}: ${err}`);\n });\n });\n }\n }\n\n /**\n * Log general info\n */\n info(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.info(message, ...args);\n }\n\n /**\n * Log warning\n */\n warn(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.warn(message, ...args);\n }\n\n /**\n * Log error\n */\n error(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.error(message, ...args);\n }\n\n /**\n * Log debug\n */\n debug(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.debug(message, ...args);\n }\n\n /**\n * Log success\n */\n success(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.success(message, ...args);\n }\n\n /**\n * Create a sub-logger with prefix\n */\n withTag(tag: string): ConsolaInstance {\n return this.consola.withTag(tag);\n }\n}\n\n/**\n * Default logger instance\n */\nexport const defaultLogger = new APILogger();","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Retry Configuration and Utilities\n *\n * Provides automatic retry logic for failed HTTP requests using p-retry.\n * Retries only on network errors and server errors (5xx), not client errors (4xx).\n */\n\nimport pRetry, { AbortError } from 'p-retry';\nimport { APIError, NetworkError } from './errors';\n\n/**\n * Information about a failed retry attempt.\n */\nexport interface FailedAttemptInfo {\n /** The error that caused the failure */\n error: Error;\n /** The attempt number (1-indexed) */\n attemptNumber: number;\n /** Number of retries left */\n retriesLeft: number;\n}\n\n/**\n * Retry configuration options.\n *\n * Uses exponential backoff with jitter by default to avoid thundering herd.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of retry attempts.\n * @default 3\n */\n retries?: number;\n\n /**\n * Exponential backoff factor.\n * @default 2\n */\n factor?: number;\n\n /**\n * Minimum wait time between retries (ms).\n * @default 1000\n */\n minTimeout?: number;\n\n /**\n * Maximum wait time between retries (ms).\n * @default 60000\n */\n maxTimeout?: number;\n\n /**\n * Add randomness to wait times (jitter).\n * Helps avoid thundering herd problem.\n * @default true\n */\n randomize?: boolean;\n\n /**\n * Callback called on each failed attempt.\n */\n onFailedAttempt?: (info: FailedAttemptInfo) => void;\n}\n\n/**\n * Default retry configuration.\n */\nexport const DEFAULT_RETRY_CONFIG: Required<RetryConfig> = {\n retries: 3,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 60000,\n randomize: true,\n onFailedAttempt: () => {},\n};\n\n/**\n * Determine if an error should trigger a retry.\n *\n * Retries on:\n * - Network errors (connection refused, timeout, etc.)\n * - Server errors (5xx status codes)\n * - Rate limiting (429 status code)\n *\n * Does NOT retry on:\n * - Client errors (4xx except 429)\n * - Authentication errors (401, 403)\n * - Not found (404)\n *\n * @param error - The error to check\n * @returns true if should retry, false otherwise\n */\nexport function shouldRetry(error: any): boolean {\n // Always retry network errors\n if (error instanceof NetworkError) {\n return true;\n }\n\n // For API errors, check status code\n if (error instanceof APIError) {\n const status = error.statusCode;\n\n // Retry on 5xx server errors\n if (status >= 500 && status < 600) {\n return true;\n }\n\n // Retry on 429 (rate limit)\n if (status === 429) {\n return true;\n }\n\n // Do NOT retry on 4xx client errors\n return false;\n }\n\n // Retry on unknown errors (might be network issues)\n return true;\n}\n\n/**\n * Wrap a function with retry logic.\n *\n * @param fn - Async function to retry\n * @param config - Retry configuration\n * @returns Result of the function\n *\n * @example\n * ```typescript\n * const result = await withRetry(\n * async () => fetch('https://api.example.com/users'),\n * { retries: 5, minTimeout: 2000 }\n * );\n * ```\n */\nexport async function withRetry<T>(\n fn: () => Promise<T>,\n config?: RetryConfig\n): Promise<T> {\n const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };\n\n return pRetry(\n async () => {\n try {\n return await fn();\n } catch (error) {\n // Check if we should retry this error\n if (!shouldRetry(error)) {\n // Abort retry immediately for non-retryable errors\n throw new AbortError(error as Error);\n }\n\n // Re-throw error to trigger retry\n throw error;\n }\n },\n {\n retries: finalConfig.retries,\n factor: finalConfig.factor,\n minTimeout: finalConfig.minTimeout,\n maxTimeout: finalConfig.maxTimeout,\n randomize: finalConfig.randomize,\n onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {\n // Adapt p-retry's FailedAttemptError to our FailedAttemptInfo\n const pRetryError = error as any; // p-retry's internal type\n finalConfig.onFailedAttempt!({\n error: pRetryError as Error,\n attemptNumber: pRetryError.attemptNumber,\n retriesLeft: pRetryError.retriesLeft,\n });\n } : undefined,\n }\n );\n}","/**\n * Zod schema for SendPushRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request serializer for sending push notifications.\n * */\nimport { z } from 'zod'\n\n/**\n * Request serializer for sending push notifications.\n */\nexport const SendPushRequestRequestSchema = z.object({\n title: z.string().min(1).max(255),\n body: z.string().min(1),\n icon: z.union([z.url(), z.literal('')]).nullable().optional(),\n url: z.union([z.url(), z.literal('')]).nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SendPushRequestRequest = z.infer<typeof SendPushRequestRequestSchema>","/**\n * Zod schema for SendPushResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for send push endpoint.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for send push endpoint.\n */\nexport const SendPushResponseSchema = z.object({\n success: z.boolean(),\n sent_to: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SendPushResponse = z.infer<typeof SendPushResponseSchema>","/**\n * Zod schema for SubscribeRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request serializer for subscribing to push notifications.\n * */\nimport { z } from 'zod'\n\n/**\n * Request serializer for subscribing to push notifications.\n */\nexport const SubscribeRequestRequestSchema = z.object({\n endpoint: z.union([z.url(), z.literal('')]),\n keys: z.record(z.string(), z.string().min(1)),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SubscribeRequestRequest = z.infer<typeof SubscribeRequestRequestSchema>","/**\n * Zod schema for SubscribeResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for subscription endpoint.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for subscription endpoint.\n */\nexport const SubscribeResponseSchema = z.object({\n success: z.boolean(),\n subscription_id: z.int(),\n created: z.boolean(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SubscribeResponse = z.infer<typeof SubscribeResponseSchema>","/**\n * Zod schema for VapidPublicKeyResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for VAPID public key endpoint.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for VAPID public key endpoint.\n */\nexport const VapidPublicKeyResponseSchema = z.object({\n publicKey: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type VapidPublicKeyResponse = z.infer<typeof VapidPublicKeyResponseSchema>","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Web Push\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { SendPushRequestRequestSchema, type SendPushRequestRequest } from '../schemas/SendPushRequestRequest.schema'\nimport { SendPushResponseSchema, type SendPushResponse } from '../schemas/SendPushResponse.schema'\nimport { SubscribeRequestRequestSchema, type SubscribeRequestRequest } from '../schemas/SubscribeRequestRequest.schema'\nimport { SubscribeResponseSchema, type SubscribeResponse } from '../schemas/SubscribeResponse.schema'\nimport { VapidPublicKeyResponseSchema, type VapidPublicKeyResponse } from '../schemas/VapidPublicKeyResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Send push notification\n *\n * @method POST\n * @path /cfg/webpush/send/\n */\nexport async function createWebpushSendCreate( data: SendPushRequestRequest, client?: any\n): Promise<SendPushResponse> {\n const api = client || getAPIInstance()\n const response = await api.web_push.webpushSendCreate(data)\n try {\n return SendPushResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createWebpushSendCreate\\nPath: /cfg/webpush/send/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createWebpushSendCreate',\n path: '/cfg/webpush/send/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Subscribe to push notifications\n *\n * @method POST\n * @path /cfg/webpush/subscribe/\n */\nexport async function createWebpushSubscribeCreate( data: SubscribeRequestRequest, client?: any\n): Promise<SubscribeResponse> {\n const api = client || getAPIInstance()\n const response = await api.web_push.webpushSubscribeCreate(data)\n try {\n return SubscribeResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createWebpushSubscribeCreate\\nPath: /cfg/webpush/subscribe/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createWebpushSubscribeCreate',\n path: '/cfg/webpush/subscribe/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get VAPID public key\n *\n * @method GET\n * @path /cfg/webpush/vapid/\n */\nexport async function getWebpushVapidRetrieve( client?: any\n): Promise<VapidPublicKeyResponse> {\n const api = client || getAPIInstance()\n const response = await api.web_push.webpushVapidRetrieve()\n try {\n return VapidPublicKeyResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getWebpushVapidRetrieve\\nPath: /cfg/webpush/vapid/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getWebpushVapidRetrieve',\n path: '/cfg/webpush/vapid/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","/**\n * @djangocfg/api - Shared API Package\n *\n * Core authentication API (cfg_accounts only).\n * Extensions are now in separate packages:\n * - @djangocfg/ext-support\n * - @djangocfg/ext-payments\n * - etc.\n */\n\n// ============================================================================\n// Main API from cfg_accounts (authentication)\n// ============================================================================\nexport * from './generated/cfg_accounts';\nexport { API, LocalStorageAdapter, MemoryStorageAdapter } from './generated/cfg_accounts';\nexport { Schemas, Fetchers, Enums } from './generated/cfg_accounts';\n\n// ============================================================================\n// CFG Accounts Type Namespace\n// ============================================================================\nexport * as CfgAccountsTypes from './generated/cfg_accounts';\n\n// ============================================================================\n// Centrifugo Fetchers (for WebSocket token refresh)\n// ============================================================================\nexport { getCentrifugoAuthTokenRetrieve } from './generated/cfg_centrifugo';\n\n// ============================================================================\n// WebPush API (for push notifications)\n// ============================================================================\nexport { API as WebPushAPI } from './generated/cfg_webpush';\nexport * as WebPushTypes from './generated/cfg_webpush';\n\n/**\n * Base Client for all API services\n *\n * Provides:\n * - Centralized API instance with JWT token management\n * - LocalStorage adapter for browser environments\n * - Singleton pattern for API client\n */\n\nimport { API, LocalStorageAdapter } from './generated/cfg_accounts';\n\n/**\n * Singleton API instance with JWT token management\n * Uses LocalStorage for token persistence\n */\nconst isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';\nconst apiUrl = isStaticBuild ? '' : process.env.NEXT_PUBLIC_API_URL || '';\n\nconst api = new API(\n apiUrl,\n {\n storage: new LocalStorageAdapter()\n }\n);\n\n/**\n * Base Client Class\n *\n * Service classes can extend this to access api instance\n */\nexport class BaseClient {\n protected static api = api;\n}\n\n/**\n * Export API instance for direct access\n */\nexport { api };\n","import { createConsola } from 'consola';\n\n/**\n * Universal logger for @djangocfg/api/auth\n * Uses consola for beautiful console logging\n *\n * Log levels:\n * - 0: silent\n * - 1: fatal, error\n * - 2: warn\n * - 3: log, info\n * - 4: debug\n * - 5: trace, verbose\n */\nconst isDevelopment = process.env.NODE_ENV === 'development';\nconst isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';\nconst showLogs = isDevelopment || isStaticBuild;\n\nexport const logger = createConsola({\n level: showLogs ? 4 : 1, // dev: debug, production: errors only\n}).withTag('api');\n\n/**\n * Auth-specific logger\n */\nexport const authLogger = logger.withTag('auth');\n\nexport default logger;\n","/**\n * Token Auto-Refresh Middleware\n *\n * Automatically refreshes access token when receiving 401 responses.\n * Implements request queuing to prevent multiple simultaneous refresh attempts.\n */\n\nimport { api as apiAccounts } from '../../';\nimport { authLogger } from '../utils/logger';\n\n// Refresh state management\nlet isRefreshing = false;\nlet refreshSubscribers: Array<(token: string | null) => void> = [];\n\n/**\n * Subscribe to token refresh completion\n */\nfunction subscribeTokenRefresh(callback: (token: string | null) => void): void {\n refreshSubscribers.push(callback);\n}\n\n/**\n * Notify all subscribers when token is refreshed\n */\nfunction onTokenRefreshed(token: string | null): void {\n refreshSubscribers.forEach(callback => callback(token));\n refreshSubscribers = [];\n}\n\n/**\n * Attempt to refresh the access token using the refresh token\n * @returns New access token or null if refresh failed\n */\nexport async function refreshAccessToken(): Promise<string | null> {\n // If already refreshing, wait for completion\n if (isRefreshing) {\n return new Promise(resolve => {\n subscribeTokenRefresh(token => resolve(token));\n });\n }\n\n isRefreshing = true;\n authLogger.info('Starting token refresh...');\n\n try {\n const refreshToken = apiAccounts.getRefreshToken();\n if (!refreshToken) {\n authLogger.warn('No refresh token available for refresh');\n onTokenRefreshed(null);\n return null;\n }\n\n // Use generated API client with correct URL (/cfg/accounts/token/refresh/)\n const result = await apiAccounts.auth.accountsTokenRefreshCreate({\n refresh: refreshToken,\n });\n\n const newAccessToken = result.access;\n\n if (!newAccessToken) {\n authLogger.error('Token refresh response missing access token');\n onTokenRefreshed(null);\n return null;\n }\n\n // Update tokens in storage\n apiAccounts.setToken(newAccessToken, refreshToken);\n authLogger.info('Token refreshed successfully');\n\n onTokenRefreshed(newAccessToken);\n return newAccessToken;\n } catch (error) {\n authLogger.error('Token refresh error:', error);\n onTokenRefreshed(null);\n return null;\n } finally {\n isRefreshing = false;\n }\n}\n\n/**\n * Check if a response indicates an authentication error\n */\nexport function isAuthenticationError(response: Response): boolean {\n return response.status === 401;\n}\n\n/**\n * Create a fetch wrapper that automatically refreshes tokens on 401\n *\n * @param originalFetch - The original fetch function to wrap\n * @returns Wrapped fetch function with auto-refresh capability\n */\nexport function createAutoRefreshFetch(originalFetch: typeof fetch): typeof fetch {\n return async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n // Make the initial request\n let response = await originalFetch(input, init);\n\n // If 401 and we have a refresh token, try to refresh\n if (isAuthenticationError(response) && apiAccounts.getRefreshToken()) {\n authLogger.info('Received 401, attempting token refresh...');\n\n const newToken = await refreshAccessToken();\n\n if (newToken) {\n // Retry the request with new token\n const newInit: RequestInit = {\n ...init,\n headers: {\n ...init?.headers,\n Authorization: `Bearer ${newToken}`,\n },\n };\n\n authLogger.info('Retrying request with new token...');\n response = await originalFetch(input, newInit);\n } else {\n authLogger.warn('Token refresh failed, returning original 401 response');\n }\n }\n\n return response;\n };\n}\n\n/**\n * Check if token is about to expire (within threshold)\n * @param thresholdMs - Time in ms before expiry to consider \"expiring soon\"\n * @returns true if token expires within threshold\n */\nexport function isTokenExpiringSoon(thresholdMs: number = 5 * 60 * 1000): boolean {\n const token = apiAccounts.getToken();\n if (!token) return false;\n\n try {\n // Decode JWT payload (base64)\n const payload = JSON.parse(atob(token.split('.')[1]));\n const expiresAt = payload.exp * 1000; // Convert to milliseconds\n const now = Date.now();\n const timeUntilExpiry = expiresAt - now;\n\n return timeUntilExpiry < thresholdMs;\n } catch (error) {\n authLogger.error('Error checking token expiry:', error);\n return false;\n }\n}\n\n/**\n * Proactively refresh token if it's expiring soon\n * Call this periodically or before important operations\n */\nexport async function refreshIfExpiringSoon(thresholdMs: number = 5 * 60 * 1000): Promise<void> {\n if (isTokenExpiringSoon(thresholdMs)) {\n authLogger.info('Token expiring soon, proactively refreshing...');\n await refreshAccessToken();\n }\n}\n"],"mappings":";;;;AAAA,SAAsB,oBAAoB;AAMnC,SAAS,gBAAgB,SAAsB;AACpD,QAAM,EAAE,UAAU,OAAO,IAAI,QAAQ;AACrC,QAAMA,UAAS,QAAQ,IAAI;AAG3B,MAAI,SAAS,WAAW,SAAS,GAAG;AAClC,UAAM,YAAY,GAAGA,OAAM,GAAG,QAAQ,GAAG,MAAM;AAC/C,WAAO,aAAa,QAAQ,WAAW,EAAE,SAAS,EAAE,SAAS,QAAQ,QAAQ,EAAE,CAAC;AAAA,EAClF;AAGA,MAAI,SAAS,WAAW,OAAO,GAAG;AAChC,UAAM,YAAY,GAAGA,OAAM,GAAG,QAAQ,GAAG,MAAM;AAC/C,WAAO,aAAa,QAAQ,WAAW,EAAE,SAAS,EAAE,SAAS,QAAQ,QAAQ,EAAE,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AI,CAAC,MAAO,QAAO;AAEnB,MAAI;AAEF,UAAM,UAAU,KAAK,MAAM,KAAK,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;AACpD,UAAM,YAAY,QAAQ,MAAM;AAChC,UAAM,MAAM,KAAK,IAAI;AACrB,UAAM,kBAAkB,YAAY;AAEpC,WAAO,kBAAkB;AAAA,EAC3B,SAAS,OAAO;AACd,eAAW,MAAM,gCAAgC,KAAK;AACtD,WAAO;AAAA,EACT;AACF;AAhBgB;AAsBhB,eAAsB,sBAAsB,cAAsB,IAAI,KAAK,KAAqB;AAC9F,MAAI,oBAAoB,WAAW,GAAG;AACpC,eAAW,KAAK,gDAAgD;AAChE,UAAM,mBAAmB;AAAA,EAC3B;AACF;AALsB;","names":["apiUrl","logger","OAuthConnectionProvider","OAuthDisconnectRequestRequestProvider","OTPRequestRequestChannel","OTPVerifyRequestChannel","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","consola","consola","consola","logger","createConsola","DEFAULT_CONFIG","SENSITIVE_HEADERS","APILogger","createConsola","defaultLogger","pRetry","AbortError","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","consola","consola","consola","consola","createConsola","DEFAULT_CONFIG","SENSITIVE_HEADERS","APILogger","createConsola","defaultLogger","pRetry","AbortError","z","z","z","z","z","consola","createConsola","isStaticBuild"]}
|
|
1
|
+
{"version":3,"sources":["../src/auth/middlewares/proxy.ts","../src/generated/cfg_accounts/accounts__auth/client.ts","../src/generated/cfg_accounts/accounts__oauth/client.ts","../src/generated/cfg_accounts/accounts__user_profile/client.ts","../src/generated/cfg_accounts/accounts/client.ts","../src/generated/cfg_accounts/http.ts","../src/generated/cfg_accounts/errors.ts","../src/generated/cfg_accounts/logger.ts","../src/generated/cfg_accounts/retry.ts","../src/generated/cfg_accounts/client.ts","../src/generated/cfg_accounts/storage.ts","../src/generated/cfg_accounts/enums.ts","../src/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts","../src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts","../src/generated/cfg_accounts/_utils/schemas/User.schema.ts","../src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts","../src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts","../src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts","../src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts","../src/generated/cfg_accounts/index.ts","../src/generated/cfg_centrifugo/logger.ts","../src/generated/cfg_centrifugo/retry.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts","../src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts","../src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts","../src/generated/cfg_webpush/logger.ts","../src/generated/cfg_webpush/retry.ts","../src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts","../src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts","../src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts","../src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts","../src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts","../src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts","../src/index.ts","../src/auth/utils/logger.ts","../src/auth/middlewares/tokenRefresh.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\n\n/**\n * Proxy middleware for media and API endpoints\n * Use this in your middleware.ts file\n */\nexport function proxyMiddleware(request: NextRequest) {\n const { pathname, search } = request.nextUrl;\n const apiUrl = process.env.NEXT_PUBLIC_API_URL;\n\n // Proxy /media/* - Images and static files\n if (pathname.startsWith('/media/')) {\n const targetUrl = `${apiUrl}${pathname}${search}`;\n return NextResponse.rewrite(targetUrl, { request: { headers: request.headers } });\n }\n\n // Proxy /api/* - API endpoints\n if (pathname.startsWith('/api/')) {\n const targetUrl = `${apiUrl}${pathname}${search}`;\n return NextResponse.rewrite(targetUrl, { request: { headers: request.headers } });\n }\n\n return NextResponse.next();\n}\n\n/**\n * Recommended matcher config for proxy middleware\n * Add this to your middleware.ts config\n */\nexport const proxyMiddlewareConfig = {\n matcher: ['/media/:path*', '/api/:path*'],\n};\n","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for Auth.\n */\nexport class Auth {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Refresh JWT token.\n */\n async accountsTokenRefreshCreate(data: Models.TokenRefreshRequest): Promise<Models.TokenRefresh> {\n const response = await this.client.request('POST', \"/cfg/accounts/token/refresh/\", { body: data });\n return response;\n }\n\n}","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for Oauth.\n */\nexport class Oauth {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * List OAuth connections\n * \n * Get all OAuth connections for the current user.\n */\n async accountsOauthConnectionsList(): Promise<any> {\n const response = await this.client.request('GET', \"/cfg/accounts/oauth/connections/\");\n return response;\n }\n\n /**\n * Disconnect OAuth provider\n * \n * Remove OAuth connection for the specified provider.\n */\n async accountsOauthDisconnectCreate(data: Models.OAuthDisconnectRequestRequest): Promise<any> {\n const response = await this.client.request('POST', \"/cfg/accounts/oauth/disconnect/\", { body: data });\n return response;\n }\n\n /**\n * Start GitHub OAuth\n * \n * Generate GitHub OAuth authorization URL. Redirect user to this URL to\n * start authentication.\n */\n async accountsOauthGithubAuthorizeCreate(data: Models.OAuthAuthorizeRequestRequest): Promise<Models.OAuthAuthorizeResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/oauth/github/authorize/\", { body: data });\n return response;\n }\n\n /**\n * Complete GitHub OAuth\n * \n * Exchange authorization code for JWT tokens. Call this after GitHub\n * redirects back with code.\n */\n async accountsOauthGithubCallbackCreate(data: Models.OAuthCallbackRequestRequest): Promise<Models.OAuthTokenResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/oauth/github/callback/\", { body: data });\n return response;\n }\n\n /**\n * List OAuth providers\n * \n * Get list of available OAuth providers for authentication.\n */\n async accountsOauthProvidersRetrieve(): Promise<Models.OAuthProvidersResponse> {\n const response = await this.client.request('GET', \"/cfg/accounts/oauth/providers/\");\n return response;\n }\n\n}","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for User Profile.\n */\nexport class UserProfile {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Get current user profile\n * \n * Retrieve the current authenticated user's profile information.\n */\n async accountsProfileRetrieve(): Promise<Models.User> {\n const response = await this.client.request('GET', \"/cfg/accounts/profile/\");\n return response;\n }\n\n /**\n * Upload user avatar\n * \n * Upload avatar image for the current authenticated user. Accepts\n * multipart/form-data with 'avatar' field.\n */\n async accountsProfileAvatarCreate(data: Models.CfgAccountsProfileAvatarCreateRequest): Promise<Models.User> {\n const formData = new FormData();\n formData.append('avatar', data.avatar);\n const response = await this.client.request('POST', \"/cfg/accounts/profile/avatar/\", { formData });\n return response;\n }\n\n /**\n * Delete user account\n * \n * Permanently delete the current user's account. This operation: -\n * Deactivates the account (user cannot log in) - Anonymizes personal data\n * (GDPR compliance) - Frees up the email address for re-registration -\n * Preserves audit trail The account can be restored by an administrator if\n * needed.\n */\n async accountsProfileDeleteCreate(): Promise<Models.AccountDeleteResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/profile/delete/\");\n return response;\n }\n\n /**\n * Partial update user profile\n * \n * Partially update the current authenticated user's profile information.\n * Supports avatar upload.\n */\n async accountsProfilePartialUpdate(data: Models.UserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PUT', \"/cfg/accounts/profile/partial/\", { body: data });\n return response;\n }\n\n /**\n * Partial update user profile\n * \n * Partially update the current authenticated user's profile information.\n * Supports avatar upload.\n */\n async accountsProfilePartialPartialUpdate(data?: Models.PatchedUserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PATCH', \"/cfg/accounts/profile/partial/\", { body: data });\n return response;\n }\n\n /**\n * Update user profile\n * \n * Update the current authenticated user's profile information.\n */\n async accountsProfileUpdateUpdate(data: Models.UserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PUT', \"/cfg/accounts/profile/update/\", { body: data });\n return response;\n }\n\n /**\n * Update user profile\n * \n * Update the current authenticated user's profile information.\n */\n async accountsProfileUpdatePartialUpdate(data?: Models.PatchedUserProfileUpdateRequest): Promise<Models.User> {\n const response = await this.client.request('PATCH', \"/cfg/accounts/profile/update/\", { body: data });\n return response;\n }\n\n}","import * as Models from \"./models\";\n\n\n/**\n * API endpoints for Accounts.\n */\nexport class Accounts {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Request OTP code to email or phone.\n */\n async otpRequestCreate(data: Models.OTPRequestRequest): Promise<Models.OTPRequestResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/otp/request/\", { body: data });\n return response;\n }\n\n /**\n * Verify OTP code and return JWT tokens or 2FA session. If user has 2FA\n * enabled: - Returns requires_2fa=True with session_id - Client must\n * complete 2FA verification at /cfg/totp/verify/ If user has no 2FA: -\n * Returns JWT tokens and user data directly\n */\n async otpVerifyCreate(data: Models.OTPVerifyRequest): Promise<Models.OTPVerifyResponse> {\n const response = await this.client.request('POST', \"/cfg/accounts/otp/verify/\", { body: data });\n return response;\n }\n\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * HTTP Client Adapter Pattern\n *\n * Allows switching between fetch/axios/httpx without changing generated code.\n * Provides unified interface for making HTTP requests.\n */\n\nexport interface HttpRequest {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n params?: Record<string, any>;\n /** FormData for file uploads (multipart/form-data) */\n formData?: FormData;\n /** Binary data for octet-stream uploads */\n binaryBody?: Blob | ArrayBuffer;\n}\n\nexport interface HttpResponse<T = any> {\n data: T;\n status: number;\n statusText: string;\n headers: Record<string, string>;\n}\n\n/**\n * HTTP Client Adapter Interface.\n * Implement this to use custom HTTP clients (axios, httpx, etc.)\n */\nexport interface HttpClientAdapter {\n request<T = any>(request: HttpRequest): Promise<HttpResponse<T>>;\n}\n\n/**\n * Default Fetch API adapter.\n * Uses native browser fetch() with proper error handling.\n */\nexport class FetchAdapter implements HttpClientAdapter {\n async request<T = any>(request: HttpRequest): Promise<HttpResponse<T>> {\n const { method, url, headers, body, params, formData, binaryBody } = request;\n\n // Build URL with query params\n let finalUrl = url;\n if (params) {\n const searchParams = new URLSearchParams();\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n searchParams.append(key, String(value));\n }\n });\n const queryString = searchParams.toString();\n if (queryString) {\n finalUrl = url.includes('?') ? `${url}&${queryString}` : `${url}?${queryString}`;\n }\n }\n\n // Build headers\n const finalHeaders: Record<string, string> = { ...headers };\n\n // Determine body and content-type\n let requestBody: string | FormData | Blob | ArrayBuffer | undefined;\n\n if (formData) {\n // For multipart/form-data, let browser set Content-Type with boundary\n requestBody = formData;\n // Don't set Content-Type - browser will set it with boundary\n } else if (binaryBody) {\n // Binary upload (application/octet-stream)\n finalHeaders['Content-Type'] = 'application/octet-stream';\n requestBody = binaryBody;\n } else if (body) {\n // JSON request\n finalHeaders['Content-Type'] = 'application/json';\n requestBody = JSON.stringify(body);\n }\n\n // Make request\n const response = await fetch(finalUrl, {\n method,\n headers: finalHeaders,\n body: requestBody,\n credentials: 'include', // Include Django session cookies\n });\n\n // Parse response\n let data: any = null;\n const contentType = response.headers.get('content-type');\n\n if (response.status !== 204 && contentType?.includes('application/json')) {\n data = await response.json();\n } else if (response.status !== 204) {\n data = await response.text();\n }\n\n // Convert Headers to plain object\n const responseHeaders: Record<string, string> = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n\n return {\n data,\n status: response.status,\n statusText: response.statusText,\n headers: responseHeaders,\n };\n }\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Error Classes\n *\n * Typed error classes with Django REST Framework support.\n */\n\n/**\n * HTTP API Error with DRF field-specific validation errors.\n *\n * Usage:\n * ```typescript\n * try {\n * await api.users.create(userData);\n * } catch (error) {\n * if (error instanceof APIError) {\n * if (error.isValidationError) {\n * console.log('Field errors:', error.fieldErrors);\n * // { \"email\": [\"Email already exists\"], \"username\": [\"Required\"] }\n * }\n * }\n * }\n * ```\n */\nexport class APIError extends Error {\n constructor(\n public statusCode: number,\n public statusText: string,\n public response: any,\n public url: string,\n message?: string\n ) {\n super(message || `HTTP ${statusCode}: ${statusText}`);\n this.name = 'APIError';\n }\n\n /**\n * Get error details from response.\n * DRF typically returns: { \"detail\": \"Error message\" } or { \"field\": [\"error1\", \"error2\"] }\n */\n get details(): Record<string, any> | null {\n if (typeof this.response === 'object' && this.response !== null) {\n return this.response;\n }\n return null;\n }\n\n /**\n * Get field-specific validation errors from DRF.\n * Returns: { \"field_name\": [\"error1\", \"error2\"], ... }\n */\n get fieldErrors(): Record<string, string[]> | null {\n const details = this.details;\n if (!details) return null;\n\n // DRF typically returns: { \"field\": [\"error1\", \"error2\"] }\n const fieldErrors: Record<string, string[]> = {};\n for (const [key, value] of Object.entries(details)) {\n if (Array.isArray(value)) {\n fieldErrors[key] = value;\n }\n }\n\n return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;\n }\n\n /**\n * Get single error message from DRF.\n * Checks for \"detail\", \"message\", or first field error.\n */\n get errorMessage(): string {\n const details = this.details;\n if (!details) return this.message;\n\n // Check for \"detail\" field (common in DRF)\n if (details.detail) {\n return Array.isArray(details.detail) ? details.detail.join(', ') : String(details.detail);\n }\n\n // Check for \"message\" field\n if (details.message) {\n return String(details.message);\n }\n\n // Return first field error\n const fieldErrors = this.fieldErrors;\n if (fieldErrors) {\n const firstField = Object.keys(fieldErrors)[0];\n if (firstField) {\n return `${firstField}: ${fieldErrors[firstField]?.join(', ')}`;\n }\n }\n\n return this.message;\n }\n\n // Helper methods for common HTTP status codes\n get isValidationError(): boolean { return this.statusCode === 400; }\n get isAuthError(): boolean { return this.statusCode === 401; }\n get isPermissionError(): boolean { return this.statusCode === 403; }\n get isNotFoundError(): boolean { return this.statusCode === 404; }\n get isServerError(): boolean { return this.statusCode >= 500 && this.statusCode < 600; }\n}\n\n/**\n * Network Error (connection failed, timeout, etc.)\n */\nexport class NetworkError extends Error {\n constructor(\n message: string,\n public url: string,\n public originalError?: Error\n ) {\n super(message);\n this.name = 'NetworkError';\n }\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Logger with Consola\n * Beautiful console logging for API requests and responses\n *\n * Installation:\n * npm install consola\n */\n\nimport { type ConsolaInstance, createConsola } from 'consola';\n\n/**\n * Request log data\n */\nexport interface RequestLog {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n timestamp: number;\n}\n\n/**\n * Response log data\n */\nexport interface ResponseLog {\n status: number;\n statusText: string;\n data?: any;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Error log data\n */\nexport interface ErrorLog {\n message: string;\n statusCode?: number;\n fieldErrors?: Record<string, string[]>;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Logger configuration\n */\nexport interface LoggerConfig {\n /** Enable logging */\n enabled: boolean;\n /** Log requests */\n logRequests: boolean;\n /** Log responses */\n logResponses: boolean;\n /** Log errors */\n logErrors: boolean;\n /** Log request/response bodies */\n logBodies: boolean;\n /** Log headers (excluding sensitive ones) */\n logHeaders: boolean;\n /** Custom consola instance */\n consola?: ConsolaInstance;\n}\n\n/**\n * Default logger configuration\n */\nconst DEFAULT_CONFIG: LoggerConfig = {\n enabled: process.env.NODE_ENV !== 'production',\n logRequests: true,\n logResponses: true,\n logErrors: true,\n logBodies: true,\n logHeaders: false,\n};\n\n/**\n * Sensitive header names to filter out\n */\nconst SENSITIVE_HEADERS = [\n 'authorization',\n 'cookie',\n 'set-cookie',\n 'x-api-key',\n 'x-csrf-token',\n];\n\n/**\n * API Logger class\n */\nexport class APILogger {\n private config: LoggerConfig;\n private consola: ConsolaInstance;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.consola = config.consola || createConsola({\n level: this.config.enabled ? 4 : 0,\n });\n }\n\n /**\n * Enable logging\n */\n enable(): void {\n this.config.enabled = true;\n }\n\n /**\n * Disable logging\n */\n disable(): void {\n this.config.enabled = false;\n }\n\n /**\n * Update configuration\n */\n setConfig(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Filter sensitive headers\n */\n private filterHeaders(headers?: Record<string, string>): Record<string, string> {\n if (!headers) return {};\n\n const filtered: Record<string, string> = {};\n Object.keys(headers).forEach((key) => {\n const lowerKey = key.toLowerCase();\n if (SENSITIVE_HEADERS.includes(lowerKey)) {\n filtered[key] = '***';\n } else {\n filtered[key] = headers[key] || '';\n }\n });\n\n return filtered;\n }\n\n /**\n * Log request\n */\n logRequest(request: RequestLog): void {\n if (!this.config.enabled || !this.config.logRequests) return;\n\n const { method, url, headers, body } = request;\n\n this.consola.start(`${method} ${url}`);\n\n if (this.config.logHeaders && headers) {\n this.consola.debug('Headers:', this.filterHeaders(headers));\n }\n\n if (this.config.logBodies && body) {\n this.consola.debug('Body:', body);\n }\n }\n\n /**\n * Log response\n */\n logResponse(request: RequestLog, response: ResponseLog): void {\n if (!this.config.enabled || !this.config.logResponses) return;\n\n const { method, url } = request;\n const { status, statusText, data, duration } = response;\n\n const statusColor = status >= 500 ? 'red'\n : status >= 400 ? 'yellow'\n : status >= 300 ? 'cyan'\n : 'green';\n\n this.consola.success(\n `${method} ${url} ${status} ${statusText} (${duration}ms)`\n );\n\n if (this.config.logBodies && data) {\n this.consola.debug('Response:', data);\n }\n }\n\n /**\n * Log error\n */\n logError(request: RequestLog, error: ErrorLog): void {\n if (!this.config.enabled || !this.config.logErrors) return;\n\n const { method, url } = request;\n const { message, statusCode, fieldErrors, duration } = error;\n\n this.consola.error(\n `${method} ${url} ${statusCode || 'Network'} Error (${duration}ms)`\n );\n\n this.consola.error('Message:', message);\n\n if (fieldErrors && Object.keys(fieldErrors).length > 0) {\n this.consola.error('Field Errors:');\n Object.entries(fieldErrors).forEach(([field, errors]) => {\n errors.forEach((err) => {\n this.consola.error(` • ${field}: ${err}`);\n });\n });\n }\n }\n\n /**\n * Log general info\n */\n info(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.info(message, ...args);\n }\n\n /**\n * Log warning\n */\n warn(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.warn(message, ...args);\n }\n\n /**\n * Log error\n */\n error(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.error(message, ...args);\n }\n\n /**\n * Log debug\n */\n debug(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.debug(message, ...args);\n }\n\n /**\n * Log success\n */\n success(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.success(message, ...args);\n }\n\n /**\n * Create a sub-logger with prefix\n */\n withTag(tag: string): ConsolaInstance {\n return this.consola.withTag(tag);\n }\n}\n\n/**\n * Default logger instance\n */\nexport const defaultLogger = new APILogger();","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Retry Configuration and Utilities\n *\n * Provides automatic retry logic for failed HTTP requests using p-retry.\n * Retries only on network errors and server errors (5xx), not client errors (4xx).\n */\n\nimport pRetry, { AbortError } from 'p-retry';\nimport { APIError, NetworkError } from './errors';\n\n/**\n * Information about a failed retry attempt.\n */\nexport interface FailedAttemptInfo {\n /** The error that caused the failure */\n error: Error;\n /** The attempt number (1-indexed) */\n attemptNumber: number;\n /** Number of retries left */\n retriesLeft: number;\n}\n\n/**\n * Retry configuration options.\n *\n * Uses exponential backoff with jitter by default to avoid thundering herd.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of retry attempts.\n * @default 3\n */\n retries?: number;\n\n /**\n * Exponential backoff factor.\n * @default 2\n */\n factor?: number;\n\n /**\n * Minimum wait time between retries (ms).\n * @default 1000\n */\n minTimeout?: number;\n\n /**\n * Maximum wait time between retries (ms).\n * @default 60000\n */\n maxTimeout?: number;\n\n /**\n * Add randomness to wait times (jitter).\n * Helps avoid thundering herd problem.\n * @default true\n */\n randomize?: boolean;\n\n /**\n * Callback called on each failed attempt.\n */\n onFailedAttempt?: (info: FailedAttemptInfo) => void;\n}\n\n/**\n * Default retry configuration.\n */\nexport const DEFAULT_RETRY_CONFIG: Required<RetryConfig> = {\n retries: 3,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 60000,\n randomize: true,\n onFailedAttempt: () => {},\n};\n\n/**\n * Determine if an error should trigger a retry.\n *\n * Retries on:\n * - Network errors (connection refused, timeout, etc.)\n * - Server errors (5xx status codes)\n * - Rate limiting (429 status code)\n *\n * Does NOT retry on:\n * - Client errors (4xx except 429)\n * - Authentication errors (401, 403)\n * - Not found (404)\n *\n * @param error - The error to check\n * @returns true if should retry, false otherwise\n */\nexport function shouldRetry(error: any): boolean {\n // Always retry network errors\n if (error instanceof NetworkError) {\n return true;\n }\n\n // For API errors, check status code\n if (error instanceof APIError) {\n const status = error.statusCode;\n\n // Retry on 5xx server errors\n if (status >= 500 && status < 600) {\n return true;\n }\n\n // Retry on 429 (rate limit)\n if (status === 429) {\n return true;\n }\n\n // Do NOT retry on 4xx client errors\n return false;\n }\n\n // Retry on unknown errors (might be network issues)\n return true;\n}\n\n/**\n * Wrap a function with retry logic.\n *\n * @param fn - Async function to retry\n * @param config - Retry configuration\n * @returns Result of the function\n *\n * @example\n * ```typescript\n * const result = await withRetry(\n * async () => fetch('https://api.example.com/users'),\n * { retries: 5, minTimeout: 2000 }\n * );\n * ```\n */\nexport async function withRetry<T>(\n fn: () => Promise<T>,\n config?: RetryConfig\n): Promise<T> {\n const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };\n\n return pRetry(\n async () => {\n try {\n return await fn();\n } catch (error) {\n // Check if we should retry this error\n if (!shouldRetry(error)) {\n // Abort retry immediately for non-retryable errors\n throw new AbortError(error as Error);\n }\n\n // Re-throw error to trigger retry\n throw error;\n }\n },\n {\n retries: finalConfig.retries,\n factor: finalConfig.factor,\n minTimeout: finalConfig.minTimeout,\n maxTimeout: finalConfig.maxTimeout,\n randomize: finalConfig.randomize,\n onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {\n // Adapt p-retry's FailedAttemptError to our FailedAttemptInfo\n const pRetryError = error as any; // p-retry's internal type\n finalConfig.onFailedAttempt!({\n error: pRetryError as Error,\n attemptNumber: pRetryError.attemptNumber,\n retriesLeft: pRetryError.retriesLeft,\n });\n } : undefined,\n }\n );\n}","import { Auth } from \"./accounts__auth\";\nimport { Oauth } from \"./accounts__oauth\";\nimport { UserProfile } from \"./accounts__user_profile\";\nimport { Accounts } from \"./accounts\";\nimport { HttpClientAdapter, FetchAdapter } from \"./http\";\nimport { APIError, NetworkError } from \"./errors\";\nimport { APILogger, type LoggerConfig } from \"./logger\";\nimport { withRetry, type RetryConfig } from \"./retry\";\n\n\n/**\n * Async API client for Django CFG API.\n *\n * Usage:\n * ```typescript\n * const client = new APIClient('https://api.example.com');\n * const users = await client.users.list();\n * const post = await client.posts.create(newPost);\n *\n * // Custom HTTP adapter (e.g., Axios)\n * const client = new APIClient('https://api.example.com', {\n * httpClient: new AxiosAdapter()\n * });\n * ```\n */\nexport class APIClient {\n private baseUrl: string;\n private httpClient: HttpClientAdapter;\n private logger: APILogger | null = null;\n private retryConfig: RetryConfig | null = null;\n private tokenGetter: (() => string | null) | null = null;\n\n // Sub-clients\n public auth: Auth;\n public oauth: Oauth;\n public user_profile: UserProfile;\n public accounts: Accounts;\n\n constructor(\n baseUrl: string,\n options?: {\n httpClient?: HttpClientAdapter;\n loggerConfig?: Partial<LoggerConfig>;\n retryConfig?: RetryConfig;\n tokenGetter?: () => string | null;\n }\n ) {\n this.baseUrl = baseUrl.replace(/\\/$/, '');\n this.httpClient = options?.httpClient || new FetchAdapter();\n this.tokenGetter = options?.tokenGetter || null;\n\n // Initialize logger if config provided\n if (options?.loggerConfig !== undefined) {\n this.logger = new APILogger(options.loggerConfig);\n }\n\n // Store retry configuration\n if (options?.retryConfig !== undefined) {\n this.retryConfig = options.retryConfig;\n }\n\n // Initialize sub-clients\n this.auth = new Auth(this);\n this.oauth = new Oauth(this);\n this.user_profile = new UserProfile(this);\n this.accounts = new Accounts(this);\n }\n\n /**\n * Get CSRF token from cookies (for SessionAuthentication).\n *\n * Returns null if cookie doesn't exist (JWT-only auth).\n */\n getCsrfToken(): string | null {\n const name = 'csrftoken';\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n return parts.pop()?.split(';').shift() || null;\n }\n return null;\n }\n\n /**\n * Get the base URL for building streaming/download URLs.\n */\n getBaseUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Get JWT token for URL authentication (used in streaming endpoints).\n * Returns null if no token getter is configured or no token is available.\n */\n getToken(): string | null {\n return this.tokenGetter ? this.tokenGetter() : null;\n }\n\n /**\n * Make HTTP request with Django CSRF and session handling.\n * Automatically retries on network errors and 5xx server errors.\n */\n async request<T>(\n method: string,\n path: string,\n options?: {\n params?: Record<string, any>;\n body?: any;\n formData?: FormData;\n binaryBody?: Blob | ArrayBuffer;\n headers?: Record<string, string>;\n }\n ): Promise<T> {\n // Wrap request in retry logic if configured\n if (this.retryConfig) {\n return withRetry(() => this._makeRequest<T>(method, path, options), {\n ...this.retryConfig,\n onFailedAttempt: (info) => {\n // Log retry attempts\n if (this.logger) {\n this.logger.warn(\n `Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} ` +\n `for ${method} ${path}: ${info.error.message}`\n );\n }\n // Call user's onFailedAttempt if provided\n this.retryConfig?.onFailedAttempt?.(info);\n },\n });\n }\n\n // No retry configured, make request directly\n return this._makeRequest<T>(method, path, options);\n }\n\n /**\n * Internal request method (without retry wrapper).\n * Used by request() method with optional retry logic.\n */\n private async _makeRequest<T>(\n method: string,\n path: string,\n options?: {\n params?: Record<string, any>;\n body?: any;\n formData?: FormData;\n binaryBody?: Blob | ArrayBuffer;\n headers?: Record<string, string>;\n }\n ): Promise<T> {\n // Build URL - handle both absolute and relative paths\n // When baseUrl is empty (static builds), path is used as-is (relative to current origin)\n const url = this.baseUrl ? `${this.baseUrl}${path}` : path;\n const startTime = Date.now();\n\n // Build headers - start with custom headers from options\n const headers: Record<string, string> = {\n ...(options?.headers || {})\n };\n\n // Don't set Content-Type for FormData/binaryBody (browser will set it with boundary)\n if (!options?.formData && !options?.binaryBody && !headers['Content-Type']) {\n headers['Content-Type'] = 'application/json';\n }\n\n // CSRF not needed - SessionAuthentication not enabled in DRF config\n // Your API uses JWT/Token authentication (no CSRF required)\n\n // Log request\n if (this.logger) {\n this.logger.logRequest({\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n });\n }\n\n try {\n // Make request via HTTP adapter\n const response = await this.httpClient.request<T>({\n method,\n url: url,\n headers,\n params: options?.params,\n body: options?.body,\n formData: options?.formData,\n binaryBody: options?.binaryBody,\n });\n\n const duration = Date.now() - startTime;\n\n // Check for HTTP errors\n if (response.status >= 400) {\n const error = new APIError(\n response.status,\n response.statusText,\n response.data,\n url\n );\n\n // Log error\n if (this.logger) {\n this.logger.logError(\n {\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n },\n {\n message: error.message,\n statusCode: response.status,\n duration,\n timestamp: Date.now(),\n }\n );\n }\n\n throw error;\n }\n\n // Log successful response\n if (this.logger) {\n this.logger.logResponse(\n {\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n },\n {\n status: response.status,\n statusText: response.statusText,\n data: response.data,\n duration,\n timestamp: Date.now(),\n }\n );\n }\n\n return response.data as T;\n } catch (error) {\n const duration = Date.now() - startTime;\n\n // Re-throw APIError as-is\n if (error instanceof APIError) {\n throw error;\n }\n\n // Detect CORS errors and dispatch event\n const isCORSError = error instanceof TypeError &&\n (error.message.toLowerCase().includes('cors') ||\n error.message.toLowerCase().includes('failed to fetch') ||\n error.message.toLowerCase().includes('network request failed'));\n\n // Log specific error type first\n if (this.logger) {\n if (isCORSError) {\n this.logger.error(`🚫 CORS Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n this.logger.error(` → Configure security_domains parameter on the server`);\n } else {\n this.logger.error(`⚠️ Network Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n // Dispatch browser events\n if (typeof window !== 'undefined') {\n try {\n if (isCORSError) {\n // Dispatch CORS-specific error event\n window.dispatchEvent(new CustomEvent('cors-error', {\n detail: {\n url: url,\n method: method,\n error: error instanceof Error ? error.message : String(error),\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n } else {\n // Dispatch generic network error event\n window.dispatchEvent(new CustomEvent('network-error', {\n detail: {\n url: url,\n method: method,\n error: error instanceof Error ? error.message : String(error),\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n }\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n }\n }\n\n // Wrap other errors as NetworkError\n const networkError = error instanceof Error\n ? new NetworkError(error.message, url, error)\n : new NetworkError('Unknown error', url);\n\n // Detailed logging via logger.logError\n if (this.logger) {\n this.logger.logError(\n {\n method,\n url: url,\n headers,\n body: options?.formData || options?.body,\n timestamp: startTime,\n },\n {\n message: networkError.message,\n duration,\n timestamp: Date.now(),\n }\n );\n }\n\n throw networkError;\n }\n }\n}\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Storage adapters for cross-platform token storage.\n *\n * Supports:\n * - LocalStorage (browser)\n * - Cookies (SSR/browser)\n * - Memory (Node.js/Electron/testing)\n */\n\nimport type { APILogger } from './logger';\n\n/**\n * Storage adapter interface for cross-platform token storage.\n */\nexport interface StorageAdapter {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\n/**\n * LocalStorage adapter with safe try-catch for browser environments.\n * Works in modern browsers with localStorage support.\n * \n * Note: This adapter uses window.localStorage and should only be used in browser/client environments.\n * For server-side usage, use MemoryStorageAdapter or CookieStorageAdapter instead.\n */\nexport class LocalStorageAdapter implements StorageAdapter {\n private logger?: APILogger;\n\n constructor(logger?: APILogger) {\n this.logger = logger;\n }\n\n getItem(key: string): string | null {\n try {\n if (typeof window !== 'undefined' && window.localStorage) {\n const value = localStorage.getItem(key);\n this.logger?.debug(`LocalStorage.getItem(\"${key}\"): ${value ? 'found' : 'not found'}`);\n return value;\n }\n this.logger?.warn('LocalStorage not available: window.localStorage is undefined');\n } catch (error) {\n this.logger?.error('LocalStorage.getItem failed:', error);\n }\n return null;\n }\n\n setItem(key: string, value: string): void {\n try {\n if (typeof window !== 'undefined' && window.localStorage) {\n localStorage.setItem(key, value);\n this.logger?.debug(`LocalStorage.setItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('LocalStorage not available: window.localStorage is undefined');\n }\n } catch (error) {\n this.logger?.error('LocalStorage.setItem failed:', error);\n }\n }\n\n removeItem(key: string): void {\n try {\n if (typeof window !== 'undefined' && window.localStorage) {\n localStorage.removeItem(key);\n this.logger?.debug(`LocalStorage.removeItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('LocalStorage not available: window.localStorage is undefined');\n }\n } catch (error) {\n this.logger?.error('LocalStorage.removeItem failed:', error);\n }\n }\n}\n\n/**\n * Cookie-based storage adapter for SSR and browser environments.\n * Useful for Next.js, Nuxt.js, and other SSR frameworks.\n */\nexport class CookieStorageAdapter implements StorageAdapter {\n private logger?: APILogger;\n\n constructor(logger?: APILogger) {\n this.logger = logger;\n }\n\n getItem(key: string): string | null {\n try {\n if (typeof document === 'undefined') {\n this.logger?.warn('Cookies not available: document is undefined (SSR context?)');\n return null;\n }\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${key}=`);\n if (parts.length === 2) {\n const result = parts.pop()?.split(';').shift() || null;\n this.logger?.debug(`CookieStorage.getItem(\"${key}\"): ${result ? 'found' : 'not found'}`);\n return result;\n }\n this.logger?.debug(`CookieStorage.getItem(\"${key}\"): not found`);\n } catch (error) {\n this.logger?.error('CookieStorage.getItem failed:', error);\n }\n return null;\n }\n\n setItem(key: string, value: string): void {\n try {\n if (typeof document !== 'undefined') {\n document.cookie = `${key}=${value}; path=/; max-age=31536000`;\n this.logger?.debug(`CookieStorage.setItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('Cookies not available: document is undefined (SSR context?)');\n }\n } catch (error) {\n this.logger?.error('CookieStorage.setItem failed:', error);\n }\n }\n\n removeItem(key: string): void {\n try {\n if (typeof document !== 'undefined') {\n document.cookie = `${key}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;\n this.logger?.debug(`CookieStorage.removeItem(\"${key}\"): success`);\n } else {\n this.logger?.warn('Cookies not available: document is undefined (SSR context?)');\n }\n } catch (error) {\n this.logger?.error('CookieStorage.removeItem failed:', error);\n }\n }\n}\n\n/**\n * In-memory storage adapter for Node.js, Electron, and testing environments.\n * Data is stored in RAM and cleared when process exits.\n */\nexport class MemoryStorageAdapter implements StorageAdapter {\n private storage: Map<string, string> = new Map();\n private logger?: APILogger;\n\n constructor(logger?: APILogger) {\n this.logger = logger;\n }\n\n getItem(key: string): string | null {\n const value = this.storage.get(key) || null;\n this.logger?.debug(`MemoryStorage.getItem(\"${key}\"): ${value ? 'found' : 'not found'}`);\n return value;\n }\n\n setItem(key: string, value: string): void {\n this.storage.set(key, value);\n this.logger?.debug(`MemoryStorage.setItem(\"${key}\"): success`);\n }\n\n removeItem(key: string): void {\n this.storage.delete(key);\n this.logger?.debug(`MemoryStorage.removeItem(\"${key}\"): success`);\n }\n}","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * OAuth provider name (github, google, etc.)\n * * `github` - GitHub\n */\nexport enum OAuthConnectionProvider {\n GITHUB = \"github\",\n}\n\n/**\n * OAuth provider to disconnect\n * * `github` - GitHub\n */\nexport enum OAuthDisconnectRequestRequestProvider {\n GITHUB = \"github\",\n}\n\n/**\n * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.\n * * `email` - Email\n * * `phone` - Phone\n */\nexport enum OTPRequestRequestChannel {\n EMAIL = \"email\",\n PHONE = \"phone\",\n}\n\n/**\n * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.\n * * `email` - Email\n * * `phone` - Phone\n */\nexport enum OTPVerifyRequestChannel {\n EMAIL = \"email\",\n PHONE = \"phone\",\n}\n\n","/**\n * Zod schema for AccountDeleteResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for account deletion.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for account deletion.\n */\nexport const AccountDeleteResponseSchema = z.object({\n success: z.boolean(),\n message: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type AccountDeleteResponse = z.infer<typeof AccountDeleteResponseSchema>","/**\n * Zod schema for CentrifugoToken\n *\n * This schema provides runtime validation and type inference.\n * * Nested serializer for Centrifugo WebSocket connection token.\n * */\nimport { z } from 'zod'\n\n/**\n * Nested serializer for Centrifugo WebSocket connection token.\n */\nexport const CentrifugoTokenSchema = z.object({\n token: z.string(),\n centrifugo_url: z.union([z.url(), z.literal('')]),\n expires_at: z.iso.datetime(),\n channels: z.array(z.string()),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoToken = z.infer<typeof CentrifugoTokenSchema>","/**\n * Zod schema for CfgAccountsProfileAvatarCreateRequest\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\n\nexport const CfgAccountsProfileAvatarCreateRequestSchema = z.object({\n avatar: z.union([z.instanceof(File), z.instanceof(Blob)]),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>","/**\n * Zod schema for OAuthAuthorizeRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to start OAuth flow.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to start OAuth flow.\n */\nexport const OAuthAuthorizeRequestRequestSchema = z.object({\n redirect_uri: z.union([z.url(), z.literal('')]).optional(),\n source_url: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthAuthorizeRequestRequest = z.infer<typeof OAuthAuthorizeRequestRequestSchema>","/**\n * Zod schema for OAuthAuthorizeResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response with OAuth authorization URL.\n * */\nimport { z } from 'zod'\n\n/**\n * Response with OAuth authorization URL.\n */\nexport const OAuthAuthorizeResponseSchema = z.object({\n authorization_url: z.union([z.url(), z.literal('')]),\n state: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthAuthorizeResponse = z.infer<typeof OAuthAuthorizeResponseSchema>","/**\n * Zod schema for OAuthCallbackRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to complete OAuth flow (callback handler).\n * */\nimport { z } from 'zod'\n\n/**\n * Request to complete OAuth flow (callback handler).\n */\nexport const OAuthCallbackRequestRequestSchema = z.object({\n code: z.string().min(10).max(500),\n state: z.string().min(20).max(100),\n redirect_uri: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthCallbackRequestRequest = z.infer<typeof OAuthCallbackRequestRequestSchema>","/**\n * Zod schema for OAuthConnection\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for OAuth connection info (user-facing).\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Serializer for OAuth connection info (user-facing).\n */\nexport const OAuthConnectionSchema = z.object({\n id: z.int(),\n provider: z.nativeEnum(Enums.OAuthConnectionProvider),\n provider_display: z.string(),\n provider_username: z.string(),\n provider_email: z.email(),\n provider_avatar_url: z.union([z.url(), z.literal('')]),\n connected_at: z.iso.datetime(),\n last_login_at: z.iso.datetime(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthConnection = z.infer<typeof OAuthConnectionSchema>","/**\n * Zod schema for OAuthDisconnectRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to disconnect OAuth provider.\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Request to disconnect OAuth provider.\n */\nexport const OAuthDisconnectRequestRequestSchema = z.object({\n provider: z.nativeEnum(Enums.OAuthDisconnectRequestRequestProvider),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthDisconnectRequestRequest = z.infer<typeof OAuthDisconnectRequestRequestSchema>","/**\n * Zod schema for OAuthError\n *\n * This schema provides runtime validation and type inference.\n * * Error response for OAuth endpoints.\n * */\nimport { z } from 'zod'\n\n/**\n * Error response for OAuth endpoints.\n */\nexport const OAuthErrorSchema = z.object({\n error: z.string(),\n error_description: z.string().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthError = z.infer<typeof OAuthErrorSchema>","/**\n * Zod schema for OAuthProvidersResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response with available OAuth providers.\n * */\nimport { z } from 'zod'\n\n/**\n * Response with available OAuth providers.\n */\nexport const OAuthProvidersResponseSchema = z.object({\n providers: z.array(z.record(z.string(), z.any())),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthProvidersResponse = z.infer<typeof OAuthProvidersResponseSchema>","/**\n * Zod schema for OAuthTokenResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response with JWT tokens after OAuth authentication.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- access/refresh/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- access/refresh/user: populated\n * */\nimport { z } from 'zod'\n\n/**\n * Response with JWT tokens after OAuth authentication.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- access/refresh/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- access/refresh/user: populated\n */\nexport const OAuthTokenResponseSchema = z.object({\n requires_2fa: z.boolean().optional(),\n session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),\n access: z.string().nullable().optional(),\n refresh: z.string().nullable().optional(),\n user: z.record(z.string(), z.any()).nullable().optional(),\n is_new_user: z.boolean(),\n is_new_connection: z.boolean(),\n should_prompt_2fa: z.boolean().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>","/**\n * Zod schema for OTPErrorResponse\n *\n * This schema provides runtime validation and type inference.\n * * Error response for OTP operations.\n * */\nimport { z } from 'zod'\n\n/**\n * Error response for OTP operations.\n */\nexport const OTPErrorResponseSchema = z.object({\n error: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPErrorResponse = z.infer<typeof OTPErrorResponseSchema>","/**\n * Zod schema for OTPRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for OTP request.\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Serializer for OTP request.\n */\nexport const OTPRequestRequestSchema = z.object({\n identifier: z.string().min(1),\n channel: z.nativeEnum(Enums.OTPRequestRequestChannel).optional(),\n source_url: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPRequestRequest = z.infer<typeof OTPRequestRequestSchema>","/**\n * Zod schema for OTPRequestResponse\n *\n * This schema provides runtime validation and type inference.\n * * OTP request response.\n * */\nimport { z } from 'zod'\n\n/**\n * OTP request response.\n */\nexport const OTPRequestResponseSchema = z.object({\n message: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>","/**\n * Zod schema for OTPVerifyRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for OTP verification.\n * */\nimport { z } from 'zod'\nimport * as Enums from '../../enums'\n\n/**\n * Serializer for OTP verification.\n */\nexport const OTPVerifyRequestSchema = z.object({\n identifier: z.string().min(1),\n otp: z.string().min(6).max(6),\n channel: z.nativeEnum(Enums.OTPVerifyRequestChannel).optional(),\n source_url: z.union([z.url(), z.literal('')]).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPVerifyRequest = z.infer<typeof OTPVerifyRequestSchema>","/**\n * Zod schema for OTPVerifyResponse\n *\n * This schema provides runtime validation and type inference.\n * * OTP verification response.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- refresh/access/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- refresh/access/user: populated\n * */\nimport { z } from 'zod'\nimport { UserSchema } from './User.schema'\n\n/**\n * OTP verification response.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- refresh/access/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- refresh/access/user: populated\n */\nexport const OTPVerifyResponseSchema = z.object({\n requires_2fa: z.boolean().optional(),\n session_id: z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),\n refresh: z.string().nullable().optional(),\n access: z.string().nullable().optional(),\n user: UserSchema.nullable().optional(),\n should_prompt_2fa: z.boolean().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type OTPVerifyResponse = z.infer<typeof OTPVerifyResponseSchema>","/**\n * Zod schema for User\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for user details.\n * */\nimport { z } from 'zod'\nimport { CentrifugoTokenSchema } from './CentrifugoToken.schema'\n\n/**\n * Serializer for user details.\n */\nexport const UserSchema = z.object({\n id: z.int(),\n email: z.email(),\n first_name: z.string().max(50).optional(),\n last_name: z.string().max(50).optional(),\n full_name: z.string(),\n initials: z.string(),\n display_username: z.string(),\n company: z.string().max(100).optional(),\n phone: z.string().max(20).optional(),\n position: z.string().max(100).optional(),\n avatar: z.union([z.url(), z.literal('')]).nullable(),\n is_staff: z.boolean(),\n is_superuser: z.boolean(),\n date_joined: z.iso.datetime(),\n last_login: z.iso.datetime().nullable(),\n unanswered_messages_count: z.int(),\n centrifugo: CentrifugoTokenSchema.nullable(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type User = z.infer<typeof UserSchema>","/**\n * Zod schema for PatchedUserProfileUpdateRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for updating user profile.\n * */\nimport { z } from 'zod'\n\n/**\n * Serializer for updating user profile.\n */\nexport const PatchedUserProfileUpdateRequestSchema = z.object({\n first_name: z.string().max(50).optional(),\n last_name: z.string().max(50).optional(),\n company: z.string().max(100).optional(),\n phone: z.string().max(20).optional(),\n position: z.string().max(100).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PatchedUserProfileUpdateRequest = z.infer<typeof PatchedUserProfileUpdateRequestSchema>","/**\n * Zod schema for TokenRefresh\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\n\nexport const TokenRefreshSchema = z.object({\n access: z.string(),\n refresh: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TokenRefresh = z.infer<typeof TokenRefreshSchema>","/**\n * Zod schema for TokenRefreshRequest\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\n\nexport const TokenRefreshRequestSchema = z.object({\n refresh: z.string().min(1),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TokenRefreshRequest = z.infer<typeof TokenRefreshRequestSchema>","/**\n * Zod schema for UserProfileUpdateRequest\n *\n * This schema provides runtime validation and type inference.\n * * Serializer for updating user profile.\n * */\nimport { z } from 'zod'\n\n/**\n * Serializer for updating user profile.\n */\nexport const UserProfileUpdateRequestSchema = z.object({\n first_name: z.string().max(50).optional(),\n last_name: z.string().max(50).optional(),\n company: z.string().max(100).optional(),\n phone: z.string().max(20).optional(),\n position: z.string().max(100).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type UserProfileUpdateRequest = z.infer<typeof UserProfileUpdateRequestSchema>","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Accounts\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { OTPRequestRequestSchema, type OTPRequestRequest } from '../schemas/OTPRequestRequest.schema'\nimport { OTPRequestResponseSchema, type OTPRequestResponse } from '../schemas/OTPRequestResponse.schema'\nimport { OTPVerifyRequestSchema, type OTPVerifyRequest } from '../schemas/OTPVerifyRequest.schema'\nimport { OTPVerifyResponseSchema, type OTPVerifyResponse } from '../schemas/OTPVerifyResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * API operation\n *\n * @method POST\n * @path /cfg/accounts/otp/request/\n */\nexport async function createAccountsOtpRequestCreate( data: OTPRequestRequest, client?: any\n): Promise<OTPRequestResponse> {\n const api = client || getAPIInstance()\n const response = await api.accounts.otpRequestCreate(data)\n try {\n return OTPRequestResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOtpRequestCreate\\nPath: /cfg/accounts/otp/request/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOtpRequestCreate',\n path: '/cfg/accounts/otp/request/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * API operation\n *\n * @method POST\n * @path /cfg/accounts/otp/verify/\n */\nexport async function createAccountsOtpVerifyCreate( data: OTPVerifyRequest, client?: any\n): Promise<OTPVerifyResponse> {\n const api = client || getAPIInstance()\n const response = await api.accounts.otpVerifyCreate(data)\n try {\n return OTPVerifyResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOtpVerifyCreate\\nPath: /cfg/accounts/otp/verify/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOtpVerifyCreate',\n path: '/cfg/accounts/otp/verify/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Auth\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { TokenRefreshSchema, type TokenRefresh } from '../schemas/TokenRefresh.schema'\nimport { TokenRefreshRequestSchema, type TokenRefreshRequest } from '../schemas/TokenRefreshRequest.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * API operation\n *\n * @method POST\n * @path /cfg/accounts/token/refresh/\n */\nexport async function createAccountsTokenRefreshCreate( data: TokenRefreshRequest, client?: any\n): Promise<TokenRefresh> {\n const api = client || getAPIInstance()\n const response = await api.auth.accountsTokenRefreshCreate(data)\n try {\n return TokenRefreshSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsTokenRefreshCreate\\nPath: /cfg/accounts/token/refresh/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsTokenRefreshCreate',\n path: '/cfg/accounts/token/refresh/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Oauth\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeRequestRequest } from '../schemas/OAuthAuthorizeRequestRequest.schema'\nimport { OAuthAuthorizeResponseSchema, type OAuthAuthorizeResponse } from '../schemas/OAuthAuthorizeResponse.schema'\nimport { OAuthCallbackRequestRequestSchema, type OAuthCallbackRequestRequest } from '../schemas/OAuthCallbackRequestRequest.schema'\nimport { OAuthDisconnectRequestRequestSchema, type OAuthDisconnectRequestRequest } from '../schemas/OAuthDisconnectRequestRequest.schema'\nimport { OAuthProvidersResponseSchema, type OAuthProvidersResponse } from '../schemas/OAuthProvidersResponse.schema'\nimport { OAuthTokenResponseSchema, type OAuthTokenResponse } from '../schemas/OAuthTokenResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * List OAuth connections\n *\n * @method GET\n * @path /cfg/accounts/oauth/connections/\n */\nexport async function getAccountsOauthConnectionsList( client?: any\n): Promise<any> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthConnectionsList()\n return response\n}\n\n\n/**\n * Disconnect OAuth provider\n *\n * @method POST\n * @path /cfg/accounts/oauth/disconnect/\n */\nexport async function createAccountsOauthDisconnectCreate( data: OAuthDisconnectRequestRequest, client?: any\n): Promise<any> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthDisconnectCreate(data)\n return response\n}\n\n\n/**\n * Start GitHub OAuth\n *\n * @method POST\n * @path /cfg/accounts/oauth/github/authorize/\n */\nexport async function createAccountsOauthGithubAuthorizeCreate( data: OAuthAuthorizeRequestRequest, client?: any\n): Promise<OAuthAuthorizeResponse> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthGithubAuthorizeCreate(data)\n try {\n return OAuthAuthorizeResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOauthGithubAuthorizeCreate\\nPath: /cfg/accounts/oauth/github/authorize/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOauthGithubAuthorizeCreate',\n path: '/cfg/accounts/oauth/github/authorize/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Complete GitHub OAuth\n *\n * @method POST\n * @path /cfg/accounts/oauth/github/callback/\n */\nexport async function createAccountsOauthGithubCallbackCreate( data: OAuthCallbackRequestRequest, client?: any\n): Promise<OAuthTokenResponse> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthGithubCallbackCreate(data)\n try {\n return OAuthTokenResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsOauthGithubCallbackCreate\\nPath: /cfg/accounts/oauth/github/callback/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsOauthGithubCallbackCreate',\n path: '/cfg/accounts/oauth/github/callback/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * List OAuth providers\n *\n * @method GET\n * @path /cfg/accounts/oauth/providers/\n */\nexport async function getAccountsOauthProvidersRetrieve( client?: any\n): Promise<OAuthProvidersResponse> {\n const api = client || getAPIInstance()\n const response = await api.oauth.accountsOauthProvidersRetrieve()\n try {\n return OAuthProvidersResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getAccountsOauthProvidersRetrieve\\nPath: /cfg/accounts/oauth/providers/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getAccountsOauthProvidersRetrieve',\n path: '/cfg/accounts/oauth/providers/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for User Profile\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { AccountDeleteResponseSchema, type AccountDeleteResponse } from '../schemas/AccountDeleteResponse.schema'\nimport { CfgAccountsProfileAvatarCreateRequestSchema, type CfgAccountsProfileAvatarCreateRequest } from '../schemas/CfgAccountsProfileAvatarCreateRequest.schema'\nimport { PatchedUserProfileUpdateRequestSchema, type PatchedUserProfileUpdateRequest } from '../schemas/PatchedUserProfileUpdateRequest.schema'\nimport { UserSchema, type User } from '../schemas/User.schema'\nimport { UserProfileUpdateRequestSchema, type UserProfileUpdateRequest } from '../schemas/UserProfileUpdateRequest.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get current user profile\n *\n * @method GET\n * @path /cfg/accounts/profile/\n */\nexport async function getAccountsProfileRetrieve( client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileRetrieve()\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getAccountsProfileRetrieve\\nPath: /cfg/accounts/profile/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getAccountsProfileRetrieve',\n path: '/cfg/accounts/profile/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Upload user avatar\n *\n * @method POST\n * @path /cfg/accounts/profile/avatar/\n */\nexport async function createAccountsProfileAvatarCreate( data: CfgAccountsProfileAvatarCreateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileAvatarCreate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsProfileAvatarCreate\\nPath: /cfg/accounts/profile/avatar/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsProfileAvatarCreate',\n path: '/cfg/accounts/profile/avatar/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Delete user account\n *\n * @method POST\n * @path /cfg/accounts/profile/delete/\n */\nexport async function createAccountsProfileDeleteCreate( client?: any\n): Promise<AccountDeleteResponse> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileDeleteCreate()\n try {\n return AccountDeleteResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createAccountsProfileDeleteCreate\\nPath: /cfg/accounts/profile/delete/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createAccountsProfileDeleteCreate',\n path: '/cfg/accounts/profile/delete/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Partial update user profile\n *\n * @method PUT\n * @path /cfg/accounts/profile/partial/\n */\nexport async function partialUpdateAccountsProfilePartialUpdate( data: UserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfilePartialUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`partialUpdateAccountsProfilePartialUpdate\\nPath: /cfg/accounts/profile/partial/\\nMethod: PUT`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'partialUpdateAccountsProfilePartialUpdate',\n path: '/cfg/accounts/profile/partial/',\n method: 'PUT',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Partial update user profile\n *\n * @method PATCH\n * @path /cfg/accounts/profile/partial/\n */\nexport async function partialUpdateAccountsProfilePartialPartialUpdate( data?: PatchedUserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfilePartialPartialUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`partialUpdateAccountsProfilePartialPartialUpdate\\nPath: /cfg/accounts/profile/partial/\\nMethod: PATCH`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'partialUpdateAccountsProfilePartialPartialUpdate',\n path: '/cfg/accounts/profile/partial/',\n method: 'PATCH',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Update user profile\n *\n * @method PUT\n * @path /cfg/accounts/profile/update/\n */\nexport async function updateAccountsProfileUpdateUpdate( data: UserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileUpdateUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`updateAccountsProfileUpdateUpdate\\nPath: /cfg/accounts/profile/update/\\nMethod: PUT`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'updateAccountsProfileUpdateUpdate',\n path: '/cfg/accounts/profile/update/',\n method: 'PUT',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Update user profile\n *\n * @method PATCH\n * @path /cfg/accounts/profile/update/\n */\nexport async function partialUpdateAccountsProfileUpdatePartialUpdate( data?: PatchedUserProfileUpdateRequest, client?: any\n): Promise<User> {\n const api = client || getAPIInstance()\n const response = await api.user_profile.accountsProfileUpdatePartialUpdate(data)\n try {\n return UserSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`partialUpdateAccountsProfileUpdatePartialUpdate\\nPath: /cfg/accounts/profile/update/\\nMethod: PATCH`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'partialUpdateAccountsProfileUpdatePartialUpdate',\n path: '/cfg/accounts/profile/update/',\n method: 'PATCH',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Django CFG API - API Client with JWT Management\n *\n * Usage:\n * ```typescript\n * import { API } from './api';\n *\n * const api = new API('https://api.example.com');\n *\n * // Set JWT token\n * api.setToken('your-jwt-token', 'refresh-token');\n *\n * // Use API\n * const posts = await api.posts.list();\n * const user = await api.users.retrieve(1);\n *\n * // Check authentication\n * if (api.isAuthenticated()) {\n * // ...\n * }\n *\n * // Custom storage with logging (for Electron/Node.js)\n * import { MemoryStorageAdapter, APILogger } from './storage';\n * const logger = new APILogger({ enabled: true, logLevel: 'debug' });\n * const api = new API('https://api.example.com', {\n * storage: new MemoryStorageAdapter(logger),\n * loggerConfig: { enabled: true, logLevel: 'debug' }\n * });\n *\n * // Get OpenAPI schema\n * const schema = api.getSchema();\n * ```\n */\n\nimport { APIClient } from \"./client\";\nimport {\n StorageAdapter,\n LocalStorageAdapter,\n CookieStorageAdapter,\n MemoryStorageAdapter\n} from \"./storage\";\nimport type { RetryConfig } from \"./retry\";\nimport type { LoggerConfig } from \"./logger\";\nimport { APILogger } from \"./logger\";\nimport { Auth } from \"./accounts__auth/client\";\nimport { Oauth } from \"./accounts__oauth/client\";\nimport { UserProfile } from \"./accounts__user_profile/client\";\nimport { Accounts } from \"./accounts/client\";\nexport * as AuthTypes from \"./accounts__auth/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as OauthTypes from \"./accounts__oauth/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as UserProfileTypes from \"./accounts__user_profile/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as AccountsTypes from \"./accounts/models\";\n// Note: Direct exports (export * from) are removed to avoid duplicate type conflicts\n// Use namespace exports like CfgAccountsTypes.User or import from specific modules\nexport * as Enums from \"./enums\";\n\n// Re-export Zod schemas for runtime validation\nexport * as Schemas from \"./_utils/schemas\";\n// Also export all schemas directly for convenience\nexport * from \"./_utils/schemas\";\n\n// Re-export Zod validation events for browser integration\nexport type { ValidationErrorDetail, ValidationErrorEvent } from \"./validation-events\";\nexport { dispatchValidationError, onValidationError, formatZodError } from \"./validation-events\";\n\n// Re-export typed fetchers for universal usage\nexport * as Fetchers from \"./_utils/fetchers\";\nexport * from \"./_utils/fetchers\";\n\n// Re-export API instance configuration functions\nexport {\n configureAPI,\n getAPIInstance,\n reconfigureAPI,\n clearAPITokens,\n resetAPI,\n isAPIConfigured\n} from \"./api-instance\";\n// NOTE: SWR hooks are generated in ./_utils/hooks/ but NOT exported here to keep\n// the main bundle server-safe. Import hooks directly from the hooks directory:\n// import { useUsers } from './_utils/hooks';\n// Or use a separate entry point like '@djangocfg/api/hooks' for client components.\n\n// Re-export core client\nexport { APIClient };\n\n// Re-export storage adapters for convenience\nexport type { StorageAdapter };\nexport { LocalStorageAdapter, CookieStorageAdapter, MemoryStorageAdapter };\n\n// Re-export error classes for convenience\nexport { APIError, NetworkError } from \"./errors\";\n\n// Re-export HTTP adapters for custom implementations\nexport type { HttpClientAdapter, HttpRequest, HttpResponse } from \"./http\";\nexport { FetchAdapter } from \"./http\";\n\n// Re-export logger types and classes\nexport type { LoggerConfig, RequestLog, ResponseLog, ErrorLog } from \"./logger\";\nexport { APILogger } from \"./logger\";\n\n// Re-export retry configuration and utilities\nexport type { RetryConfig, FailedAttemptInfo } from \"./retry\";\nexport { withRetry, shouldRetry, DEFAULT_RETRY_CONFIG } from \"./retry\";\n\nexport const TOKEN_KEY = \"auth_token\";\nexport const REFRESH_TOKEN_KEY = \"refresh_token\";\n\nexport interface APIOptions {\n /** Custom storage adapter (defaults to LocalStorageAdapter) */\n storage?: StorageAdapter;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** Logger configuration */\n loggerConfig?: Partial<LoggerConfig>;\n}\n\nexport class API {\n private baseUrl: string;\n private _client: APIClient;\n private _token: string | null = null;\n private _refreshToken: string | null = null;\n private storage: StorageAdapter;\n private options?: APIOptions;\n\n // Sub-clients\n public auth!: Auth;\n public oauth!: Oauth;\n public user_profile!: UserProfile;\n public accounts!: Accounts;\n\n constructor(baseUrl: string, options?: APIOptions) {\n this.baseUrl = baseUrl;\n this.options = options;\n\n // Create logger if config provided\n const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : undefined;\n\n // Initialize storage with logger\n this.storage = options?.storage || new LocalStorageAdapter(logger);\n\n this._loadTokensFromStorage();\n\n // Initialize APIClient with token getter for URL authentication\n this._client = new APIClient(this.baseUrl, {\n retryConfig: this.options?.retryConfig,\n loggerConfig: this.options?.loggerConfig,\n tokenGetter: () => this.getToken(),\n });\n\n // Always inject auth header wrapper (reads token dynamically from storage)\n this._injectAuthHeader();\n\n // Initialize sub-clients from APIClient\n this.auth = this._client.auth;\n this.oauth = this._client.oauth;\n this.user_profile = this._client.user_profile;\n this.accounts = this._client.accounts;\n }\n\n private _loadTokensFromStorage(): void {\n this._token = this.storage.getItem(TOKEN_KEY);\n this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);\n }\n\n private _reinitClients(): void {\n this._client = new APIClient(this.baseUrl, {\n retryConfig: this.options?.retryConfig,\n loggerConfig: this.options?.loggerConfig,\n tokenGetter: () => this.getToken(),\n });\n\n // Always inject auth header wrapper (reads token dynamically from storage)\n this._injectAuthHeader();\n\n // Reinitialize sub-clients\n this.auth = this._client.auth;\n this.oauth = this._client.oauth;\n this.user_profile = this._client.user_profile;\n this.accounts = this._client.accounts;\n }\n\n private _injectAuthHeader(): void {\n // Override request method to inject auth header\n const originalRequest = this._client.request.bind(this._client);\n this._client.request = async <T>(\n method: string,\n path: string,\n options?: { params?: Record<string, any>; body?: any; formData?: FormData; headers?: Record<string, string> }\n ): Promise<T> => {\n // Read token from storage dynamically (supports JWT injection after instantiation)\n const token = this.getToken();\n const mergedOptions = {\n ...options,\n headers: {\n ...(options?.headers || {}),\n ...(token ? { 'Authorization': `Bearer ${token}` } : {}),\n },\n };\n\n return originalRequest(method, path, mergedOptions);\n };\n }\n\n /**\n * Get current JWT token\n */\n getToken(): string | null {\n return this.storage.getItem(TOKEN_KEY);\n }\n\n /**\n * Get current refresh token\n */\n getRefreshToken(): string | null {\n return this.storage.getItem(REFRESH_TOKEN_KEY);\n }\n\n /**\n * Set JWT token and refresh token\n * @param token - JWT access token\n * @param refreshToken - JWT refresh token (optional)\n */\n setToken(token: string, refreshToken?: string): void {\n this._token = token;\n this.storage.setItem(TOKEN_KEY, token);\n\n if (refreshToken) {\n this._refreshToken = refreshToken;\n this.storage.setItem(REFRESH_TOKEN_KEY, refreshToken);\n }\n\n // Reinitialize clients with new token\n this._reinitClients();\n }\n\n /**\n * Clear all tokens\n */\n clearTokens(): void {\n this._token = null;\n this._refreshToken = null;\n this.storage.removeItem(TOKEN_KEY);\n this.storage.removeItem(REFRESH_TOKEN_KEY);\n\n // Reinitialize clients without token\n this._reinitClients();\n }\n\n /**\n * Check if user is authenticated\n */\n isAuthenticated(): boolean {\n return !!this.getToken();\n }\n\n /**\n * Update base URL and reinitialize clients\n * @param url - New base URL\n */\n setBaseUrl(url: string): void {\n this.baseUrl = url;\n this._reinitClients();\n }\n\n /**\n * Get current base URL\n */\n getBaseUrl(): string {\n return this.baseUrl;\n }\n\n /**\n * Get OpenAPI schema path\n * @returns Path to the OpenAPI schema JSON file\n *\n * Note: The OpenAPI schema is available in the schema.json file.\n * You can load it dynamically using:\n * ```typescript\n * const schema = await fetch('./schema.json').then(r => r.json());\n * // or using fs in Node.js:\n * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));\n * ```\n */\n getSchemaPath(): string {\n return './schema.json';\n }\n}\n\nexport default API;","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Logger with Consola\n * Beautiful console logging for API requests and responses\n *\n * Installation:\n * npm install consola\n */\n\nimport { type ConsolaInstance, createConsola } from 'consola';\n\n/**\n * Request log data\n */\nexport interface RequestLog {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n timestamp: number;\n}\n\n/**\n * Response log data\n */\nexport interface ResponseLog {\n status: number;\n statusText: string;\n data?: any;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Error log data\n */\nexport interface ErrorLog {\n message: string;\n statusCode?: number;\n fieldErrors?: Record<string, string[]>;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Logger configuration\n */\nexport interface LoggerConfig {\n /** Enable logging */\n enabled: boolean;\n /** Log requests */\n logRequests: boolean;\n /** Log responses */\n logResponses: boolean;\n /** Log errors */\n logErrors: boolean;\n /** Log request/response bodies */\n logBodies: boolean;\n /** Log headers (excluding sensitive ones) */\n logHeaders: boolean;\n /** Custom consola instance */\n consola?: ConsolaInstance;\n}\n\n/**\n * Default logger configuration\n */\nconst DEFAULT_CONFIG: LoggerConfig = {\n enabled: process.env.NODE_ENV !== 'production',\n logRequests: true,\n logResponses: true,\n logErrors: true,\n logBodies: true,\n logHeaders: false,\n};\n\n/**\n * Sensitive header names to filter out\n */\nconst SENSITIVE_HEADERS = [\n 'authorization',\n 'cookie',\n 'set-cookie',\n 'x-api-key',\n 'x-csrf-token',\n];\n\n/**\n * API Logger class\n */\nexport class APILogger {\n private config: LoggerConfig;\n private consola: ConsolaInstance;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.consola = config.consola || createConsola({\n level: this.config.enabled ? 4 : 0,\n });\n }\n\n /**\n * Enable logging\n */\n enable(): void {\n this.config.enabled = true;\n }\n\n /**\n * Disable logging\n */\n disable(): void {\n this.config.enabled = false;\n }\n\n /**\n * Update configuration\n */\n setConfig(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Filter sensitive headers\n */\n private filterHeaders(headers?: Record<string, string>): Record<string, string> {\n if (!headers) return {};\n\n const filtered: Record<string, string> = {};\n Object.keys(headers).forEach((key) => {\n const lowerKey = key.toLowerCase();\n if (SENSITIVE_HEADERS.includes(lowerKey)) {\n filtered[key] = '***';\n } else {\n filtered[key] = headers[key] || '';\n }\n });\n\n return filtered;\n }\n\n /**\n * Log request\n */\n logRequest(request: RequestLog): void {\n if (!this.config.enabled || !this.config.logRequests) return;\n\n const { method, url, headers, body } = request;\n\n this.consola.start(`${method} ${url}`);\n\n if (this.config.logHeaders && headers) {\n this.consola.debug('Headers:', this.filterHeaders(headers));\n }\n\n if (this.config.logBodies && body) {\n this.consola.debug('Body:', body);\n }\n }\n\n /**\n * Log response\n */\n logResponse(request: RequestLog, response: ResponseLog): void {\n if (!this.config.enabled || !this.config.logResponses) return;\n\n const { method, url } = request;\n const { status, statusText, data, duration } = response;\n\n const statusColor = status >= 500 ? 'red'\n : status >= 400 ? 'yellow'\n : status >= 300 ? 'cyan'\n : 'green';\n\n this.consola.success(\n `${method} ${url} ${status} ${statusText} (${duration}ms)`\n );\n\n if (this.config.logBodies && data) {\n this.consola.debug('Response:', data);\n }\n }\n\n /**\n * Log error\n */\n logError(request: RequestLog, error: ErrorLog): void {\n if (!this.config.enabled || !this.config.logErrors) return;\n\n const { method, url } = request;\n const { message, statusCode, fieldErrors, duration } = error;\n\n this.consola.error(\n `${method} ${url} ${statusCode || 'Network'} Error (${duration}ms)`\n );\n\n this.consola.error('Message:', message);\n\n if (fieldErrors && Object.keys(fieldErrors).length > 0) {\n this.consola.error('Field Errors:');\n Object.entries(fieldErrors).forEach(([field, errors]) => {\n errors.forEach((err) => {\n this.consola.error(` • ${field}: ${err}`);\n });\n });\n }\n }\n\n /**\n * Log general info\n */\n info(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.info(message, ...args);\n }\n\n /**\n * Log warning\n */\n warn(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.warn(message, ...args);\n }\n\n /**\n * Log error\n */\n error(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.error(message, ...args);\n }\n\n /**\n * Log debug\n */\n debug(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.debug(message, ...args);\n }\n\n /**\n * Log success\n */\n success(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.success(message, ...args);\n }\n\n /**\n * Create a sub-logger with prefix\n */\n withTag(tag: string): ConsolaInstance {\n return this.consola.withTag(tag);\n }\n}\n\n/**\n * Default logger instance\n */\nexport const defaultLogger = new APILogger();","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Retry Configuration and Utilities\n *\n * Provides automatic retry logic for failed HTTP requests using p-retry.\n * Retries only on network errors and server errors (5xx), not client errors (4xx).\n */\n\nimport pRetry, { AbortError } from 'p-retry';\nimport { APIError, NetworkError } from './errors';\n\n/**\n * Information about a failed retry attempt.\n */\nexport interface FailedAttemptInfo {\n /** The error that caused the failure */\n error: Error;\n /** The attempt number (1-indexed) */\n attemptNumber: number;\n /** Number of retries left */\n retriesLeft: number;\n}\n\n/**\n * Retry configuration options.\n *\n * Uses exponential backoff with jitter by default to avoid thundering herd.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of retry attempts.\n * @default 3\n */\n retries?: number;\n\n /**\n * Exponential backoff factor.\n * @default 2\n */\n factor?: number;\n\n /**\n * Minimum wait time between retries (ms).\n * @default 1000\n */\n minTimeout?: number;\n\n /**\n * Maximum wait time between retries (ms).\n * @default 60000\n */\n maxTimeout?: number;\n\n /**\n * Add randomness to wait times (jitter).\n * Helps avoid thundering herd problem.\n * @default true\n */\n randomize?: boolean;\n\n /**\n * Callback called on each failed attempt.\n */\n onFailedAttempt?: (info: FailedAttemptInfo) => void;\n}\n\n/**\n * Default retry configuration.\n */\nexport const DEFAULT_RETRY_CONFIG: Required<RetryConfig> = {\n retries: 3,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 60000,\n randomize: true,\n onFailedAttempt: () => {},\n};\n\n/**\n * Determine if an error should trigger a retry.\n *\n * Retries on:\n * - Network errors (connection refused, timeout, etc.)\n * - Server errors (5xx status codes)\n * - Rate limiting (429 status code)\n *\n * Does NOT retry on:\n * - Client errors (4xx except 429)\n * - Authentication errors (401, 403)\n * - Not found (404)\n *\n * @param error - The error to check\n * @returns true if should retry, false otherwise\n */\nexport function shouldRetry(error: any): boolean {\n // Always retry network errors\n if (error instanceof NetworkError) {\n return true;\n }\n\n // For API errors, check status code\n if (error instanceof APIError) {\n const status = error.statusCode;\n\n // Retry on 5xx server errors\n if (status >= 500 && status < 600) {\n return true;\n }\n\n // Retry on 429 (rate limit)\n if (status === 429) {\n return true;\n }\n\n // Do NOT retry on 4xx client errors\n return false;\n }\n\n // Retry on unknown errors (might be network issues)\n return true;\n}\n\n/**\n * Wrap a function with retry logic.\n *\n * @param fn - Async function to retry\n * @param config - Retry configuration\n * @returns Result of the function\n *\n * @example\n * ```typescript\n * const result = await withRetry(\n * async () => fetch('https://api.example.com/users'),\n * { retries: 5, minTimeout: 2000 }\n * );\n * ```\n */\nexport async function withRetry<T>(\n fn: () => Promise<T>,\n config?: RetryConfig\n): Promise<T> {\n const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };\n\n return pRetry(\n async () => {\n try {\n return await fn();\n } catch (error) {\n // Check if we should retry this error\n if (!shouldRetry(error)) {\n // Abort retry immediately for non-retryable errors\n throw new AbortError(error as Error);\n }\n\n // Re-throw error to trigger retry\n throw error;\n }\n },\n {\n retries: finalConfig.retries,\n factor: finalConfig.factor,\n minTimeout: finalConfig.minTimeout,\n maxTimeout: finalConfig.maxTimeout,\n randomize: finalConfig.randomize,\n onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {\n // Adapt p-retry's FailedAttemptError to our FailedAttemptInfo\n const pRetryError = error as any; // p-retry's internal type\n finalConfig.onFailedAttempt!({\n error: pRetryError as Error,\n attemptNumber: pRetryError.attemptNumber,\n retriesLeft: pRetryError.retriesLeft,\n });\n } : undefined,\n }\n );\n}","/**\n * Zod schema for CentrifugoChannelInfo\n *\n * This schema provides runtime validation and type inference.\n * * Information about a single channel.\n * */\nimport { z } from 'zod'\n\n/**\n * Information about a single channel.\n */\nexport const CentrifugoChannelInfoSchema = z.object({\n num_clients: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelInfo = z.infer<typeof CentrifugoChannelInfoSchema>","/**\n * Zod schema for CentrifugoChannelsRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to list active channels.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to list active channels.\n */\nexport const CentrifugoChannelsRequestRequestSchema = z.object({\n pattern: z.string().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelsRequestRequest = z.infer<typeof CentrifugoChannelsRequestRequestSchema>","/**\n * Zod schema for CentrifugoChannelsResponse\n *\n * This schema provides runtime validation and type inference.\n * * List of active channels response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoChannelsResultSchema } from './CentrifugoChannelsResult.schema'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\n\n/**\n * List of active channels response.\n */\nexport const CentrifugoChannelsResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoChannelsResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelsResponse = z.infer<typeof CentrifugoChannelsResponseSchema>","/**\n * Zod schema for CentrifugoChannelsResult\n *\n * This schema provides runtime validation and type inference.\n * * Channels result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoChannelInfoSchema } from './CentrifugoChannelInfo.schema'\n\n/**\n * Channels result wrapper.\n */\nexport const CentrifugoChannelsResultSchema = z.object({\n channels: z.record(z.string(), CentrifugoChannelInfoSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoChannelsResult = z.infer<typeof CentrifugoChannelsResultSchema>","/**\n * Zod schema for CentrifugoError\n *\n * This schema provides runtime validation and type inference.\n * * Centrifugo API error structure.\n * */\nimport { z } from 'zod'\n\n/**\n * Centrifugo API error structure.\n */\nexport const CentrifugoErrorSchema = z.object({\n code: z.int().optional(),\n message: z.string().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoError = z.infer<typeof CentrifugoErrorSchema>","/**\n * Zod schema for CentrifugoClientInfo\n *\n * This schema provides runtime validation and type inference.\n * * Information about connected client.\n * */\nimport { z } from 'zod'\n\n/**\n * Information about connected client.\n */\nexport const CentrifugoClientInfoSchema = z.object({\n user: z.string(),\n client: z.string(),\n conn_info: z.record(z.string(), z.any()).nullable().optional(),\n chan_info: z.record(z.string(), z.any()).nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoClientInfo = z.infer<typeof CentrifugoClientInfoSchema>","/**\n * Zod schema for CentrifugoHealthCheck\n *\n * This schema provides runtime validation and type inference.\n * * Health check response.\n * */\nimport { z } from 'zod'\n\n/**\n * Health check response.\n */\nexport const CentrifugoHealthCheckSchema = z.object({\n status: z.string(),\n wrapper_url: z.string(),\n has_api_key: z.boolean(),\n timestamp: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHealthCheck = z.infer<typeof CentrifugoHealthCheckSchema>","/**\n * Zod schema for CentrifugoHistoryRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to get channel history.\n * */\nimport { z } from 'zod'\nimport { CentrifugoStreamPositionSchema } from './CentrifugoStreamPosition.schema'\n\n/**\n * Request to get channel history.\n */\nexport const CentrifugoHistoryRequestRequestSchema = z.object({\n channel: z.string(),\n limit: z.int().nullable().optional(),\n since: CentrifugoStreamPositionSchema.optional(),\n reverse: z.boolean().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHistoryRequestRequest = z.infer<typeof CentrifugoHistoryRequestRequestSchema>","/**\n * Zod schema for CentrifugoStreamPosition\n *\n * This schema provides runtime validation and type inference.\n * * Stream position for pagination.\n * */\nimport { z } from 'zod'\n\n/**\n * Stream position for pagination.\n */\nexport const CentrifugoStreamPositionSchema = z.object({\n offset: z.int(),\n epoch: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoStreamPosition = z.infer<typeof CentrifugoStreamPositionSchema>","/**\n * Zod schema for CentrifugoHistoryResponse\n *\n * This schema provides runtime validation and type inference.\n * * Channel history response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoHistoryResultSchema } from './CentrifugoHistoryResult.schema'\n\n/**\n * Channel history response.\n */\nexport const CentrifugoHistoryResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoHistoryResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHistoryResponse = z.infer<typeof CentrifugoHistoryResponseSchema>","/**\n * Zod schema for CentrifugoHistoryResult\n *\n * This schema provides runtime validation and type inference.\n * * History result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoPublicationSchema } from './CentrifugoPublication.schema'\n\n/**\n * History result wrapper.\n */\nexport const CentrifugoHistoryResultSchema = z.object({\n publications: z.array(CentrifugoPublicationSchema),\n epoch: z.string(),\n offset: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoHistoryResult = z.infer<typeof CentrifugoHistoryResultSchema>","/**\n * Zod schema for CentrifugoPublication\n *\n * This schema provides runtime validation and type inference.\n * * Single publication (message) in channel history.\n * */\nimport { z } from 'zod'\nimport { CentrifugoClientInfoSchema } from './CentrifugoClientInfo.schema'\n\n/**\n * Single publication (message) in channel history.\n */\nexport const CentrifugoPublicationSchema = z.object({\n data: z.record(z.string(), z.any()),\n info: CentrifugoClientInfoSchema.optional(),\n offset: z.int(),\n tags: z.record(z.string(), z.any()).nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPublication = z.infer<typeof CentrifugoPublicationSchema>","/**\n * Zod schema for CentrifugoInfoResponse\n *\n * This schema provides runtime validation and type inference.\n * * Server info response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoInfoResultSchema } from './CentrifugoInfoResult.schema'\n\n/**\n * Server info response.\n */\nexport const CentrifugoInfoResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoInfoResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoInfoResponse = z.infer<typeof CentrifugoInfoResponseSchema>","/**\n * Zod schema for CentrifugoInfoResult\n *\n * This schema provides runtime validation and type inference.\n * * Info result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoNodeInfoSchema } from './CentrifugoNodeInfo.schema'\n\n/**\n * Info result wrapper.\n */\nexport const CentrifugoInfoResultSchema = z.object({\n nodes: z.array(CentrifugoNodeInfoSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoInfoResult = z.infer<typeof CentrifugoInfoResultSchema>","/**\n * Zod schema for CentrifugoNodeInfo\n *\n * This schema provides runtime validation and type inference.\n * * Information about a single Centrifugo node.\n * */\nimport { z } from 'zod'\nimport { CentrifugoMetricsSchema } from './CentrifugoMetrics.schema'\nimport { CentrifugoProcessSchema } from './CentrifugoProcess.schema'\n\n/**\n * Information about a single Centrifugo node.\n */\nexport const CentrifugoNodeInfoSchema = z.object({\n uid: z.string(),\n name: z.string(),\n version: z.string(),\n num_clients: z.int(),\n num_users: z.int(),\n num_channels: z.int(),\n uptime: z.int(),\n num_subs: z.int(),\n metrics: CentrifugoMetricsSchema.optional(),\n process: CentrifugoProcessSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoNodeInfo = z.infer<typeof CentrifugoNodeInfoSchema>","/**\n * Zod schema for CentrifugoMetrics\n *\n * This schema provides runtime validation and type inference.\n * * Server metrics.\n * */\nimport { z } from 'zod'\n\n/**\n * Server metrics.\n */\nexport const CentrifugoMetricsSchema = z.object({\n interval: z.number(),\n items: z.record(z.string(), z.number()),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoMetrics = z.infer<typeof CentrifugoMetricsSchema>","/**\n * Zod schema for CentrifugoProcess\n *\n * This schema provides runtime validation and type inference.\n * * Process information.\n * */\nimport { z } from 'zod'\n\n/**\n * Process information.\n */\nexport const CentrifugoProcessSchema = z.object({\n cpu: z.number(),\n rss: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoProcess = z.infer<typeof CentrifugoProcessSchema>","/**\n * Zod schema for CentrifugoOverviewStats\n *\n * This schema provides runtime validation and type inference.\n * * Overview statistics for Centrifugo publishes.\n * */\nimport { z } from 'zod'\n\n/**\n * Overview statistics for Centrifugo publishes.\n */\nexport const CentrifugoOverviewStatsSchema = z.object({\n total: z.int(),\n successful: z.int(),\n failed: z.int(),\n timeout: z.int(),\n success_rate: z.number(),\n avg_duration_ms: z.number(),\n avg_acks_received: z.number(),\n period_hours: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoOverviewStats = z.infer<typeof CentrifugoOverviewStatsSchema>","/**\n * Zod schema for CentrifugoPresenceRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to get channel presence.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to get channel presence.\n */\nexport const CentrifugoPresenceRequestRequestSchema = z.object({\n channel: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceRequestRequest = z.infer<typeof CentrifugoPresenceRequestRequestSchema>","/**\n * Zod schema for CentrifugoPresenceResponse\n *\n * This schema provides runtime validation and type inference.\n * * Channel presence response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoPresenceResultSchema } from './CentrifugoPresenceResult.schema'\n\n/**\n * Channel presence response.\n */\nexport const CentrifugoPresenceResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoPresenceResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceResponse = z.infer<typeof CentrifugoPresenceResponseSchema>","/**\n * Zod schema for CentrifugoPresenceResult\n *\n * This schema provides runtime validation and type inference.\n * * Presence result wrapper.\n * */\nimport { z } from 'zod'\nimport { CentrifugoClientInfoSchema } from './CentrifugoClientInfo.schema'\n\n/**\n * Presence result wrapper.\n */\nexport const CentrifugoPresenceResultSchema = z.object({\n presence: z.record(z.string(), CentrifugoClientInfoSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceResult = z.infer<typeof CentrifugoPresenceResultSchema>","/**\n * Zod schema for CentrifugoPresenceStatsRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request to get channel presence statistics.\n * */\nimport { z } from 'zod'\n\n/**\n * Request to get channel presence statistics.\n */\nexport const CentrifugoPresenceStatsRequestRequestSchema = z.object({\n channel: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceStatsRequestRequest = z.infer<typeof CentrifugoPresenceStatsRequestRequestSchema>","/**\n * Zod schema for CentrifugoPresenceStatsResponse\n *\n * This schema provides runtime validation and type inference.\n * * Channel presence stats response.\n * */\nimport { z } from 'zod'\nimport { CentrifugoErrorSchema } from './CentrifugoError.schema'\nimport { CentrifugoPresenceStatsResultSchema } from './CentrifugoPresenceStatsResult.schema'\n\n/**\n * Channel presence stats response.\n */\nexport const CentrifugoPresenceStatsResponseSchema = z.object({\n error: CentrifugoErrorSchema.optional(),\n result: CentrifugoPresenceStatsResultSchema.optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceStatsResponse = z.infer<typeof CentrifugoPresenceStatsResponseSchema>","/**\n * Zod schema for CentrifugoPresenceStatsResult\n *\n * This schema provides runtime validation and type inference.\n * * Presence stats result.\n * */\nimport { z } from 'zod'\n\n/**\n * Presence stats result.\n */\nexport const CentrifugoPresenceStatsResultSchema = z.object({\n num_clients: z.int(),\n num_users: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type CentrifugoPresenceStatsResult = z.infer<typeof CentrifugoPresenceStatsResultSchema>","/**\n * Zod schema for ChannelList\n *\n * This schema provides runtime validation and type inference.\n * * List of channel statistics.\n * */\nimport { z } from 'zod'\nimport { ChannelStatsSchema } from './ChannelStats.schema'\n\n/**\n * List of channel statistics.\n */\nexport const ChannelListSchema = z.object({\n channels: z.array(ChannelStatsSchema),\n total_channels: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ChannelList = z.infer<typeof ChannelListSchema>","/**\n * Zod schema for ChannelStats\n *\n * This schema provides runtime validation and type inference.\n * * Statistics per channel.\n * */\nimport { z } from 'zod'\n\n/**\n * Statistics per channel.\n */\nexport const ChannelStatsSchema = z.object({\n channel: z.string(),\n total: z.int(),\n successful: z.int(),\n failed: z.int(),\n avg_duration_ms: z.number(),\n avg_acks: z.number(),\n last_activity_at: z.string().nullable(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ChannelStats = z.infer<typeof ChannelStatsSchema>","/**\n * Zod schema for ConnectionTokenResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response model for Centrifugo connection token.\n * */\nimport { z } from 'zod'\n\n/**\n * Response model for Centrifugo connection token.\n */\nexport const ConnectionTokenResponseSchema = z.object({\n token: z.string(),\n centrifugo_url: z.string(),\n expires_at: z.string(),\n channels: z.array(z.string()),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ConnectionTokenResponse = z.infer<typeof ConnectionTokenResponseSchema>","/**\n * Zod schema for ManualAckRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request model for manual ACK sending.\n * */\nimport { z } from 'zod'\n\n/**\n * Request model for manual ACK sending.\n */\nexport const ManualAckRequestRequestSchema = z.object({\n message_id: z.string(),\n client_id: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ManualAckRequestRequest = z.infer<typeof ManualAckRequestRequestSchema>","/**\n * Zod schema for ManualAckResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response model for manual ACK.\n * */\nimport { z } from 'zod'\n\n/**\n * Response model for manual ACK.\n */\nexport const ManualAckResponseSchema = z.object({\n success: z.boolean(),\n message_id: z.string(),\n error: z.string().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type ManualAckResponse = z.infer<typeof ManualAckResponseSchema>","/**\n * Zod schema for PaginatedPublishList\n *\n * This schema provides runtime validation and type inference.\n * */\nimport { z } from 'zod'\nimport { PublishSchema } from './Publish.schema'\n\nexport const PaginatedPublishListSchema = z.object({\n count: z.int(),\n page: z.int(),\n pages: z.int(),\n page_size: z.int(),\n has_next: z.boolean(),\n has_previous: z.boolean(),\n next_page: z.int().nullable().optional(),\n previous_page: z.int().nullable().optional(),\n results: z.array(PublishSchema),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PaginatedPublishList = z.infer<typeof PaginatedPublishListSchema>","/**\n * Zod schema for Publish\n *\n * This schema provides runtime validation and type inference.\n * * Single publish item for DRF pagination.\n * */\nimport { z } from 'zod'\n\n/**\n * Single publish item for DRF pagination.\n */\nexport const PublishSchema = z.object({\n message_id: z.string(),\n channel: z.string(),\n status: z.string(),\n wait_for_ack: z.boolean(),\n acks_received: z.int(),\n acks_expected: z.int().nullable(),\n duration_ms: z.number().nullable(),\n created_at: z.iso.datetime(),\n completed_at: z.iso.datetime().nullable(),\n error_code: z.string().nullable(),\n error_message: z.string().nullable(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type Publish = z.infer<typeof PublishSchema>","/**\n * Zod schema for PublishTestRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request model for test message publishing.\n * */\nimport { z } from 'zod'\n\n/**\n * Request model for test message publishing.\n */\nexport const PublishTestRequestRequestSchema = z.object({\n channel: z.string(),\n data: z.record(z.string(), z.any()),\n wait_for_ack: z.boolean().optional(),\n ack_timeout: z.int().min(1.0).max(60.0).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PublishTestRequestRequest = z.infer<typeof PublishTestRequestRequestSchema>","/**\n * Zod schema for PublishTestResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response model for test message publishing.\n * */\nimport { z } from 'zod'\n\n/**\n * Response model for test message publishing.\n */\nexport const PublishTestResponseSchema = z.object({\n success: z.boolean(),\n message_id: z.string(),\n channel: z.string(),\n acks_received: z.int().optional(),\n delivered: z.boolean().optional(),\n error: z.string().nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type PublishTestResponse = z.infer<typeof PublishTestResponseSchema>","/**\n * Zod schema for TimelineItem\n *\n * This schema provides runtime validation and type inference.\n * * Single timeline data point for DRF.\n * */\nimport { z } from 'zod'\n\n/**\n * Single timeline data point for DRF.\n */\nexport const TimelineItemSchema = z.object({\n timestamp: z.string(),\n count: z.int(),\n successful: z.int(),\n failed: z.int(),\n timeout: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TimelineItem = z.infer<typeof TimelineItemSchema>","/**\n * Zod schema for TimelineResponse\n *\n * This schema provides runtime validation and type inference.\n * * Timeline response with hourly/daily breakdown for DRF.\n * */\nimport { z } from 'zod'\nimport { TimelineItemSchema } from './TimelineItem.schema'\n\n/**\n * Timeline response with hourly/daily breakdown for DRF.\n */\nexport const TimelineResponseSchema = z.object({\n timeline: z.array(TimelineItemSchema),\n period_hours: z.int(),\n interval: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type TimelineResponse = z.infer<typeof TimelineResponseSchema>","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Admin API\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { CentrifugoChannelsRequestRequestSchema, type CentrifugoChannelsRequestRequest } from '../schemas/CentrifugoChannelsRequestRequest.schema'\nimport { CentrifugoChannelsResponseSchema, type CentrifugoChannelsResponse } from '../schemas/CentrifugoChannelsResponse.schema'\nimport { CentrifugoHistoryRequestRequestSchema, type CentrifugoHistoryRequestRequest } from '../schemas/CentrifugoHistoryRequestRequest.schema'\nimport { CentrifugoHistoryResponseSchema, type CentrifugoHistoryResponse } from '../schemas/CentrifugoHistoryResponse.schema'\nimport { CentrifugoInfoResponseSchema, type CentrifugoInfoResponse } from '../schemas/CentrifugoInfoResponse.schema'\nimport { CentrifugoPresenceRequestRequestSchema, type CentrifugoPresenceRequestRequest } from '../schemas/CentrifugoPresenceRequestRequest.schema'\nimport { CentrifugoPresenceResponseSchema, type CentrifugoPresenceResponse } from '../schemas/CentrifugoPresenceResponse.schema'\nimport { CentrifugoPresenceStatsRequestRequestSchema, type CentrifugoPresenceStatsRequestRequest } from '../schemas/CentrifugoPresenceStatsRequestRequest.schema'\nimport { CentrifugoPresenceStatsResponseSchema, type CentrifugoPresenceStatsResponse } from '../schemas/CentrifugoPresenceStatsResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get connection token for dashboard\n *\n * @method POST\n * @path /cfg/centrifugo/server/auth/token/\n */\nexport async function createCentrifugoServerAuthTokenCreate( client?: any\n): Promise<any> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerAuthTokenCreate()\n return response\n}\n\n\n/**\n * List active channels\n *\n * @method POST\n * @path /cfg/centrifugo/server/channels/\n */\nexport async function createCentrifugoServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?: any\n): Promise<CentrifugoChannelsResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerChannelsCreate(data)\n try {\n return CentrifugoChannelsResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerChannelsCreate\\nPath: /cfg/centrifugo/server/channels/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerChannelsCreate',\n path: '/cfg/centrifugo/server/channels/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get channel history\n *\n * @method POST\n * @path /cfg/centrifugo/server/history/\n */\nexport async function createCentrifugoServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?: any\n): Promise<CentrifugoHistoryResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerHistoryCreate(data)\n try {\n return CentrifugoHistoryResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerHistoryCreate\\nPath: /cfg/centrifugo/server/history/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerHistoryCreate',\n path: '/cfg/centrifugo/server/history/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get Centrifugo server info\n *\n * @method POST\n * @path /cfg/centrifugo/server/info/\n */\nexport async function createCentrifugoServerInfoCreate( client?: any\n): Promise<CentrifugoInfoResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerInfoCreate()\n try {\n return CentrifugoInfoResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerInfoCreate\\nPath: /cfg/centrifugo/server/info/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerInfoCreate',\n path: '/cfg/centrifugo/server/info/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get channel presence\n *\n * @method POST\n * @path /cfg/centrifugo/server/presence/\n */\nexport async function createCentrifugoServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?: any\n): Promise<CentrifugoPresenceResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerPresenceCreate(data)\n try {\n return CentrifugoPresenceResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerPresenceCreate\\nPath: /cfg/centrifugo/server/presence/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerPresenceCreate',\n path: '/cfg/centrifugo/server/presence/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get channel presence statistics\n *\n * @method POST\n * @path /cfg/centrifugo/server/presence-stats/\n */\nexport async function createCentrifugoServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?: any\n): Promise<CentrifugoPresenceStatsResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_admin_api.centrifugoServerPresenceStatsCreate(data)\n try {\n return CentrifugoPresenceStatsResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoServerPresenceStatsCreate\\nPath: /cfg/centrifugo/server/presence-stats/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoServerPresenceStatsCreate',\n path: '/cfg/centrifugo/server/presence-stats/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Auth\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { ConnectionTokenResponseSchema, type ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get Centrifugo connection token\n *\n * @method GET\n * @path /cfg/centrifugo/auth/token/\n */\nexport async function getCentrifugoAuthTokenRetrieve( client?: any\n): Promise<ConnectionTokenResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_auth.tokenRetrieve()\n try {\n return ConnectionTokenResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoAuthTokenRetrieve\\nPath: /cfg/centrifugo/auth/token/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoAuthTokenRetrieve',\n path: '/cfg/centrifugo/auth/token/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Monitoring\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { CentrifugoHealthCheckSchema, type CentrifugoHealthCheck } from '../schemas/CentrifugoHealthCheck.schema'\nimport { CentrifugoOverviewStatsSchema, type CentrifugoOverviewStats } from '../schemas/CentrifugoOverviewStats.schema'\nimport { ChannelListSchema, type ChannelList } from '../schemas/ChannelList.schema'\nimport { PaginatedPublishListSchema, type PaginatedPublishList } from '../schemas/PaginatedPublishList.schema'\nimport { TimelineResponseSchema, type TimelineResponse } from '../schemas/TimelineResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Get channel statistics\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/channels/\n */\nexport async function getCentrifugoMonitorChannelsRetrieve( params?: { hours?: number }, client?: any\n): Promise<ChannelList> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorChannelsRetrieve(params?.hours)\n try {\n return ChannelListSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorChannelsRetrieve\\nPath: /cfg/centrifugo/monitor/channels/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorChannelsRetrieve',\n path: '/cfg/centrifugo/monitor/channels/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get Centrifugo health status\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/health/\n */\nexport async function getCentrifugoMonitorHealthRetrieve( client?: any\n): Promise<CentrifugoHealthCheck> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorHealthRetrieve()\n try {\n return CentrifugoHealthCheckSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorHealthRetrieve\\nPath: /cfg/centrifugo/monitor/health/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorHealthRetrieve',\n path: '/cfg/centrifugo/monitor/health/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get overview statistics\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/overview/\n */\nexport async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?: number }, client?: any\n): Promise<CentrifugoOverviewStats> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours)\n try {\n return CentrifugoOverviewStatsSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorOverviewRetrieve\\nPath: /cfg/centrifugo/monitor/overview/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorOverviewRetrieve',\n path: '/cfg/centrifugo/monitor/overview/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get recent publishes\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/publishes/\n */\nexport async function getCentrifugoMonitorPublishesList( params?: { channel?: string; page?: number; page_size?: number; status?: string }, client?: any\n): Promise<PaginatedPublishList> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorPublishesList(params?.channel, params?.page, params?.page_size, params?.status)\n try {\n return PaginatedPublishListSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorPublishesList\\nPath: /cfg/centrifugo/monitor/publishes/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorPublishesList',\n path: '/cfg/centrifugo/monitor/publishes/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get publish timeline\n *\n * @method GET\n * @path /cfg/centrifugo/monitor/timeline/\n */\nexport async function getCentrifugoMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any\n): Promise<TimelineResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval)\n try {\n return TimelineResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getCentrifugoMonitorTimelineRetrieve\\nPath: /cfg/centrifugo/monitor/timeline/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getCentrifugoMonitorTimelineRetrieve',\n path: '/cfg/centrifugo/monitor/timeline/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Centrifugo Testing\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { ManualAckRequestRequestSchema, type ManualAckRequestRequest } from '../schemas/ManualAckRequestRequest.schema'\nimport { ManualAckResponseSchema, type ManualAckResponse } from '../schemas/ManualAckResponse.schema'\nimport { PublishTestRequestRequestSchema, type PublishTestRequestRequest } from '../schemas/PublishTestRequestRequest.schema'\nimport { PublishTestResponseSchema, type PublishTestResponse } from '../schemas/PublishTestResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Publish test message\n *\n * @method POST\n * @path /cfg/centrifugo/testing/publish-test/\n */\nexport async function createCentrifugoTestingPublishTestCreate( data: PublishTestRequestRequest, client?: any\n): Promise<PublishTestResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_testing.publishTestCreate(data)\n try {\n return PublishTestResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoTestingPublishTestCreate\\nPath: /cfg/centrifugo/testing/publish-test/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoTestingPublishTestCreate',\n path: '/cfg/centrifugo/testing/publish-test/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Publish with database logging\n *\n * @method POST\n * @path /cfg/centrifugo/testing/publish-with-logging/\n */\nexport async function createCentrifugoTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: any\n): Promise<PublishTestResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_testing.publishWithLoggingCreate(data)\n try {\n return PublishTestResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoTestingPublishWithLoggingCreate\\nPath: /cfg/centrifugo/testing/publish-with-logging/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoTestingPublishWithLoggingCreate',\n path: '/cfg/centrifugo/testing/publish-with-logging/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Send manual ACK\n *\n * @method POST\n * @path /cfg/centrifugo/testing/send-ack/\n */\nexport async function createCentrifugoTestingSendAckCreate( data: ManualAckRequestRequest, client?: any\n): Promise<ManualAckResponse> {\n const api = client || getAPIInstance()\n const response = await api.centrifugo_testing.sendAckCreate(data)\n try {\n return ManualAckResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createCentrifugoTestingSendAckCreate\\nPath: /cfg/centrifugo/testing/send-ack/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createCentrifugoTestingSendAckCreate',\n path: '/cfg/centrifugo/testing/send-ack/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * API Logger with Consola\n * Beautiful console logging for API requests and responses\n *\n * Installation:\n * npm install consola\n */\n\nimport { type ConsolaInstance, createConsola } from 'consola';\n\n/**\n * Request log data\n */\nexport interface RequestLog {\n method: string;\n url: string;\n headers?: Record<string, string>;\n body?: any;\n timestamp: number;\n}\n\n/**\n * Response log data\n */\nexport interface ResponseLog {\n status: number;\n statusText: string;\n data?: any;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Error log data\n */\nexport interface ErrorLog {\n message: string;\n statusCode?: number;\n fieldErrors?: Record<string, string[]>;\n duration: number;\n timestamp: number;\n}\n\n/**\n * Logger configuration\n */\nexport interface LoggerConfig {\n /** Enable logging */\n enabled: boolean;\n /** Log requests */\n logRequests: boolean;\n /** Log responses */\n logResponses: boolean;\n /** Log errors */\n logErrors: boolean;\n /** Log request/response bodies */\n logBodies: boolean;\n /** Log headers (excluding sensitive ones) */\n logHeaders: boolean;\n /** Custom consola instance */\n consola?: ConsolaInstance;\n}\n\n/**\n * Default logger configuration\n */\nconst DEFAULT_CONFIG: LoggerConfig = {\n enabled: process.env.NODE_ENV !== 'production',\n logRequests: true,\n logResponses: true,\n logErrors: true,\n logBodies: true,\n logHeaders: false,\n};\n\n/**\n * Sensitive header names to filter out\n */\nconst SENSITIVE_HEADERS = [\n 'authorization',\n 'cookie',\n 'set-cookie',\n 'x-api-key',\n 'x-csrf-token',\n];\n\n/**\n * API Logger class\n */\nexport class APILogger {\n private config: LoggerConfig;\n private consola: ConsolaInstance;\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.consola = config.consola || createConsola({\n level: this.config.enabled ? 4 : 0,\n });\n }\n\n /**\n * Enable logging\n */\n enable(): void {\n this.config.enabled = true;\n }\n\n /**\n * Disable logging\n */\n disable(): void {\n this.config.enabled = false;\n }\n\n /**\n * Update configuration\n */\n setConfig(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Filter sensitive headers\n */\n private filterHeaders(headers?: Record<string, string>): Record<string, string> {\n if (!headers) return {};\n\n const filtered: Record<string, string> = {};\n Object.keys(headers).forEach((key) => {\n const lowerKey = key.toLowerCase();\n if (SENSITIVE_HEADERS.includes(lowerKey)) {\n filtered[key] = '***';\n } else {\n filtered[key] = headers[key] || '';\n }\n });\n\n return filtered;\n }\n\n /**\n * Log request\n */\n logRequest(request: RequestLog): void {\n if (!this.config.enabled || !this.config.logRequests) return;\n\n const { method, url, headers, body } = request;\n\n this.consola.start(`${method} ${url}`);\n\n if (this.config.logHeaders && headers) {\n this.consola.debug('Headers:', this.filterHeaders(headers));\n }\n\n if (this.config.logBodies && body) {\n this.consola.debug('Body:', body);\n }\n }\n\n /**\n * Log response\n */\n logResponse(request: RequestLog, response: ResponseLog): void {\n if (!this.config.enabled || !this.config.logResponses) return;\n\n const { method, url } = request;\n const { status, statusText, data, duration } = response;\n\n const statusColor = status >= 500 ? 'red'\n : status >= 400 ? 'yellow'\n : status >= 300 ? 'cyan'\n : 'green';\n\n this.consola.success(\n `${method} ${url} ${status} ${statusText} (${duration}ms)`\n );\n\n if (this.config.logBodies && data) {\n this.consola.debug('Response:', data);\n }\n }\n\n /**\n * Log error\n */\n logError(request: RequestLog, error: ErrorLog): void {\n if (!this.config.enabled || !this.config.logErrors) return;\n\n const { method, url } = request;\n const { message, statusCode, fieldErrors, duration } = error;\n\n this.consola.error(\n `${method} ${url} ${statusCode || 'Network'} Error (${duration}ms)`\n );\n\n this.consola.error('Message:', message);\n\n if (fieldErrors && Object.keys(fieldErrors).length > 0) {\n this.consola.error('Field Errors:');\n Object.entries(fieldErrors).forEach(([field, errors]) => {\n errors.forEach((err) => {\n this.consola.error(` • ${field}: ${err}`);\n });\n });\n }\n }\n\n /**\n * Log general info\n */\n info(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.info(message, ...args);\n }\n\n /**\n * Log warning\n */\n warn(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.warn(message, ...args);\n }\n\n /**\n * Log error\n */\n error(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.error(message, ...args);\n }\n\n /**\n * Log debug\n */\n debug(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.debug(message, ...args);\n }\n\n /**\n * Log success\n */\n success(message: string, ...args: any[]): void {\n if (!this.config.enabled) return;\n this.consola.success(message, ...args);\n }\n\n /**\n * Create a sub-logger with prefix\n */\n withTag(tag: string): ConsolaInstance {\n return this.consola.withTag(tag);\n }\n}\n\n/**\n * Default logger instance\n */\nexport const defaultLogger = new APILogger();","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Retry Configuration and Utilities\n *\n * Provides automatic retry logic for failed HTTP requests using p-retry.\n * Retries only on network errors and server errors (5xx), not client errors (4xx).\n */\n\nimport pRetry, { AbortError } from 'p-retry';\nimport { APIError, NetworkError } from './errors';\n\n/**\n * Information about a failed retry attempt.\n */\nexport interface FailedAttemptInfo {\n /** The error that caused the failure */\n error: Error;\n /** The attempt number (1-indexed) */\n attemptNumber: number;\n /** Number of retries left */\n retriesLeft: number;\n}\n\n/**\n * Retry configuration options.\n *\n * Uses exponential backoff with jitter by default to avoid thundering herd.\n */\nexport interface RetryConfig {\n /**\n * Maximum number of retry attempts.\n * @default 3\n */\n retries?: number;\n\n /**\n * Exponential backoff factor.\n * @default 2\n */\n factor?: number;\n\n /**\n * Minimum wait time between retries (ms).\n * @default 1000\n */\n minTimeout?: number;\n\n /**\n * Maximum wait time between retries (ms).\n * @default 60000\n */\n maxTimeout?: number;\n\n /**\n * Add randomness to wait times (jitter).\n * Helps avoid thundering herd problem.\n * @default true\n */\n randomize?: boolean;\n\n /**\n * Callback called on each failed attempt.\n */\n onFailedAttempt?: (info: FailedAttemptInfo) => void;\n}\n\n/**\n * Default retry configuration.\n */\nexport const DEFAULT_RETRY_CONFIG: Required<RetryConfig> = {\n retries: 3,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 60000,\n randomize: true,\n onFailedAttempt: () => {},\n};\n\n/**\n * Determine if an error should trigger a retry.\n *\n * Retries on:\n * - Network errors (connection refused, timeout, etc.)\n * - Server errors (5xx status codes)\n * - Rate limiting (429 status code)\n *\n * Does NOT retry on:\n * - Client errors (4xx except 429)\n * - Authentication errors (401, 403)\n * - Not found (404)\n *\n * @param error - The error to check\n * @returns true if should retry, false otherwise\n */\nexport function shouldRetry(error: any): boolean {\n // Always retry network errors\n if (error instanceof NetworkError) {\n return true;\n }\n\n // For API errors, check status code\n if (error instanceof APIError) {\n const status = error.statusCode;\n\n // Retry on 5xx server errors\n if (status >= 500 && status < 600) {\n return true;\n }\n\n // Retry on 429 (rate limit)\n if (status === 429) {\n return true;\n }\n\n // Do NOT retry on 4xx client errors\n return false;\n }\n\n // Retry on unknown errors (might be network issues)\n return true;\n}\n\n/**\n * Wrap a function with retry logic.\n *\n * @param fn - Async function to retry\n * @param config - Retry configuration\n * @returns Result of the function\n *\n * @example\n * ```typescript\n * const result = await withRetry(\n * async () => fetch('https://api.example.com/users'),\n * { retries: 5, minTimeout: 2000 }\n * );\n * ```\n */\nexport async function withRetry<T>(\n fn: () => Promise<T>,\n config?: RetryConfig\n): Promise<T> {\n const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };\n\n return pRetry(\n async () => {\n try {\n return await fn();\n } catch (error) {\n // Check if we should retry this error\n if (!shouldRetry(error)) {\n // Abort retry immediately for non-retryable errors\n throw new AbortError(error as Error);\n }\n\n // Re-throw error to trigger retry\n throw error;\n }\n },\n {\n retries: finalConfig.retries,\n factor: finalConfig.factor,\n minTimeout: finalConfig.minTimeout,\n maxTimeout: finalConfig.maxTimeout,\n randomize: finalConfig.randomize,\n onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {\n // Adapt p-retry's FailedAttemptError to our FailedAttemptInfo\n const pRetryError = error as any; // p-retry's internal type\n finalConfig.onFailedAttempt!({\n error: pRetryError as Error,\n attemptNumber: pRetryError.attemptNumber,\n retriesLeft: pRetryError.retriesLeft,\n });\n } : undefined,\n }\n );\n}","/**\n * Zod schema for SendPushRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request serializer for sending push notifications.\n * */\nimport { z } from 'zod'\n\n/**\n * Request serializer for sending push notifications.\n */\nexport const SendPushRequestRequestSchema = z.object({\n title: z.string().min(1).max(255),\n body: z.string().min(1),\n icon: z.union([z.url(), z.literal('')]).nullable().optional(),\n url: z.union([z.url(), z.literal('')]).nullable().optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SendPushRequestRequest = z.infer<typeof SendPushRequestRequestSchema>","/**\n * Zod schema for SendPushResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for send push endpoint.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for send push endpoint.\n */\nexport const SendPushResponseSchema = z.object({\n success: z.boolean(),\n sent_to: z.int(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SendPushResponse = z.infer<typeof SendPushResponseSchema>","/**\n * Zod schema for SubscribeRequestRequest\n *\n * This schema provides runtime validation and type inference.\n * * Request serializer for subscribing to push notifications.\n * */\nimport { z } from 'zod'\n\n/**\n * Request serializer for subscribing to push notifications.\n */\nexport const SubscribeRequestRequestSchema = z.object({\n endpoint: z.union([z.url(), z.literal('')]),\n keys: z.record(z.string(), z.string().min(1)),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SubscribeRequestRequest = z.infer<typeof SubscribeRequestRequestSchema>","/**\n * Zod schema for SubscribeResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for subscription endpoint.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for subscription endpoint.\n */\nexport const SubscribeResponseSchema = z.object({\n success: z.boolean(),\n subscription_id: z.int(),\n created: z.boolean(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type SubscribeResponse = z.infer<typeof SubscribeResponseSchema>","/**\n * Zod schema for VapidPublicKeyResponse\n *\n * This schema provides runtime validation and type inference.\n * * Response serializer for VAPID public key endpoint.\n * */\nimport { z } from 'zod'\n\n/**\n * Response serializer for VAPID public key endpoint.\n */\nexport const VapidPublicKeyResponseSchema = z.object({\n publicKey: z.string(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type VapidPublicKeyResponse = z.infer<typeof VapidPublicKeyResponseSchema>","// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed fetchers for Web Push\n *\n * Universal functions that work in any environment:\n * - Next.js (App Router / Pages Router / Server Components)\n * - React Native\n * - Node.js backend\n *\n * These fetchers use Zod schemas for runtime validation.\n *\n * Usage:\n * ```typescript\n * // Configure API once (in your app entry point)\n * import { configureAPI } from '../../api-instance'\n * configureAPI({ baseUrl: 'https://api.example.com' })\n *\n * // Then use fetchers anywhere\n * const users = await getUsers({ page: 1 })\n *\n * // With SWR\n * const { data } = useSWR(['users', params], () => getUsers(params))\n *\n * // With React Query\n * const { data } = useQuery(['users', params], () => getUsers(params))\n *\n * // In Server Component or SSR (pass custom client)\n * import { API } from '../../index'\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\nimport { consola } from 'consola'\nimport { SendPushRequestRequestSchema, type SendPushRequestRequest } from '../schemas/SendPushRequestRequest.schema'\nimport { SendPushResponseSchema, type SendPushResponse } from '../schemas/SendPushResponse.schema'\nimport { SubscribeRequestRequestSchema, type SubscribeRequestRequest } from '../schemas/SubscribeRequestRequest.schema'\nimport { SubscribeResponseSchema, type SubscribeResponse } from '../schemas/SubscribeResponse.schema'\nimport { VapidPublicKeyResponseSchema, type VapidPublicKeyResponse } from '../schemas/VapidPublicKeyResponse.schema'\nimport { getAPIInstance } from '../../api-instance'\n\n/**\n * Send push notification\n *\n * @method POST\n * @path /cfg/webpush/send/\n */\nexport async function createWebpushSendCreate( data: SendPushRequestRequest, client?: any\n): Promise<SendPushResponse> {\n const api = client || getAPIInstance()\n const response = await api.web_push.webpushSendCreate(data)\n try {\n return SendPushResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createWebpushSendCreate\\nPath: /cfg/webpush/send/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createWebpushSendCreate',\n path: '/cfg/webpush/send/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Subscribe to push notifications\n *\n * @method POST\n * @path /cfg/webpush/subscribe/\n */\nexport async function createWebpushSubscribeCreate( data: SubscribeRequestRequest, client?: any\n): Promise<SubscribeResponse> {\n const api = client || getAPIInstance()\n const response = await api.web_push.webpushSubscribeCreate(data)\n try {\n return SubscribeResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`createWebpushSubscribeCreate\\nPath: /cfg/webpush/subscribe/\\nMethod: POST`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'createWebpushSubscribeCreate',\n path: '/cfg/webpush/subscribe/',\n method: 'POST',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n/**\n * Get VAPID public key\n *\n * @method GET\n * @path /cfg/webpush/vapid/\n */\nexport async function getWebpushVapidRetrieve( client?: any\n): Promise<VapidPublicKeyResponse> {\n const api = client || getAPIInstance()\n const response = await api.web_push.webpushVapidRetrieve()\n try {\n return VapidPublicKeyResponseSchema.parse(response)\n } catch (error) {\n // Zod validation error - log detailed information\n consola.error('❌ Zod Validation Failed');\n consola.box(`getWebpushVapidRetrieve\\nPath: /cfg/webpush/vapid/\\nMethod: GET`);\n\n if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {\n consola.error('Validation Issues:');\n (error as any).issues.forEach((issue: any, index: number) => {\n consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);\n consola.error(` ├─ Message: ${issue.message}`);\n if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);\n if (issue.received) consola.error(` └─ Received: ${issue.received}`);\n });\n }\n\n consola.error('Response data:', response);\n\n // Dispatch browser CustomEvent (only if window is defined)\n if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {\n try {\n const event = new CustomEvent('zod-validation-error', {\n detail: {\n operation: 'getWebpushVapidRetrieve',\n path: '/cfg/webpush/vapid/',\n method: 'GET',\n error: error,\n response: response,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n });\n window.dispatchEvent(event);\n } catch (eventError) {\n // Silently fail - event dispatch should never crash the app\n consola.warn('Failed to dispatch validation error event:', eventError);\n }\n }\n\n // Re-throw the error\n throw error;\n }\n}\n\n\n","/**\n * @djangocfg/api - Shared API Package\n *\n * Core authentication API (cfg_accounts only).\n * Extensions are now in separate packages:\n * - @djangocfg/ext-support\n * - @djangocfg/ext-payments\n * - etc.\n */\n\n// ============================================================================\n// Main API from cfg_accounts (authentication)\n// ============================================================================\nexport * from './generated/cfg_accounts';\nexport { API, LocalStorageAdapter, MemoryStorageAdapter } from './generated/cfg_accounts';\nexport { Schemas, Fetchers, Enums } from './generated/cfg_accounts';\n\n// ============================================================================\n// CFG Accounts Type Namespace\n// ============================================================================\nexport * as CfgAccountsTypes from './generated/cfg_accounts';\n\n// ============================================================================\n// Centrifugo Fetchers (for WebSocket token refresh)\n// ============================================================================\nexport { getCentrifugoAuthTokenRetrieve } from './generated/cfg_centrifugo';\n\n// ============================================================================\n// WebPush API (for push notifications)\n// ============================================================================\nexport { API as WebPushAPI } from './generated/cfg_webpush';\nexport * as WebPushTypes from './generated/cfg_webpush';\n\n/**\n * Base Client for all API services\n *\n * Provides:\n * - Centralized API instance with JWT token management\n * - LocalStorage adapter for browser environments\n * - Singleton pattern for API client\n */\n\nimport { API, LocalStorageAdapter } from './generated/cfg_accounts';\n\n/**\n * Singleton API instance with JWT token management\n * Uses LocalStorage for token persistence\n */\nconst isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';\nconst apiUrl = isStaticBuild ? '' : process.env.NEXT_PUBLIC_API_URL || '';\n\nconst api = new API(\n apiUrl,\n {\n storage: new LocalStorageAdapter()\n }\n);\n\n/**\n * Base Client Class\n *\n * Service classes can extend this to access api instance\n */\nexport class BaseClient {\n protected static api = api;\n}\n\n/**\n * Export API instance for direct access\n */\nexport { api };\n","import { createConsola } from 'consola';\n\n/**\n * Universal logger for @djangocfg/api/auth\n * Uses consola for beautiful console logging\n *\n * Log levels:\n * - 0: silent\n * - 1: fatal, error\n * - 2: warn\n * - 3: log, info\n * - 4: debug\n * - 5: trace, verbose\n */\nconst isDevelopment = process.env.NODE_ENV === 'development';\nconst isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';\nconst showLogs = isDevelopment || isStaticBuild;\n\nexport const logger = createConsola({\n level: showLogs ? 4 : 1, // dev: debug, production: errors only\n}).withTag('api');\n\n/**\n * Auth-specific logger\n */\nexport const authLogger = logger.withTag('auth');\n\nexport default logger;\n","/**\n * Token Auto-Refresh Middleware\n *\n * Automatically refreshes access token when receiving 401 responses.\n * Implements request queuing to prevent multiple simultaneous refresh attempts.\n */\n\nimport { api as apiAccounts } from '../../';\nimport { authLogger } from '../utils/logger';\n\n// Refresh state management\nlet isRefreshing = false;\nlet refreshSubscribers: Array<(token: string | null) => void> = [];\n\n/**\n * Subscribe to token refresh completion\n */\nfunction subscribeTokenRefresh(callback: (token: string | null) => void): void {\n refreshSubscribers.push(callback);\n}\n\n/**\n * Notify all subscribers when token is refreshed\n */\nfunction onTokenRefreshed(token: string | null): void {\n refreshSubscribers.forEach(callback => callback(token));\n refreshSubscribers = [];\n}\n\n/**\n * Attempt to refresh the access token using the refresh token\n * @returns New access token or null if refresh failed\n */\nexport async function refreshAccessToken(): Promise<string | null> {\n // If already refreshing, wait for completion\n if (isRefreshing) {\n return new Promise(resolve => {\n subscribeTokenRefresh(token => resolve(token));\n });\n }\n\n isRefreshing = true;\n authLogger.info('Starting token refresh...');\n\n try {\n const refreshToken = apiAccounts.getRefreshToken();\n if (!refreshToken) {\n authLogger.warn('No refresh token available for refresh');\n onTokenRefreshed(null);\n return null;\n }\n\n // Use generated API client with correct URL (/cfg/accounts/token/refresh/)\n const result = await apiAccounts.auth.accountsTokenRefreshCreate({\n refresh: refreshToken,\n });\n\n const newAccessToken = result.access;\n\n if (!newAccessToken) {\n authLogger.error('Token refresh response missing access token');\n onTokenRefreshed(null);\n return null;\n }\n\n // Update tokens in storage\n apiAccounts.setToken(newAccessToken, refreshToken);\n authLogger.info('Token refreshed successfully');\n\n onTokenRefreshed(newAccessToken);\n return newAccessToken;\n } catch (error) {\n authLogger.error('Token refresh error:', error);\n onTokenRefreshed(null);\n return null;\n } finally {\n isRefreshing = false;\n }\n}\n\n/**\n * Check if a response indicates an authentication error\n */\nexport function isAuthenticationError(response: Response): boolean {\n return response.status === 401;\n}\n\n/**\n * Create a fetch wrapper that automatically refreshes tokens on 401\n *\n * @param originalFetch - The original fetch function to wrap\n * @returns Wrapped fetch function with auto-refresh capability\n */\nexport function createAutoRefreshFetch(originalFetch: typeof fetch): typeof fetch {\n return async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n // Make the initial request\n let response = await originalFetch(input, init);\n\n // If 401 and we have a refresh token, try to refresh\n if (isAuthenticationError(response) && apiAccounts.getRefreshToken()) {\n authLogger.info('Received 401, attempting token refresh...');\n\n const newToken = await refreshAccessToken();\n\n if (newToken) {\n // Retry the request with new token\n const newInit: RequestInit = {\n ...init,\n headers: {\n ...init?.headers,\n Authorization: `Bearer ${newToken}`,\n },\n };\n\n authLogger.info('Retrying request with new token...');\n response = await originalFetch(input, newInit);\n } else {\n authLogger.warn('Token refresh failed, returning original 401 response');\n }\n }\n\n return response;\n };\n}\n\n/**\n * Check if token is about to expire (within threshold)\n * @param thresholdMs - Time in ms before expiry to consider \"expiring soon\"\n * @returns true if token expires within threshold\n */\nexport function isTokenExpiringSoon(thresholdMs: number = 5 * 60 * 1000): boolean {\n const token = apiAccounts.getToken();\n if (!token) return false;\n\n try {\n // Decode JWT payload (base64)\n const payload = JSON.parse(atob(token.split('.')[1]));\n const expiresAt = payload.exp * 1000; // Convert to milliseconds\n const now = Date.now();\n const timeUntilExpiry = expiresAt - now;\n\n return timeUntilExpiry < thresholdMs;\n } catch (error) {\n authLogger.error('Error checking token expiry:', error);\n return false;\n }\n}\n\n/**\n * Proactively refresh token if it's expiring soon\n * Call this periodically or before important operations\n */\nexport async function refreshIfExpiringSoon(thresholdMs: number = 5 * 60 * 1000): Promise<void> {\n if (isTokenExpiringSoon(thresholdMs)) {\n authLogger.info('Token expiring soon, proactively refreshing...');\n await refreshAccessToken();\n }\n}\n"],"mappings":";;;;AAAA,SAAsB,oBAAoB;AAMnC,SAAS,gBAAgB,SAAsB;AACpD,QAAM,EAAE,UAAU,OAAO,IAAI,QAAQ;AACrC,QAAMA,UAAS,QAAQ,IAAI;AAG3B,MAAI,SAAS,WAAW,SAAS,GAAG;AAClC,UAAM,YAAY,GAAGA,OAAM,GAAG,QAAQ,GAAG,MAAM;AAC/C,WAAO,aAAa,QAAQ,WAAW,EAAE,SAAS,EAAE,SAAS,QAAQ,QAAQ,EAAE,CAAC;AAAA,EAClF;AAGA,MAAI,SAAS,WAAW,OAAO,GAAG;AAChC,UAAM,YAAY,GAAGA,OAAM,GAAG,QAAQ,GAAG,MAAM;AAC/C,WAAO,aAAa,QAAQ,WAAW,EAAE,SAAS,EAAE,SAAS,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ACP,GAAG,MAAM;AAAA,YACT,eAAe,UAAU,QAAQ;AAAA,UACnC;AAAA,QACF;AAEA,mBAAW,KAAK,oCAAoC;AACpD,mBAAW,MAAM,cAAc,OAAO,OAAO;AAAA,MAC/C,OAAO;AACL,mBAAW,KAAK,uDAAuD;AAAA,MACzE;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AACF;AA9BgB;AAqCT,SAAS,oBAAoB,cAAsB,IAAI,KAAK,KAAe;AAChF,QAAM,QAAQ,IAAY,SAAS;AACnC,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI;AAEF,UAAM,UAAU,KAAK,MAAM,KAAK,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;AACpD,UAAM,YAAY,QAAQ,MAAM;AAChC,UAAM,MAAM,KAAK,IAAI;AACrB,UAAM,kBAAkB,YAAY;AAEpC,WAAO,kBAAkB;AAAA,EAC3B,SAAS,OAAO;AACd,eAAW,MAAM,gCAAgC,KAAK;AACtD,WAAO;AAAA,EACT;AACF;AAhBgB;AAsBhB,eAAsB,sBAAsB,cAAsB,IAAI,KAAK,KAAqB;AAC9F,MAAI,oBAAoB,WAAW,GAAG;AACpC,eAAW,KAAK,gDAAgD;AAChE,UAAM,mBAAmB;AAAA,EAC3B;AACF;AALsB;","names":["apiUrl","logger","OAuthConnectionProvider","OAuthDisconnectRequestRequestProvider","OTPRequestRequestChannel","OTPVerifyRequestChannel","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","consola","consola","consola","logger","createConsola","DEFAULT_CONFIG","SENSITIVE_HEADERS","APILogger","createConsola","defaultLogger","pRetry","AbortError","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","consola","consola","consola","consola","createConsola","DEFAULT_CONFIG","SENSITIVE_HEADERS","APILogger","createConsola","defaultLogger","pRetry","AbortError","z","z","z","z","z","consola","createConsola","isStaticBuild"]}
|