/** * Types pour le password recovery et registration Mobile SSO v1.0 * * @version 2.7.9 */ export type MobilePasswordStatus = 'idle' | 'choice_required' | 'pending_otp' | 'pending_password' | 'completed'; export interface MobilePasswordState { processToken: string | null; status: MobilePasswordStatus; storedOtp: string | null; receiveMode: 'email' | 'phone' | null; maskedEmail: string | null; maskedPhone: string | null; loading: boolean; error: string | null; errorType: string | null; credentialsLoaded: boolean; } export interface MobilePasswordInitResponse { success: boolean; message?: string; error_type?: 'email_not_found' | 'phone_not_found' | 'validation_error' | string; process_token?: string; status?: string; expires_at?: string; otp_code?: string; receive_mode?: 'email' | 'phone'; masked_email?: string; masked_phone?: string; has_phone?: boolean; otp_code_dev?: string; } export interface MobilePasswordSelectMethodResponse { success: boolean; message?: string; error_type?: 'invalid_token' | 'validation_error' | string; process_token?: string; status?: 'pending_otp'; otp_code?: string; receive_mode?: 'email' | 'phone'; masked_contact?: string; } export interface MobilePasswordResetResponse { success: boolean; message?: string; error_type?: 'weak_password' | 'token_expired' | 'invalid_token' | string; status?: 'completed'; } export interface MobilePasswordResendResponse { success: boolean; message?: string; error_type?: 'cooldown_active' | 'session_expired' | string; otp_code?: string; receive_mode?: 'email' | 'phone'; cooldown_remaining?: number; } export type AccountType = 'email' | 'phone-only'; export interface MobileRegistrationFormData { name: string; email: string; ccphone: string; phone: string; address?: string; town?: string; country?: string; password: string; password_confirmation: string; registration_type?: 'email' | 'phone'; } export interface MobileRegistrationInitResponse { success: boolean; message?: string; error_type?: 'email_exists' | 'phone_exists' | 'validation_error' | string; process_token?: string; status?: string; expires_at?: string; otp_code_dev?: string; otp_method?: 'email' | 'sms'; otp_sent_to?: string; conflict?: { type: 'email' | 'phone'; masked_identifier: string; options: { can_login: boolean; can_recover_by_email: boolean; can_recover_by_sms: boolean; masked_email?: string; masked_phone?: string; }; }; } export interface MobileVerifyOtpResponse { success: boolean; message?: string; error_type?: 'invalid_otp' | 'otp_expired' | 'max_attempts_exceeded' | string; status?: string; callback_token?: string; expires_at?: string; recovery_token?: string; } export interface MobileRegistrationCompleteResponse { success: boolean; message?: string; error_type?: 'weak_password' | 'session_expired' | string; callback_token?: string; status?: 'completed'; } export interface MobileResendOtpResponse { success: boolean; message?: string; error_type?: 'cooldown_active' | 'session_expired' | string; otp_code?: string; cooldown_remaining?: number; otp_code_dev?: string; otp_method?: 'email' | 'sms'; otp_sent_to?: string; } export interface MobileAuthFinalResponse { success: boolean; message?: string; token: string; expires_at: string; user: { reference: string; name: string; email?: string; phone?: string; image_url?: string; }; }