import { HttpService } from "@nestjs/axios";
import { EventEmitter2 } from "@nestjs/event-emitter";
import { JwtService } from "@nestjs/jwt";
import { MailFactory } from "../factories/mail.factory";
import { UserRepository } from "../repository/user.repository";
import { DataSource, DeepPartial, Repository } from "typeorm";
import { ChangePasswordDto } from "../dtos/change-password.dto";
import { ConfirmForgotPasswordDto } from "../dtos/confirm-forgot-password.dto";
import { InitiateForgotPasswordDto } from "../dtos/initiate-forgot-password.dto";
import { OTPConfirmOTPDto } from "../dtos/otp-confirm-otp.dto";
import { OTPSignInDto } from "../dtos/otp-sign-in.dto";
import { OTPSignUpDto } from "../dtos/otp-sign-up.dto";
import { RefreshTokenDto } from "../dtos/refresh-token.dto";
import { SignInDto } from "../dtos/sign-in.dto";
import { SignUpDto } from "../dtos/sign-up.dto";
import { User } from "../entities/user.entity";
import { ActiveUserData } from "../interfaces/active-user-data.interface";
import { HashingService } from "./hashing.service";
import { RefreshTokenIdsStorageService } from "./refresh-token-ids-storage.service";
import { SsoCodeStorageService } from "./sso-code-storage.service";
import { RoleMetadataService } from "./role-metadata.service";
import { SettingService } from "./setting.service";
import { UserActivityHistoryService } from "./user-activity-history.service";
import { UserService } from "./user.service";
import { SmsFactory } from "../factories/sms.factory";
import { WhatsAppFactory } from "../factories/whatsapp.factory";
import { SolidRegistry } from "../helpers/solid-registry";
export declare class AuthenticationService {
    private readonly userService;
    private readonly userRepository;
    private readonly hashingService;
    private readonly jwtService;
    private readonly refreshTokenIdsStorage;
    private readonly httpService;
    private readonly mailServiceFactory;
    private readonly smsFactory;
    private readonly whatsAppFactory;
    private readonly eventEmitter;
    private readonly settingService;
    private readonly roleMetadataService;
    private readonly userActivityHistoryService;
    private readonly ssoCodeStorage;
    private readonly dataSource;
    private readonly solidRegistry;
    private readonly logger;
    constructor(userService: UserService, userRepository: UserRepository, hashingService: HashingService, jwtService: JwtService, refreshTokenIdsStorage: RefreshTokenIdsStorageService, httpService: HttpService, mailServiceFactory: MailFactory, smsFactory: SmsFactory, whatsAppFactory: WhatsAppFactory, eventEmitter: EventEmitter2, settingService: SettingService, roleMetadataService: RoleMetadataService, userActivityHistoryService: UserActivityHistoryService, ssoCodeStorage: SsoCodeStorageService, dataSource: DataSource, solidRegistry: SolidRegistry);
    private getCompanyLogo;
    resolveUser(username: string, email: string): Promise<User>;
    updatePasswordDetails(user: User, newPassword: string): Promise<User>;
    resolveUserByVerificationToken(token: string): Promise<User>;
    private validateUserForPasswordLogin;
    private rehashPasswordIfRequired;
    private static readonly SIGNUP_DTO_KEYS;
    signUp(signUpDto: SignUpDto & Record<string, any>, activeUser?: ActiveUserData): Promise<User>;
    private performSignUp;
    private handlePasswordlessSignupOtp;
    signupForExtensionUser<T extends User>(signUpDto: SignUpDto, extensionUserDto: DeepPartial<T>, extensionUserRepo: Repository<T>): Promise<T>;
    private populateForSignup;
    private handlePostSignup;
    generatePassword(length?: number): string;
    private notifyUserOnForcePasswordChange;
    private isWelcomeEmailEnabled;
    private isWelcomeSmsEnabled;
    private notifyUserOnSignup;
    otpInitiateRegistration(signUpDto: OTPSignUpDto): Promise<{
        message: string;
    }>;
    private validateOtpRegistrationInput;
    private findExistingRegistrationUser;
    private resolvePasswordlessValidationSource;
    private upsertUserWithRegistrationVerificationTokens;
    private createUser;
    private assignRegistrationOtp;
    private notifyUserOnOtpInitiateRegistration;
    private normalizeWhatsAppDestination;
    private sendOtpToWhatsappProvider;
    otpConfirmRegistration(confirmSignUpDto: OTPConfirmOTPDto): Promise<{
        active: boolean;
        message: string;
    }>;
    private findUserByRegistrationIdentifier;
    private validateRegistrationOtp;
    private clearRegistrationOtp;
    private triggerRegistrationEvent;
    private areAllPasswordlessRegistrationValidationSourcesVerified;
    private otp;
    private getDummyOtpForUser;
    private getDummyOtpUsers;
    signIn(signInDto: SignInDto): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            email: string;
            mobile: string;
            username: string;
            forcePasswordChange: boolean;
            id: number;
            roles: string[];
        };
    }>;
    private maskEmail;
    private maskMobile;
    otpInitiateLogin(signInDto: OTPSignInDto): Promise<{
        message: string;
        user: {
            email: string;
            mobile?: undefined;
        } | {
            mobile: string;
            email?: undefined;
        };
    }>;
    private resolveLoginType;
    private findUserForLogin;
    private assignLoginOtp;
    private buildLoginOtpResponse;
    private notifyUserOnOtpInititateLogin;
    otpConfirmLogin(confirmSignInDto: OTPConfirmOTPDto): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            id: number;
            username: string;
            email: string;
            mobile: string;
            lastLoginProvider: string;
            roles: string[];
        };
    }>;
    private validateLoginOtp;
    private clearLoginOtp;
    private buildUserPayload;
    private buildLoginTokenResponse;
    changePassword(changePasswordDto: ChangePasswordDto, activeUser: ActiveUserData): Promise<boolean>;
    private generateForgotPasswordToken;
    initiateForgotPassword(initiateForgotPasswordDto: InitiateForgotPasswordDto): Promise<{
        status: string;
        message: string;
        error: string;
        errorCode: string;
        data: {
            user: {
                email: string;
            };
        };
    }>;
    private notifyUserOnForgotPassword;
    confirmForgotPassword(confirmForgotPasswordDto: ConfirmForgotPasswordDto): Promise<{
        status: string;
        message: string;
        error: string;
        errorCode: string;
        data: {};
    }>;
    private notifyUserOnPasswordChanged;
    generateTokens(user: User): Promise<{
        accessToken: string;
        refreshToken: string;
    }>;
    generateAccessToken(user: User): Promise<string>;
    generateRefreshToken(user: User, previousRefreshToken?: string): Promise<string>;
    refreshTokens(refreshTokenDto: RefreshTokenDto): Promise<{
        accessToken: string;
        refreshToken: string;
    }>;
    private signToken;
    validateUserUsingGoogle(user: User): Promise<any>;
    signInUsingGoogle(accessCode: string): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            email: string;
            mobile: string;
            username: string;
            id: number;
            roles: string[];
        };
    }>;
    validateUserUsingFacebook(user: User): Promise<any>;
    signInUsingFacebook(accessCode: string): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            email: string;
            mobile: string;
            username: string;
            id: number;
            roles: string[];
        };
    }>;
    validateUserUsingMicrosoft(user: User): Promise<any>;
    signInUsingMicrosoft(accessCode: string): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            email: string;
            mobile: string;
            username: string;
            id: number;
            roles: string[];
        };
    }>;
    signInUsingApple(accessCode: string): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            email: string;
            mobile: string;
            username: string;
            id: number;
            roles: string[];
        };
    }>;
    private isPasswordlessRegistrationEnabled;
    private checkAccountBlocked;
    private incrementFailedAttempts;
    private resetFailedAttempts;
    logout(refreshToken: string): Promise<{
        message: string;
    }>;
    activateUser(userId: number): Promise<void>;
    me(activeUser: ActiveUserData): Promise<{
        user: {
            email: string;
            mobile: string;
            username: string;
            id: number;
            roles: string[];
        };
        refreshToken: any;
    }>;
    generateSsoCode(activeUser: ActiveUserData, rawAccessToken: string): Promise<{
        ssoCode: string;
    }>;
    exchangeSsoCode(code: string): Promise<{
        accessToken: string;
        refreshToken: string;
        user: {
            id: number;
            username: string;
            email: string;
            mobile: string;
            lastLoginProvider: string;
            roles: string[];
        };
    }>;
}
//# sourceMappingURL=authentication.service.d.ts.map