Files

42 lines
999 B
TypeScript
Raw Permalink Normal View History

export type TIdpAccountAuthSource = 'local' | 'idp.global';
export type TIdpAccountRole = 'admin' | 'user';
export type TIdpAccountStatus = 'active' | 'disabled';
export interface IIdpSdkAccount {
id: string;
email: string;
emailNormalized: string;
name: string;
role: TIdpAccountRole;
status: TIdpAccountStatus;
authSources: TIdpAccountAuthSource[];
passwordHash?: string;
idpSubject?: string;
createdAt: number;
updatedAt: number;
lastLoginAt?: number;
}
export interface ICreateIdpSdkAccountOptions {
email: string;
name: string;
role: TIdpAccountRole;
status?: TIdpAccountStatus;
authSources: TIdpAccountAuthSource[];
password?: string;
idpSubject?: string;
}
export interface IAuthenticateAccountOptions {
email: string;
password: string;
authSource?: TIdpAccountAuthSource | 'auto';
}
export interface IAuthenticatedAccountResult {
account: IIdpSdkAccount;
authSource: TIdpAccountAuthSource;
idpJwt?: string;
idpRefreshToken?: string;
}