/** * ============================================================================ * @amaster.ai/auth-client - Type Definitions * ============================================================================ * * 🤖 AI NAVIGATION - Read these files based on your task: * * 1. Need LOGIN/REGISTER/LOGOUT? → Read: ./auth.d.ts * 2. Need PERMISSION checks? → Read: ./permissions.d.ts * 3. Need USER profile management? → Read: ./user.d.ts * 4. Need OAUTH binding? → Read: ./oauth.d.ts * 5. Need SESSION management? → Read: ./sessions.d.ts * * ============================================================================ */ import { HttpClient, HttpClientOptions } from '@amaster.ai/http-client'; import { createAuthModule } from './auth.cjs'; import { createPermissionsModule } from './permissions.cjs'; import { createUserModule } from './user.cjs'; import { createOAuthModule } from './oauth.cjs'; import { createSessionsModule } from './sessions.cjs'; import { A as AuthClientOptions, a as AuthEvent, E as EventHandler } from './types-DqwQ2EzH.cjs'; export { b as CaptchaResponse, C as ChangePasswordParams, c as CodeLoginParams, d as CodeLoginType, L as LoginParams, e as LoginResponse, f as LoginType, M as MiniGetPhoneEvent, g as MiniGetPhoneParams, h as MiniLoginParams, i as MiniProgramLoginParams, k as MiniProgramPhoneParams, l as MiniProgramPhoneResponse, j as MiniProgramPlatform, O as OAuthBinding, m as OAuthProvider, P as Permission, n as PermissionDetail, R as RefreshTokenResponse, o as RegisterParams, p as RegisterResponse, q as RevokeAllSessionsResponse, r as Role, s as RoleDetail, S as SendCodeParams, t as SendCodeType, u as Session, v as SuccessResponse, U as UpdateMeParams, w as User } from './types-DqwQ2EzH.cjs'; /** * Main Authentication Client * * Combines all modules into a unified client interface */ type AuthClient = ReturnType & ReturnType & ReturnType & ReturnType & ReturnType & { on(event: AuthEvent, handler: EventHandler): void; off(event: AuthEvent, handler: EventHandler): void; isAuthenticated(): boolean; getAccessToken(): string | null; setAccessToken(token: string): void; clearAuth(): void; }; declare function createAuthClient(options?: AuthClientOptions, http?: HttpClient): AuthClient; /** * HTTP Client Configuration Utilities * * Provides shared HTTP client configuration for Amaster backend integration */ /** * Transform Amaster backend response format * Backend returns: { statusCode: 200, data: {...}, message: "..." } * We extract the inner 'data' field for cleaner client usage * * @param responseData - Raw response data from backend * @returns Extracted data or original response if not in Amaster format * * @example * ```typescript * const response = { statusCode: 200, data: { userId: "123" }, message: "Success" }; * const result = transformAmasterResponse(response); * // result = { userId: "123" } * ``` */ declare function transformAmasterResponse(responseData: unknown): T; /** * Default HTTP client options for Amaster backend * Includes response transformation and error logging */ declare const defaultHttpClientOptions: HttpClientOptions; export { type AuthClient, AuthClientOptions, AuthEvent, EventHandler, createAuthClient, defaultHttpClientOptions, transformAmasterResponse };