import { AuthAttributionContext } from '../utils/signupAttribution'; interface AuthResponse { token: string; user: { id: string; name: string; email: string; profilePicture?: string; }; } interface AppleAuthPayload { identityToken: string; nonce?: string; fullName?: { givenName?: string; familyName?: string; }; email?: string; user: string; } /** * Generic SDK Authentication Response * Used by all auth methods (Google, Apple, Email) */ export interface SDKAuthResponse { success: boolean; token: string; user: { id: string; odeanId?: string; email: string; username: string; name?: string; profilePicture?: string; }; onairos?: { hasConnectedOnairos: boolean; onairosUserId?: string; lastConnectedAt?: string; }; isNewUser: boolean; } /** * Authenticate with Apple * @param appleAuthData Data from Apple authentication * @returns Authentication response with token and user data */ /** * Authenticate with Onairos (similar to Apple authentication) * @param onairosAuthData Data from Onairos authentication * @returns Authentication response with token and user data */ export declare const authenticateWithOnairos: (onairosAuthData: { token: string; email: string; }) => Promise; /** * Authenticate with Onairos using the standardized /login/signin endpoint * @param credentials Email and password for Onairos sign-in * @returns Authentication response with token and user data */ export declare const authenticateWithOnairosSignIn: (credentials: { email: string; password: string; }) => Promise; /** * Authenticate with Apple using generic SDK endpoint * NOTE: This is generic SDK auth - does NOT create EnochUser * Consuming apps should call /enoch/users/register after this if needed */ export declare const authenticateWithApple: (appleAuthData: AppleAuthPayload) => Promise; /** * Save authentication token * @param token JWT token */ export declare const saveAuthToken: (token: string) => Promise; /** * Debug function to check all auth-related storage */ export declare const debugAuthStorage: () => Promise; /** * Clear all auth tokens and start fresh */ export declare const clearAllAuthTokens: () => Promise; /** * Set user JWT token explicitly (for host apps that authenticate externally) * Accepts raw JWT or Bearer token format. */ export declare const setUserToken: (token: string) => Promise; /** * Clear only the stored user JWT token. */ export declare const clearUserToken: () => Promise; /** * Get saved authentication token * @returns Saved JWT token or null if not found */ export declare const getAuthToken: () => Promise; /** * Remove authentication token (logout) */ export declare const removeAuthToken: () => Promise; /** * Validate if user is properly authenticated * @returns boolean indicating if user has valid authentication */ export declare const isAuthenticated: () => Promise; /** * Ensure authentication is available before making API calls * @param apiName - Name of the API being called (for logging) * @returns boolean indicating if authentication is available */ export declare const ensureAuthentication: (apiName: string) => Promise; /** * Verify token with backend * @returns Boolean indicating if token is valid */ export declare const verifyToken: () => Promise; export declare const getUserProfile: () => Promise; export declare const updateUserOnboardedStatus: () => Promise; /** * Check if a user email has admin privileges * @param email User email to check * @returns True if user is an admin */ export declare const isAdminEmail: (email: string | null | undefined) => boolean; /** * Get the current admin status from AsyncStorage * This could be used for caching admin status between sessions */ export declare const getAdminStatus: () => Promise; /** * Save admin status to AsyncStorage * @param isAdmin Whether the user is an admin */ export declare const saveAdminStatus: (isAdmin: boolean) => Promise; /** * Get stored Onairos username for API calls * This is used for data connector APIs (Reddit, etc.) that need the username * @returns Stored username or null if not found */ export declare const getOnairosUsername: () => Promise; /** * Save Onairos username for API calls * @param username Username to store */ export declare const saveOnairosUsername: (username: string) => Promise; /** * Send email verification code * @param email Email address to send verification code to * @returns Result with success status and optional message */ export declare const sendEmailVerificationCode: (email: string, attributionContext?: AuthAttributionContext) => Promise<{ success: boolean; message?: string; }>; /** * Confirm email verification code * NOTE: This is generic SDK email verification - does NOT create EnochUser * Consuming apps should call /enoch/users/register after this if needed * @param email Email address that received the code * @param code Verification code entered by user * @returns Result with success status, optional token, and message */ export declare const confirmEmailVerificationCode: (email: string, code: string, attributionContext?: AuthAttributionContext) => Promise<{ success: boolean; token?: string; message?: string; username?: string; isNewUser?: boolean; flowType?: string; existingUserData?: { hasExistingData?: boolean; connections?: Array<{ platform: string; hasData: boolean; status: string; }>; }; enochInstructions?: { showWelcomeBack?: boolean; skipOnboarding?: boolean; }; }>; export {}; //# sourceMappingURL=authService.d.ts.map