@jealous-robot-dev/shared-types-databases
Version:
72 lines (71 loc) • 1.81 kB
TypeScript
import { AuthProviders } from '@jealous-robot-dev/shared-types-app';
import { DataStandartModel } from '../common';
import { OS } from './devices';
export interface PasswordReset {
token: string;
issuedAt: number;
}
export interface UserDevice {
UID: string;
DUID: string;
ips: string[];
os: OS;
issueTokensBefore?: number;
}
export interface UserCredentials {
readonly UID: string;
readonly devices: string[];
passwordReset?: PasswordReset;
authProviders?: AuthProviders[];
firstname?: string;
lastname?: string;
email: string;
suspended?: boolean;
profilePicUrl?: string;
username: string;
password?: string;
verifiedEmail: boolean;
emailVerificationToken?: string;
requireCodeFromNewDevice: boolean;
}
export interface DBMUserCredentials extends UserCredentials, DataStandartModel {
}
export interface DBMUserDevice extends UserDevice, DataStandartModel {
}
export interface DeviceVerification {
UID: string;
DUID: string;
ip: string;
osVersion: string;
osName: string;
rememberMe: boolean;
authenticatedWith?: AuthProviders;
deviceVerificationCode?: string;
attempts: number;
}
export interface DBMDeviceVerification extends DeviceVerification, DataStandartModel {
}
export interface HighlySuggestedParams {
firstname?: boolean;
lastname?: boolean;
username?: boolean;
}
export interface UserCardData {
firstname?: string;
lastname?: string;
username?: string;
email: string;
authProvider?: AuthProviders;
ppu?: string;
}
export interface SerializedUser {
lastname: string;
firstname: string;
email: string;
aw: AuthProviders;
ppu: string;
UID: string;
suspended: boolean;
username: string;
issuedAt: number;
}