@nestjs/common 8.3.1 → 8.4.0
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/Readme.md +1 -1
- package/decorators/core/catch.decorator.d.ts +2 -2
- package/enums/version-type.enum.d.ts +2 -1
- package/enums/version-type.enum.js +1 -0
- package/file-stream/streamable-file.d.ts +1 -0
- package/file-stream/streamable-file.js +6 -2
- package/file-stream/streamable-options.interface.d.ts +1 -0
- package/index.d.ts +1 -1
- package/interfaces/middleware/nest-middleware.interface.d.ts +1 -1
- package/interfaces/modules/index.d.ts +2 -0
- package/interfaces/modules/index.js +2 -0
- package/interfaces/modules/injection-token.interface.d.ts +3 -0
- package/interfaces/modules/injection-token.interface.js +2 -0
- package/interfaces/modules/optional-factory-dependency.interface.d.ts +5 -0
- package/interfaces/modules/optional-factory-dependency.interface.js +2 -0
- package/interfaces/modules/provider.interface.d.ts +7 -6
- package/interfaces/version-options.interface.d.ts +13 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -18
package/Readme.md
CHANGED
|
@@ -54,7 +54,7 @@ With official support, you can get expert help straight from Nest core team. We
|
|
|
54
54
|
|
|
55
55
|
## Support
|
|
56
56
|
|
|
57
|
-
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support
|
|
57
|
+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support from the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
|
58
58
|
|
|
59
59
|
#### Principal Sponsors
|
|
60
60
|
<table style="text-align:center;"><tr>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type } from '../../interfaces';
|
|
1
|
+
import { Type, Abstract } from '../../interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator that marks a class as a Nest exception filter. An exception filter
|
|
4
4
|
* handles exceptions thrown by or not handled by your application code.
|
|
@@ -16,4 +16,4 @@ import { Type } from '../../interfaces';
|
|
|
16
16
|
*
|
|
17
17
|
* @publicApi
|
|
18
18
|
*/
|
|
19
|
-
export declare function Catch(...exceptions: Type<any>
|
|
19
|
+
export declare function Catch(...exceptions: Array<Type<any> | Abstract<any>>): ClassDecorator;
|
|
@@ -9,4 +9,5 @@ var VersioningType;
|
|
|
9
9
|
VersioningType[VersioningType["URI"] = 0] = "URI";
|
|
10
10
|
VersioningType[VersioningType["HEADER"] = 1] = "HEADER";
|
|
11
11
|
VersioningType[VersioningType["MEDIA_TYPE"] = 2] = "MEDIA_TYPE";
|
|
12
|
+
VersioningType[VersioningType["CUSTOM"] = 3] = "CUSTOM";
|
|
12
13
|
})(VersioningType = exports.VersioningType || (exports.VersioningType = {}));
|
|
@@ -20,8 +20,12 @@ class StreamableFile {
|
|
|
20
20
|
return this.stream;
|
|
21
21
|
}
|
|
22
22
|
getHeaders() {
|
|
23
|
-
const { type = 'application/octet-stream', disposition =
|
|
24
|
-
return {
|
|
23
|
+
const { type = 'application/octet-stream', disposition = undefined, length = undefined, } = this.options;
|
|
24
|
+
return {
|
|
25
|
+
type,
|
|
26
|
+
disposition,
|
|
27
|
+
length,
|
|
28
|
+
};
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
exports.StreamableFile = StreamableFile;
|
package/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './enums';
|
|
|
5
5
|
export * from './exceptions';
|
|
6
6
|
export * from './file-stream';
|
|
7
7
|
export * from './http';
|
|
8
|
-
export { Abstract, ArgumentMetadata, ArgumentsHost, BeforeApplicationShutdown, CallHandler, CanActivate, ClassProvider, ContextType, DynamicModule, ExceptionFilter, ExecutionContext, ExistingProvider, FactoryProvider, ForwardReference, HttpServer, INestApplication, INestApplicationContext, INestMicroservice, IntrospectionResult, MessageEvent, MiddlewareConsumer, ModuleMetadata, NestApplicationOptions, NestHybridApplicationOptions, NestInterceptor, NestMiddleware, NestModule, OnApplicationBootstrap, OnApplicationShutdown, OnModuleDestroy, OnModuleInit, Paramtype, PipeTransform, Provider, RpcExceptionFilter, Scope, ScopeOptions, Type, ValidationError, ValueProvider, VersioningOptions, VERSION_NEUTRAL, WebSocketAdapter, WsExceptionFilter, WsMessageHandler, } from './interfaces';
|
|
8
|
+
export { Abstract, ArgumentMetadata, ArgumentsHost, BeforeApplicationShutdown, CallHandler, CanActivate, ClassProvider, ContextType, DynamicModule, ExceptionFilter, ExecutionContext, ExistingProvider, FactoryProvider, ForwardReference, HttpServer, INestApplication, INestApplicationContext, INestMicroservice, InjectionToken, IntrospectionResult, MessageEvent, MiddlewareConsumer, ModuleMetadata, NestApplicationOptions, NestHybridApplicationOptions, NestInterceptor, NestMiddleware, NestModule, OnApplicationBootstrap, OnApplicationShutdown, OnModuleDestroy, OnModuleInit, OptionalFactoryDependency, Paramtype, PipeTransform, Provider, RpcExceptionFilter, Scope, ScopeOptions, Type, ValidationError, ValueProvider, VersioningOptions, VERSION_NEUTRAL, WebSocketAdapter, WsExceptionFilter, WsMessageHandler, } from './interfaces';
|
|
9
9
|
export * from './pipes';
|
|
10
10
|
export * from './serializer';
|
|
11
11
|
export * from './services';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './dynamic-module.interface';
|
|
2
2
|
export * from './forward-reference.interface';
|
|
3
|
+
export * from './injection-token.interface';
|
|
3
4
|
export * from './introspection-result.interface';
|
|
4
5
|
export * from './module-metadata.interface';
|
|
5
6
|
export * from './nest-module.interface';
|
|
7
|
+
export * from './optional-factory-dependency.interface';
|
|
6
8
|
export * from './provider.interface';
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./dynamic-module.interface"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./forward-reference.interface"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./injection-token.interface"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./introspection-result.interface"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./module-metadata.interface"), exports);
|
|
8
9
|
tslib_1.__exportStar(require("./nest-module.interface"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./optional-factory-dependency.interface"), exports);
|
|
9
11
|
tslib_1.__exportStar(require("./provider.interface"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Abstract } from '../abstract.interface';
|
|
2
1
|
import { Scope } from '../scope-options.interface';
|
|
3
2
|
import { Type } from '../type.interface';
|
|
3
|
+
import { InjectionToken } from './injection-token.interface';
|
|
4
|
+
import { OptionalFactoryDependency } from './optional-factory-dependency.interface';
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
6
7
|
* @publicApi
|
|
@@ -29,7 +30,7 @@ export interface ClassProvider<T = any> {
|
|
|
29
30
|
/**
|
|
30
31
|
* Injection token
|
|
31
32
|
*/
|
|
32
|
-
provide:
|
|
33
|
+
provide: InjectionToken;
|
|
33
34
|
/**
|
|
34
35
|
* Type (class name) of provider (instance to be injected).
|
|
35
36
|
*/
|
|
@@ -58,7 +59,7 @@ export interface ValueProvider<T = any> {
|
|
|
58
59
|
/**
|
|
59
60
|
* Injection token
|
|
60
61
|
*/
|
|
61
|
-
provide:
|
|
62
|
+
provide: InjectionToken;
|
|
62
63
|
/**
|
|
63
64
|
* Instance of a provider to be injected.
|
|
64
65
|
*/
|
|
@@ -88,7 +89,7 @@ export interface FactoryProvider<T = any> {
|
|
|
88
89
|
/**
|
|
89
90
|
* Injection token
|
|
90
91
|
*/
|
|
91
|
-
provide:
|
|
92
|
+
provide: InjectionToken;
|
|
92
93
|
/**
|
|
93
94
|
* Factory function that returns an instance of the provider to be injected.
|
|
94
95
|
*/
|
|
@@ -96,7 +97,7 @@ export interface FactoryProvider<T = any> {
|
|
|
96
97
|
/**
|
|
97
98
|
* Optional list of providers to be injected into the context of the Factory function.
|
|
98
99
|
*/
|
|
99
|
-
inject?: Array<
|
|
100
|
+
inject?: Array<InjectionToken | OptionalFactoryDependency>;
|
|
100
101
|
/**
|
|
101
102
|
* Optional enum defining lifetime of the provider that is returned by the Factory function.
|
|
102
103
|
*/
|
|
@@ -121,7 +122,7 @@ export interface ExistingProvider<T = any> {
|
|
|
121
122
|
/**
|
|
122
123
|
* Injection token
|
|
123
124
|
*/
|
|
124
|
-
provide:
|
|
125
|
+
provide: InjectionToken;
|
|
125
126
|
/**
|
|
126
127
|
* Provider to be aliased by the Injection token.
|
|
127
128
|
*/
|
|
@@ -48,6 +48,18 @@ export interface MediaTypeVersioningOptions {
|
|
|
48
48
|
*/
|
|
49
49
|
key: string;
|
|
50
50
|
}
|
|
51
|
+
export interface CustomVersioningOptions {
|
|
52
|
+
type: VersioningType.CUSTOM;
|
|
53
|
+
/**
|
|
54
|
+
* A function that accepts a request object (specific to the underlying platform, ie Express or Fastify)
|
|
55
|
+
* and returns a single version value or an ordered array of versions, in order from HIGHEST to LOWEST.
|
|
56
|
+
*
|
|
57
|
+
* Ex. Returned version array = ['3.1', '3.0', '2.5', '2', '1.9']
|
|
58
|
+
*
|
|
59
|
+
* Use type assertion or narrowing to identify the specific request type.
|
|
60
|
+
*/
|
|
61
|
+
extractor: (request: unknown) => string | string[];
|
|
62
|
+
}
|
|
51
63
|
interface VersioningCommonOptions {
|
|
52
64
|
/**
|
|
53
65
|
* The default version to be used as a fallback when you did not provide some
|
|
@@ -58,5 +70,5 @@ interface VersioningCommonOptions {
|
|
|
58
70
|
/**
|
|
59
71
|
* @publicApi
|
|
60
72
|
*/
|
|
61
|
-
export declare type VersioningOptions = VersioningCommonOptions & (HeaderVersioningOptions | UriVersioningOptions | MediaTypeVersioningOptions);
|
|
73
|
+
export declare type VersioningOptions = VersioningCommonOptions & (HeaderVersioningOptions | UriVersioningOptions | MediaTypeVersioningOptions | CustomVersioningOptions);
|
|
62
74
|
export {};
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
<a name="8.2.0"></a>
|
|
7
|
-
# [8.2.0](https://github.com/nestjs/nest/compare/v8.1.2...v8.2.0) (2021-11-08)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
### Bug Fixes
|
|
11
|
-
|
|
12
|
-
* **deps:** update dependency axios to v0.24.0 ([fc77e4f](https://github.com/nestjs/nest/commit/fc77e4f))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Features
|
|
16
|
-
|
|
17
|
-
* **common:** add the ability to set some extra metadata about returned files ([5100573](https://github.com/nestjs/nest/commit/5100573))
|
|
18
|
-
* **common:** allow to swap out class-validator and class-transformer ([2a1cc62](https://github.com/nestjs/nest/commit/2a1cc62))
|