feat: signup enhancements; more extensions to schema

This commit is contained in:
Wyatt Johnson
2018-07-10 15:54:52 -06:00
parent d46145f04c
commit 6efe36ceaa
16 changed files with 278 additions and 63 deletions
+21 -8
View File
@@ -15,12 +15,24 @@ function collection(db: Db) {
return db.collection<Readonly<User>>("users");
}
export interface Profile {
readonly id: string;
readonly type: string;
provider?: string;
export interface LocalProfile {
type: "local";
id: string;
}
export interface OIDCProfile {
type: "oidc";
id: string;
provider: string;
}
export interface SSOProfile {
type: "sso";
id: string;
}
export type Profile = LocalProfile | OIDCProfile | SSOProfile;
export interface Token {
readonly id: string;
name: string;
@@ -28,14 +40,14 @@ export interface Token {
}
export interface UserStatusHistory<T> {
status: T; // TODO: migrate field
status: T;
assigned_by?: string;
reason?: string; // TODO: migrate field
reason?: string;
created_at: Date;
}
export interface UserStatusItem<T> {
status: T; // TODO: migrate field
status: T;
history: Array<UserStatusHistory<T>>;
}
@@ -48,6 +60,7 @@ export interface UserStatus {
export interface User extends TenantResource {
readonly id: string;
username: string | null;
displayName?: string;
password?: string;
email?: string;
email_verified?: boolean;
@@ -56,7 +69,7 @@ export interface User extends TenantResource {
role: GQLUSER_ROLE;
status: UserStatus;
action_counts: ActionCounts;
ignored_users: string[]; // TODO: migrate field
ignored_users: string[];
created_at: Date;
}