Code cleanup

pull/2/head
Trivernis 5 years ago
parent 580f15da3d
commit 7785a118f2

@ -1,4 +1,3 @@
import {AggregateError} from "bluebird";
import {GraphQLError} from "graphql"; import {GraphQLError} from "graphql";
import * as status from "http-status"; import * as status from "http-status";
import dataaccess from "../lib/dataaccess"; import dataaccess from "../lib/dataaccess";

@ -1,3 +1,6 @@
/**
* Events that are emitted and processsed internally on the server
*/
export enum InternalEvents { export enum InternalEvents {
CHATCREATE = "chatCreate", CHATCREATE = "chatCreate",
CHATMESSAGE = "chatMessage", CHATMESSAGE = "chatMessage",

@ -1,10 +1,3 @@
/**
* @author Trivernis
* @remarks
*
* Taken from {@link https://github.com/Trivernis/whooshy}
*/
import {Router} from "express"; import {Router} from "express";
import {Namespace, Server} from "socket.io"; import {Namespace, Server} from "socket.io";

@ -1,10 +1,8 @@
import * as crypto from "crypto"; import * as crypto from "crypto";
import * as status from "http-status";
import * as sqz from "sequelize"; import * as sqz from "sequelize";
import {Sequelize} from "sequelize-typescript"; import {Sequelize} from "sequelize-typescript";
import {ChatNotFoundError} from "./errors/ChatNotFoundError"; import {ChatNotFoundError} from "./errors/ChatNotFoundError";
import {EmailAlreadyRegisteredError} from "./errors/EmailAlreadyRegisteredError"; import {EmailAlreadyRegisteredError} from "./errors/EmailAlreadyRegisteredError";
import {GroupNotFoundGqlError, NotLoggedInGqlError} from "./errors/graphqlErrors";
import {GroupNotFoundError} from "./errors/GroupNotFoundError"; import {GroupNotFoundError} from "./errors/GroupNotFoundError";
import {InvalidLoginError} from "./errors/InvalidLoginError"; import {InvalidLoginError} from "./errors/InvalidLoginError";
import {NoActionSpecifiedError} from "./errors/NoActionSpecifiedError"; import {NoActionSpecifiedError} from "./errors/NoActionSpecifiedError";

@ -1,14 +1,8 @@
/**
* @author Trivernis
* @remarks
*
* Partly taken from {@link https://github.com/Trivernis/whooshy}
*/
import {EventEmitter} from "events"; import {EventEmitter} from "events";
import * as fsx from "fs-extra"; import * as fsx from "fs-extra";
import * as yaml from "js-yaml"; import * as yaml from "js-yaml";
import * as winston from "winston"; import * as winston from "winston";
require("winston-daily-rotate-file"); require("winston-daily-rotate-file");
const configPath = "config.yaml"; const configPath = "config.yaml";

@ -11,8 +11,12 @@ export enum RequestType {
@Table({underscored: true}) @Table({underscored: true})
export class Request extends Model<Request> { export class Request extends Model<Request> {
@NotNull @NotNull
@Column({type: sqz.ENUM, values: ["FRIENDREQUEST", "GROUPINVITE", "EVENTINVITE"], @Column({
defaultValue: "FRIENDREQUEST", allowNull: false}) allowNull: false,
defaultValue: "FRIENDREQUEST",
type: sqz.ENUM,
values: ["FRIENDREQUEST", "GROUPINVITE", "EVENTINVITE"],
})
public requestType: RequestType; public requestType: RequestType;
@ForeignKey(() => User) @ForeignKey(() => User)

@ -1,6 +1,5 @@
import * as sqz from "sequelize"; import * as sqz from "sequelize";
import { import {
BelongsTo,
BelongsToMany, BelongsToMany,
Column, Column,
CreatedAt, CreatedAt,

Loading…
Cancel
Save