import { NewUser, User } from './types'; export declare class InactiveUser extends Error { } export declare const fieldNames: string[]; export declare function findAll(): Promise; export declare function findById(id: number): Promise; export declare function findActiveById(id: number): Promise; /** * Returns true if more than 1 user exists in the system. * * If there are 0 users, this puts a12nserver in setup mode, which allows a * person to create the first user in the system, automatically activate it * and make them an admin. */ export declare function hasUsers(): Promise; export declare function findByIdentity(identity: string): Promise; /** * Finds a user by its href'. * * This can be a string like /user/1, or a full url. * It can also be the uri listed in the 'identity' field. */ export declare function findByHref(href: string): Promise; export declare function save(user: User | NewUser): Promise; export declare function createPassword(user: User, password: string): Promise; export declare function updatePassword(user: User, password: string): Promise; /** * Returns true or false if the password was correct. * * Calling this method multiple times might result in a block. */ export declare function validatePassword(user: User, password: string): Promise; /** * Returns true or false if the totp token was correct. * * Calling this method multiple times might result in a block. */ export declare function validateTotp(user: User, token: string): Promise; /** * Returns true or false if the totp was provided or not. * * */ export declare function hasTotp(user: User): Promise; export declare type UserRecord = { id: number; identity: string; nickname: string; created: number; type: number; active: number; }; export declare function recordToModel(user: UserRecord): User; export declare function getPathName(href: string): string;