1
0
Fork 0

Definitions inside methods

refactor/models
Bsian 2020-06-09 12:56:14 +01:00
parent d534ea163d
commit 52351fd8e4
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
4 changed files with 64 additions and 64 deletions

View File

@ -22,7 +22,7 @@ export interface AccountInterface extends Document {
authTag: Buffer authTag: Buffer
} }
const Account: Schema = new Schema({ const Account = new Schema<AccountInterface>({
username: String, username: String,
userID: String, userID: String,
homepath: String, homepath: String,

View File

@ -1,24 +1,24 @@
import { Document, Schema, model } from 'mongoose'; import { Document, Schema, model } from 'mongoose';
import { AccountInterface } from './Account'; import { AccountInterface } from './Account';
export interface DomainInterface extends Document { export interface DomainInterface extends Document {
account: AccountInterface, account: AccountInterface,
domain: string, domain: string,
port: number, port: number,
// Below is the full absolute path to the location of the x509 certificate and key files. // Below is the full absolute path to the location of the x509 certificate and key files.
x509: { x509: {
cert: string, cert: string,
key: string key: string
}, },
enabled: true enabled: true
} }
const Domain: Schema = new Schema({ const Domain = new Schema<DomainInterface>({
account: Object, account: Object,
domain: String, domain: String,
port: Number, port: Number,
x509: { cert: String, key: String }, x509: { cert: String, key: String },
enabled: Boolean, enabled: Boolean,
}); });
export default model<DomainInterface>('Domain', Domain); export default model<DomainInterface>('Domain', Domain);

View File

@ -1,38 +1,38 @@
import { Document, Schema, model } from 'mongoose'; import { Document, Schema, model } from 'mongoose';
export interface ModerationInterface extends Document { export interface ModerationInterface extends Document {
username: string, username: string,
userID: string, userID: string,
logID: string, logID: string,
moderatorID: string, moderatorID: string,
reason: string, reason: string,
/** /**
* @field 0 - Create * @field 0 - Create
* @field 1 - Warn * @field 1 - Warn
* @field 2 - Lock * @field 2 - Lock
* @field 3 - Unlock * @field 3 - Unlock
* @field 4 - Delete * @field 4 - Delete
*/ */
type: 0 | 1 | 2 | 3 | 4 type: 0 | 1 | 2 | 3 | 4
date: Date, date: Date,
expiration: { expiration: {
date: Date, date: Date,
processed: boolean processed: boolean
} }
} }
const Moderation: Schema = new Schema({ const Moderation = new Schema<ModerationInterface>({
username: String, username: String,
userID: String, userID: String,
logID: String, logID: String,
moderatorID: String, moderatorID: String,
reason: String, reason: String,
type: Number, type: Number,
date: Date, date: Date,
expiration: { expiration: {
date: Date, date: Date,
processed: Boolean, processed: Boolean,
}, },
}); });
export default model<ModerationInterface>('Moderation', Moderation); export default model<ModerationInterface>('Moderation', Moderation);

View File

@ -12,7 +12,7 @@ export interface TierInterface extends Tiers, Document {
id: number; id: number;
} }
const Tier: Schema = new Schema({ const Tier = new Schema<TierInterface>({
id: Number, id: Number,
resourceLimits: { resourceLimits: {
ram: Number, ram: Number,