@nestjs/platform-express 10.0.3 → 10.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/express-adapter.js +1 -1
- package/multer/interceptors/any-files.interceptor.d.ts +5 -0
- package/multer/interceptors/any-files.interceptor.js +5 -0
- package/multer/interceptors/file-fields.interceptor.d.ts +5 -0
- package/multer/interceptors/file-fields.interceptor.js +5 -0
- package/multer/interceptors/file.interceptor.d.ts +6 -0
- package/multer/interceptors/file.interceptor.js +6 -0
- package/multer/interceptors/files.interceptor.d.ts +8 -0
- package/multer/interceptors/files.interceptor.js +8 -0
- package/multer/interceptors/no-files.interceptor.d.ts +5 -0
- package/multer/interceptors/no-files.interceptor.js +5 -0
- package/multer/interfaces/files-upload-module.interface.d.ts +6 -0
- package/multer/interfaces/multer-options.interface.d.ts +5 -0
- package/multer/multer.module.d.ts +3 -0
- package/multer/multer.module.js +3 -0
- package/package.json +4 -4
|
@@ -53,7 +53,7 @@ class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
if (response.getHeader('Content-Type') !== undefined &&
|
|
56
|
-
response.getHeader('Content-Type')
|
|
56
|
+
!response.getHeader('Content-Type').startsWith('application/json') &&
|
|
57
57
|
body?.statusCode >= common_1.HttpStatus.BAD_REQUEST) {
|
|
58
58
|
this.logger.warn("Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses");
|
|
59
59
|
response.setHeader('Content-Type', 'application/json');
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { NestInterceptor, Type } from '@nestjs/common';
|
|
2
2
|
import { MulterOptions } from '../interfaces/multer-options.interface';
|
|
3
|
+
/**
|
|
4
|
+
* @param localOptions
|
|
5
|
+
*
|
|
6
|
+
* @publicApi
|
|
7
|
+
*/
|
|
3
8
|
export declare function AnyFilesInterceptor(localOptions?: MulterOptions): Type<NestInterceptor>;
|
|
@@ -6,6 +6,11 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const multer = require("multer");
|
|
7
7
|
const files_constants_1 = require("../files.constants");
|
|
8
8
|
const multer_utils_1 = require("../multer/multer.utils");
|
|
9
|
+
/**
|
|
10
|
+
* @param localOptions
|
|
11
|
+
*
|
|
12
|
+
* @publicApi
|
|
13
|
+
*/
|
|
9
14
|
function AnyFilesInterceptor(localOptions) {
|
|
10
15
|
let MixinInterceptor = class MixinInterceptor {
|
|
11
16
|
constructor(options = {}) {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { NestInterceptor, Type } from '@nestjs/common';
|
|
2
2
|
import { MulterField, MulterOptions } from '../interfaces/multer-options.interface';
|
|
3
|
+
/**
|
|
4
|
+
* @param uploadFields
|
|
5
|
+
* @param localOptions
|
|
6
|
+
* @publicApi
|
|
7
|
+
*/
|
|
3
8
|
export declare function FileFieldsInterceptor(uploadFields: MulterField[], localOptions?: MulterOptions): Type<NestInterceptor>;
|
|
@@ -6,6 +6,11 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const multer = require("multer");
|
|
7
7
|
const files_constants_1 = require("../files.constants");
|
|
8
8
|
const multer_utils_1 = require("../multer/multer.utils");
|
|
9
|
+
/**
|
|
10
|
+
* @param uploadFields
|
|
11
|
+
* @param localOptions
|
|
12
|
+
* @publicApi
|
|
13
|
+
*/
|
|
9
14
|
function FileFieldsInterceptor(uploadFields, localOptions) {
|
|
10
15
|
let MixinInterceptor = class MixinInterceptor {
|
|
11
16
|
constructor(options = {}) {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { NestInterceptor, Type } from '@nestjs/common';
|
|
2
2
|
import { MulterOptions } from '../interfaces/multer-options.interface';
|
|
3
|
+
/**
|
|
4
|
+
* @param fieldName
|
|
5
|
+
* @param localOptions
|
|
6
|
+
*
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
3
9
|
export declare function FileInterceptor(fieldName: string, localOptions?: MulterOptions): Type<NestInterceptor>;
|
|
@@ -6,6 +6,12 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const multer = require("multer");
|
|
7
7
|
const files_constants_1 = require("../files.constants");
|
|
8
8
|
const multer_utils_1 = require("../multer/multer.utils");
|
|
9
|
+
/**
|
|
10
|
+
* @param fieldName
|
|
11
|
+
* @param localOptions
|
|
12
|
+
*
|
|
13
|
+
* @publicApi
|
|
14
|
+
*/
|
|
9
15
|
function FileInterceptor(fieldName, localOptions) {
|
|
10
16
|
let MixinInterceptor = class MixinInterceptor {
|
|
11
17
|
constructor(options = {}) {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { NestInterceptor, Type } from '@nestjs/common';
|
|
2
2
|
import { MulterOptions } from '../interfaces/multer-options.interface';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param fieldName
|
|
6
|
+
* @param maxCount
|
|
7
|
+
* @param localOptions
|
|
8
|
+
*
|
|
9
|
+
* @publicApi
|
|
10
|
+
*/
|
|
3
11
|
export declare function FilesInterceptor(fieldName: string, maxCount?: number, localOptions?: MulterOptions): Type<NestInterceptor>;
|
|
@@ -6,6 +6,14 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const multer = require("multer");
|
|
7
7
|
const files_constants_1 = require("../files.constants");
|
|
8
8
|
const multer_utils_1 = require("../multer/multer.utils");
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param fieldName
|
|
12
|
+
* @param maxCount
|
|
13
|
+
* @param localOptions
|
|
14
|
+
*
|
|
15
|
+
* @publicApi
|
|
16
|
+
*/
|
|
9
17
|
function FilesInterceptor(fieldName, maxCount, localOptions) {
|
|
10
18
|
let MixinInterceptor = class MixinInterceptor {
|
|
11
19
|
constructor(options = {}) {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { NestInterceptor, Type } from '@nestjs/common';
|
|
2
2
|
import { MulterOptions } from '../interfaces/multer-options.interface';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param localOptions
|
|
6
|
+
* @publicApi
|
|
7
|
+
*/
|
|
3
8
|
export declare function NoFilesInterceptor(localOptions?: MulterOptions): Type<NestInterceptor>;
|
|
@@ -6,6 +6,11 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const multer = require("multer");
|
|
7
7
|
const files_constants_1 = require("../files.constants");
|
|
8
8
|
const multer_utils_1 = require("../multer/multer.utils");
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param localOptions
|
|
12
|
+
* @publicApi
|
|
13
|
+
*/
|
|
9
14
|
function NoFilesInterceptor(localOptions) {
|
|
10
15
|
let MixinInterceptor = class MixinInterceptor {
|
|
11
16
|
constructor(options = {}) {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
|
2
2
|
import { MulterOptions } from './multer-options.interface';
|
|
3
3
|
export type MulterModuleOptions = MulterOptions;
|
|
4
|
+
/**
|
|
5
|
+
* @publicApi
|
|
6
|
+
*/
|
|
4
7
|
export interface MulterOptionsFactory {
|
|
5
8
|
createMulterOptions(): Promise<MulterModuleOptions> | MulterModuleOptions;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
7
13
|
export interface MulterModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
8
14
|
useExisting?: Type<MulterOptionsFactory>;
|
|
9
15
|
useClass?: Type<MulterOptionsFactory>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/**
|
|
3
3
|
* @see https://github.com/expressjs/multer
|
|
4
|
+
*
|
|
5
|
+
* @publicApi
|
|
4
6
|
*/
|
|
5
7
|
export interface MulterOptions {
|
|
6
8
|
dest?: string;
|
|
@@ -49,6 +51,9 @@ export interface MulterOptions {
|
|
|
49
51
|
buffer: Buffer;
|
|
50
52
|
}, callback: (error: Error | null, acceptFile: boolean) => void): void;
|
|
51
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* @publicApi
|
|
56
|
+
*/
|
|
52
57
|
export interface MulterField {
|
|
53
58
|
/** The field name. */
|
|
54
59
|
name: string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
2
|
import { MulterModuleAsyncOptions, MulterModuleOptions } from './interfaces/files-upload-module.interface';
|
|
3
|
+
/**
|
|
4
|
+
* @publicApi
|
|
5
|
+
*/
|
|
3
6
|
export declare class MulterModule {
|
|
4
7
|
static register(options?: MulterModuleOptions): DynamicModule;
|
|
5
8
|
static registerAsync(options: MulterModuleAsyncOptions): DynamicModule;
|
package/multer/multer.module.js
CHANGED
|
@@ -7,6 +7,9 @@ const common_1 = require("@nestjs/common");
|
|
|
7
7
|
const random_string_generator_util_1 = require("@nestjs/common/utils/random-string-generator.util");
|
|
8
8
|
const files_constants_1 = require("./files.constants");
|
|
9
9
|
const multer_constants_1 = require("./multer.constants");
|
|
10
|
+
/**
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
10
13
|
let MulterModule = exports.MulterModule = MulterModule_1 = class MulterModule {
|
|
11
14
|
static register(options = {}) {
|
|
12
15
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/platform-express",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.5",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"cors": "2.8.5",
|
|
23
23
|
"express": "4.18.2",
|
|
24
24
|
"multer": "1.4.4-lts.1",
|
|
25
|
-
"tslib": "2.
|
|
25
|
+
"tslib": "2.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@nestjs/common": "10.0.
|
|
29
|
-
"@nestjs/core": "10.0.
|
|
28
|
+
"@nestjs/common": "10.0.5",
|
|
29
|
+
"@nestjs/core": "10.0.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@nestjs/common": "^10.0.0",
|