export type AuthBindingStatus = 'active' | 'pending_bind_phone'; export type AuthLoginMethod = 'password' | 'phone' | 'wechat'; export type AuthUser = { id: string; publicUserCode: string; username: string; displayName: string; phoneNumberMasked: string | null; loginMethod: AuthLoginMethod; bindingStatus: AuthBindingStatus; wechatBound: boolean; }; export type PublicUserSummary = { id: string; publicUserCode: string; displayName: string; }; export type PublicUserSearchResponse = { user: PublicUserSummary; }; export type AuthEntryRequest = { phone: string; password: string; }; export type AuthEntryResponse = { token: string; user: AuthUser; }; export type AuthPasswordChangeRequest = { currentPassword?: string; newPassword: string; }; export type AuthPasswordChangeResponse = { user: AuthUser; }; export type AuthPasswordResetRequest = { phone: string; code: string; newPassword: string; }; export type AuthPasswordResetResponse = { token: string; user: AuthUser; }; export type AuthPhoneSendCodeRequest = { phone: string; scene?: 'login' | 'bind_phone' | 'change_phone'; captchaChallengeId?: string; captchaAnswer?: string; }; export type AuthPhoneSendCodeResponse = { ok: true; cooldownSeconds: number; expiresInSeconds: number; providerRequestId: string | null; }; export type AuthPhoneLoginRequest = { phone: string; code: string; }; export type AuthPhoneLoginResponse = { token: string; user: AuthUser; }; export type AuthMeResponse = { user: AuthUser | null; availableLoginMethods: AuthLoginMethod[]; }; export type AuthLoginOptionsResponse = { availableLoginMethods: AuthLoginMethod[]; }; export type AuthWechatStartResponse = { authorizationUrl: string; }; export type AuthWechatBindPhoneRequest = { phone: string; code: string; }; export type AuthWechatBindPhoneResponse = { token: string; user: AuthUser; }; export type AuthPhoneChangeRequest = { phone: string; code: string; }; export type AuthPhoneChangeResponse = { user: AuthUser; }; export type AuthRefreshResponse = { ok: true; token?: string; }; export type AuthSessionSummary = { sessionId: string; clientType: string; clientRuntime: string; clientPlatform: string; clientLabel: string; deviceDisplayName: string; miniProgramAppId: string | null; miniProgramEnv: string | null; userAgent: string | null; ipMasked: string | null; isCurrent: boolean; createdAt: string; lastSeenAt: string; expiresAt: string; }; export type AuthSessionsResponse = { sessions: AuthSessionSummary[]; }; export type AuthLogoutAllResponse = { ok: true; }; export type AuthRevokeSessionResponse = { ok: true; }; export type AuthAuditLogEventType = | 'password_login' | 'phone_login' | 'wechat_login' | 'wechat_bind_phone' | 'change_phone' | 'captcha_required' | 'logout' | 'logout_all' | 'revoke_session' | 'risk_block_phone' | 'risk_block_ip' | 'risk_unblock_phone' | 'risk_unblock_ip'; export type AuthAuditLogEntry = { id: string; eventType: AuthAuditLogEventType; title: string; detail: string; ipMasked: string | null; userAgent: string | null; createdAt: string; }; export type AuthAuditLogsResponse = { logs: AuthAuditLogEntry[]; }; export type AuthCaptchaChallenge = { challengeId: string; promptText: string; imageDataUrl: string; expiresInSeconds: number; }; export type AuthRiskBlockSummary = { scopeType: 'phone' | 'ip'; title: string; detail: string; expiresAt: string; remainingSeconds: number; }; export type AuthRiskBlocksResponse = { blocks: AuthRiskBlockSummary[]; }; export type AuthLiftRiskBlockResponse = { ok: true; }; export type LogoutResponse = { ok: true; };