import { Type } from '@nestjs/common';
import { MFAOptions } from './mfa-options.interface';
import { CookieOptions, SessionOptions } from './session-options.interface';
import { BaseAuthProvider } from '../providers/base-auth.provider';
import { DebugLogOptions } from '../services/debug-logger.service';
import { NestAuthUser } from '../../user/entities/user.entity';
import { SessionPayload, JWTTokenPayload } from './token-payload.interface';
export interface DefaultTenantOptions {
    name: string;
    slug: string;
    domain?: string;
    description?: string;
    metadata?: Record<string, any>;
}
export interface RegistrationCollectProfileField {
    id: string;
    label: string;
    required: boolean;
    type: 'text' | 'email' | 'phone' | 'select' | 'checkbox' | 'password';
    placeholder?: string;
    options?: Array<{
        label: string;
        value: string;
    }>;
}
export interface UserHooks {
    beforeCreate?: (userData: Partial<NestAuthUser>, input: any) => Promise<Partial<NestAuthUser>> | Partial<NestAuthUser>;
    afterCreate?: (user: NestAuthUser, input: any) => Promise<void> | void;
    serialize?: (user: NestAuthUser) => Partial<NestAuthUser>;
    sensitiveFields?: string[];
}
export interface AuthHooks {
    transformResponse?: (response: any, user: NestAuthUser, session: SessionPayload) => Promise<any> | any;
}
export interface PasswordHooks {
    hash?: (password: string) => Promise<string>;
    verify?: (password: string, hash: string) => Promise<boolean>;
    validate?: (password: string) => {
        valid: boolean;
        errors?: string[];
    };
}
export interface OtpOptions {
    generate?: (length?: number) => string | Promise<string>;
    length?: number;
    format?: 'numeric' | 'alphanumeric';
}
export interface GuardHooks {
    beforeAuth?: (request: any, payload: JWTTokenPayload) => Promise<void | {
        reject: boolean;
        reason?: string;
    }>;
    afterAuth?: (request: any, user: NestAuthUser, session: SessionPayload) => Promise<void> | void;
}
export interface AuthorizationHooks {
    resolveRoles?: (user: NestAuthUser) => Promise<string[]>;
    resolvePermissions?: (user: NestAuthUser, roles: string[]) => Promise<string[]>;
}
export interface AuthAuditEvent {
    type: 'login' | 'logout' | 'signup' | 'password_change' | 'mfa_enable' | 'session_revoke';
    userId?: string;
    ip?: string;
    userAgent?: string;
    success: boolean;
    metadata?: Record<string, any>;
    timestamp: Date;
}
export interface AuditOptions {
    enabled?: boolean;
    onEvent?: (event: AuthAuditEvent) => Promise<void> | void;
}
export interface AuthModuleOptions {
    isGlobal?: boolean;
    appName: string;
    enableAutoRefresh?: boolean;
    accessTokenType?: 'header' | 'cookie';
    cookieOptions?: CookieOptions;
    jwt: {
        secret: string;
        accessTokenExpiresIn?: number | string;
        refreshTokenExpiresIn?: number | string;
        validateToken?: (payload: JWTTokenPayload, session: SessionPayload) => Promise<boolean>;
    };
    google?: {
        clientId: string;
        clientSecret: string;
        redirectUri: string;
    };
    facebook?: {
        appId: string;
        appSecret: string;
        redirectUri: string;
    };
    apple?: {
        clientId: string;
        teamId: string;
        keyId: string;
        privateKey: string;
        privateKeyMethod?: string;
        redirectUri: string;
    };
    github?: {
        clientId: string;
        clientSecret: string;
        redirectUri: string;
    };
    phoneAuth?: {
        enabled: boolean;
    };
    emailAuth?: {
        enabled: boolean;
    };
    registration?: {
        enabled?: boolean;
        requireInvitation?: boolean;
        collectProfileFields?: Array<RegistrationCollectProfileField>;
    };
    clientConfig?: {
        factory?: (defaultConfig: any, context: {
            configService: any;
            tenantService: any;
        }) => Promise<any> | any;
    };
    mfa?: MFAOptions;
    session?: SessionOptions;
    customAuthProviders?: BaseAuthProvider[];
    passwordResetOtpExpiresIn?: number | string;
    passwordResetTokenExpiresIn?: number | string;
    defaultTenant?: DefaultTenantOptions;
    adminConsole?: AdminConsoleOptions;
    debug?: DebugLogOptions;
    user?: UserHooks;
    auth?: AuthHooks;
    guards?: GuardHooks;
    password?: PasswordHooks;
    otp?: OtpOptions;
    authorization?: AuthorizationHooks;
    audit?: AuditOptions;
    errorHandler?: (error: Error, context: 'login' | 'signup' | 'refresh' | 'mfa' | 'password_reset' | 'password_change') => any;
}
export interface AdminConsoleOptions {
    enabled?: boolean;
    basePath?: string;
    secretKey?: string;
    sessionCookieName?: string;
    sessionDuration?: string | number;
    superAdminRole?: string;
    initializeEnabled?: boolean;
    cookie?: CookieOptions;
    allowAdminManagement?: boolean;
}
export interface AuthModuleAsyncOptions {
    isGlobal?: boolean;
    enableAutoRefresh?: boolean;
    imports?: any[];
    useFactory?: (...args: any[]) => Promise<AuthModuleOptions> | AuthModuleOptions;
    inject?: any[];
    useClass?: Type<AuthModuleOptionsFactory>;
    useExisting?: Type<AuthModuleOptionsFactory>;
}
export interface AuthModuleOptionsFactory {
    createAuthModuleOptions(): Promise<AuthModuleOptions> | AuthModuleOptions;
}
//# sourceMappingURL=auth-module-options.interface.d.ts.map