Commit d3e4dc02 authored by Christopher Fullarton's avatar Christopher Fullarton

Updates dependencies

parent 3bd1daad
......@@ -15,7 +15,7 @@
"dependency-check": "npx --ignore-existing madge --circular --extensions ts src"
},
"dependencies": {
"api-spec-converter": "^2.8.3",
"api-spec-converter": "^2.10.1",
"body-parser": "^1.19.0",
"bunyan": "^1.8.12",
"cas": "0.0.3",
......@@ -25,62 +25,60 @@
"excel4node": "^1.7.2",
"express": "^4.17.1",
"express-ws": "^4.0.0",
"file-type": "^12.0.0",
"gitlab": "^4.5.1",
"i18n": "^0.8.3",
"file-type": "^12.4.0",
"gitlab": "^11.4.2",
"i18n": "^0.8.4",
"jsonwebtoken": "^8.5.1",
"mathjax-node": "^2.1.1",
"messageformat": "^2.2.1",
"messageformat": "^2.3.0",
"mime": "^2.4.4",
"mime-types": "^2.1.24",
"minimist": "^1.2.0",
"mongoose": "^5.6.10",
"mongoose": "^5.7.7",
"morgan": "^1.9.1",
"multer": "^1.4.1",
"nodemailer": "^6.2.1",
"multer": "^1.4.2",
"nodemailer": "^6.3.1",
"reflect-metadata": "^0.1.13",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"routing-controllers": "^0.7.7",
"routing-controllers": "^0.8.0",
"routing-controllers-openapi": "^1.7.0",
"source-map-support": "^0.5.12",
"swagger-ui-express": "^4.0.6",
"typegoose": "^5.9.0",
"xml2js": "^0.4.19",
"source-map-support": "^0.5.16",
"swagger-ui-express": "^4.1.2",
"@typegoose/typegoose": "^6.0.4",
"xml2js": "^0.4.22",
"amqplib": "^0.5.5"
},
"devDependencies": {
"@types/amqplib": "^0.5.13",
"@types/body-parser": "1.17.0",
"@types/bull": "^3.5.14",
"@types/body-parser": "1.17.1",
"@types/lodash": "^4.14.144",
"@types/bunyan": "^1.8.6",
"@types/busboy": "^0.2.3",
"@types/chai": "^4.1.7",
"@types/chai-http": "4.2.0",
"@types/compression": "^0.0.36",
"@types/cors": "^2.8.5",
"@types/chai": "^4.2.4",
"@types/chai-http": "^4.2.0",
"@types/compression": "^1.0.1",
"@types/cors": "^2.8.6",
"@types/crypto-js": "^3.1.43",
"@types/express": "^4.17.0",
"@types/express": "^4.17.2",
"@types/file-type": "^10.9.1",
"@types/i18n": "^0.8.5",
"@types/jsonwebtoken": "^8.3.2",
"@types/lowdb": "^1.0.7",
"@types/i18n": "^0.8.6",
"@types/jsonwebtoken": "^8.3.5",
"@types/minimist": "^1.2.0",
"@types/mocha": "^5.2.7",
"@types/mongoose": "^5.3.24",
"@types/morgan": "^1.7.35",
"@types/node": "^12.0.10",
"@types/request": "^2.48.1",
"@types/request-promise-native": "^1.0.16",
"@types/xml2js": "^0.4.4",
"@types/mongoose": "^5.5.28",
"@types/morgan": "^1.7.37",
"@types/node": "^12.12.5",
"@types/request": "^2.48.3",
"@types/request-promise-native": "^1.0.17",
"@types/xml2js": "^0.4.5",
"chai": "^4.2.0",
"chai-http": "^4.3.0",
"mocha": "^6.1.4",
"mocha": "^6.2.2",
"mocha-typescript": "^1.1.17",
"nyc": "^14.1.1",
"ts-loader": "^6.0.4",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"typescript": "^3.5.3"
"ts-loader": "^6.2.1",
"ts-node": "^8.4.1",
"tslint": "^5.20.0",
"typescript": "^3.6.4"
}
}
......@@ -38,7 +38,7 @@ class DbDAO extends AbstractDAO<object> {
return this.instance;
}
public create(collection: string, elem: IDbObject | object): Promise<InsertOneWriteOpResult> {
public create(collection: string, elem: IDbObject | object): Promise<InsertOneWriteOpResult<any>> {
if (!this._isConnected || !this._dbCon) {
return;
}
......
const Gitlab = require('gitlab/dist/es5').default;
import { Branch, CommitAction, GitlabProject, Language } from '../enums/Enums';
import { ICommitAction, IGitlabCommitAction } from '../interfaces/gitlab/apiv4';
import { Gitlab } from 'gitlab';
import { Branch, GitlabCommitAction, GitlabProject, Language } from '../enums/Enums';
import { IGitlabCommitAction } from '../interfaces/gitlab/apiv11';
import { generateToken } from '../lib/generateToken';
import LoggerService from '../services/LoggerService';
import { availableLangs } from '../statistics';
......@@ -46,7 +46,7 @@ class I18nDAO extends AbstractDAO<object> {
since: this.storage[project].lastUpdate.toISOString(),
});
return commits.length > 0;
return (commits as any).length > 0;
}
public reloadCache(): Promise<void> {
......@@ -137,10 +137,10 @@ class I18nDAO extends AbstractDAO<object> {
const filter = /\.(ts|html|js)$/;
const negativeFilter = /(spec|test|po|mock|pipe|module|config|conf|karma|environment|assets|adapter)\./;
const fileContents = ((await gitlabService.Repositories.tree(project, {
const fileContents = (((await gitlabService.Repositories.tree(project, {
recursive: true,
ref: Branch.TargetBranch,
})).filter(val => val.type === 'blob' && val.name.match(filter)).filter(val => !val.name.match(negativeFilter)));
})) as any).filter(val => val.type === 'blob' && val.name.match(filter)).filter(val => !val.name.match(negativeFilter)));
let fileData = [];
while (fileContents.length > 0) {
......@@ -162,12 +162,12 @@ class I18nDAO extends AbstractDAO<object> {
const langData = [];
availableLangs.forEach(async (langRef, index) => {
const dataNode = await gitlabService.RepositoryFiles.showRaw(project, `${this.buildI18nBasePath(project)}/${langRef.toLowerCase()}.json`,
Branch.TargetBranch);
const dataNode = (await gitlabService.RepositoryFiles.showRaw(project, `${this.buildI18nBasePath(project)}/${langRef.toLowerCase()}.json`,
Branch.TargetBranch)) as unknown as string;
this.buildKeys({
root: '',
dataNode,
dataNode: JSON.parse(dataNode),
langRef: langRef.toLowerCase(),
langData,
});
......@@ -187,7 +187,7 @@ class I18nDAO extends AbstractDAO<object> {
return false;
}
return remoteProject.permissions.project_access.access_level >= 30;
return (remoteProject as any).permissions.project_access.access_level >= 30;
}
public createObjectFromKeys({ data, result }): void {
......@@ -215,9 +215,9 @@ class I18nDAO extends AbstractDAO<object> {
}
}
private prepareGitlabConnection(token?: string): any {
private prepareGitlabConnection(token?: string): InstanceType<typeof Gitlab> {
return new Gitlab({
url: 'https://git.thm.de',
host: 'https://git.thm.de',
token: token || this.gitlabAccessToken,
});
}
......@@ -228,8 +228,8 @@ class I18nDAO extends AbstractDAO<object> {
private generateCommitActionForFile(project: GitlabProject, langKey: string, data: object): IGitlabCommitAction {
return {
action: <ICommitAction>CommitAction.Update,
file_path: `${this.buildI18nBasePath(project)}/${langKey.toLowerCase()}.json`,
action: GitlabCommitAction.Update,
filePath: `${this.buildI18nBasePath(project)}/${langKey.toLowerCase()}.json`,
content: JSON.stringify(data),
};
}
......
......@@ -40,6 +40,7 @@ class MongoDbConnector {
useCreateIndex: true,
autoIndex: true,
useNewUrlParser: true,
useUnifiedTopology: true,
} as any);
});
}
......
......@@ -7,7 +7,7 @@ export enum Branch {
TargetBranch = 'master', //
}
export enum CommitAction {
export enum GitlabCommitAction {
Create = 'create', //
Delete = 'delete', //
Move = 'move', //
......
// Copy/pasted from node_modules/gitlab/dist/types/core/services/Commits.d.ts since it is not exported
export interface IGitlabCommitAction {
/** The action to perform */
action: 'create' | 'delete' | 'move' | 'update';
/** Full path to the file. Ex. lib/class.rb */
filePath: string;
/** Original full path to the file being moved.Ex.lib / class1.rb */
previousPath?: string;
/** File content, required for all except delete. Optional for move */
content?: string;
/** text or base64. text is default. */
encoding?: string;
/** Last known file commit id. Will be only considered in update, move and delete actions. */
lastCommitId?: string;
}
export interface ICommitAction {
CREATE?: 'create';
DELETE?: 'delete';
MOVE?: 'move';
UPDATE?: 'update';
}
export interface IGitlabCommitAction {
action: ICommitAction;
file_path: string;
previous_path?: string;
content?: string;
encoding?: string;
last_commit_id?: string;
}
import { index, prop, Typegoose } from 'typegoose';
import { getModelForClass, index, prop } from '@typegoose/typegoose';
import AssetDAO from '../db/AssetDAO';
import DbDAO from '../db/DbDAO';
import { DbCollection, DbEvent, DbWatchStreamOperation } from '../enums/DbOperation';
......@@ -6,14 +6,14 @@ import { IAssetSerialized } from '../interfaces/IAsset';
import LoggerService from '../services/LoggerService';
@index({ digest: 1 }, { unique: true })
export class AssetModelItem extends Typegoose implements IAssetSerialized {
export class AssetModelItem implements IAssetSerialized {
@prop({ required: true }) public data: Uint8Array;
@prop() public digest: string;
@prop() public url: string;
@prop() public mimeType: string;
}
export const AssetModel = new AssetModelItem().getModelForClass(AssetModelItem, {
export const AssetModel = getModelForClass(AssetModelItem, {
schemaOptions: {
collection: DbCollection.Assets,
timestamps: true,
......
import { arrayProp, index, prop, Typegoose } from 'typegoose';
import { arrayProp, getModelForClass, index, prop } from '@typegoose/typegoose';
import DbDAO from '../../db/DbDAO';
import UserDAO from '../../db/UserDAO';
import { DbCollection, DbEvent, DbWatchStreamOperation } from '../../enums/DbOperation';
......@@ -6,7 +6,7 @@ import { IUserSerialized } from '../../interfaces/users/IUserSerialized';
import LoggerService from '../../services/LoggerService';
@index({ name: 1 }, { unique: true })
export class UserModelItem extends Typegoose implements IUserSerialized {
export class UserModelItem implements IUserSerialized {
@prop({ required: true }) public name: string;
@prop({ required: false }) public passwordHash: string;
@prop({ required: false }) public tokenHash: string;
......@@ -19,7 +19,7 @@ export class UserModelItem extends Typegoose implements IUserSerialized {
@prop() public token?: string;
}
export const UserModel = new UserModelItem().getModelForClass(UserModelItem, {
export const UserModel = getModelForClass(UserModelItem, {
schemaOptions: {
collection: DbCollection.Users,
timestamps: true,
......
import { arrayProp, index, prop, Typegoose } from 'typegoose';
import { arrayProp, getModelForClass, index, prop } from '@typegoose/typegoose';
import DbDAO from '../../db/DbDAO';
import MemberDAO from '../../db/MemberDAO';
import { DbCollection, DbEvent, DbWatchStreamOperation } from '../../enums/DbOperation';
......@@ -10,7 +10,7 @@ import LoggerService from '../../services/LoggerService';
name: 1,
currentQuizName: 1,
}, { unique: true })
export class MemberModelItem extends Typegoose implements IMemberSerialized {
export class MemberModelItem implements IMemberSerialized {
@prop() public colorCode: string;
@prop({ required: false }) public groupName: string;
@prop() public name: string;
......@@ -20,7 +20,7 @@ export class MemberModelItem extends Typegoose implements IMemberSerialized {
@prop() public currentQuizName: string;
}
export const MemberModel = new MemberModelItem().getModelForClass(MemberModelItem, {
export const MemberModel = getModelForClass(MemberModelItem, {
schemaOptions: {
collection: DbCollection.Members,
timestamps: true,
......
import { arrayProp, index, prop, Typegoose } from 'typegoose';
import { arrayProp, getModelForClass, index, prop } from '@typegoose/typegoose';
import DbDAO from '../../db/DbDAO';
import QuizDAO from '../../db/quiz/QuizDAO';
import { AbstractQuestionEntity } from '../../entities/question/AbstractQuestionEntity';
......@@ -10,7 +10,7 @@ import { ISessionConfigurationSerialized } from '../../interfaces/session_config
import LoggerService from '../../services/LoggerService';
@index({ name: 1 }, { unique: true })
export class QuizModelItem extends Typegoose implements IQuizSerialized {
export class QuizModelItem implements IQuizSerialized {
@prop({ required: false }) public expiry?: Date;
@prop({
required: false,
......@@ -34,7 +34,7 @@ export class QuizModelItem extends Typegoose implements IQuizSerialized {
@prop() public readingConfirmationRequested: boolean;
}
export const QuizModel = new QuizModelItem().getModelForClass(QuizModelItem, {
export const QuizModel = getModelForClass(QuizModelItem, {
schemaOptions: {
collection: DbCollection.Quizzes,
timestamps: true,
......
import { prop, Typegoose } from 'typegoose';
import { prop } from '@typegoose/typegoose';
import { IMusicSessionConfigurationSerialized } from '../../interfaces/session_configuration/music/IMusicSessionConfigurationSerialized';
import { TitleMusicSessionConfigurationModelItem } from './TitleMusicSessionConfigurationModelItem';
import { VolumeMusicSessionConfigurationModelItem } from './VolumeMusicSessionConfigurationModelItem';
export class MusicSessionConfigurationModelItem extends Typegoose implements IMusicSessionConfigurationSerialized {
export class MusicSessionConfigurationModelItem implements IMusicSessionConfigurationSerialized {
@prop() public enabled: { lobby: boolean; countdownRunning: boolean; countdownEnd: boolean };
@prop() public titleConfig: TitleMusicSessionConfigurationModelItem;
@prop() public volumeConfig: VolumeMusicSessionConfigurationModelItem;
......
import { prop, Typegoose } from 'typegoose';
import { prop } from '@typegoose/typegoose';
import { INickSessionConfigurationSerialized } from '../../interfaces/session_configuration/nicks/INickSessionConfigurationSerialized';
export class NickSessionConfigurationModelItem extends Typegoose implements INickSessionConfigurationSerialized {
export class NickSessionConfigurationModelItem implements INickSessionConfigurationSerialized {
@prop() public autoJoinToGroup: boolean;
@prop() public blockIllegalNicks: boolean;
@prop() public maxMembersPerGroup: number;
......
import { prop, Typegoose } from 'typegoose';
import { prop } from '@typegoose/typegoose';
import { LeaderboardConfiguration } from '../../enums/LeaderboardConfiguration';
import { ISessionConfigurationSerialized } from '../../interfaces/session_configuration/ISessionConfigurationSerialized';
import { MusicSessionConfigurationModelItem } from './MusicSessionConfigurationModelItem';
import { NickSessionConfigurationModelItem } from './NickSessionConfigurationModelItem';
export class SessionConfigurationModelItem extends Typegoose implements ISessionConfigurationSerialized {
export class SessionConfigurationModelItem implements ISessionConfigurationSerialized {
@prop() public confidenceSliderEnabled: boolean;
@prop() public music: MusicSessionConfigurationModelItem;
@prop() public nicks: NickSessionConfigurationModelItem;
......
import { prop, Typegoose } from 'typegoose';
import { prop } from '@typegoose/typegoose';
import { ITitleMusicSessionConfigurationSerialized } from '../../interfaces/session_configuration/music/ITitleMusicSessionConfigurationSerialized';
export class TitleMusicSessionConfigurationModelItem extends Typegoose implements ITitleMusicSessionConfigurationSerialized {
export class TitleMusicSessionConfigurationModelItem implements ITitleMusicSessionConfigurationSerialized {
@prop() public countdownEnd: string;
@prop() public countdownRunning: string;
@prop() public lobby: string;
......
import { prop, Typegoose } from 'typegoose';
import { prop } from '@typegoose/typegoose';
import { IVolumeMusicSessionConfigurationSerialized } from '../../interfaces/session_configuration/music/IVolumeMusicSessionConfigurationSerialized';
export class VolumeMusicSessionConfigurationModelItem extends Typegoose implements IVolumeMusicSessionConfigurationSerialized {
export class VolumeMusicSessionConfigurationModelItem implements IVolumeMusicSessionConfigurationSerialized {
@prop() public countdownEnd: number;
@prop() public countdownRunning: number;
@prop() public global: number;
......
......@@ -25,7 +25,7 @@ export class ApiRouter extends AbstractRouter {
private openAPISpec(): OpenAPIObject {
const storage = getMetadataArgsStorage();
return routingControllersToSpec(storage, routingControllerOptions, {
return routingControllersToSpec(storage as any, routingControllerOptions, {
info: {
title: staticStatistics.appName,
version: staticStatistics.appVersion,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment