import { SingleResult } from "toyhauler-common/contracts"; import { IRepo } from "toyhauler-common/IRepo"; import { TenantUser, Principal, AccessProfile } from "toyhauler-common/security"; import { JwtFactory } from "./JwtFactory"; import { AuthSettings } from "./AuthSettings"; /** SDK for performing business actions against the auth service */ export declare class Authenticator { private repo; private tokenizer; private settings; DEFAULT_FIRST_NAME: string; DEFAULT_LAST_NAME: string; DEFAULT_EMAIL: string; /** SDK for performing business actions against the auth service */ constructor(repo: IRepo, tokenizer: JwtFactory, settings: AuthSettings); /** The default projection used when outputting user objects. * ie: we never send the password back with the user object. */ private userProjection; /** NOTE: This token only identifies the user; it does NOT provide access to a tenant. */ createPrincipalToken(Principal: Principal): string; /** Authentication token for a given tenant */ createToken(user: TenantUser): string; tryLogin(login: string, password: string): Promise>; isEmail(candidate: string): boolean; /** Attempts to register the given account, * but if it matches a given username and password, * then logs the user in under the given credentials instead. */ tryRegister(login: string, password: string, accessProfiles?: AccessProfile[], firstName?: string, lastName?: string, email?: string): Promise>; }