@djangocfg/api 2.1.234 → 2.1.235
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 +0 -1
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +0 -1
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +0 -1
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +0 -1
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/auth/utils/env.ts +1 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/_api/generated/cfg_accounts/index.ts","../src/_api/generated/cfg_accounts/accounts__auth/client.ts","../src/_api/generated/cfg_accounts/accounts__auth/models.ts","../src/_api/generated/cfg_accounts/accounts__oauth/client.ts","../src/_api/generated/cfg_accounts/accounts__oauth/models.ts","../src/_api/generated/cfg_accounts/accounts__user_profile/client.ts","../src/_api/generated/cfg_accounts/accounts__user_profile/models.ts","../src/_api/generated/cfg_accounts/accounts/client.ts","../src/_api/generated/cfg_accounts/accounts/models.ts","../src/_api/generated/cfg_accounts/http.ts","../src/_api/generated/cfg_accounts/errors.ts","../src/_api/generated/cfg_accounts/logger.ts","../src/_api/generated/cfg_accounts/retry.ts","../src/_api/generated/cfg_accounts/client.ts","../src/_api/generated/cfg_accounts/storage.ts","../src/_api/generated/cfg_accounts/enums.ts","../src/_api/generated/cfg_accounts/_utils/schemas/index.ts","../src/_api/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/User.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts","../src/_api/generated/cfg_accounts/validation-events.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/index.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts.ts","../src/_api/generated/cfg_accounts/api-instance.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts","../src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts","../src/_api/generated/cfg_centrifugo/http.ts","../src/_api/generated/cfg_centrifugo/errors.ts","../src/_api/generated/cfg_centrifugo/logger.ts","../src/_api/generated/cfg_centrifugo/retry.ts","../src/_api/generated/cfg_centrifugo/client.ts","../src/_api/generated/cfg_centrifugo/storage.ts","../src/_api/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts","../src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts","../src/_api/generated/cfg_centrifugo/api-instance.ts","../src/_api/generated/cfg_centrifugo/index.ts","../src/index.ts"],"sourcesContent":["// @ts-nocheck\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, KeepAliveFetchAdapter } 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\n/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language */\nfunction detectLocale(): string | null {\n try {\n if (typeof document !== 'undefined') {\n const match = document.cookie.match(/(?:^|;\\s*)NEXT_LOCALE=([^;]*)/);\n if (match) return match[1];\n }\n if (typeof navigator !== 'undefined' && navigator.language) {\n return navigator.language;\n }\n } catch {}\n return null;\n}\n\nexport interface APIOptions {\n /** Custom storage adapter (defaults to LocalStorageAdapter) */\n storage?: StorageAdapter;\n /** Custom HTTP client adapter (defaults to FetchAdapter) */\n httpClient?: HttpClientAdapter;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** Logger configuration */\n loggerConfig?: Partial<LoggerConfig>;\n /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */\n locale?: string;\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 _locale: 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._locale = options?.locale || null;\n\n this._loadTokensFromStorage();\n\n // Initialize APIClient with token getter for URL authentication\n this._client = new APIClient(this.baseUrl, {\n httpClient: this.options?.httpClient,\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 httpClient: this.options?.httpClient,\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 locale = this._locale || detectLocale();\n const mergedOptions = {\n ...options,\n headers: {\n ...(options?.headers || {}),\n ...(token ? { 'Authorization': `Bearer ${token}` } : {}),\n ...(locale ? { 'Accept-Language': locale } : {}),\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 * Set locale for Accept-Language header\n * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear\n */\n setLocale(locale: string | null): void {\n this._locale = locale;\n }\n\n /**\n * Get current locale\n */\n getLocale(): string | null {\n return this._locale;\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;","// @ts-nocheck\nimport * 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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * \n * Request model (no read-only fields).\n */\nexport interface TokenRefreshRequest {\n refresh: string;\n}\n\n/**\n * \n * Response model (includes read-only fields).\n */\nexport interface TokenRefresh {\n access: string;\n refresh: string;\n}\n\n","// @ts-nocheck\nimport * 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 as any).results || 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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\nimport * as Enums from \"../enums\";\n\n/**\n * Response with available OAuth providers.\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthProvidersResponse {\n /** List of available OAuth providers */\n providers: Array<Record<string, any>>;\n}\n\n/**\n * Request to disconnect OAuth provider.\n * \n * Request model (no read-only fields).\n */\nexport interface OAuthDisconnectRequestRequest {\n /** OAuth provider to disconnect\n\n * `github` - GitHub */\n provider: Enums.OAuthConnectionProvider;\n}\n\n/**\n * Error response for OAuth endpoints.\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthError {\n /** Error code */\n error: string;\n /** Human-readable error description */\n error_description?: string;\n}\n\n/**\n * Request to start OAuth flow.\n * \n * Request model (no read-only fields).\n */\nexport interface OAuthAuthorizeRequestRequest {\n /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */\n redirect_uri?: string;\n /** Optional source URL for registration tracking */\n source_url?: string;\n}\n\n/**\n * Response with JWT tokens after OAuth authentication. When 2FA is required: -\n * requires_2fa: True - session_id: UUID of 2FA verification session -\n * access/refresh/user: null When 2FA is not required: - requires_2fa: False -\n * session_id: null - access/refresh/user: populated\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthTokenResponse {\n /** True if 2FA verification is required */\n requires_2fa?: boolean;\n /** 2FA session ID (only when requires_2fa=True) */\n session_id?: string | null;\n /** JWT access token (null when requires_2fa=True) */\n access?: string | null;\n /** JWT refresh token (null when requires_2fa=True) */\n refresh?: string | null;\n /** Authenticated user info (null when requires_2fa=True) */\n user?: Record<string, any> | null;\n /** True if a new user was created during this OAuth flow */\n is_new_user: boolean;\n /** True if a new OAuth connection was created */\n is_new_connection: boolean;\n /** True if user should be prompted to enable 2FA */\n should_prompt_2fa?: boolean;\n}\n\n/**\n * Serializer for OAuth connection info (user-facing).\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthConnection {\n id: number;\n /** OAuth provider name (github, google, etc.)\n\n * `github` - GitHub */\n provider: Enums.OAuthConnectionProvider;\n provider_display: string;\n /** Username on the OAuth provider platform */\n provider_username: string;\n /** Email from OAuth provider (may differ from user.email) */\n provider_email: string;\n /** Avatar URL from OAuth provider */\n provider_avatar_url: string;\n /** When this OAuth connection was created */\n connected_at: string;\n /** Last time this OAuth connection was used for login */\n last_login_at: string;\n}\n\n/**\n * Response with OAuth authorization URL.\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthAuthorizeResponse {\n /** Full URL to redirect user to OAuth provider */\n authorization_url: string;\n /** State token for CSRF protection. Store this and verify on callback. */\n state: string;\n}\n\n/**\n * Request to complete OAuth flow (callback handler).\n * \n * Request model (no read-only fields).\n */\nexport interface OAuthCallbackRequestRequest {\n /** Authorization code from OAuth provider callback */\n code: string;\n /** State token for CSRF verification (from authorize response) */\n state: string;\n /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */\n redirect_uri?: string;\n}\n\n","// @ts-nocheck\nimport * 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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Serializer for updating user profile.\n * \n * Request model (no read-only fields).\n */\nexport interface PatchedUserProfileUpdateRequest {\n first_name?: string;\n last_name?: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n}\n\n/**\n * Serializer for user details.\n * \n * Response model (includes read-only fields).\n */\nexport interface User {\n id: number;\n email: string;\n first_name?: string;\n last_name?: string;\n /** Get user's full name. */\n full_name: string;\n /** Get user's initials for avatar fallback. */\n initials: string;\n /** Get formatted username for display. */\n display_username: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n avatar?: string | null;\n /** Designates whether the user can log into this admin site. */\n is_staff: boolean;\n /** Designates that this user has all permissions without explicitly assigning them. */\n is_superuser: boolean;\n date_joined: string;\n last_login?: string | null;\n unanswered_messages_count: number;\n centrifugo: CentrifugoToken | null;\n}\n\n/**\n * Response serializer for account deletion.\n * \n * Response model (includes read-only fields).\n */\nexport interface AccountDeleteResponse {\n /** Whether the account was successfully deleted */\n success: boolean;\n /** Human-readable message about the deletion */\n message: string;\n}\n\n/**\n * Serializer for updating user profile.\n * \n * Request model (no read-only fields).\n */\nexport interface UserProfileUpdateRequest {\n first_name?: string;\n last_name?: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n}\n\n/**\n * \n * Request model (no read-only fields).\n */\nexport interface CfgAccountsProfileAvatarCreateRequest {\n /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */\n avatar: File | Blob;\n}\n\n/**\n * Nested serializer for Centrifugo WebSocket connection token.\n * \n * Response model (includes read-only fields).\n */\nexport interface CentrifugoToken {\n /** JWT token for Centrifugo WebSocket connection */\n token: string;\n /** Centrifugo WebSocket URL */\n centrifugo_url: string;\n /** Token expiration time (ISO 8601) */\n expires_at: string;\n /** List of allowed channels for this user */\n channels: Array<string>;\n}\n\n","// @ts-nocheck\nimport * 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.\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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Serializer for OTP verification.\n * \n * Request model (no read-only fields).\n */\nexport interface OTPVerifyRequest {\n /** Email address used for OTP request */\n identifier: string;\n otp: string;\n /** Source URL for tracking login (e.g., https://my.djangocfg.com) */\n source_url?: string;\n}\n\n/**\n * OTP request response.\n * \n * Response model (includes read-only fields).\n */\nexport interface OTPRequestResponse {\n /** Success message */\n message: string;\n}\n\n/**\n * Typed error response for OTP operations. error_code values: -\n * invalid_identifier — malformed email - cooldown — too soon after last\n * request (retry_after = seconds) - hourly_limit — hourly quota exceeded\n * (retry_after = seconds until reset) - daily_limit — daily quota exceeded\n * (retry_after = seconds until reset) - rate_limited — IP-level rate limit hit\n * (no retry_after) - user_creation_failed — internal error creating account -\n * send_failed — transport error (email / SMS) - internal_error — unexpected\n * server error\n * \n * Response model (includes read-only fields).\n */\nexport interface OTPErrorResponse {\n /** Human-readable error message */\n error: string;\n /** Machine-readable error code */\n error_code?: string | null;\n /** Seconds until the client may retry (present only for rate-limit errors) */\n retry_after?: number | null;\n}\n\n/**\n * Serializer for OTP request.\n * \n * Request model (no read-only fields).\n */\nexport interface OTPRequestRequest {\n /** Email address for OTP delivery */\n identifier: string;\n /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */\n source_url?: string;\n}\n\n/**\n * OTP verification response. When 2FA is required: - requires_2fa: True -\n * session_id: UUID of 2FA verification session - refresh/access/user: null\n * When 2FA is not required: - requires_2fa: False - session_id: null -\n * refresh/access/user: populated\n * \n * Response model (includes read-only fields).\n */\nexport interface OTPVerifyResponse {\n /** Whether 2FA verification is required */\n requires_2fa?: boolean;\n /** 2FA session ID (if requires_2fa is True) */\n session_id?: string | null;\n /** JWT refresh token (if requires_2fa is False) */\n refresh?: string | null;\n /** JWT access token (if requires_2fa is False) */\n access?: string | null;\n user?: User | null;\n /** Whether user should be prompted to enable 2FA */\n should_prompt_2fa?: boolean;\n}\n\n/**\n * Serializer for user details.\n * \n * Response model (includes read-only fields).\n */\nexport interface User {\n id: number;\n email: string;\n first_name?: string;\n last_name?: string;\n /** Get user's full name. */\n full_name: string;\n /** Get user's initials for avatar fallback. */\n initials: string;\n /** Get formatted username for display. */\n display_username: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n avatar?: string | null;\n /** Designates whether the user can log into this admin site. */\n is_staff: boolean;\n /** Designates that this user has all permissions without explicitly assigning them. */\n is_superuser: boolean;\n date_joined: string;\n last_login?: string | null;\n unanswered_messages_count: number;\n centrifugo: CentrifugoToken | null;\n}\n\n/**\n * Nested serializer for Centrifugo WebSocket connection token.\n * \n * Response model (includes read-only fields).\n */\nexport interface CentrifugoToken {\n /** JWT token for Centrifugo WebSocket connection */\n token: string;\n /** Centrifugo WebSocket URL */\n centrifugo_url: string;\n /** Token expiration time (ISO 8601) */\n expires_at: string;\n /** List of allowed channels for this user */\n channels: Array<string>;\n}\n\n","// @ts-nocheck\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}\n\n/**\n * FetchAdapter with keepalive:true.\n *\n * Use this adapter when you need requests to survive page unload\n * (visibilitychange / beforeunload) — the browser will complete the request\n * even after the page is navigated away. Typical use: monitor / analytics flush.\n *\n * @example\n * ```typescript\n * import { APIClient, KeepAliveFetchAdapter } from './client';\n * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() });\n * ```\n */\nexport class KeepAliveFetchAdapter extends FetchAdapter {\n async request<T = any>(request: HttpRequest): Promise<HttpResponse<T>> {\n const origFetch = globalThis.fetch;\n globalThis.fetch = (input: RequestInfo | URL, init?: RequestInit) =>\n origFetch(input, { ...init, keepalive: true });\n try {\n return await super.request<T>(request);\n } finally {\n globalThis.fetch = origFetch;\n }\n }\n}","// @ts-nocheck\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}","// @ts-nocheck\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();","// @ts-nocheck\n// 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 // Classify network error using PerformanceResourceTiming.\n // Browser intentionally makes CORS errors indistinguishable from network failures\n // (same TypeError: \"Failed to fetch\") for security reasons. We use PerformanceResourceTiming\n // as the best available heuristic:\n // - Entry exists with responseStatus === 0 → request reached server, JS blocked → likely CORS\n // - No entry / entry missing → connection never established → server unavailable / DNS / offline\n // All cases are dispatched as 'network-error' with a `possibly_cors` flag.\n let possiblyCors = false;\n if (error instanceof TypeError && typeof window !== 'undefined') {\n try {\n const isCrossOrigin = (() => {\n try { return new URL(url).origin !== window.location.origin; } catch { return false; }\n })();\n if (isCrossOrigin) {\n const entries = performance.getEntriesByName(url, 'resource');\n if (entries.length > 0) {\n const last = entries[entries.length - 1] as PerformanceResourceTiming;\n possiblyCors = 'responseStatus' in last && (last as any).responseStatus === 0;\n }\n }\n } catch { /* ignore — PerformanceResourceTiming not available */ }\n }\n\n if (this.logger) {\n this.logger.error(`⚠️ Network Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n if (possiblyCors) {\n this.logger.error(` → Possibly blocked by CORS policy (configure CORS on the server)`);\n }\n }\n\n // Dispatch network-error event with possibly_cors hint\n if (typeof window !== 'undefined') {\n try {\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 possibly_cors: possiblyCors,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n } catch { /* silently ignore — event dispatch must never crash the app */ }\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","// @ts-nocheck\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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * OAuth provider to disconnect\n * * `github` - GitHub\n */\nexport enum OAuthConnectionProvider {\n GITHUB = \"github\",\n}\n\n","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Zod Schemas - Runtime validation and type inference\n *\n * Auto-generated from OpenAPI specification.\n * Provides runtime validation for API requests and responses.\n *\n * Usage:\n * ```typescript\n * import { UserSchema } from './schemas'\n *\n * // Validate data\n * const user = UserSchema.parse(data)\n *\n * // Type inference\n * type User = z.infer<typeof UserSchema>\n * ```\n */\n\nexport * from './AccountDeleteResponse.schema'\nexport * from './CentrifugoToken.schema'\nexport * from './CfgAccountsProfileAvatarCreateRequest.schema'\nexport * from './OAuthAuthorizeRequestRequest.schema'\nexport * from './OAuthAuthorizeResponse.schema'\nexport * from './OAuthCallbackRequestRequest.schema'\nexport * from './OAuthConnection.schema'\nexport * from './OAuthDisconnectRequestRequest.schema'\nexport * from './OAuthError.schema'\nexport * from './OAuthProvidersResponse.schema'\nexport * from './OAuthTokenResponse.schema'\nexport * from './OTPErrorResponse.schema'\nexport * from './OTPRequestRequest.schema'\nexport * from './OTPRequestResponse.schema'\nexport * from './OTPVerifyRequest.schema'\nexport * from './OTPVerifyResponse.schema'\nexport * from './PatchedUserProfileUpdateRequest.schema'\nexport * from './TokenRefresh.schema'\nexport * from './TokenRefreshRequest.schema'\nexport * from './User.schema'\nexport * from './UserProfileUpdateRequest.schema'\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.string(),\n expires_at: z.string().datetime({ offset: true }),\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.string().optional(),\n source_url: z.string().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.string(),\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.string().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.number().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.string(),\n connected_at: z.string().datetime({ offset: true }),\n last_login_at: z.string().datetime({ offset: true }),\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.OAuthConnectionProvider),\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 * * Typed error response for OTP operations.\n\nerror_code values:\n - invalid_identifier — malformed email\n - cooldown — too soon after last request (retry_after = seconds)\n - hourly_limit — hourly quota exceeded (retry_after = seconds until reset)\n - daily_limit — daily quota exceeded (retry_after = seconds until reset)\n - rate_limited — IP-level rate limit hit (no retry_after)\n - user_creation_failed — internal error creating account\n - send_failed — transport error (email / SMS)\n - internal_error — unexpected server error\n * */\nimport { z } from 'zod'\n\n/**\n * Typed error response for OTP operations.\n\nerror_code values:\n - invalid_identifier — malformed email\n - cooldown — too soon after last request (retry_after = seconds)\n - hourly_limit — hourly quota exceeded (retry_after = seconds until reset)\n - daily_limit — daily quota exceeded (retry_after = seconds until reset)\n - rate_limited — IP-level rate limit hit (no retry_after)\n - user_creation_failed — internal error creating account\n - send_failed — transport error (email / SMS)\n - internal_error — unexpected server error\n */\nexport const OTPErrorResponseSchema = z.object({\n error: z.string(),\n error_code: z.string().nullable().optional(),\n retry_after: z.number().int().nullable().optional(),\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'\n\n/**\n * Serializer for OTP request.\n */\nexport const OTPRequestRequestSchema = z.object({\n identifier: z.string().min(1),\n source_url: z.string().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'\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 source_url: z.string().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.number().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 language: z.string().max(10).optional(),\n avatar: z.string().nullable(),\n is_staff: z.boolean(),\n is_superuser: z.boolean(),\n date_joined: z.string().datetime({ offset: true }),\n last_login: z.string().datetime({ offset: true }).nullable(),\n unanswered_messages_count: z.number().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 language: z.string().max(10).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 language: z.string().max(10).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type UserProfileUpdateRequest = z.infer<typeof UserProfileUpdateRequestSchema>","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Zod Validation Events - Browser CustomEvent integration\n *\n * Dispatches browser CustomEvents when Zod validation fails, allowing\n * React/frontend apps to listen and handle validation errors globally.\n *\n * @example\n * ```typescript\n * // In your React app\n * window.addEventListener('zod-validation-error', (event) => {\n * const { operation, path, method, error, response } = event.detail;\n * console.error(`Validation failed for ${method} ${path}`, error);\n * // Show toast notification, log to Sentry, etc.\n * });\n * ```\n */\n\nimport type { ZodError } from 'zod'\n\n/**\n * Validation error event detail\n */\nexport interface ValidationErrorDetail {\n /** Operation/function name that failed validation */\n operation: string\n /** API endpoint path */\n path: string\n /** HTTP method */\n method: string\n /** Zod validation error */\n error: ZodError\n /** Raw response data that failed validation */\n response: any\n /** Timestamp of the error */\n timestamp: Date\n}\n\n/**\n * Custom event type for Zod validation errors\n */\nexport type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>\n\n/**\n * Dispatch a Zod validation error event.\n *\n * Only dispatches in browser environment (when window is defined).\n * Safe to call in Node.js/SSR - will be a no-op.\n *\n * @param detail - Validation error details\n */\nexport function dispatchValidationError(detail: ValidationErrorDetail): void {\n // Check if running in browser\n if (typeof window === 'undefined') {\n return\n }\n\n try {\n const event = new CustomEvent<ValidationErrorDetail>('zod-validation-error', {\n detail,\n bubbles: true,\n cancelable: false,\n })\n\n window.dispatchEvent(event)\n } catch (error) {\n // Silently fail - validation event dispatch should never crash the app\n console.warn('Failed to dispatch validation error event:', error)\n }\n}\n\n/**\n * Add a global listener for Zod validation errors.\n *\n * @param callback - Function to call when validation error occurs\n * @returns Cleanup function to remove the listener\n *\n * @example\n * ```typescript\n * const cleanup = onValidationError(({ operation, error }) => {\n * toast.error(`Validation failed in ${operation}`);\n * logToSentry(error);\n * });\n *\n * // Later, remove listener\n * cleanup();\n * ```\n */\nexport function onValidationError(\n callback: (detail: ValidationErrorDetail) => void\n): () => void {\n if (typeof window === 'undefined') {\n // Return no-op cleanup function for SSR\n return () => {}\n }\n\n const handler = (event: Event) => {\n if (event instanceof CustomEvent) {\n callback(event.detail)\n }\n }\n\n window.addEventListener('zod-validation-error', handler)\n\n // Return cleanup function\n return () => {\n window.removeEventListener('zod-validation-error', handler)\n }\n}\n\n/**\n * Format Zod error for logging/display.\n *\n * @param error - Zod validation error\n * @returns Formatted error message\n */\nexport function formatZodError(error: ZodError): string {\n const issues = error.issues.map((issue, index) => {\n const path = issue.path.join('.') || 'root'\n const parts = [`${index + 1}. ${path}: ${issue.message}`]\n\n if ('expected' in issue && issue.expected) {\n parts.push(` Expected: ${issue.expected}`)\n }\n\n if ('received' in issue && issue.received) {\n parts.push(` Received: ${issue.received}`)\n }\n\n return parts.join('\\n')\n })\n\n return issues.join('\\n')\n}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed Fetchers - Universal API functions\n *\n * Auto-generated from OpenAPI specification.\n * These functions work in any JavaScript environment.\n *\n * Features:\n * - Runtime validation with Zod\n * - Type-safe parameters and responses\n * - Works with any data-fetching library (SWR, React Query, etc)\n * - Server Component compatible\n *\n * Usage:\n * ```typescript\n * import * as fetchers from './fetchers'\n *\n * // Direct usage\n * const user = await fetchers.getUser(1)\n *\n * // With SWR\n * const { data } = useSWR('user-1', () => fetchers.getUser(1))\n *\n * // With React Query\n * const { data } = useQuery(['user', 1], () => fetchers.getUser(1))\n * ```\n */\n\nexport * from './accounts'\nexport * from './accounts__auth'\nexport * from './accounts__oauth'\nexport * from './accounts__user_profile'\n","// @ts-nocheck\n// 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","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Global API Instance - Singleton configuration with auto-configuration support\n *\n * This module provides a global API instance that auto-configures from\n * environment variables or can be configured manually.\n *\n * AUTO-CONFIGURATION (recommended):\n * Set one of these environment variables and the API will auto-configure:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n *\n * Then just use fetchers and hooks directly:\n * ```typescript\n * import { getUsers } from './_utils/fetchers'\n * const users = await getUsers({ page: 1 })\n * ```\n *\n * MANUAL CONFIGURATION:\n * ```typescript\n * import { configureAPI } from './api-instance'\n *\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'your-jwt-token'\n * })\n * ```\n *\n * For SSR or multiple instances:\n * ```typescript\n * import { API } from './index'\n * import { getUsers } from './_utils/fetchers'\n *\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\n\nimport { API, type APIOptions } from './index'\n\nlet globalAPI: API | null = null\nlet autoConfigAttempted = false\n\n/**\n * Auto-configure from environment variable if available (Next.js pattern)\n * This allows hooks and fetchers to work without explicit configureAPI() call\n *\n * Supported environment variables:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n */\nfunction tryAutoConfigureFromEnv(): void {\n // Only attempt once\n if (autoConfigAttempted) return\n autoConfigAttempted = true\n\n // Skip if already configured\n if (globalAPI) return\n\n // Skip if process is not available (pure browser without bundler)\n if (typeof process === 'undefined' || !process.env) return\n\n // Try different environment variable patterns\n const baseUrl =\n process.env.NEXT_PUBLIC_API_URL ||\n process.env.VITE_API_URL ||\n process.env.REACT_APP_API_URL ||\n process.env.API_URL\n\n if (baseUrl) {\n globalAPI = new API(baseUrl)\n }\n}\n\n/**\n * Get the global API instance\n * Auto-configures from environment variables on first call if not manually configured.\n * @throws Error if API is not configured and no env variable is set\n */\nexport function getAPIInstance(): API {\n // Try auto-configuration on first access (lazy initialization)\n tryAutoConfigureFromEnv()\n\n if (!globalAPI) {\n throw new Error(\n 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\\n\\n' +\n 'Example:\\n' +\n ' import { configureAPI } from \"./api-instance\"\\n' +\n ' configureAPI({ baseUrl: \"https://api.example.com\" })\\n\\n' +\n 'Or set environment variable: NEXT_PUBLIC_API_URL, VITE_API_URL, or REACT_APP_API_URL'\n )\n }\n return globalAPI\n}\n\n/**\n * Check if API is configured (or can be auto-configured)\n */\nexport function isAPIConfigured(): boolean {\n tryAutoConfigureFromEnv()\n return globalAPI !== null\n}\n\n/**\n * Configure the global API instance\n *\n * @param baseUrl - Base URL for the API\n * @param options - Optional configuration (storage, retry, logger)\n *\n * @example\n * ```typescript\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'jwt-token',\n * options: {\n * retryConfig: { maxRetries: 3 },\n * loggerConfig: { enabled: true }\n * }\n * })\n * ```\n */\nexport function configureAPI(config: {\n baseUrl: string\n token?: string\n refreshToken?: string\n options?: APIOptions\n}): API {\n globalAPI = new API(config.baseUrl, config.options)\n\n if (config.token) {\n globalAPI.setToken(config.token, config.refreshToken)\n }\n\n return globalAPI\n}\n\n/**\n * Reconfigure the global API instance with new settings\n * Useful for updating tokens or base URL\n */\nexport function reconfigureAPI(updates: {\n baseUrl?: string\n token?: string\n refreshToken?: string\n}): API {\n const instance = getAPIInstance()\n\n if (updates.baseUrl) {\n instance.setBaseUrl(updates.baseUrl)\n }\n\n if (updates.token) {\n instance.setToken(updates.token, updates.refreshToken)\n }\n\n return instance\n}\n\n/**\n * Clear tokens from the global API instance\n */\nexport function clearAPITokens(): void {\n const instance = getAPIInstance()\n instance.clearTokens()\n}\n\n/**\n * Reset the global API instance\n * Useful for testing or logout scenarios\n */\nexport function resetAPI(): void {\n if (globalAPI) {\n globalAPI.clearTokens()\n }\n globalAPI = null\n}","// @ts-nocheck\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","// @ts-nocheck\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","// @ts-nocheck\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","// @ts-nocheck\nimport * as Models from \"./models\";\n\n\n/**\n * API endpoints for Centrifugo Auth.\n */\nexport class CentrifugoAuth {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Get Centrifugo connection token\n * \n * Generate JWT token for WebSocket connection to Centrifugo. Token\n * includes user's allowed channels based on their permissions. Requires\n * authentication.\n */\n async tokenRetrieve(): Promise<Models.ConnectionTokenResponse> {\n const response = await this.client.request('GET', \"/cfg/centrifugo/auth/token/\");\n return response;\n }\n\n}","// @ts-nocheck\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}\n\n/**\n * FetchAdapter with keepalive:true.\n *\n * Use this adapter when you need requests to survive page unload\n * (visibilitychange / beforeunload) — the browser will complete the request\n * even after the page is navigated away. Typical use: monitor / analytics flush.\n *\n * @example\n * ```typescript\n * import { APIClient, KeepAliveFetchAdapter } from './client';\n * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() });\n * ```\n */\nexport class KeepAliveFetchAdapter extends FetchAdapter {\n async request<T = any>(request: HttpRequest): Promise<HttpResponse<T>> {\n const origFetch = globalThis.fetch;\n globalThis.fetch = (input: RequestInfo | URL, init?: RequestInit) =>\n origFetch(input, { ...init, keepalive: true });\n try {\n return await super.request<T>(request);\n } finally {\n globalThis.fetch = origFetch;\n }\n }\n}","// @ts-nocheck\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}","// @ts-nocheck\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();","// @ts-nocheck\n// 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 { CentrifugoAuth } from \"./centrifugo__centrifugo_auth\";\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 centrifugo_auth: CentrifugoAuth;\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.centrifugo_auth = new CentrifugoAuth(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 // Classify network error using PerformanceResourceTiming.\n // Browser intentionally makes CORS errors indistinguishable from network failures\n // (same TypeError: \"Failed to fetch\") for security reasons. We use PerformanceResourceTiming\n // as the best available heuristic:\n // - Entry exists with responseStatus === 0 → request reached server, JS blocked → likely CORS\n // - No entry / entry missing → connection never established → server unavailable / DNS / offline\n // All cases are dispatched as 'network-error' with a `possibly_cors` flag.\n let possiblyCors = false;\n if (error instanceof TypeError && typeof window !== 'undefined') {\n try {\n const isCrossOrigin = (() => {\n try { return new URL(url).origin !== window.location.origin; } catch { return false; }\n })();\n if (isCrossOrigin) {\n const entries = performance.getEntriesByName(url, 'resource');\n if (entries.length > 0) {\n const last = entries[entries.length - 1] as PerformanceResourceTiming;\n possiblyCors = 'responseStatus' in last && (last as any).responseStatus === 0;\n }\n }\n } catch { /* ignore — PerformanceResourceTiming not available */ }\n }\n\n if (this.logger) {\n this.logger.error(`⚠️ Network Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n if (possiblyCors) {\n this.logger.error(` → Possibly blocked by CORS policy (configure CORS on the server)`);\n }\n }\n\n // Dispatch network-error event with possibly_cors hint\n if (typeof window !== 'undefined') {\n try {\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 possibly_cors: possiblyCors,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n } catch { /* silently ignore — event dispatch must never crash the app */ }\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","// @ts-nocheck\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}","/**\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>","// @ts-nocheck\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","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Global API Instance - Singleton configuration with auto-configuration support\n *\n * This module provides a global API instance that auto-configures from\n * environment variables or can be configured manually.\n *\n * AUTO-CONFIGURATION (recommended):\n * Set one of these environment variables and the API will auto-configure:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n *\n * Then just use fetchers and hooks directly:\n * ```typescript\n * import { getUsers } from './_utils/fetchers'\n * const users = await getUsers({ page: 1 })\n * ```\n *\n * MANUAL CONFIGURATION:\n * ```typescript\n * import { configureAPI } from './api-instance'\n *\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'your-jwt-token'\n * })\n * ```\n *\n * For SSR or multiple instances:\n * ```typescript\n * import { API } from './index'\n * import { getUsers } from './_utils/fetchers'\n *\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\n\nimport { API, type APIOptions } from './index'\n\nlet globalAPI: API | null = null\nlet autoConfigAttempted = false\n\n/**\n * Auto-configure from environment variable if available (Next.js pattern)\n * This allows hooks and fetchers to work without explicit configureAPI() call\n *\n * Supported environment variables:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n */\nfunction tryAutoConfigureFromEnv(): void {\n // Only attempt once\n if (autoConfigAttempted) return\n autoConfigAttempted = true\n\n // Skip if already configured\n if (globalAPI) return\n\n // Skip if process is not available (pure browser without bundler)\n if (typeof process === 'undefined' || !process.env) return\n\n // Try different environment variable patterns\n const baseUrl =\n process.env.NEXT_PUBLIC_API_URL ||\n process.env.VITE_API_URL ||\n process.env.REACT_APP_API_URL ||\n process.env.API_URL\n\n if (baseUrl) {\n globalAPI = new API(baseUrl)\n }\n}\n\n/**\n * Get the global API instance\n * Auto-configures from environment variables on first call if not manually configured.\n * @throws Error if API is not configured and no env variable is set\n */\nexport function getAPIInstance(): API {\n // Try auto-configuration on first access (lazy initialization)\n tryAutoConfigureFromEnv()\n\n if (!globalAPI) {\n throw new Error(\n 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\\n\\n' +\n 'Example:\\n' +\n ' import { configureAPI } from \"./api-instance\"\\n' +\n ' configureAPI({ baseUrl: \"https://api.example.com\" })\\n\\n' +\n 'Or set environment variable: NEXT_PUBLIC_API_URL, VITE_API_URL, or REACT_APP_API_URL'\n )\n }\n return globalAPI\n}\n\n/**\n * Check if API is configured (or can be auto-configured)\n */\nexport function isAPIConfigured(): boolean {\n tryAutoConfigureFromEnv()\n return globalAPI !== null\n}\n\n/**\n * Configure the global API instance\n *\n * @param baseUrl - Base URL for the API\n * @param options - Optional configuration (storage, retry, logger)\n *\n * @example\n * ```typescript\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'jwt-token',\n * options: {\n * retryConfig: { maxRetries: 3 },\n * loggerConfig: { enabled: true }\n * }\n * })\n * ```\n */\nexport function configureAPI(config: {\n baseUrl: string\n token?: string\n refreshToken?: string\n options?: APIOptions\n}): API {\n globalAPI = new API(config.baseUrl, config.options)\n\n if (config.token) {\n globalAPI.setToken(config.token, config.refreshToken)\n }\n\n return globalAPI\n}\n\n/**\n * Reconfigure the global API instance with new settings\n * Useful for updating tokens or base URL\n */\nexport function reconfigureAPI(updates: {\n baseUrl?: string\n token?: string\n refreshToken?: string\n}): API {\n const instance = getAPIInstance()\n\n if (updates.baseUrl) {\n instance.setBaseUrl(updates.baseUrl)\n }\n\n if (updates.token) {\n instance.setToken(updates.token, updates.refreshToken)\n }\n\n return instance\n}\n\n/**\n * Clear tokens from the global API instance\n */\nexport function clearAPITokens(): void {\n const instance = getAPIInstance()\n instance.clearTokens()\n}\n\n/**\n * Reset the global API instance\n * Useful for testing or logout scenarios\n */\nexport function resetAPI(): void {\n if (globalAPI) {\n globalAPI.clearTokens()\n }\n globalAPI = null\n}","// @ts-nocheck\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 { CentrifugoAuth } from \"./centrifugo__centrifugo_auth/client\";\nexport * as CentrifugoAuthTypes from \"./centrifugo__centrifugo_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\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, KeepAliveFetchAdapter } 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\n/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language */\nfunction detectLocale(): string | null {\n try {\n if (typeof document !== 'undefined') {\n const match = document.cookie.match(/(?:^|;\\s*)NEXT_LOCALE=([^;]*)/);\n if (match) return match[1];\n }\n if (typeof navigator !== 'undefined' && navigator.language) {\n return navigator.language;\n }\n } catch {}\n return null;\n}\n\nexport interface APIOptions {\n /** Custom storage adapter (defaults to LocalStorageAdapter) */\n storage?: StorageAdapter;\n /** Custom HTTP client adapter (defaults to FetchAdapter) */\n httpClient?: HttpClientAdapter;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** Logger configuration */\n loggerConfig?: Partial<LoggerConfig>;\n /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */\n locale?: string;\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 _locale: string | null = null;\n private storage: StorageAdapter;\n private options?: APIOptions;\n\n // Sub-clients\n public centrifugo_auth!: CentrifugoAuth;\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._locale = options?.locale || null;\n\n this._loadTokensFromStorage();\n\n // Initialize APIClient with token getter for URL authentication\n this._client = new APIClient(this.baseUrl, {\n httpClient: this.options?.httpClient,\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.centrifugo_auth = this._client.centrifugo_auth;\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 httpClient: this.options?.httpClient,\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.centrifugo_auth = this._client.centrifugo_auth;\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 locale = this._locale || detectLocale();\n const mergedOptions = {\n ...options,\n headers: {\n ...(options?.headers || {}),\n ...(token ? { 'Authorization': `Bearer ${token}` } : {}),\n ...(locale ? { 'Accept-Language': locale } : {}),\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 * Set locale for Accept-Language header\n * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear\n */\n setLocale(locale: string | null): void {\n this._locale = locale;\n }\n\n /**\n * Get current locale\n */\n getLocale(): string | null {\n return this._locale;\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;","/**\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 './_api/generated/cfg_accounts';\nexport { API, LocalStorageAdapter, MemoryStorageAdapter } from './_api/generated/cfg_accounts';\nexport { Schemas, Fetchers, Enums } from './_api/generated/cfg_accounts';\n\n// ============================================================================\n// CFG Accounts Type Namespace\n// ============================================================================\nexport * as CfgAccountsTypes from './_api/generated/cfg_accounts';\n\n// ============================================================================\n// Centrifugo Fetchers (for WebSocket token refresh)\n// ============================================================================\nexport { getCentrifugoAuthTokenRetrieve } from './_api/generated/cfg_centrifugo';\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 './_api/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"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAA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ACzB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,gBAAwB;AACtB,WAAO;AAAA,EACT;AACF;;;AC/QA,IAAM,gBAAgB,QAAQ,IAAI,6BAA6B;AAC/D,IAAM,SAAS,gBAAgB,KAAK,QAAQ,IAAI,uBAAuB;AAEvE,IAAM,MAAM,IAAI;AAAA,EACd;AAAA,EACA;AAAA,IACE,SAAS,IAAI,oBAAoB;AAAA,EACnC;AACF;AAOO,IAAM,aAAN,MAAiB;AAAA,EAzDxB,OAyDwB;AAAA;AAAA;AAAA,EACtB;AAAA,SAAiB,MAAM;AAAA;AACzB;","names":["models_exports","models_exports","models_exports","models_exports","OAuthConnectionProvider","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","api","consola","api","consola","consola","api","consola","consola","api","consola","FetchAdapter","APIError","NetworkError","createConsola","DEFAULT_CONFIG","SENSITIVE_HEADERS","APILogger","createConsola","defaultLogger","pRetry","AbortError","DEFAULT_RETRY_CONFIG","shouldRetry","NetworkError","APIError","withRetry","pRetry","AbortError","APIClient","FetchAdapter","APILogger","withRetry","APIError","NetworkError","LocalStorageAdapter","z","consola","globalAPI","autoConfigAttempted","tryAutoConfigureFromEnv","API","getAPIInstance","api","getAPIInstance","consola","TOKEN_KEY","REFRESH_TOKEN_KEY","detectLocale","API","APILogger","LocalStorageAdapter","APIClient"]}
|
|
1
|
+
{"version":3,"sources":["../src/_api/generated/cfg_accounts/index.ts","../src/_api/generated/cfg_accounts/accounts__auth/client.ts","../src/_api/generated/cfg_accounts/accounts__auth/models.ts","../src/_api/generated/cfg_accounts/accounts__oauth/client.ts","../src/_api/generated/cfg_accounts/accounts__oauth/models.ts","../src/_api/generated/cfg_accounts/accounts__user_profile/client.ts","../src/_api/generated/cfg_accounts/accounts__user_profile/models.ts","../src/_api/generated/cfg_accounts/accounts/client.ts","../src/_api/generated/cfg_accounts/accounts/models.ts","../src/_api/generated/cfg_accounts/http.ts","../src/_api/generated/cfg_accounts/errors.ts","../src/_api/generated/cfg_accounts/logger.ts","../src/_api/generated/cfg_accounts/retry.ts","../src/_api/generated/cfg_accounts/client.ts","../src/_api/generated/cfg_accounts/storage.ts","../src/_api/generated/cfg_accounts/enums.ts","../src/_api/generated/cfg_accounts/_utils/schemas/index.ts","../src/_api/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/User.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts","../src/_api/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts","../src/_api/generated/cfg_accounts/validation-events.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/index.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts.ts","../src/_api/generated/cfg_accounts/api-instance.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts","../src/_api/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts","../src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts","../src/_api/generated/cfg_centrifugo/http.ts","../src/_api/generated/cfg_centrifugo/errors.ts","../src/_api/generated/cfg_centrifugo/logger.ts","../src/_api/generated/cfg_centrifugo/retry.ts","../src/_api/generated/cfg_centrifugo/client.ts","../src/_api/generated/cfg_centrifugo/storage.ts","../src/_api/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts","../src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts","../src/_api/generated/cfg_centrifugo/api-instance.ts","../src/_api/generated/cfg_centrifugo/index.ts","../src/index.ts"],"sourcesContent":["// @ts-nocheck\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, KeepAliveFetchAdapter } 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\n/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language */\nfunction detectLocale(): string | null {\n try {\n if (typeof document !== 'undefined') {\n const match = document.cookie.match(/(?:^|;\\s*)NEXT_LOCALE=([^;]*)/);\n if (match) return match[1];\n }\n if (typeof navigator !== 'undefined' && navigator.language) {\n return navigator.language;\n }\n } catch {}\n return null;\n}\n\nexport interface APIOptions {\n /** Custom storage adapter (defaults to LocalStorageAdapter) */\n storage?: StorageAdapter;\n /** Custom HTTP client adapter (defaults to FetchAdapter) */\n httpClient?: HttpClientAdapter;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** Logger configuration */\n loggerConfig?: Partial<LoggerConfig>;\n /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */\n locale?: string;\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 _locale: 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._locale = options?.locale || null;\n\n this._loadTokensFromStorage();\n\n // Initialize APIClient with token getter for URL authentication\n this._client = new APIClient(this.baseUrl, {\n httpClient: this.options?.httpClient,\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 httpClient: this.options?.httpClient,\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 locale = this._locale || detectLocale();\n const mergedOptions = {\n ...options,\n headers: {\n ...(options?.headers || {}),\n ...(token ? { 'Authorization': `Bearer ${token}` } : {}),\n ...(locale ? { 'Accept-Language': locale } : {}),\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 * Set locale for Accept-Language header\n * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear\n */\n setLocale(locale: string | null): void {\n this._locale = locale;\n }\n\n /**\n * Get current locale\n */\n getLocale(): string | null {\n return this._locale;\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;","// @ts-nocheck\nimport * 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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * \n * Request model (no read-only fields).\n */\nexport interface TokenRefreshRequest {\n refresh: string;\n}\n\n/**\n * \n * Response model (includes read-only fields).\n */\nexport interface TokenRefresh {\n access: string;\n refresh: string;\n}\n\n","// @ts-nocheck\nimport * 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 as any).results || 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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\nimport * as Enums from \"../enums\";\n\n/**\n * Response with available OAuth providers.\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthProvidersResponse {\n /** List of available OAuth providers */\n providers: Array<Record<string, any>>;\n}\n\n/**\n * Request to disconnect OAuth provider.\n * \n * Request model (no read-only fields).\n */\nexport interface OAuthDisconnectRequestRequest {\n /** OAuth provider to disconnect\n\n * `github` - GitHub */\n provider: Enums.OAuthConnectionProvider;\n}\n\n/**\n * Error response for OAuth endpoints.\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthError {\n /** Error code */\n error: string;\n /** Human-readable error description */\n error_description?: string;\n}\n\n/**\n * Request to start OAuth flow.\n * \n * Request model (no read-only fields).\n */\nexport interface OAuthAuthorizeRequestRequest {\n /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */\n redirect_uri?: string;\n /** Optional source URL for registration tracking */\n source_url?: string;\n}\n\n/**\n * Response with JWT tokens after OAuth authentication. When 2FA is required: -\n * requires_2fa: True - session_id: UUID of 2FA verification session -\n * access/refresh/user: null When 2FA is not required: - requires_2fa: False -\n * session_id: null - access/refresh/user: populated\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthTokenResponse {\n /** True if 2FA verification is required */\n requires_2fa?: boolean;\n /** 2FA session ID (only when requires_2fa=True) */\n session_id?: string | null;\n /** JWT access token (null when requires_2fa=True) */\n access?: string | null;\n /** JWT refresh token (null when requires_2fa=True) */\n refresh?: string | null;\n /** Authenticated user info (null when requires_2fa=True) */\n user?: Record<string, any> | null;\n /** True if a new user was created during this OAuth flow */\n is_new_user: boolean;\n /** True if a new OAuth connection was created */\n is_new_connection: boolean;\n /** True if user should be prompted to enable 2FA */\n should_prompt_2fa?: boolean;\n}\n\n/**\n * Serializer for OAuth connection info (user-facing).\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthConnection {\n id: number;\n /** OAuth provider name (github, google, etc.)\n\n * `github` - GitHub */\n provider: Enums.OAuthConnectionProvider;\n provider_display: string;\n /** Username on the OAuth provider platform */\n provider_username: string;\n /** Email from OAuth provider (may differ from user.email) */\n provider_email: string;\n /** Avatar URL from OAuth provider */\n provider_avatar_url: string;\n /** When this OAuth connection was created */\n connected_at: string;\n /** Last time this OAuth connection was used for login */\n last_login_at: string;\n}\n\n/**\n * Response with OAuth authorization URL.\n * \n * Response model (includes read-only fields).\n */\nexport interface OAuthAuthorizeResponse {\n /** Full URL to redirect user to OAuth provider */\n authorization_url: string;\n /** State token for CSRF protection. Store this and verify on callback. */\n state: string;\n}\n\n/**\n * Request to complete OAuth flow (callback handler).\n * \n * Request model (no read-only fields).\n */\nexport interface OAuthCallbackRequestRequest {\n /** Authorization code from OAuth provider callback */\n code: string;\n /** State token for CSRF verification (from authorize response) */\n state: string;\n /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */\n redirect_uri?: string;\n}\n\n","// @ts-nocheck\nimport * 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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Serializer for updating user profile.\n * \n * Request model (no read-only fields).\n */\nexport interface PatchedUserProfileUpdateRequest {\n first_name?: string;\n last_name?: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n}\n\n/**\n * Serializer for user details.\n * \n * Response model (includes read-only fields).\n */\nexport interface User {\n id: number;\n email: string;\n first_name?: string;\n last_name?: string;\n /** Get user's full name. */\n full_name: string;\n /** Get user's initials for avatar fallback. */\n initials: string;\n /** Get formatted username for display. */\n display_username: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n avatar?: string | null;\n /** Designates whether the user can log into this admin site. */\n is_staff: boolean;\n /** Designates that this user has all permissions without explicitly assigning them. */\n is_superuser: boolean;\n date_joined: string;\n last_login?: string | null;\n unanswered_messages_count: number;\n centrifugo: CentrifugoToken | null;\n}\n\n/**\n * Response serializer for account deletion.\n * \n * Response model (includes read-only fields).\n */\nexport interface AccountDeleteResponse {\n /** Whether the account was successfully deleted */\n success: boolean;\n /** Human-readable message about the deletion */\n message: string;\n}\n\n/**\n * Serializer for updating user profile.\n * \n * Request model (no read-only fields).\n */\nexport interface UserProfileUpdateRequest {\n first_name?: string;\n last_name?: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n}\n\n/**\n * \n * Request model (no read-only fields).\n */\nexport interface CfgAccountsProfileAvatarCreateRequest {\n /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */\n avatar: File | Blob;\n}\n\n/**\n * Nested serializer for Centrifugo WebSocket connection token.\n * \n * Response model (includes read-only fields).\n */\nexport interface CentrifugoToken {\n /** JWT token for Centrifugo WebSocket connection */\n token: string;\n /** Centrifugo WebSocket URL */\n centrifugo_url: string;\n /** Token expiration time (ISO 8601) */\n expires_at: string;\n /** List of allowed channels for this user */\n channels: Array<string>;\n}\n\n","// @ts-nocheck\nimport * 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.\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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Serializer for OTP verification.\n * \n * Request model (no read-only fields).\n */\nexport interface OTPVerifyRequest {\n /** Email address used for OTP request */\n identifier: string;\n otp: string;\n /** Source URL for tracking login (e.g., https://my.djangocfg.com) */\n source_url?: string;\n}\n\n/**\n * OTP request response.\n * \n * Response model (includes read-only fields).\n */\nexport interface OTPRequestResponse {\n /** Success message */\n message: string;\n}\n\n/**\n * Typed error response for OTP operations. error_code values: -\n * invalid_identifier — malformed email - cooldown — too soon after last\n * request (retry_after = seconds) - hourly_limit — hourly quota exceeded\n * (retry_after = seconds until reset) - daily_limit — daily quota exceeded\n * (retry_after = seconds until reset) - rate_limited — IP-level rate limit hit\n * (no retry_after) - user_creation_failed — internal error creating account -\n * send_failed — transport error (email / SMS) - internal_error — unexpected\n * server error\n * \n * Response model (includes read-only fields).\n */\nexport interface OTPErrorResponse {\n /** Human-readable error message */\n error: string;\n /** Machine-readable error code */\n error_code?: string | null;\n /** Seconds until the client may retry (present only for rate-limit errors) */\n retry_after?: number | null;\n}\n\n/**\n * Serializer for OTP request.\n * \n * Request model (no read-only fields).\n */\nexport interface OTPRequestRequest {\n /** Email address for OTP delivery */\n identifier: string;\n /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */\n source_url?: string;\n}\n\n/**\n * OTP verification response. When 2FA is required: - requires_2fa: True -\n * session_id: UUID of 2FA verification session - refresh/access/user: null\n * When 2FA is not required: - requires_2fa: False - session_id: null -\n * refresh/access/user: populated\n * \n * Response model (includes read-only fields).\n */\nexport interface OTPVerifyResponse {\n /** Whether 2FA verification is required */\n requires_2fa?: boolean;\n /** 2FA session ID (if requires_2fa is True) */\n session_id?: string | null;\n /** JWT refresh token (if requires_2fa is False) */\n refresh?: string | null;\n /** JWT access token (if requires_2fa is False) */\n access?: string | null;\n user?: User | null;\n /** Whether user should be prompted to enable 2FA */\n should_prompt_2fa?: boolean;\n}\n\n/**\n * Serializer for user details.\n * \n * Response model (includes read-only fields).\n */\nexport interface User {\n id: number;\n email: string;\n first_name?: string;\n last_name?: string;\n /** Get user's full name. */\n full_name: string;\n /** Get user's initials for avatar fallback. */\n initials: string;\n /** Get formatted username for display. */\n display_username: string;\n company?: string;\n phone?: string;\n position?: string;\n language?: string;\n avatar?: string | null;\n /** Designates whether the user can log into this admin site. */\n is_staff: boolean;\n /** Designates that this user has all permissions without explicitly assigning them. */\n is_superuser: boolean;\n date_joined: string;\n last_login?: string | null;\n unanswered_messages_count: number;\n centrifugo: CentrifugoToken | null;\n}\n\n/**\n * Nested serializer for Centrifugo WebSocket connection token.\n * \n * Response model (includes read-only fields).\n */\nexport interface CentrifugoToken {\n /** JWT token for Centrifugo WebSocket connection */\n token: string;\n /** Centrifugo WebSocket URL */\n centrifugo_url: string;\n /** Token expiration time (ISO 8601) */\n expires_at: string;\n /** List of allowed channels for this user */\n channels: Array<string>;\n}\n\n","// @ts-nocheck\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}\n\n/**\n * FetchAdapter with keepalive:true.\n *\n * Use this adapter when you need requests to survive page unload\n * (visibilitychange / beforeunload) — the browser will complete the request\n * even after the page is navigated away. Typical use: monitor / analytics flush.\n *\n * @example\n * ```typescript\n * import { APIClient, KeepAliveFetchAdapter } from './client';\n * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() });\n * ```\n */\nexport class KeepAliveFetchAdapter extends FetchAdapter {\n async request<T = any>(request: HttpRequest): Promise<HttpResponse<T>> {\n const origFetch = globalThis.fetch;\n globalThis.fetch = (input: RequestInfo | URL, init?: RequestInit) =>\n origFetch(input, { ...init, keepalive: true });\n try {\n return await super.request<T>(request);\n } finally {\n globalThis.fetch = origFetch;\n }\n }\n}","// @ts-nocheck\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}","// @ts-nocheck\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();","// @ts-nocheck\n// 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 // Classify network error using PerformanceResourceTiming.\n // Browser intentionally makes CORS errors indistinguishable from network failures\n // (same TypeError: \"Failed to fetch\") for security reasons. We use PerformanceResourceTiming\n // as the best available heuristic:\n // - Entry exists with responseStatus === 0 → request reached server, JS blocked → likely CORS\n // - No entry / entry missing → connection never established → server unavailable / DNS / offline\n // All cases are dispatched as 'network-error' with a `possibly_cors` flag.\n let possiblyCors = false;\n if (error instanceof TypeError && typeof window !== 'undefined') {\n try {\n const isCrossOrigin = (() => {\n try { return new URL(url).origin !== window.location.origin; } catch { return false; }\n })();\n if (isCrossOrigin) {\n const entries = performance.getEntriesByName(url, 'resource');\n if (entries.length > 0) {\n const last = entries[entries.length - 1] as PerformanceResourceTiming;\n possiblyCors = 'responseStatus' in last && (last as any).responseStatus === 0;\n }\n }\n } catch { /* ignore — PerformanceResourceTiming not available */ }\n }\n\n if (this.logger) {\n this.logger.error(`⚠️ Network Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n if (possiblyCors) {\n this.logger.error(` → Possibly blocked by CORS policy (configure CORS on the server)`);\n }\n }\n\n // Dispatch network-error event with possibly_cors hint\n if (typeof window !== 'undefined') {\n try {\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 possibly_cors: possiblyCors,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n } catch { /* silently ignore — event dispatch must never crash the app */ }\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","// @ts-nocheck\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}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * OAuth provider to disconnect\n * * `github` - GitHub\n */\nexport enum OAuthConnectionProvider {\n GITHUB = \"github\",\n}\n\n","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Zod Schemas - Runtime validation and type inference\n *\n * Auto-generated from OpenAPI specification.\n * Provides runtime validation for API requests and responses.\n *\n * Usage:\n * ```typescript\n * import { UserSchema } from './schemas'\n *\n * // Validate data\n * const user = UserSchema.parse(data)\n *\n * // Type inference\n * type User = z.infer<typeof UserSchema>\n * ```\n */\n\nexport * from './AccountDeleteResponse.schema'\nexport * from './CentrifugoToken.schema'\nexport * from './CfgAccountsProfileAvatarCreateRequest.schema'\nexport * from './OAuthAuthorizeRequestRequest.schema'\nexport * from './OAuthAuthorizeResponse.schema'\nexport * from './OAuthCallbackRequestRequest.schema'\nexport * from './OAuthConnection.schema'\nexport * from './OAuthDisconnectRequestRequest.schema'\nexport * from './OAuthError.schema'\nexport * from './OAuthProvidersResponse.schema'\nexport * from './OAuthTokenResponse.schema'\nexport * from './OTPErrorResponse.schema'\nexport * from './OTPRequestRequest.schema'\nexport * from './OTPRequestResponse.schema'\nexport * from './OTPVerifyRequest.schema'\nexport * from './OTPVerifyResponse.schema'\nexport * from './PatchedUserProfileUpdateRequest.schema'\nexport * from './TokenRefresh.schema'\nexport * from './TokenRefreshRequest.schema'\nexport * from './User.schema'\nexport * from './UserProfileUpdateRequest.schema'\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.string(),\n expires_at: z.string().datetime({ offset: true }),\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.string().optional(),\n source_url: z.string().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.string(),\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.string().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.number().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.string(),\n connected_at: z.string().datetime({ offset: true }),\n last_login_at: z.string().datetime({ offset: true }),\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.OAuthConnectionProvider),\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 * * Typed error response for OTP operations.\n\nerror_code values:\n - invalid_identifier — malformed email\n - cooldown — too soon after last request (retry_after = seconds)\n - hourly_limit — hourly quota exceeded (retry_after = seconds until reset)\n - daily_limit — daily quota exceeded (retry_after = seconds until reset)\n - rate_limited — IP-level rate limit hit (no retry_after)\n - user_creation_failed — internal error creating account\n - send_failed — transport error (email / SMS)\n - internal_error — unexpected server error\n * */\nimport { z } from 'zod'\n\n/**\n * Typed error response for OTP operations.\n\nerror_code values:\n - invalid_identifier — malformed email\n - cooldown — too soon after last request (retry_after = seconds)\n - hourly_limit — hourly quota exceeded (retry_after = seconds until reset)\n - daily_limit — daily quota exceeded (retry_after = seconds until reset)\n - rate_limited — IP-level rate limit hit (no retry_after)\n - user_creation_failed — internal error creating account\n - send_failed — transport error (email / SMS)\n - internal_error — unexpected server error\n */\nexport const OTPErrorResponseSchema = z.object({\n error: z.string(),\n error_code: z.string().nullable().optional(),\n retry_after: z.number().int().nullable().optional(),\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'\n\n/**\n * Serializer for OTP request.\n */\nexport const OTPRequestRequestSchema = z.object({\n identifier: z.string().min(1),\n source_url: z.string().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'\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 source_url: z.string().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.number().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 language: z.string().max(10).optional(),\n avatar: z.string().nullable(),\n is_staff: z.boolean(),\n is_superuser: z.boolean(),\n date_joined: z.string().datetime({ offset: true }),\n last_login: z.string().datetime({ offset: true }).nullable(),\n unanswered_messages_count: z.number().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 language: z.string().max(10).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 language: z.string().max(10).optional(),\n})\n\n/**\n * Infer TypeScript type from Zod schema\n */\nexport type UserProfileUpdateRequest = z.infer<typeof UserProfileUpdateRequestSchema>","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Zod Validation Events - Browser CustomEvent integration\n *\n * Dispatches browser CustomEvents when Zod validation fails, allowing\n * React/frontend apps to listen and handle validation errors globally.\n *\n * @example\n * ```typescript\n * // In your React app\n * window.addEventListener('zod-validation-error', (event) => {\n * const { operation, path, method, error, response } = event.detail;\n * console.error(`Validation failed for ${method} ${path}`, error);\n * // Show toast notification, log to Sentry, etc.\n * });\n * ```\n */\n\nimport type { ZodError } from 'zod'\n\n/**\n * Validation error event detail\n */\nexport interface ValidationErrorDetail {\n /** Operation/function name that failed validation */\n operation: string\n /** API endpoint path */\n path: string\n /** HTTP method */\n method: string\n /** Zod validation error */\n error: ZodError\n /** Raw response data that failed validation */\n response: any\n /** Timestamp of the error */\n timestamp: Date\n}\n\n/**\n * Custom event type for Zod validation errors\n */\nexport type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>\n\n/**\n * Dispatch a Zod validation error event.\n *\n * Only dispatches in browser environment (when window is defined).\n * Safe to call in Node.js/SSR - will be a no-op.\n *\n * @param detail - Validation error details\n */\nexport function dispatchValidationError(detail: ValidationErrorDetail): void {\n // Check if running in browser\n if (typeof window === 'undefined') {\n return\n }\n\n try {\n const event = new CustomEvent<ValidationErrorDetail>('zod-validation-error', {\n detail,\n bubbles: true,\n cancelable: false,\n })\n\n window.dispatchEvent(event)\n } catch (error) {\n // Silently fail - validation event dispatch should never crash the app\n console.warn('Failed to dispatch validation error event:', error)\n }\n}\n\n/**\n * Add a global listener for Zod validation errors.\n *\n * @param callback - Function to call when validation error occurs\n * @returns Cleanup function to remove the listener\n *\n * @example\n * ```typescript\n * const cleanup = onValidationError(({ operation, error }) => {\n * toast.error(`Validation failed in ${operation}`);\n * logToSentry(error);\n * });\n *\n * // Later, remove listener\n * cleanup();\n * ```\n */\nexport function onValidationError(\n callback: (detail: ValidationErrorDetail) => void\n): () => void {\n if (typeof window === 'undefined') {\n // Return no-op cleanup function for SSR\n return () => {}\n }\n\n const handler = (event: Event) => {\n if (event instanceof CustomEvent) {\n callback(event.detail)\n }\n }\n\n window.addEventListener('zod-validation-error', handler)\n\n // Return cleanup function\n return () => {\n window.removeEventListener('zod-validation-error', handler)\n }\n}\n\n/**\n * Format Zod error for logging/display.\n *\n * @param error - Zod validation error\n * @returns Formatted error message\n */\nexport function formatZodError(error: ZodError): string {\n const issues = error.issues.map((issue, index) => {\n const path = issue.path.join('.') || 'root'\n const parts = [`${index + 1}. ${path}: ${issue.message}`]\n\n if ('expected' in issue && issue.expected) {\n parts.push(` Expected: ${issue.expected}`)\n }\n\n if ('received' in issue && issue.received) {\n parts.push(` Received: ${issue.received}`)\n }\n\n return parts.join('\\n')\n })\n\n return issues.join('\\n')\n}","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Typed Fetchers - Universal API functions\n *\n * Auto-generated from OpenAPI specification.\n * These functions work in any JavaScript environment.\n *\n * Features:\n * - Runtime validation with Zod\n * - Type-safe parameters and responses\n * - Works with any data-fetching library (SWR, React Query, etc)\n * - Server Component compatible\n *\n * Usage:\n * ```typescript\n * import * as fetchers from './fetchers'\n *\n * // Direct usage\n * const user = await fetchers.getUser(1)\n *\n * // With SWR\n * const { data } = useSWR('user-1', () => fetchers.getUser(1))\n *\n * // With React Query\n * const { data } = useQuery(['user', 1], () => fetchers.getUser(1))\n * ```\n */\n\nexport * from './accounts'\nexport * from './accounts__auth'\nexport * from './accounts__oauth'\nexport * from './accounts__user_profile'\n","// @ts-nocheck\n// 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","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Global API Instance - Singleton configuration with auto-configuration support\n *\n * This module provides a global API instance that auto-configures from\n * environment variables or can be configured manually.\n *\n * AUTO-CONFIGURATION (recommended):\n * Set one of these environment variables and the API will auto-configure:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n *\n * Then just use fetchers and hooks directly:\n * ```typescript\n * import { getUsers } from './_utils/fetchers'\n * const users = await getUsers({ page: 1 })\n * ```\n *\n * MANUAL CONFIGURATION:\n * ```typescript\n * import { configureAPI } from './api-instance'\n *\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'your-jwt-token'\n * })\n * ```\n *\n * For SSR or multiple instances:\n * ```typescript\n * import { API } from './index'\n * import { getUsers } from './_utils/fetchers'\n *\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\n\nimport { API, type APIOptions } from './index'\n\nlet globalAPI: API | null = null\nlet autoConfigAttempted = false\n\n/**\n * Auto-configure from environment variable if available (Next.js pattern)\n * This allows hooks and fetchers to work without explicit configureAPI() call\n *\n * Supported environment variables:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n */\nfunction tryAutoConfigureFromEnv(): void {\n // Only attempt once\n if (autoConfigAttempted) return\n autoConfigAttempted = true\n\n // Skip if already configured\n if (globalAPI) return\n\n // Skip if process is not available (pure browser without bundler)\n if (typeof process === 'undefined' || !process.env) return\n\n // Try different environment variable patterns\n const baseUrl =\n process.env.NEXT_PUBLIC_API_URL ||\n process.env.VITE_API_URL ||\n process.env.REACT_APP_API_URL ||\n process.env.API_URL\n\n if (baseUrl) {\n globalAPI = new API(baseUrl)\n }\n}\n\n/**\n * Get the global API instance\n * Auto-configures from environment variables on first call if not manually configured.\n * @throws Error if API is not configured and no env variable is set\n */\nexport function getAPIInstance(): API {\n // Try auto-configuration on first access (lazy initialization)\n tryAutoConfigureFromEnv()\n\n if (!globalAPI) {\n throw new Error(\n 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\\n\\n' +\n 'Example:\\n' +\n ' import { configureAPI } from \"./api-instance\"\\n' +\n ' configureAPI({ baseUrl: \"https://api.example.com\" })\\n\\n' +\n 'Or set environment variable: NEXT_PUBLIC_API_URL, VITE_API_URL, or REACT_APP_API_URL'\n )\n }\n return globalAPI\n}\n\n/**\n * Check if API is configured (or can be auto-configured)\n */\nexport function isAPIConfigured(): boolean {\n tryAutoConfigureFromEnv()\n return globalAPI !== null\n}\n\n/**\n * Configure the global API instance\n *\n * @param baseUrl - Base URL for the API\n * @param options - Optional configuration (storage, retry, logger)\n *\n * @example\n * ```typescript\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'jwt-token',\n * options: {\n * retryConfig: { maxRetries: 3 },\n * loggerConfig: { enabled: true }\n * }\n * })\n * ```\n */\nexport function configureAPI(config: {\n baseUrl: string\n token?: string\n refreshToken?: string\n options?: APIOptions\n}): API {\n globalAPI = new API(config.baseUrl, config.options)\n\n if (config.token) {\n globalAPI.setToken(config.token, config.refreshToken)\n }\n\n return globalAPI\n}\n\n/**\n * Reconfigure the global API instance with new settings\n * Useful for updating tokens or base URL\n */\nexport function reconfigureAPI(updates: {\n baseUrl?: string\n token?: string\n refreshToken?: string\n}): API {\n const instance = getAPIInstance()\n\n if (updates.baseUrl) {\n instance.setBaseUrl(updates.baseUrl)\n }\n\n if (updates.token) {\n instance.setToken(updates.token, updates.refreshToken)\n }\n\n return instance\n}\n\n/**\n * Clear tokens from the global API instance\n */\nexport function clearAPITokens(): void {\n const instance = getAPIInstance()\n instance.clearTokens()\n}\n\n/**\n * Reset the global API instance\n * Useful for testing or logout scenarios\n */\nexport function resetAPI(): void {\n if (globalAPI) {\n globalAPI.clearTokens()\n }\n globalAPI = null\n}","// @ts-nocheck\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","// @ts-nocheck\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","// @ts-nocheck\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","// @ts-nocheck\nimport * as Models from \"./models\";\n\n\n/**\n * API endpoints for Centrifugo Auth.\n */\nexport class CentrifugoAuth {\n private client: any;\n\n constructor(client: any) {\n this.client = client;\n }\n\n /**\n * Get Centrifugo connection token\n * \n * Generate JWT token for WebSocket connection to Centrifugo. Token\n * includes user's allowed channels based on their permissions. Requires\n * authentication.\n */\n async tokenRetrieve(): Promise<Models.ConnectionTokenResponse> {\n const response = await this.client.request('GET', \"/cfg/centrifugo/auth/token/\");\n return response;\n }\n\n}","// @ts-nocheck\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}\n\n/**\n * FetchAdapter with keepalive:true.\n *\n * Use this adapter when you need requests to survive page unload\n * (visibilitychange / beforeunload) — the browser will complete the request\n * even after the page is navigated away. Typical use: monitor / analytics flush.\n *\n * @example\n * ```typescript\n * import { APIClient, KeepAliveFetchAdapter } from './client';\n * const client = new APIClient(baseUrl, { httpClient: new KeepAliveFetchAdapter() });\n * ```\n */\nexport class KeepAliveFetchAdapter extends FetchAdapter {\n async request<T = any>(request: HttpRequest): Promise<HttpResponse<T>> {\n const origFetch = globalThis.fetch;\n globalThis.fetch = (input: RequestInfo | URL, init?: RequestInit) =>\n origFetch(input, { ...init, keepalive: true });\n try {\n return await super.request<T>(request);\n } finally {\n globalThis.fetch = origFetch;\n }\n }\n}","// @ts-nocheck\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}","// @ts-nocheck\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();","// @ts-nocheck\n// 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 { CentrifugoAuth } from \"./centrifugo__centrifugo_auth\";\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 centrifugo_auth: CentrifugoAuth;\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.centrifugo_auth = new CentrifugoAuth(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 // Classify network error using PerformanceResourceTiming.\n // Browser intentionally makes CORS errors indistinguishable from network failures\n // (same TypeError: \"Failed to fetch\") for security reasons. We use PerformanceResourceTiming\n // as the best available heuristic:\n // - Entry exists with responseStatus === 0 → request reached server, JS blocked → likely CORS\n // - No entry / entry missing → connection never established → server unavailable / DNS / offline\n // All cases are dispatched as 'network-error' with a `possibly_cors` flag.\n let possiblyCors = false;\n if (error instanceof TypeError && typeof window !== 'undefined') {\n try {\n const isCrossOrigin = (() => {\n try { return new URL(url).origin !== window.location.origin; } catch { return false; }\n })();\n if (isCrossOrigin) {\n const entries = performance.getEntriesByName(url, 'resource');\n if (entries.length > 0) {\n const last = entries[entries.length - 1] as PerformanceResourceTiming;\n possiblyCors = 'responseStatus' in last && (last as any).responseStatus === 0;\n }\n }\n } catch { /* ignore — PerformanceResourceTiming not available */ }\n }\n\n if (this.logger) {\n this.logger.error(`⚠️ Network Error: ${method} ${url}`);\n this.logger.error(` → ${error instanceof Error ? error.message : String(error)}`);\n if (possiblyCors) {\n this.logger.error(` → Possibly blocked by CORS policy (configure CORS on the server)`);\n }\n }\n\n // Dispatch network-error event with possibly_cors hint\n if (typeof window !== 'undefined') {\n try {\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 possibly_cors: possiblyCors,\n timestamp: new Date(),\n },\n bubbles: true,\n cancelable: false,\n }));\n } catch { /* silently ignore — event dispatch must never crash the app */ }\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","// @ts-nocheck\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}","/**\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>","// @ts-nocheck\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","// @ts-nocheck\n// Auto-generated by DjangoCFG - see CLAUDE.md\n/**\n * Global API Instance - Singleton configuration with auto-configuration support\n *\n * This module provides a global API instance that auto-configures from\n * environment variables or can be configured manually.\n *\n * AUTO-CONFIGURATION (recommended):\n * Set one of these environment variables and the API will auto-configure:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n *\n * Then just use fetchers and hooks directly:\n * ```typescript\n * import { getUsers } from './_utils/fetchers'\n * const users = await getUsers({ page: 1 })\n * ```\n *\n * MANUAL CONFIGURATION:\n * ```typescript\n * import { configureAPI } from './api-instance'\n *\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'your-jwt-token'\n * })\n * ```\n *\n * For SSR or multiple instances:\n * ```typescript\n * import { API } from './index'\n * import { getUsers } from './_utils/fetchers'\n *\n * const api = new API('https://api.example.com')\n * const users = await getUsers({ page: 1 }, api)\n * ```\n */\n\nimport { API, type APIOptions } from './index'\n\nlet globalAPI: API | null = null\nlet autoConfigAttempted = false\n\n/**\n * Auto-configure from environment variable if available (Next.js pattern)\n * This allows hooks and fetchers to work without explicit configureAPI() call\n *\n * Supported environment variables:\n * - NEXT_PUBLIC_API_URL (Next.js)\n * - VITE_API_URL (Vite)\n * - REACT_APP_API_URL (Create React App)\n * - API_URL (generic)\n */\nfunction tryAutoConfigureFromEnv(): void {\n // Only attempt once\n if (autoConfigAttempted) return\n autoConfigAttempted = true\n\n // Skip if already configured\n if (globalAPI) return\n\n // Skip if process is not available (pure browser without bundler)\n if (typeof process === 'undefined' || !process.env) return\n\n // Try different environment variable patterns\n const baseUrl =\n process.env.NEXT_PUBLIC_API_URL ||\n process.env.VITE_API_URL ||\n process.env.REACT_APP_API_URL ||\n process.env.API_URL\n\n if (baseUrl) {\n globalAPI = new API(baseUrl)\n }\n}\n\n/**\n * Get the global API instance\n * Auto-configures from environment variables on first call if not manually configured.\n * @throws Error if API is not configured and no env variable is set\n */\nexport function getAPIInstance(): API {\n // Try auto-configuration on first access (lazy initialization)\n tryAutoConfigureFromEnv()\n\n if (!globalAPI) {\n throw new Error(\n 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\\n\\n' +\n 'Example:\\n' +\n ' import { configureAPI } from \"./api-instance\"\\n' +\n ' configureAPI({ baseUrl: \"https://api.example.com\" })\\n\\n' +\n 'Or set environment variable: NEXT_PUBLIC_API_URL, VITE_API_URL, or REACT_APP_API_URL'\n )\n }\n return globalAPI\n}\n\n/**\n * Check if API is configured (or can be auto-configured)\n */\nexport function isAPIConfigured(): boolean {\n tryAutoConfigureFromEnv()\n return globalAPI !== null\n}\n\n/**\n * Configure the global API instance\n *\n * @param baseUrl - Base URL for the API\n * @param options - Optional configuration (storage, retry, logger)\n *\n * @example\n * ```typescript\n * configureAPI({\n * baseUrl: 'https://api.example.com',\n * token: 'jwt-token',\n * options: {\n * retryConfig: { maxRetries: 3 },\n * loggerConfig: { enabled: true }\n * }\n * })\n * ```\n */\nexport function configureAPI(config: {\n baseUrl: string\n token?: string\n refreshToken?: string\n options?: APIOptions\n}): API {\n globalAPI = new API(config.baseUrl, config.options)\n\n if (config.token) {\n globalAPI.setToken(config.token, config.refreshToken)\n }\n\n return globalAPI\n}\n\n/**\n * Reconfigure the global API instance with new settings\n * Useful for updating tokens or base URL\n */\nexport function reconfigureAPI(updates: {\n baseUrl?: string\n token?: string\n refreshToken?: string\n}): API {\n const instance = getAPIInstance()\n\n if (updates.baseUrl) {\n instance.setBaseUrl(updates.baseUrl)\n }\n\n if (updates.token) {\n instance.setToken(updates.token, updates.refreshToken)\n }\n\n return instance\n}\n\n/**\n * Clear tokens from the global API instance\n */\nexport function clearAPITokens(): void {\n const instance = getAPIInstance()\n instance.clearTokens()\n}\n\n/**\n * Reset the global API instance\n * Useful for testing or logout scenarios\n */\nexport function resetAPI(): void {\n if (globalAPI) {\n globalAPI.clearTokens()\n }\n globalAPI = null\n}","// @ts-nocheck\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 { CentrifugoAuth } from \"./centrifugo__centrifugo_auth/client\";\nexport * as CentrifugoAuthTypes from \"./centrifugo__centrifugo_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\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, KeepAliveFetchAdapter } 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\n/** Auto-detect locale from cookie NEXT_LOCALE or navigator.language */\nfunction detectLocale(): string | null {\n try {\n if (typeof document !== 'undefined') {\n const match = document.cookie.match(/(?:^|;\\s*)NEXT_LOCALE=([^;]*)/);\n if (match) return match[1];\n }\n if (typeof navigator !== 'undefined' && navigator.language) {\n return navigator.language;\n }\n } catch {}\n return null;\n}\n\nexport interface APIOptions {\n /** Custom storage adapter (defaults to LocalStorageAdapter) */\n storage?: StorageAdapter;\n /** Custom HTTP client adapter (defaults to FetchAdapter) */\n httpClient?: HttpClientAdapter;\n /** Retry configuration for failed requests */\n retryConfig?: RetryConfig;\n /** Logger configuration */\n loggerConfig?: Partial<LoggerConfig>;\n /** Locale for Accept-Language header (e.g. 'en', 'ko', 'ru') */\n locale?: string;\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 _locale: string | null = null;\n private storage: StorageAdapter;\n private options?: APIOptions;\n\n // Sub-clients\n public centrifugo_auth!: CentrifugoAuth;\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._locale = options?.locale || null;\n\n this._loadTokensFromStorage();\n\n // Initialize APIClient with token getter for URL authentication\n this._client = new APIClient(this.baseUrl, {\n httpClient: this.options?.httpClient,\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.centrifugo_auth = this._client.centrifugo_auth;\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 httpClient: this.options?.httpClient,\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.centrifugo_auth = this._client.centrifugo_auth;\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 locale = this._locale || detectLocale();\n const mergedOptions = {\n ...options,\n headers: {\n ...(options?.headers || {}),\n ...(token ? { 'Authorization': `Bearer ${token}` } : {}),\n ...(locale ? { 'Accept-Language': locale } : {}),\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 * Set locale for Accept-Language header\n * @param locale - Locale string (e.g. 'en', 'ko', 'ru') or null to clear\n */\n setLocale(locale: string | null): void {\n this._locale = locale;\n }\n\n /**\n * Get current locale\n */\n getLocale(): string | null {\n return this._locale;\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;","/**\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 './_api/generated/cfg_accounts';\nexport { API, LocalStorageAdapter, MemoryStorageAdapter } from './_api/generated/cfg_accounts';\nexport { Schemas, Fetchers, Enums } from './_api/generated/cfg_accounts';\n\n// ============================================================================\n// CFG Accounts Type Namespace\n// ============================================================================\nexport * as CfgAccountsTypes from './_api/generated/cfg_accounts';\n\n// ============================================================================\n// Centrifugo Fetchers (for WebSocket token refresh)\n// ============================================================================\nexport { getCentrifugoAuthTokenRetrieve } from './_api/generated/cfg_centrifugo';\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 './_api/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"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOO,IAAM,OAAN,MAAW;AAAA,EAPlB,OAOkB;AAAA;AAAA;AAAA,EAGhB,YAAY,QAAa;AACvB,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,2BAA2B,MAAgE;AAC/F,UAAM,WAAW,MAAM,KAAK,OAAO,QAAQ,QAAQ,gCAAgC,EAAE,MAAM,KAAK,CAAC;AACjG,WAAO;AAAA,EACT;AAEF;;;ACtBA;;;ACOO,IAAM,QAAN,MAAY;AAAA,EAPnB,OAOmB;AAAA;AAAA;AAAA,EAGjB,YAAY,QAAa;AACvB,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,+BAA6C;AACjD,UAAM,WAAW,MAAM,KAAK,OAAO,QAAQ,OAAO,kCAAkC;AACpF,WAAQ,SAAiB,WAAW;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAA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,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,kBAA2B;AACzB,WAAO,CAAC,CAAC,KAAK,SAAS;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,KAAmB;AAC5B,SAAK,UAAU;AACf,SAAK,eAAe;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,aAAqB;AACnB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAU,QAA6B;AACrC,SAAK,UAAU;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKA,YAA2B;AACzB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,gBAAwB;AACtB,WAAO;AAAA,EACT;AACF;;;AC/QA,IAAM,gBAAgB,QAAQ,IAAI,6BAA6B;AAC/D,IAAM,SAAS,gBAAgB,KAAK,QAAQ,IAAI,uBAAuB;AAEvE,IAAM,MAAM,IAAI;AAAA,EACd;AAAA,EACA;AAAA,IACE,SAAS,IAAI,oBAAoB;AAAA,EACnC;AACF;AAOO,IAAM,aAAN,MAAiB;AAAA,EAzDxB,OAyDwB;AAAA;AAAA;AAAA,EACtB;AAAA,SAAiB,MAAM;AAAA;AACzB;","names":["models_exports","models_exports","models_exports","models_exports","OAuthConnectionProvider","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","api","consola","api","consola","consola","api","consola","consola","api","consola","FetchAdapter","APIError","NetworkError","createConsola","DEFAULT_CONFIG","SENSITIVE_HEADERS","APILogger","createConsola","defaultLogger","pRetry","AbortError","DEFAULT_RETRY_CONFIG","shouldRetry","NetworkError","APIError","withRetry","pRetry","AbortError","APIClient","FetchAdapter","APILogger","withRetry","APIError","NetworkError","LocalStorageAdapter","z","consola","globalAPI","autoConfigAttempted","tryAutoConfigureFromEnv","API","getAPIInstance","api","getAPIInstance","consola","TOKEN_KEY","REFRESH_TOKEN_KEY","detectLocale","API","APILogger","LocalStorageAdapter","APIClient"]}
|