Skip to content

Commit b144dbe

Browse files
chore(release) publish v5.0.0-beta.0
1 parent eff9942 commit b144dbe

64 files changed

Lines changed: 3900 additions & 206 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "nestjs",
33
"version": "4.6.6",
44
"description": "Modern, fast, powerful node.js web framework",
5-
"main": "index.js",
65
"scripts": {
76
"precommit": "lint-staged",
87
"test":
@@ -18,7 +17,9 @@
1817
"publish":
1918
"./node_modules/.bin/lerna publish --exact -m \"chore(release) publish %s\"",
2019
"publish:next":
21-
"./node_modules/.bin/lerna publish --npm-tag=next --skip-git"
20+
"./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(release) publish %s\"",
21+
"publish:beta":
22+
"./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(release) publish %s\""
2223
},
2324
"engines": {
2425
"node": ">=6.11.0"
@@ -30,11 +31,11 @@
3031
"author": "Kamil Mysliwiec",
3132
"license": "MIT",
3233
"dependencies": {
33-
"@nestjs/common": "^5.0.0",
34-
"@nestjs/core": "^5.0.0",
35-
"@nestjs/microservices": "^5.0.0",
36-
"@nestjs/testing": "^5.0.0",
37-
"@nestjs/websockets": "^5.0.0",
34+
"@nestjs/common": "beta",
35+
"@nestjs/core": "beta",
36+
"@nestjs/microservices": "beta",
37+
"@nestjs/testing": "beta",
38+
"@nestjs/websockets": "beta",
3839
"axios": "^0.17.1",
3940
"class-transformer": "^0.1.8",
4041
"class-validator": "^0.8.1",
@@ -59,7 +60,7 @@
5960
"pump": "^3.0.0",
6061
"redis": "^2.7.1",
6162
"reflect-metadata": "^0.1.10",
62-
"rxjs": "^5.5.6",
63+
"rxjs": "^5.5.8",
6364
"rxjs-grpc": "^0.1.6",
6465
"socket.io": "^2.0.4",
6566
"trouter": "^1.0.0"

packages/common/decorators/http/create-route-param-metadata.decorator.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const randomString = () =>
2929
Math.random()
3030
.toString(36)
3131
.substring(2, 15);
32-
32+
3333
/**
3434
* Creates HTTP route param decorator
3535
* @param factory
@@ -54,13 +54,15 @@ export function createParamDecorator(
5454
}
5555

5656
/**
57-
* Creates route params custom decorator
57+
* Creates HTTP route param decorator
5858
* @deprecated
5959
* @param factory
6060
*/
6161
export function createRouteParamDecorator(
6262
factory: CustomParamFactory,
6363
): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator {
64-
deprecate('The "createRouteParamDecorator" function is deprecated and will be removed within next major release. Use "createParamDecorator" instead.')
64+
deprecate(
65+
'The "createRouteParamDecorator" function is deprecated and will be removed within next major release. Use "createParamDecorator" instead.',
66+
);
6567
return createParamDecorator(factory);
6668
}

packages/common/decorators/http/route-params.decorator.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ROUTE_ARGS_METADATA } from '../../constants';
33
import { RouteParamtypes } from '../../enums/route-paramtypes.enum';
44
import { PipeTransform } from '../../index';
55
import { isNil, isString } from '../../utils/shared.utils';
6+
import { Type } from '../../interfaces';
67

78
export type ParamData = object | string | number;
89
export interface RouteParamsMetadata {
@@ -17,7 +18,7 @@ const assignMetadata = (
1718
paramtype: RouteParamtypes,
1819
index: number,
1920
data?: ParamData,
20-
...pipes: PipeTransform<any>[]
21+
...pipes: (Type<PipeTransform> | PipeTransform)[]
2122
) => ({
2223
...args,
2324
[`${paramtype}:${index}`]: {
@@ -41,7 +42,7 @@ const createRouteParamDecorator = (paramtype: RouteParamtypes) => {
4142

4243
const createPipesRouteParamDecorator = (paramtype: RouteParamtypes) => (
4344
data?,
44-
...pipes: PipeTransform<any>[]
45+
...pipes: (Type<PipeTransform> | PipeTransform)[]
4546
): ParameterDecorator => (target, key, index) => {
4647
const args = Reflect.getMetadata(ROUTE_ARGS_METADATA, target, key) || {};
4748
const hasParamData = isNil(data) || isString(data);
@@ -79,11 +80,14 @@ export const Headers: (
7980
) => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.HEADERS);
8081

8182
export function Query();
82-
export function Query(...pipes: PipeTransform<any>[]);
83-
export function Query(property: string, ...pipes: PipeTransform<any>[]);
83+
export function Query(...pipes: (Type<PipeTransform> | PipeTransform)[]);
8484
export function Query(
85-
property?: string | PipeTransform<any>,
86-
...pipes: PipeTransform<any>[]
85+
property: string,
86+
...pipes: (Type<PipeTransform> | PipeTransform)[]
87+
);
88+
export function Query(
89+
property?: string | (Type<PipeTransform> | PipeTransform),
90+
...pipes: (Type<PipeTransform> | PipeTransform)[]
8791
) {
8892
return createPipesRouteParamDecorator(RouteParamtypes.QUERY)(
8993
property,
@@ -92,11 +96,14 @@ export function Query(
9296
}
9397

9498
export function Body();
95-
export function Body(...pipes: PipeTransform<any>[]);
96-
export function Body(property: string, ...pipes: PipeTransform<any>[]);
99+
export function Body(...pipes: (Type<PipeTransform> | PipeTransform)[]);
100+
export function Body(
101+
property: string,
102+
...pipes: (Type<PipeTransform> | PipeTransform)[]
103+
);
97104
export function Body(
98-
property?: string | PipeTransform<any>,
99-
...pipes: PipeTransform<any>[]
105+
property?: string | (Type<PipeTransform> | PipeTransform),
106+
...pipes: (Type<PipeTransform> | PipeTransform)[]
100107
) {
101108
return createPipesRouteParamDecorator(RouteParamtypes.BODY)(
102109
property,
@@ -105,11 +112,14 @@ export function Body(
105112
}
106113

107114
export function Param();
108-
export function Param(...pipes: PipeTransform<any>[]);
109-
export function Param(property: string, ...pipes: PipeTransform<any>[]);
115+
export function Param(...pipes: (Type<PipeTransform> | PipeTransform)[]);
116+
export function Param(
117+
property: string,
118+
...pipes: (Type<PipeTransform> | PipeTransform)[]
119+
);
110120
export function Param(
111-
property?: string | PipeTransform<any>,
112-
...pipes: PipeTransform<any>[]
121+
property?: string | (Type<PipeTransform> | PipeTransform),
122+
...pipes: (Type<PipeTransform> | PipeTransform)[]
113123
) {
114124
return createPipesRouteParamDecorator(RouteParamtypes.PARAM)(
115125
property,

packages/common/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ export * from './services/logger.service';
3939
export * from './pipes';
4040
export * from './utils';
4141
export * from './exceptions';
42+
export * from './http';

packages/common/interceptors/file.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export function FileInterceptor(fieldName: string, options?: MulterOptions) {
1313

1414
async intercept(
1515
context: ExecutionContext,
16-
stream$: Observable<any>,
16+
call$: Observable<any>,
1717
): Promise<Observable<any>> {
1818
const ctx = context.switchToHttp();
19-
19+
2020
await new Promise((resolve, reject) =>
2121
this.upload.single(fieldName)(
2222
ctx.getRequest(),
@@ -30,7 +30,7 @@ export function FileInterceptor(fieldName: string, options?: MulterOptions) {
3030
},
3131
),
3232
);
33-
return stream$;
33+
return call$;
3434
}
3535
},
3636
);

packages/common/interceptors/files.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export function FilesInterceptor(
1515

1616
async intercept(
1717
context: ExecutionContext,
18-
stream$: Observable<any>,
18+
call$: Observable<any>,
1919
): Promise<Observable<any>> {
2020
const ctx = context.switchToHttp();
21-
21+
2222
await new Promise((resolve, reject) =>
2323
this.upload.array(fieldName, maxCount)(
2424
ctx.getRequest(),
@@ -32,7 +32,7 @@ export function FilesInterceptor(
3232
},
3333
),
3434
);
35-
return stream$;
35+
return call$;
3636
}
3737
};
3838
return Interceptor;

packages/common/interfaces/features/nest-interceptor.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { ExecutionContext } from './execution-context.interface';
44
export interface NestInterceptor<T = any, R = any> {
55
intercept(
66
context: ExecutionContext,
7-
stream$: Observable<T>,
7+
call$: Observable<T>,
88
): Observable<R> | Promise<Observable<R>>;
99
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { LoggerService } from '../services/logger.service';
22

33
export class NestApplicationContextOptions {
4-
logger?: LoggerService;
4+
logger?: LoggerService | boolean;
55
}

packages/common/interfaces/nest-application-context.interface.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ export interface INestApplicationContext {
99
select<T>(module: Type<T>): INestApplicationContext;
1010

1111
/**
12-
* Retrieves an instance of either injectable or controller available inside the processed module, otherwise, returns null.
12+
* Retrieves an instance of either injectable or controller available anywhere, otherwise, throws exception.
1313
* @returns {T}
1414
*/
15-
get<T>(typeOrToken: Type<T> | string | symbol): T | null;
16-
17-
/**
18-
* Retrieves an instance of either injectable or controller available inside any module, otherwise, returns null.
19-
* @returns {T}
20-
*/
21-
find<T>(typeOrToken: Type<T> | string | symbol): T | null;
15+
get<T>(
16+
typeOrToken: Type<T> | string | symbol,
17+
options?: { strict: boolean },
18+
): T;
2219
}

0 commit comments

Comments
 (0)