@nestjs/platform-express
Advanced tools
Comparing version 10.4.11 to 11.0.0-next.1
@@ -1,2 +0,1 @@ | ||
import type { Server } from 'http'; | ||
import { RequestMethod, VersioningOptions } from '@nestjs/common'; | ||
@@ -7,2 +6,3 @@ import { VersionValue } from '@nestjs/common/interfaces'; | ||
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter'; | ||
import type { Server } from 'http'; | ||
import * as http from 'http'; | ||
@@ -35,3 +35,3 @@ import * as https from 'https'; | ||
listen(port: string | number, hostname: string, callback?: () => void): Server; | ||
close(): Promise<unknown>; | ||
close(): Promise<unknown> | undefined; | ||
set(...args: any[]): any; | ||
@@ -51,3 +51,3 @@ enable(...args: any[]): any; | ||
registerParserMiddleware(prefix?: string, rawBody?: boolean): void; | ||
useBodyParser<Options = NestExpressBodyParserOptions>(type: NestExpressBodyParserType, rawBody: boolean, options?: Omit<Options, 'verify'>): this; | ||
useBodyParser<Options extends NestExpressBodyParserOptions = NestExpressBodyParserOptions>(type: NestExpressBodyParserType, rawBody: boolean, options?: Omit<Options, 'verify'>): this; | ||
setLocal(key: string, value: any): this; | ||
@@ -54,0 +54,0 @@ getType(): string; |
@@ -8,4 +8,5 @@ "use strict"; | ||
const router_method_factory_1 = require("@nestjs/core/helpers/router-method-factory"); | ||
const legacy_route_converter_1 = require("@nestjs/core/router/legacy-route-converter"); | ||
const bodyparser = require("body-parser"); | ||
const body_parser_1 = require("body-parser"); | ||
const bodyparser = require("body-parser"); | ||
const cors = require("cors"); | ||
@@ -142,5 +143,16 @@ const express = require("express"); | ||
createMiddlewareFactory(requestMethod) { | ||
return this.routerMethodFactory | ||
.get(this.instance, requestMethod) | ||
.bind(this.instance); | ||
return (path, callback) => { | ||
try { | ||
const convertedPath = legacy_route_converter_1.LegacyRouteConverter.tryConvert(path); | ||
return this.routerMethodFactory | ||
.get(this.instance, requestMethod) | ||
.call(this.instance, convertedPath, callback); | ||
} | ||
catch (e) { | ||
if (e instanceof TypeError) { | ||
legacy_route_converter_1.LegacyRouteConverter.printError(path); | ||
} | ||
throw e; | ||
} | ||
}; | ||
} | ||
@@ -292,2 +304,3 @@ initHttpServer(options) { | ||
} | ||
throw new Error('Unsupported versioning options'); | ||
} | ||
@@ -294,0 +307,0 @@ trackOpenConnections() { |
import type { NestExpressBodyParserOptions } from '../../interfaces'; | ||
export declare function getBodyParserOptions<Options = NestExpressBodyParserOptions>(rawBody: boolean, options?: Omit<Options, 'verify'> | undefined): Options; | ||
export declare function getBodyParserOptions<Options = NestExpressBodyParserOptions>(rawBody: boolean, options?: Omit<Options, 'verify'>): Options; |
@@ -1,1 +0,6 @@ | ||
export declare function transformException(error: Error | undefined): Error; | ||
import { HttpException } from '@nestjs/common'; | ||
export declare function transformException(error: (Error & { | ||
field?: string; | ||
}) | undefined): HttpException | (Error & { | ||
field?: string; | ||
}) | undefined; |
@@ -6,2 +6,4 @@ "use strict"; | ||
const multer_constants_1 = require("./multer.constants"); | ||
// Multer may add in a 'field' property to the error | ||
// https://github.com/expressjs/multer/blob/aa42bea6ac7d0cb8fcb279b15a7278cda805dc63/lib/multer-error.js#L19 | ||
function transformException(error) { | ||
@@ -21,2 +23,5 @@ if (!error || error instanceof common_1.HttpException) { | ||
case multer_constants_1.multerExceptions.MISSING_FIELD_NAME: | ||
if (error.field) { | ||
return new common_1.BadRequestException(`${error.message} - ${error.field}`); | ||
} | ||
return new common_1.BadRequestException(error.message); | ||
@@ -23,0 +28,0 @@ case multer_constants_1.busboyExceptions.MULTIPART_BOUNDARY_NOT_FOUND: |
{ | ||
"name": "@nestjs/platform-express", | ||
"version": "10.4.11", | ||
"version": "11.0.0-next.1", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)", | ||
@@ -23,3 +23,3 @@ "author": "Kamil Mysliwiec", | ||
"cors": "2.8.5", | ||
"express": "4.21.1", | ||
"express": "5.0.1", | ||
"multer": "1.4.4-lts.1", | ||
@@ -29,4 +29,4 @@ "tslib": "2.7.0" | ||
"devDependencies": { | ||
"@nestjs/common": "10.4.11", | ||
"@nestjs/core": "10.4.11" | ||
"@nestjs/common": "^11.0.0-next.1", | ||
"@nestjs/core": "^11.0.0-next.1" | ||
}, | ||
@@ -33,0 +33,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63893
1203
1
+ Added@nestjs/common@10.4.12(transitive)
+ Added@nestjs/core@10.4.12(transitive)
+ Addedaccepts@2.0.0(transitive)
+ Addedarray-flatten@3.0.0(transitive)
+ Addedbody-parser@2.0.2(transitive)
+ Addedcontent-disposition@1.0.0(transitive)
+ Addedcookie-signature@1.2.2(transitive)
+ Addeddebug@3.1.04.3.64.3.7(transitive)
+ Addedexpress@5.0.1(transitive)
+ Addedfinalhandler@2.0.0(transitive)
+ Addedfresh@2.0.0(transitive)
+ Addedgopd@1.1.0(transitive)
+ Addediconv-lite@0.5.20.6.3(transitive)
+ Addedis-promise@4.0.0(transitive)
+ Addedmedia-typer@1.1.0(transitive)
+ Addedmerge-descriptors@2.0.0(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addedmime-types@3.0.0(transitive)
+ Addedms@2.1.2(transitive)
+ Addednegotiator@1.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-to-regexp@8.2.0(transitive)
+ Addedraw-body@3.0.0(transitive)
+ Addedrouter@2.0.0(transitive)
+ Addedsend@1.1.0(transitive)
+ Addedserve-static@2.1.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-is@2.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removed@nestjs/common@10.4.11(transitive)
- Removed@nestjs/core@10.4.11(transitive)
- Removedaccepts@1.3.8(transitive)
- Removedarray-flatten@1.1.1(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcookie-signature@1.0.6(transitive)
- Removedexpress@4.21.1(transitive)
- Removedfinalhandler@1.3.1(transitive)
- Removedgopd@1.0.1(transitive)
- Removedmerge-descriptors@1.0.3(transitive)
- Removedmime@1.6.0(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedpath-to-regexp@0.1.10(transitive)
- Removedsend@0.19.0(transitive)
- Removedserve-static@1.16.2(transitive)
Updatedexpress@5.0.1