mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
46 lines
821 B
TypeScript
46 lines
821 B
TypeScript
import { Schema } from "mongoose";
|
|
|
|
const UserSchema = new Schema({
|
|
accessTokens: {
|
|
github: { type: String },
|
|
},
|
|
externalIDs: {
|
|
github: { type: String, index: true },
|
|
},
|
|
username: {
|
|
type: String,
|
|
index: { unique: true },
|
|
},
|
|
emails: [
|
|
{
|
|
email: { type: String },
|
|
default: Boolean,
|
|
},
|
|
],
|
|
isAdmin: { type: Boolean, default: false },
|
|
photo: String,
|
|
repositories: [String],
|
|
default: {
|
|
terms: [String],
|
|
options: {
|
|
expirationMode: { type: String },
|
|
update: Boolean,
|
|
image: Boolean,
|
|
pdf: Boolean,
|
|
notebook: Boolean,
|
|
link: Boolean,
|
|
page: { type: String },
|
|
},
|
|
},
|
|
status: {
|
|
type: String,
|
|
default: "active",
|
|
},
|
|
dateOfEntry: {
|
|
type: Date,
|
|
default: new Date(),
|
|
},
|
|
});
|
|
|
|
export default UserSchema;
|