Skip to content

Commit a597236

Browse files
committed
refactor: express as dev dependency
1 parent 720c334 commit a597236

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
"cross-env": "^7.0.3",
127127
"dotenv": "^16.3.1",
128128
"ejs": "^3.1.9",
129-
"express": "^4.18.2",
130129
"fs": "^0.0.1-security",
131130
"graphql": "^16.8.1",
132131
"ioredis": "^5.3.2",
@@ -200,6 +199,7 @@
200199
"eslint-plugin-promise": "^6.1.1",
201200
"eslint-plugin-security": "^1.7.1",
202201
"eslint-plugin-standard": "^5.0.0",
202+
"express": "^4.21.2",
203203
"ioredis-mock": "^8.7.0",
204204
"jest": "^29.7.0",
205205
"jest-cli": "^29.7.0",

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { writeFileSync } from 'fs';
33
import { NestFactory, SerializedGraph, PartialGraphHost } from '@nestjs/core';
44
import { INestApplication } from '@nestjs/common';
55
import { ConfigService } from '@nestjs/config';
6-
import { Express } from 'express';
76
import CoreModule from '@core/core.module';
87
import nestListenConfig, { createNestApplicationOptions, validateKnownExceptions } from '@core/configs/nestListen.config';
98
import nestApiConfig from '@core/configs/nestApi.config';
@@ -12,6 +11,7 @@ import { ConfigsInterface } from '@core/configs/envs.config';
1211
import { EnvironmentsEnum } from '@common/enums/environments.enum';
1312
import { ProcessExitStatusEnum } from '@common/enums/processEvents.enum';
1413
import { ErrorInterface } from '@shared/internal/interfaces/errorInterface';
14+
import type { Express } from 'express';
1515

1616

1717
async function startNestApplication(): Promise<void> {

src/modules/app/file/api/controllers/File.controller.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import {
66
} from '@nestjs/common';
77
import { ApiOperation, ApiTags, ApiBody, ApiHeaders, ApiProduces, ApiConsumes, ApiOkResponse, ApiCreatedResponse } from '@nestjs/swagger';
88
import { FileInterceptor } from '@nestjs/platform-express';
9-
import { Response } from 'express';
109
import FileService from '@app/file/services/File.service';
1110
import AuthGuard from '@api/guards/Auth.guard';
1211
import { HttpExceptionsFilter } from '@api/filters/HttpExceptions.filter';
1312
import ResponseInterceptor from '@api/interceptors/Response.interceptor';
1413
import authSwaggerDecorator from '@api/decorators/authSwagger.decorator';
1514
import exceptionsResponseDecorator from '@api/decorators/exceptionsResponse.decorator';
1615
import CustomThrottlerGuard from '@common/guards/CustomThrottler.guard';
17-
import { RequestFileInterface } from '@shared/internal/interfaces/endpointInterface';
16+
import { RequestFileInterface, ResponseInterface } from '@shared/internal/interfaces/endpointInterface';
1817

1918

2019
@ApiTags('Files')
@@ -50,7 +49,7 @@ export default class FileController {
5049
@Headers() headers: Record<string, string | undefined>,
5150
@Headers('fileName') fileNameHeader: string,
5251
@Headers('filePath') filePathHeader: string,
53-
@Res({ passthrough: true }) response: Response,
52+
@Res({ passthrough: true }) response: ResponseInterface,
5453
): Promise<Buffer | StreamableFile | string> {
5554
const { content, contentType, fileName } = await this.fileService.downloadFile(fileNameHeader, filePathHeader, headers.accept);
5655

src/modules/app/hook/api/controllers/Hook.controller.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
UseGuards, UseFilters, UseInterceptors,
55
} from '@nestjs/common';
66
import { ApiOperation, ApiTags, ApiProduces, ApiConsumes, ApiCreatedResponse, ApiNotAcceptableResponse } from '@nestjs/swagger';
7-
import { Response } from 'express';
87
import WebhookService from '@app/hook/services/Webhook.service';
98
import { RegisterEventHookValidatorPipe } from '@app/hook/api/pipes/HookValidator.pipe';
109
import { RegisterEventHookInputDto } from '@app/hook/api/dto/HookInput.dto';
@@ -16,6 +15,7 @@ import ResponseInterceptor from '@api/interceptors/Response.interceptor';
1615
import CustomThrottlerGuard from '@common/guards/CustomThrottler.guard';
1716
import { HttpStatusEnum } from '@common/enums/httpStatus.enum';
1817
import HttpMessagesConstants from '@common/constants/HttpMessages.constants';
18+
import { ResponseInterface } from '@shared/internal/interfaces/endpointInterface';
1919

2020

2121
@ApiTags('Webhooks')
@@ -55,7 +55,7 @@ export default class HookController {
5555
@ApiProduces('application/json')
5656
public async registerEventHook(
5757
@Query(RegisterEventHookValidatorPipe) query: RegisterEventHookInputDto,
58-
@Res({ passthrough: true }) response: Response,
58+
@Res({ passthrough: true }) response: ResponseInterface,
5959
): Promise<{ statusMessage: string }> {
6060
const resourceName = 'Hook event register';
6161

src/shared/internal/interfaces/endpointInterface.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { HttpException } from '@nestjs/common';
2-
import { Request, Response, NextFunction } from 'express';
3-
import { Multer as _Multer } from 'multer';
42
import { UserAuthInterface } from './userAuthInterface';
53
import { ErrorInterface } from './errorInterface';
4+
import type { Multer as _Multer } from 'multer';
5+
import type { Request, Response, NextFunction } from 'express';
66

77

88
export interface RequestInterface extends Request {
@@ -22,3 +22,4 @@ export interface EndpointInterface {
2222
response: ResponseInterface,
2323
next: NextFunctionInterface,
2424
}
25+

0 commit comments

Comments
 (0)