import { Schema } from "mongoose"; import { EnumMap, IJson, IDocument, IObject, IInstance, IModel, IAction, IActionTypes, ILocation, MiscInfo } from "@onebro/oba-common"; import { OBAuthIdJson, OBAuthIdModel, OBAuthId } from "./auth-ids"; import { OBAuthCredsJson, OBAuthCredsModel, OBAuthCreds } from "./auth-creds"; export declare enum OBAuthAcctStatuses { A = "Authenticated", E = "Enabled", V = "Verified", L = "Locked", D = "Disabled", X = "Deleted", N = "New", I = "Inactive", O = "Offline" } export declare type OBAuthAcctStatus = keyof typeof OBAuthAcctStatuses; export declare enum OBAuthAcctRoles { G = "GUEST", U = "USER", A = "ADMIN", S = "SUPER", SA = "SYSADMIN" } export declare type OBAuthAcctRole = keyof typeof OBAuthAcctRoles; export declare type OBAuthAcctFullName = { first: string; last: string; }; export declare type OBAuthAcctContactInfo = { phn: string; method: "email" | "text" | "push"; }; export declare type OBAuthAcctScope = { name: string; version?: string; }; export declare type OBAuthAcctDevice = { mobile: boolean; name: string; }; export declare type OBAuthAcctUserInfo = Partial<{ ssn: string; dob: string; addr: string; phn: string; dl: { num: number; st?: string; reg?: string; cty?: string; ctry: string; }; }>; export declare type OBAuthTokenData = { username: string; next: string; role: string; okto: string; }; export declare type OBAuthAcctConfig = { role: OBAuthAcctRole; scopes: OBAuthAcctScope[]; name?: OBAuthAcctFullName; yob?: string; dob?: string | Date; contact?: OBAuthAcctContactInfo; device?: OBAuthAcctDevice; locs?: ILocation[]; user?: OBAuthAcctUserInfo; }; export declare type OBAuthAcctType = IObject & Omit & { next: string; user?: string; info?: MiscInfo; }; export interface OBAuthAcctDocument extends IDocument, OBAuthAcctType { age: [number, number]; fullname: string; location: string; } export interface OBAuthAcct extends IInstance, OBAuthAcctDocument { valid(): Promise; } export interface OBAuthAcctModel extends IModel { } export declare type OBAuthAcctPublicKeys = "age" | "location" | "info"; export declare type OBAuthAcctPublicData = Pick; export declare type OBAuthAcctJson = IJson & OBAuthAcctPublicData & { role: OBAuthAcctRoles; scopes: string[]; phnEnabled: boolean; name: string; memberSince: Date; user?: OBAuthAcctUserInfo; }; export declare type OBAuthJson = Omit; export declare type OBAuthAcctModelMap = { OBAuthAcct: OBAuthAcctModel; OBAuthId: OBAuthIdModel; OBAuthCreds: OBAuthCredsModel; }; export declare type OBAuthAcctInstanceMap = { authId: OBAuthId; creds?: OBAuthCreds; acct?: OBAuthAcct; }; export declare type OBAuthAcctSchemaMap = { acct: Schema; }; export declare type OBAuthAcctActionTypes = IActionTypes | "register$" | "verify$" | "set$" | "autoset$" | "login$" | "forgot$" | "reset$" | "logout$"; export declare type OBAuthAcctActions = EnumMap;