Skip to content
Snippets Groups Projects
Commit 5db05fa0 authored by Jérôme POIRIER's avatar Jérôme POIRIER
Browse files

chore: update libraries

parent 0856c4b9
Branches
No related tags found
1 merge request!1Release
Pipeline #66461 passed
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -19,76 +19,76 @@
"test:debug": "node --expose-gc --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand --logHeapUsage"
},
"dependencies": {
"@nestjs/common": "8.2.4",
"@nestjs/core": "8.2.4",
"@nestjs/microservices": "8.2.4",
"@nestjs/passport": "^8.0.1",
"@nestjs/platform-express": "8.2.4",
"@nestjs/swagger": "5.1.5",
"@nestjs/terminus": "8.0.3",
"@nestjs/axios": "^3.0.0",
"@nestjs/common": "10.1.0",
"@nestjs/core": "10.1.0",
"@nestjs/microservices": "10.1.0",
"@nestjs/passport": "^10.0.0",
"@nestjs/platform-express": "10.1.0",
"@nestjs/swagger": "7.1.1",
"@nestjs/terminus": "10.0.1",
"@types/multer": "^1.4.7",
"axios": "0.24.0",
"axios": "^1.4.0",
"class-transformer": "0.5.1",
"class-validator": "0.13.2",
"dotenv": "^10.0.0",
"express-rate-limit": "5.5.1",
"class-validator": "0.14.0",
"dotenv": "^16.3.1",
"express-rate-limit": "6.7.1",
"form-data": "4.0.0",
"fs-extra": "10.0.0",
"helmet": "4.6.0",
"fs-extra": "11.1.1",
"helmet": "7.0.0",
"iconv-lite": "^0.6.3",
"joi": "17.5.0",
"joi": "17.9.2",
"passport": "^0.4.0",
"passport-headerapikey": "^1.2.2",
"rxjs": "7.5.1",
"swagger-ui-express": "4.3.0",
"winston": "^3.8.2",
"rxjs": "7.8.1",
"swagger-ui-express": "5.0.0",
"winston": "^3.10.0",
"winston-daily-rotate-file": "^4.7.1"
},
"devDependencies": {
"@nestjs/cli": "^8.1.6",
"@nestjs/testing": "8.2.4",
"@nestjs/cli": "^10.1.9",
"@nestjs/testing": "10.1.0",
"@types/bcrypt": "5.0.0",
"@types/bull": "3.15.7",
"@types/cookie-parser": "1.4.2",
"@types/cron": "1.7.3",
"@types/crypto-js": "4.1.0",
"@types/bull": "3.15.9",
"@types/cookie-parser": "1.4.3",
"@types/cron": "2.0.1",
"@types/crypto-js": "4.1.1",
"@types/csurf": "1.11.2",
"@types/dotenv": "8.2.0",
"@types/express": "4.17.13",
"@types/express": "4.17.17",
"@types/express-rate-limit": "5.1.3",
"@types/express-serve-static-core": "4.17.27",
"@types/fs-extra": "9.0.13",
"@types/jest": "27.4.0",
"@types/mustache": "4.1.2",
"@types/node": "17.0.8",
"@types/nodemailer": "6.4.4",
"@types/passport": "^1.0.7",
"@types/express-serve-static-core": "4.17.35",
"@types/fs-extra": "11.0.1",
"@types/jest": "29.5.3",
"@types/mustache": "4.2.2",
"@types/node": "20.4.2",
"@types/nodemailer": "6.4.8",
"@types/passport": "^1.0.12",
"@types/passport-http": "^0.3.9",
"@types/passport-jwt": "3.0.6",
"@types/passport-local": "1.0.34",
"@types/puppeteer": "5.4.4",
"@types/passport-jwt": "3.0.9",
"@types/passport-local": "1.0.35",
"@types/puppeteer": "5.4.7",
"@types/qs": "6.9.7",
"@types/serve-static": "1.13.10",
"@types/supertest": "2.0.11",
"@types/uuid": "8.3.4",
"@types/validator": "13.7.1",
"@types/serve-static": "1.15.2",
"@types/supertest": "2.0.12",
"@types/uuid": "9.0.2",
"@types/validator": "13.7.17",
"cli-highlight": "2.1.11",
"concurrently": "7.0.0",
"highlight.js": "11.3.1",
"husky": "7.0.4",
"jest": "27.4.7",
"prettier": "2.5.1",
"concurrently": "8.2.0",
"highlight.js": "11.8.0",
"husky": "8.0.3",
"jest": "29.6.1",
"pretty-quick": "3.1.3",
"reflect-metadata": "0.1.13",
"supertest": "6.1.6",
"ts-jest": "27.1.2",
"supertest": "6.3.3",
"ts-jest": "29.1.1",
"ts-mockito": "2.6.1",
"ts-node": "^10.7.0",
"tsconfig-paths": "3.12.0",
"ts-node": "^10.9.1",
"tsconfig-paths": "4.2.0",
"tslint": "6.1.3",
"tslint-config-prettier": "1.18.0",
"tslint-plugin-prettier": "2.3.0",
"typescript": "4.5.4"
"typescript": "5.1.6"
},
"jest": {
"moduleFileExtensions": [
......
import * as dotenv from 'dotenv';
import { Request, Response } from 'express';
import { Options } from 'express-rate-limit';
import * as fs from 'fs';
import * as Joi from 'joi';
......@@ -75,8 +76,8 @@ export class ConfigService {
return {
windowMs: Number(this.envConfig.RATE_LIMIT_WINDOW),
max: Number(this.envConfig.RATE_LIMIT_MAX),
headers: Boolean(this.envConfig.RATE_LIMIT_HEADERS),
skip: () => Boolean(this.envConfig.RATE_LIMIT_ENABLED) !== true,
};
standardHeaders: Boolean(this.envConfig.RATE_LIMIT_HEADERS),
skip: (req: Request, res: Response) => Boolean(this.envConfig.RATE_LIMIT_ENABLED) !== true,
} as Options;
}
}
import { Body, Controller, Header, Post, Res, UploadedFile, UseGuards, UseInterceptors } from '@nestjs/common';
import { Body, Controller, Post, Res, UploadedFile, UseGuards, UseInterceptors } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { FileInterceptor } from '@nestjs/platform-express';
import { ApiTags } from '@nestjs/swagger';
......@@ -24,7 +24,6 @@ export class FilesController {
// *********************************************************************************************
@Post('read-file')
@Header('Content-Type', 'application/octet-stream')
@UseGuards(AuthGuard('api-key'))
@PreventCache()
async readFile(@Body() dto: ReadFileDto, @Res() res): Promise<void> {
......@@ -46,7 +45,6 @@ export class FilesController {
}
@Post('move-doc')
@Header('Content-Type', 'application/octet-stream')
@UseGuards(AuthGuard('api-key'))
@PreventCache()
async moveDoc(@Body() dto: MoveFileDto, @Res() res): Promise<void> {
......@@ -60,11 +58,10 @@ export class FilesController {
// *********************************************************************************************
@Post('remove')
@Header('Content-Type', 'application/octet-stream')
@UseGuards(AuthGuard('api-key'))
@PreventCache()
async remove(@Body() dto: RemoveDto, @Res() res): Promise<void> {
await this.fileService.remove(dto.path);
remove(@Body() dto: RemoveDto, @Res() res): void {
this.fileService.remove(dto.path);
res.send();
}
......@@ -74,7 +71,6 @@ export class FilesController {
// *********************************************************************************************
@Post('file-rotate')
@Header('Content-Type', 'application/octet-stream')
@UseGuards(AuthGuard('api-key'))
@PreventCache()
async fileRotate(@Body() dto: FileRotateDto, @Res() res): Promise<void> {
......
import { HttpModule, Module } from '@nestjs/common';
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';
import * as https from 'https';
import { ConfigModule } from '../config/config.module';
import { FileService } from '../shared/services/file.service';
......
......@@ -14,7 +14,7 @@ async function bootstrap() {
const config: ConfigService = app.get(ConfigService);
app.useGlobalPipes(new ValidationPipe());
app.use(helmet());
app.use(helmet.default());
app.use(
// @ts-ignore: known issue
RateLimit({ ...config.rateLimit }),
......
......@@ -55,14 +55,16 @@ export class FileService {
// * REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOVE REMOV *
// *********************************************************************************************
public async remove(path: string): Promise<void> {
public remove(path: string): void {
const fullpath: string = join(this.configService.documentsDir, path);
this.logger.debug(`Removing path ${fullpath})`);
if (existsSync(fullpath)) {
removeSync(fullpath);
return removeSync(fullpath);
}
throw new NotFoundException(`No such file or directory '${path}'`);
}
// *********************************************************************************************
......
import { HttpModule, Module } from '@nestjs/common';
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';
import * as https from 'https';
import { ConfigModule } from '../config/config.module';
import { FileService } from './services/file.service';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment