Add frontend, backend and CLI

This commit is contained in:
Maidul Islam
2022-11-17 17:54:35 -05:00
parent 8d00c5cdb7
commit bea0ff6e05
276 changed files with 50230 additions and 72 deletions
+65
View File
@@ -0,0 +1,65 @@
import { Schema, model, Types } from 'mongoose';
export interface IUser {
_id: Types.ObjectId;
email: string;
firstName?: string;
lastName?: string;
publicKey?: string;
encryptedPrivateKey?: string;
iv?: string;
tag?: string;
salt?: string;
verifier?: string;
refreshVersion?: Number;
}
const userSchema = new Schema<IUser>(
{
email: {
type: String,
required: true
},
firstName: {
type: String
},
lastName: {
type: String
},
publicKey: {
type: String,
select: false
},
encryptedPrivateKey: {
type: String,
select: false
},
iv: {
type: String,
select: false
},
tag: {
type: String,
select: false
},
salt: {
type: String,
select: false
},
verifier: {
type: String,
select: false
},
refreshVersion: {
type: Number,
default: 0
}
},
{
timestamps: true
}
);
const User = model<IUser>('User', userSchema);
export default User;