/// <reference types="node" />
import type { URL } from 'url';
import { type IAuditUser, type IUser, type IUserWithRootRole } from '../types/user';
import type { AccessService } from './access-service';
import type ResetTokenService from './reset-token-service';
import type { EmailService } from './email-service';
import type { IAuthOption, IUnleashConfig } from '../types/option';
import type SessionService from './session-service';
import type { IUnleashStores } from '../types/stores';
import { RoleName } from '../types/model';
import type SettingService from './setting-service';
import type { TokenUserSchema } from '../openapi/spec/token-user-schema';
import type EventService from '../features/events/event-service';
export interface ICreateUser {
    name?: string;
    email?: string;
    username?: string;
    password?: string;
    rootRole: number | RoleName;
}
export interface IUpdateUser {
    id: number;
    name?: string;
    email?: string;
    rootRole?: number | RoleName;
}
export interface ILoginUserRequest {
    email: string;
    name?: string;
    rootRole?: number | RoleName;
    autoCreate?: boolean;
}
declare class UserService {
    private logger;
    private store;
    private eventService;
    private accessService;
    private resetTokenService;
    private sessionService;
    private emailService;
    private settingService;
    private passwordResetTimeouts;
    private baseUriPath;
    constructor(stores: Pick<IUnleashStores, 'userStore'>, { server, getLogger, authentication, }: Pick<IUnleashConfig, 'getLogger' | 'authentication' | 'server'>, services: {
        accessService: AccessService;
        resetTokenService: ResetTokenService;
        emailService: EmailService;
        eventService: EventService;
        sessionService: SessionService;
        settingService: SettingService;
    });
    validatePassword(password: string): boolean;
    initAdminUser(initialAdminUserConfig: Pick<IAuthOption, 'createAdminUser' | 'initialAdminUser'>): Promise<void>;
    getAll(): Promise<IUserWithRootRole[]>;
    getUser(id: number): Promise<IUserWithRootRole>;
    search(query: string): Promise<IUser[]>;
    getByEmail(email: string): Promise<IUser>;
    createUser({ username, email, name, password, rootRole }: ICreateUser, auditUser?: IAuditUser): Promise<IUserWithRootRole>;
    updateUser({ id, name, email, rootRole }: IUpdateUser, auditUser: IAuditUser): Promise<IUserWithRootRole>;
    deleteUser(userId: number, auditUser: IAuditUser): Promise<void>;
    loginUser(usernameOrEmail: string, password: string): Promise<IUser>;
    /**
     * Used to login users without specifying password. Used when integrating
     * with external identity providers.
     *
     * @param usernameOrEmail
     * @param autoCreateUser
     * @returns
     */
    loginUserWithoutPassword(email: string, autoCreateUser?: boolean): Promise<IUser>;
    loginUserSSO({ email, name, rootRole, autoCreate, }: ILoginUserRequest): Promise<IUser>;
    loginDemoAuthDefaultAdmin(): Promise<IUser>;
    changePassword(userId: number, password: string): Promise<void>;
    changePasswordWithVerification(userId: number, newPassword: string, oldPassword: string): Promise<void>;
    getUserForToken(token: string): Promise<TokenUserSchema>;
    /**
     * If the password is a strong password will update password and delete all sessions for the user we're changing the password for
     * @param token - the token authenticating this request
     * @param password - new password
     */
    resetPassword(token: string, password: string): Promise<void>;
    createResetPasswordEmail(receiverEmail: string, user?: IUser): Promise<URL>;
}
export default UserService;
//# sourceMappingURL=user-service.d.ts.map