@nestjs/platform-express
Advanced tools
Comparing version 9.4.3 to 10.0.0
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import type { Server } from 'http'; | ||
@@ -8,2 +9,4 @@ import { RequestMethod, VersioningOptions } from '@nestjs/common'; | ||
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import { NestExpressBodyParserOptions } from '../interfaces/nest-express-body-parser-options.interface'; | ||
@@ -16,3 +19,3 @@ import { NestExpressBodyParserType } from '../interfaces/nest-express-body-parser.interface'; | ||
*/ | ||
export declare class ExpressAdapter extends AbstractHttpAdapter { | ||
export declare class ExpressAdapter extends AbstractHttpAdapter<http.Server | https.Server> { | ||
private readonly routerMethodFactory; | ||
@@ -19,0 +22,0 @@ private readonly logger; |
@@ -57,3 +57,3 @@ "use strict"; | ||
response.getHeader('Content-Type') !== 'application/json' && | ||
(body === null || body === void 0 ? void 0 : body.statusCode) >= common_1.HttpStatus.BAD_REQUEST) { | ||
body?.statusCode >= common_1.HttpStatus.BAD_REQUEST) { | ||
this.logger.warn("Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses"); | ||
@@ -147,3 +147,3 @@ response.setHeader('Content-Type', 'application/json'); | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.forceCloseConnections) { | ||
if (options?.forceCloseConnections) { | ||
this.trackOpenConnections(); | ||
@@ -225,6 +225,5 @@ } | ||
const handlerForMediaTypeVersioning = (req, res, next) => { | ||
var _a, _b; | ||
const MEDIA_TYPE_HEADER = 'Accept'; | ||
const acceptHeaderValue = ((_a = req.headers) === null || _a === void 0 ? void 0 : _a[MEDIA_TYPE_HEADER]) || | ||
((_b = req.headers) === null || _b === void 0 ? void 0 : _b[MEDIA_TYPE_HEADER.toLowerCase()]); | ||
const acceptHeaderValue = req.headers?.[MEDIA_TYPE_HEADER] || | ||
req.headers?.[MEDIA_TYPE_HEADER.toLowerCase()]; | ||
const acceptHeaderVersionParameter = acceptHeaderValue | ||
@@ -261,5 +260,4 @@ ? acceptHeaderValue.split(';')[1] | ||
const handlerForHeaderVersioning = (req, res, next) => { | ||
var _a, _b; | ||
const customHeaderVersionParameter = ((_a = req.headers) === null || _a === void 0 ? void 0 : _a[versioningOptions.header]) || | ||
((_b = req.headers) === null || _b === void 0 ? void 0 : _b[versioningOptions.header.toLowerCase()]); | ||
const customHeaderVersionParameter = req.headers?.[versioningOptions.header] || | ||
req.headers?.[versioningOptions.header.toLowerCase()]; | ||
// No version was supplied | ||
@@ -266,0 +264,0 @@ if ((0, shared_utils_1.isUndefined)(customHeaderVersionParameter)) { |
@@ -13,3 +13,6 @@ "use strict"; | ||
if (rawBody === true) { | ||
parserOptions = Object.assign(Object.assign({}, parserOptions), { verify: rawBodyParser }); | ||
parserOptions = { | ||
...parserOptions, | ||
verify: rawBodyParser, | ||
}; | ||
} | ||
@@ -16,0 +19,0 @@ return parserOptions; |
/// <reference types="node" /> | ||
import { Server } from 'http'; | ||
import { INestApplication } from '@nestjs/common'; | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { INestApplication, HttpServer } from '@nestjs/common'; | ||
import type { Server as CoreHttpServer } from 'http'; | ||
import type { Server as CoreHttpsServer } from 'https'; | ||
import type { Server } from 'net'; | ||
import type { Express } from 'express'; | ||
import { NestExpressBodyParserOptions } from './nest-express-body-parser-options.interface'; | ||
import { NestExpressBodyParserType } from './nest-express-body-parser.interface'; | ||
import { ServeStaticOptions } from './serve-static-options.interface'; | ||
import { NestExpressBodyParserType } from './nest-express-body-parser.interface'; | ||
/** | ||
@@ -14,4 +19,10 @@ * Interface describing methods on NestExpressApplication. | ||
*/ | ||
export interface NestExpressApplication extends INestApplication { | ||
export interface NestExpressApplication<TServer extends CoreHttpServer | CoreHttpsServer = CoreHttpServer> extends INestApplication<TServer> { | ||
/** | ||
* Returns the underlying HTTP adapter bounded to the Express.js app. | ||
* | ||
* @returns {HttpServer} | ||
*/ | ||
getHttpAdapter(): HttpServer<Express.Request, Express.Response, Express>; | ||
/** | ||
* Starts the application. | ||
@@ -18,0 +29,0 @@ * |
@@ -12,3 +12,6 @@ "use strict"; | ||
constructor(options = {}) { | ||
this.multer = multer(Object.assign(Object.assign({}, options), localOptions)); | ||
this.multer = multer({ | ||
...options, | ||
...localOptions, | ||
}); | ||
} | ||
@@ -15,0 +18,0 @@ async intercept(context, next) { |
@@ -12,3 +12,6 @@ "use strict"; | ||
constructor(options = {}) { | ||
this.multer = multer(Object.assign(Object.assign({}, options), localOptions)); | ||
this.multer = multer({ | ||
...options, | ||
...localOptions, | ||
}); | ||
} | ||
@@ -15,0 +18,0 @@ async intercept(context, next) { |
@@ -12,3 +12,6 @@ "use strict"; | ||
constructor(options = {}) { | ||
this.multer = multer(Object.assign(Object.assign({}, options), localOptions)); | ||
this.multer = multer({ | ||
...options, | ||
...localOptions, | ||
}); | ||
} | ||
@@ -15,0 +18,0 @@ async intercept(context, next) { |
@@ -12,3 +12,6 @@ "use strict"; | ||
constructor(options = {}) { | ||
this.multer = multer(Object.assign(Object.assign({}, options), localOptions)); | ||
this.multer = multer({ | ||
...options, | ||
...localOptions, | ||
}); | ||
} | ||
@@ -15,0 +18,0 @@ async intercept(context, next) { |
@@ -5,1 +5,2 @@ export * from './any-files.interceptor'; | ||
export * from './files.interceptor'; | ||
export * from './no-files.interceptor'; |
@@ -8,1 +8,2 @@ "use strict"; | ||
tslib_1.__exportStar(require("./files.interceptor"), exports); | ||
tslib_1.__exportStar(require("./no-files.interceptor"), exports); |
@@ -10,3 +10,3 @@ "use strict"; | ||
const multer_constants_1 = require("./multer.constants"); | ||
let MulterModule = MulterModule_1 = class MulterModule { | ||
let MulterModule = exports.MulterModule = MulterModule_1 = class MulterModule { | ||
static register(options = {}) { | ||
@@ -66,5 +66,4 @@ return { | ||
}; | ||
MulterModule = MulterModule_1 = tslib_1.__decorate([ | ||
exports.MulterModule = MulterModule = MulterModule_1 = tslib_1.__decorate([ | ||
(0, common_1.Module)({}) | ||
], MulterModule); | ||
exports.MulterModule = MulterModule; |
{ | ||
"name": "@nestjs/platform-express", | ||
"version": "9.4.3", | ||
"version": "10.0.0", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)", | ||
@@ -28,9 +28,9 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@nestjs/common": "9.4.3", | ||
"@nestjs/core": "9.4.3" | ||
"@nestjs/common": "10.0.0", | ||
"@nestjs/core": "10.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@nestjs/common": "^9.0.0", | ||
"@nestjs/core": "^9.0.0" | ||
"@nestjs/common": "^10.0.0", | ||
"@nestjs/core": "^10.0.0" | ||
} | ||
} |
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
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
65584
52
1110