mirror of
https://github.com/nestjs/nest.git
synced 2026-02-24 00:02:56 +00:00
Compare commits
167 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b85844c316 | ||
|
|
daeb99f858 | ||
|
|
3dca681a08 | ||
|
|
442e2f66a1 | ||
|
|
659c52f8bc | ||
|
|
835e4ed94d | ||
|
|
d9cfdd0846 | ||
|
|
83251e3a45 | ||
|
|
eef373c93f | ||
|
|
83b3b6d9d5 | ||
|
|
0ac56fd62a | ||
|
|
8b97f94c38 | ||
|
|
b5a7a6cda4 | ||
|
|
2ce40138b9 | ||
|
|
53070f07f3 | ||
|
|
60c92fe5a8 | ||
|
|
c51984e440 | ||
|
|
05cc5b83f8 | ||
|
|
28fcfe6647 | ||
|
|
2fc29847f3 | ||
|
|
1c846e46f9 | ||
|
|
42fedbb81b | ||
|
|
7f2c35174d | ||
|
|
1931283e75 | ||
|
|
dcabde2fb5 | ||
|
|
b4f3cdc73b | ||
|
|
32ed43b390 | ||
|
|
9d781cde22 | ||
|
|
aed62cc7bd | ||
|
|
a4252b4285 | ||
|
|
171cc9d392 | ||
|
|
64b7237c23 | ||
|
|
c97e495c11 | ||
|
|
1534cf5d0a | ||
|
|
8436c27a65 | ||
|
|
ab0b29b627 | ||
|
|
6d034f5c1f | ||
|
|
1ddab1b2bb | ||
|
|
364a963426 | ||
|
|
72ff7ae40e | ||
|
|
184fffe043 | ||
|
|
d92e85f297 | ||
|
|
acce5e953d | ||
|
|
dfd7846779 | ||
|
|
d895c367fe | ||
|
|
b9cf26708e | ||
|
|
18979b3b46 | ||
|
|
877cc3e4d6 | ||
|
|
feeed43c56 | ||
|
|
a10bb787b8 | ||
|
|
ca7e348478 | ||
|
|
67e15afbf3 | ||
|
|
d59c7b87bd | ||
|
|
cf5e5bceca | ||
|
|
b5e8197500 | ||
|
|
17969748e9 | ||
|
|
8836251c88 | ||
|
|
d74e173e59 | ||
|
|
9511984f2c | ||
|
|
eb7decd35c | ||
|
|
cd6555edd3 | ||
|
|
5b15dbfbaa | ||
|
|
8dcced7256 | ||
|
|
cf10752f40 | ||
|
|
1789753248 | ||
|
|
fb62ffe48c | ||
|
|
f38223ade4 | ||
|
|
f95b219a3c | ||
|
|
b4adc2c771 | ||
|
|
d56267fb99 | ||
|
|
2971ba6a3c | ||
|
|
f7e4885c2d | ||
|
|
cce0bc6407 | ||
|
|
ed4becbe99 | ||
|
|
3cac1ca2b2 | ||
|
|
9059c3d5ac | ||
|
|
3433ab06f4 | ||
|
|
55bd8ab1c7 | ||
|
|
2e5eb4b8e9 | ||
|
|
59ad650c8f | ||
|
|
764d26b28e | ||
|
|
2f29d7790b | ||
|
|
6a53d1e131 | ||
|
|
d37f68d05e | ||
|
|
72c16ccd9a | ||
|
|
3f9be96815 | ||
|
|
7bcf90cb8c | ||
|
|
f4f85f254c | ||
|
|
fc625f2957 | ||
|
|
61b6c7df25 | ||
|
|
79caf671ea | ||
|
|
e24f23d030 | ||
|
|
d184f906ff | ||
|
|
7efc27c186 | ||
|
|
27de22fdfb | ||
|
|
2342c65efc | ||
|
|
7d03b2d78d | ||
|
|
c0e6139419 | ||
|
|
f574663414 | ||
|
|
7f3a9955be | ||
|
|
cc828d493a | ||
|
|
dda9d52c4c | ||
|
|
1194fbae9f | ||
|
|
b3542806d8 | ||
|
|
3991fb9525 | ||
|
|
91cf3190b3 | ||
|
|
1ddeaa2aad | ||
|
|
2bdcdb5814 | ||
|
|
bb4ed69b0e | ||
|
|
b69f3be0aa | ||
|
|
96136f72e7 | ||
|
|
724403067b | ||
|
|
12b807f149 | ||
|
|
07237a07c7 | ||
|
|
0e7197c828 | ||
|
|
7c64c77031 | ||
|
|
6e2033ba7e | ||
|
|
ba2bdea524 | ||
|
|
12b9940b65 | ||
|
|
8a02e39001 | ||
|
|
b82f6f6b5b | ||
|
|
6a754515a1 | ||
|
|
517cad59e9 | ||
|
|
2714f57fcf | ||
|
|
e91d1b1ced | ||
|
|
6e49223e4c | ||
|
|
0b33f8fe31 | ||
|
|
b315162269 | ||
|
|
cd21b2ff93 | ||
|
|
4a1eed1e44 | ||
|
|
09a3ad2950 | ||
|
|
5e9d5c57ed | ||
|
|
d7c69707f6 | ||
|
|
f6114abea9 | ||
|
|
33d6c393e0 | ||
|
|
97edbe0c2a | ||
|
|
2e9fcb1a42 | ||
|
|
2581903818 | ||
|
|
ab4295ed02 | ||
|
|
f05786d8c1 | ||
|
|
772e589327 | ||
|
|
82d0171bcf | ||
|
|
706f55488c | ||
|
|
adce6c8ec0 | ||
|
|
7d209e3d8f | ||
|
|
a718809f30 | ||
|
|
25ba42cca2 | ||
|
|
eb1828431d | ||
|
|
038beb0c54 | ||
|
|
2a7bf6a357 | ||
|
|
d03830e998 | ||
|
|
dc35501e74 | ||
|
|
570dc303c9 | ||
|
|
300f0e39a5 | ||
|
|
c76e12eb17 | ||
|
|
5ca6a1e794 | ||
|
|
eb8f58a624 | ||
|
|
9e7c610ebe | ||
|
|
f17d29bf99 | ||
|
|
59c6cebb22 | ||
|
|
75e1e71e10 | ||
|
|
d4f93cd909 | ||
|
|
b5d553604d | ||
|
|
41764370eb | ||
|
|
e14670ee16 | ||
|
|
1c4ab360e3 | ||
|
|
f8e788a929 |
@@ -70,10 +70,10 @@ jobs:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
|
||||
test_node_8:
|
||||
test_node_14:
|
||||
<<: *unit-tests-template
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- image: circleci/node:14
|
||||
|
||||
lint:
|
||||
working_directory: ~/nest
|
||||
@@ -160,15 +160,15 @@ workflows:
|
||||
build-and-test:
|
||||
jobs:
|
||||
- build
|
||||
- test_node_14:
|
||||
requires:
|
||||
- build
|
||||
- test_node_12:
|
||||
requires:
|
||||
- build
|
||||
- test_node_10:
|
||||
requires:
|
||||
- build
|
||||
- test_node_8:
|
||||
requires:
|
||||
- build
|
||||
- lint:
|
||||
requires:
|
||||
- build
|
||||
|
||||
14
Readme.md
14
Readme.md
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,7 +86,11 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td>
|
||||
<td align="center" valign="middle">
|
||||
<a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" width="97" valign="middle" /></a> </td></tr>
|
||||
<tr><td align="center" valign="middle"><a href="https://sanyodigital.com/" target="_blank"><img src="https://nestjs.com/img/sanyo-digital.png" width="130" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
34
integration/injector/e2e/introspection.spec.ts
Normal file
34
integration/injector/e2e/introspection.spec.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Scope } from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { ScopedModule, STATIC_FACTORY } from '../src/scoped/scoped.module';
|
||||
import { ScopedService } from '../src/scoped/scoped.service';
|
||||
import { TransientService } from '../src/scoped/transient.service';
|
||||
|
||||
describe('Providers introspection', () => {
|
||||
let testingModule: TestingModule;
|
||||
let moduleRef: ModuleRef;
|
||||
|
||||
beforeEach(async () => {
|
||||
testingModule = await Test.createTestingModule({
|
||||
imports: [ScopedModule],
|
||||
}).compile();
|
||||
moduleRef = testingModule.get(ModuleRef);
|
||||
});
|
||||
|
||||
it('should properly introspect a transient provider', async () => {
|
||||
const introspectionResult = moduleRef.introspect(TransientService);
|
||||
expect(introspectionResult.scope).to.be.equal(Scope.TRANSIENT);
|
||||
});
|
||||
|
||||
it('should properly introspect a singleton provider', async () => {
|
||||
const introspectionResult = moduleRef.introspect(STATIC_FACTORY);
|
||||
expect(introspectionResult.scope).to.be.equal(Scope.DEFAULT);
|
||||
});
|
||||
|
||||
it('should properly introspect a request-scoped provider', async () => {
|
||||
const introspectionResult = moduleRef.introspect(ScopedService);
|
||||
expect(introspectionResult.scope).to.be.equal(Scope.REQUEST);
|
||||
});
|
||||
});
|
||||
@@ -54,13 +54,19 @@ describe('Scoped Instances', () => {
|
||||
it('should dynamically resolve request-scoped provider', async () => {
|
||||
const request1 = await testingModule.resolve(ScopedService);
|
||||
const request2 = await testingModule.resolve(ScopedService);
|
||||
const request3 = await testingModule.resolve(ScopedService, { id: 1 });
|
||||
|
||||
const ctxId = { id: 1 };
|
||||
const requestProvider = { host: 'localhost' };
|
||||
testingModule.registerRequestByContextId(requestProvider, ctxId);
|
||||
|
||||
const request3 = await testingModule.resolve(ScopedService, ctxId);
|
||||
const requestFactory = await testingModule.resolve(REQUEST_SCOPED_FACTORY);
|
||||
|
||||
expect(request1).to.be.instanceOf(ScopedService);
|
||||
expect(request2).to.be.instanceOf(ScopedService);
|
||||
expect(request3).to.not.be.equal(request2);
|
||||
expect(requestFactory).to.be.true;
|
||||
expect(request3.request).to.be.equal(requestProvider);
|
||||
});
|
||||
|
||||
it('should dynamically resolve request-scoped controller', async () => {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Injectable, Scope } from '@nestjs/common';
|
||||
import { Inject, Injectable, Scope } from '@nestjs/common';
|
||||
import { REQUEST } from '@nestjs/core';
|
||||
|
||||
@Injectable({ scope: Scope.REQUEST })
|
||||
export class ScopedService {}
|
||||
export class ScopedService {
|
||||
constructor(@Inject(REQUEST) public readonly request) {}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,20 @@ describe('RPC transport', () => {
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (useFactory client)`, () => {
|
||||
return request(server)
|
||||
.post('/useFactory?command=sum')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (useClass client)`, () => {
|
||||
return request(server)
|
||||
.post('/useClass?command=sum')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (concurrent)`, () => {
|
||||
return request(server)
|
||||
.post('/concurrent')
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { Body, Controller, HttpCode, Post, Query } from '@nestjs/common';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
HttpCode,
|
||||
Inject,
|
||||
Post,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
Client,
|
||||
ClientProxy,
|
||||
@@ -11,6 +18,10 @@ import { scan } from 'rxjs/operators';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(
|
||||
@Inject('USE_CLASS_CLIENT') private useClassClient: ClientProxy,
|
||||
@Inject('USE_FACTORY_CLIENT') private useFactoryClient: ClientProxy,
|
||||
) {}
|
||||
static IS_NOTIFIED = false;
|
||||
|
||||
@Client({ transport: Transport.TCP })
|
||||
@@ -22,6 +33,24 @@ export class AppController {
|
||||
return this.client.send<number>({ cmd }, data);
|
||||
}
|
||||
|
||||
@Post('useFactory')
|
||||
@HttpCode(200)
|
||||
callWithClientUseFactory(
|
||||
@Query('command') cmd,
|
||||
@Body() data: number[],
|
||||
): Observable<number> {
|
||||
return this.useFactoryClient.send<number>({ cmd }, data);
|
||||
}
|
||||
|
||||
@Post('useClass')
|
||||
@HttpCode(200)
|
||||
callWithClientUseClass(
|
||||
@Query('command') cmd,
|
||||
@Body() data: number[],
|
||||
): Observable<number> {
|
||||
return this.useClassClient.send<number>({ cmd }, data);
|
||||
}
|
||||
|
||||
@Post('stream')
|
||||
@HttpCode(200)
|
||||
stream(@Body() data: number[]): Observable<number> {
|
||||
|
||||
@@ -1,7 +1,59 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { Module, Injectable } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import {
|
||||
ClientsModule,
|
||||
Transport,
|
||||
ClientsModuleOptionsFactory,
|
||||
ClientOptions,
|
||||
} from '@nestjs/microservices';
|
||||
|
||||
@Injectable()
|
||||
class ConfigService {
|
||||
private readonly config = {
|
||||
transport: Transport.TCP,
|
||||
};
|
||||
get(key: string) {
|
||||
return this.config[key];
|
||||
}
|
||||
}
|
||||
|
||||
@Module({
|
||||
providers: [ConfigService],
|
||||
exports: [ConfigService],
|
||||
})
|
||||
class ConfigModule {}
|
||||
|
||||
@Injectable()
|
||||
class ClientOptionService implements ClientsModuleOptionsFactory {
|
||||
constructor(private readonly configService: ConfigService) {}
|
||||
createClientOptions(): Promise<ClientOptions> | ClientOptions {
|
||||
return {
|
||||
transport: this.configService.get('transport'),
|
||||
options: {},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ClientsModule.registerAsync([
|
||||
{
|
||||
imports: [ConfigModule],
|
||||
name: 'USE_FACTORY_CLIENT',
|
||||
useFactory: (configService: ConfigService) => ({
|
||||
transport: configService.get('transport'),
|
||||
options: {},
|
||||
}),
|
||||
inject: [ConfigService],
|
||||
},
|
||||
{
|
||||
imports: [ConfigModule],
|
||||
name: 'USE_CLASS_CLIENT',
|
||||
useClass: ClientOptionService,
|
||||
inject: [ConfigService],
|
||||
},
|
||||
]),
|
||||
],
|
||||
controllers: [AppController],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "7.1.3"
|
||||
"version": "7.3.2"
|
||||
}
|
||||
|
||||
7420
package-lock.json
generated
7420
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
88
package.json
88
package.json
@@ -58,48 +58,48 @@
|
||||
"cli-color": "2.0.0",
|
||||
"cors": "2.8.5",
|
||||
"express": "4.17.1",
|
||||
"fast-json-stringify": "2.0.0",
|
||||
"fast-json-stringify": "2.2.1",
|
||||
"fast-safe-stringify": "2.0.7",
|
||||
"iterare": "1.2.0",
|
||||
"iterare": "1.2.1",
|
||||
"object-hash": "2.0.3",
|
||||
"path-to-regexp": "3.2.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.5",
|
||||
"rxjs": "6.6.0",
|
||||
"socket.io": "2.3.0",
|
||||
"uuid": "8.0.0",
|
||||
"uuid": "8.2.0",
|
||||
"tslib": "2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codechecks/client": "0.1.10",
|
||||
"@commitlint/cli": "8.3.5",
|
||||
"@commitlint/config-angular": "8.3.4",
|
||||
"@commitlint/cli": "9.0.1",
|
||||
"@commitlint/config-angular": "9.0.1",
|
||||
"@grpc/proto-loader": "0.5.4",
|
||||
"@nestjs/graphql": "7.3.7",
|
||||
"@nestjs/mongoose": "7.0.0",
|
||||
"@nestjs/typeorm": "7.0.0",
|
||||
"@nestjs/graphql": "7.5.1",
|
||||
"@nestjs/mongoose": "7.0.2",
|
||||
"@nestjs/typeorm": "7.1.0",
|
||||
"@types/amqplib": "0.5.13",
|
||||
"@types/bytes": "3.1.0",
|
||||
"@types/cache-manager": "2.10.2",
|
||||
"@types/chai": "4.2.10",
|
||||
"@types/chai-as-promised": "7.1.2",
|
||||
"@types/cache-manager": "2.10.3",
|
||||
"@types/chai": "4.2.11",
|
||||
"@types/chai-as-promised": "7.1.3",
|
||||
"@types/cors": "2.8.6",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/fastify-cors": "2.1.0",
|
||||
"@types/gulp": "4.0.6",
|
||||
"@types/mocha": "7.0.2",
|
||||
"@types/mongoose": "5.7.16",
|
||||
"@types/mongoose": "5.7.30",
|
||||
"@types/node": "10.17.3",
|
||||
"@types/redis": "2.8.20",
|
||||
"@types/redis": "2.8.24",
|
||||
"@types/reflect-metadata": "0.0.5",
|
||||
"@types/sinon": "9.0.0",
|
||||
"@types/socket.io": "2.1.4",
|
||||
"@types/ws": "7.2.4",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"@types/sinon": "9.0.4",
|
||||
"@types/socket.io": "2.1.8",
|
||||
"@types/ws": "7.2.6",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"amqp-connection-manager": "3.2.0",
|
||||
"amqplib": "0.5.5",
|
||||
"apollo-server-express": "2.13.1",
|
||||
"artillery": "1.6.0",
|
||||
"amqplib": "0.5.6",
|
||||
"apollo-server-express": "2.15.1",
|
||||
"artillery": "1.6.1",
|
||||
"awesome-typescript-loader": "5.2.1",
|
||||
"body-parser": "1.19.0",
|
||||
"bytes": "3.1.0",
|
||||
@@ -113,19 +113,19 @@
|
||||
"core-js": "3.6.5",
|
||||
"coveralls": "3.1.0",
|
||||
"delete-empty": "3.0.0",
|
||||
"engine.io-client": "3.4.1",
|
||||
"eslint": "7.0.0",
|
||||
"engine.io-client": "3.4.3",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"fancy-log": "1.3.3",
|
||||
"fastify": "2.14.1",
|
||||
"fastify": "2.15.1",
|
||||
"fastify-cors": "3.0.3",
|
||||
"fastify-formbody": "3.2.0",
|
||||
"fastify-multipart": "1.0.6",
|
||||
"fastify-static": "2.7.0",
|
||||
"graphql": "15.0.0",
|
||||
"graphql-tools": "6.0.0",
|
||||
"grpc": "1.24.2",
|
||||
"graphql": "15.3.0",
|
||||
"graphql-tools": "6.0.12",
|
||||
"grpc": "1.24.3",
|
||||
"gulp": "4.0.2",
|
||||
"gulp-clang-format": "1.0.27",
|
||||
"gulp-clean": "0.4.0",
|
||||
@@ -133,35 +133,35 @@
|
||||
"gulp-typescript": "5.0.1",
|
||||
"gulp-watch": "5.0.1",
|
||||
"husky": "4.2.5",
|
||||
"imports-loader": "0.8.0",
|
||||
"imports-loader": "1.1.0",
|
||||
"json-loader": "0.5.7",
|
||||
"kafkajs": "1.12.0",
|
||||
"lerna": "2.11.0",
|
||||
"lint-staged": "10.2.2",
|
||||
"lint-staged": "10.2.11",
|
||||
"markdown-table": "2.0.0",
|
||||
"merge-graphql-schemas": "1.7.8",
|
||||
"mocha": "7.1.2",
|
||||
"mongoose": "5.9.13",
|
||||
"mqtt": "4.0.1",
|
||||
"mocha": "8.0.1",
|
||||
"mongoose": "5.9.22",
|
||||
"mqtt": "4.1.0",
|
||||
"multer": "1.4.2",
|
||||
"mysql": "2.18.1",
|
||||
"nats": "1.4.9",
|
||||
"nodemon": "2.0.3",
|
||||
"nyc": "15.0.1",
|
||||
"nodemon": "2.0.4",
|
||||
"nyc": "15.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"redis": "3.0.2",
|
||||
"rxjs-compat": "6.5.5",
|
||||
"rxjs-compat": "6.6.0",
|
||||
"sinon": "9.0.2",
|
||||
"sinon-chai": "3.5.0",
|
||||
"socket.io-client": "2.3.0",
|
||||
"subscriptions-transport-ws": "0.9.16",
|
||||
"supertest": "4.0.2",
|
||||
"ts-morph": "7.0.3",
|
||||
"ts-node": "8.10.1",
|
||||
"typeorm": "0.2.24",
|
||||
"typescript": "3.7.2",
|
||||
"ts-morph": "7.1.2",
|
||||
"ts-node": "8.10.2",
|
||||
"typeorm": "0.2.25",
|
||||
"typescript": "3.9.6",
|
||||
"wrk": "1.2.0",
|
||||
"ws": "7.3.0"
|
||||
"ws": "7.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
@@ -192,7 +192,7 @@
|
||||
"packages/microservices/microservices-module.ts",
|
||||
"packages/core/middleware/middleware-module.ts",
|
||||
"packages/core/injector/module-ref.ts",
|
||||
"packages/core/injector/container-scanner.ts",
|
||||
"packages/core/injector/instance-links-host.ts",
|
||||
"packages/common/cache/**/*",
|
||||
"packages/common/serializer/**/*",
|
||||
"packages/common/services/logger.service.ts"
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class CacheInterceptor implements NestInterceptor {
|
||||
}
|
||||
try {
|
||||
const value = await this.cacheManager.get(key);
|
||||
if (value) {
|
||||
if (!isNil(value)) {
|
||||
return of(value);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ export * from './unsupported-media-type.exception';
|
||||
export * from './unprocessable-entity.exception';
|
||||
export * from './internal-server-error.exception';
|
||||
export * from './not-implemented.exception';
|
||||
export * from './http-version-not-supported.exception';
|
||||
export * from './bad-gateway.exception';
|
||||
export * from './service-unavailable.exception';
|
||||
export * from './gateway-timeout.exception';
|
||||
|
||||
@@ -30,12 +30,14 @@ export {
|
||||
INestApplication,
|
||||
INestApplicationContext,
|
||||
INestMicroservice,
|
||||
IntrospectionResult,
|
||||
MiddlewareConsumer,
|
||||
ModuleMetadata,
|
||||
NestApplicationOptions,
|
||||
NestHybridApplicationOptions,
|
||||
NestInterceptor,
|
||||
NestMiddleware,
|
||||
NestModule,
|
||||
NestHybridApplicationOptions,
|
||||
OnApplicationBootstrap,
|
||||
OnApplicationShutdown,
|
||||
OnModuleDestroy,
|
||||
|
||||
@@ -15,12 +15,9 @@ export * from './features/pipe-transform.interface';
|
||||
export * from './hooks';
|
||||
export * from './http/http-server.interface';
|
||||
export * from './injectable.interface';
|
||||
export * from './microservices/nest-hybrid-application-options.interface';
|
||||
export * from './middleware';
|
||||
export * from './modules/dynamic-module.interface';
|
||||
export * from './modules/forward-reference.interface';
|
||||
export * from './modules/module-metadata.interface';
|
||||
export * from './modules/nest-module.interface';
|
||||
export * from './modules/provider.interface';
|
||||
export * from './modules';
|
||||
export * from './nest-application-context.interface';
|
||||
export * from './nest-application-options.interface';
|
||||
export * from './nest-application.interface';
|
||||
@@ -28,4 +25,3 @@ export * from './nest-microservice.interface';
|
||||
export * from './scope-options.interface';
|
||||
export * from './type.interface';
|
||||
export * from './websockets/web-socket-adapter.interface';
|
||||
export * from './microservices/nest-hybrid-application-options.interface';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from './dynamic-module.interface';
|
||||
export * from './forward-reference.interface';
|
||||
export * from './introspection-result.interface';
|
||||
export * from './module-metadata.interface';
|
||||
export * from './nest-module.interface';
|
||||
export * from './provider.interface';
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Scope } from '../scope-options.interface';
|
||||
|
||||
/**
|
||||
* @publicApi
|
||||
*/
|
||||
export interface IntrospectionResult {
|
||||
/**
|
||||
* Enum defining lifetime of host class or factory.
|
||||
*/
|
||||
scope: Scope;
|
||||
}
|
||||
@@ -34,6 +34,15 @@ export interface INestApplicationContext {
|
||||
options?: { strict: boolean },
|
||||
): Promise<TResult>;
|
||||
|
||||
/**
|
||||
* Registers the request/context object for a given context ID (DI container sub-tree).
|
||||
* @returns {void}
|
||||
*/
|
||||
registerRequestByContextId<T = any>(
|
||||
request: T,
|
||||
contextId: { id: number },
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Terminates the application
|
||||
* @returns {Promise<void>}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/common",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"homepage": "https://nestjs.com",
|
||||
@@ -19,9 +19,9 @@
|
||||
"dependencies": {
|
||||
"axios": "0.19.2",
|
||||
"cli-color": "2.0.0",
|
||||
"iterare": "1.2.0",
|
||||
"iterare": "1.2.1",
|
||||
"tslib": "2.0.0",
|
||||
"uuid": "8.0.0"
|
||||
"uuid": "8.2.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"reflect-metadata": "^0.1.12",
|
||||
|
||||
@@ -14,7 +14,10 @@ export class DefaultValuePipe<T = any, R = any>
|
||||
constructor(private readonly defaultValue: R) {}
|
||||
|
||||
transform(value?: T, _metadata?: ArgumentMetadata): T | R {
|
||||
if (isNil(value)) {
|
||||
if (
|
||||
isNil(value) ||
|
||||
(typeof value === 'number' && isNaN((value as unknown) as number))
|
||||
) {
|
||||
return this.defaultValue;
|
||||
}
|
||||
return value;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Inject, Injectable } from '../decorators/core';
|
||||
import { Inject, Injectable, Optional } from '../decorators/core';
|
||||
import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces';
|
||||
import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface';
|
||||
import { loadPackage } from '../utils/load-package.util';
|
||||
import { isObject } from '../utils/shared.utils';
|
||||
import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces';
|
||||
import { CLASS_SERIALIZER_OPTIONS } from './class-serializer.constants';
|
||||
|
||||
let classTransformer: any = {};
|
||||
@@ -20,7 +20,10 @@ const REFLECTOR = 'Reflector';
|
||||
|
||||
@Injectable()
|
||||
export class ClassSerializerInterceptor implements NestInterceptor {
|
||||
constructor(@Inject(REFLECTOR) protected readonly reflector: any) {
|
||||
constructor(
|
||||
@Inject(REFLECTOR) protected readonly reflector: any,
|
||||
@Optional() protected readonly defaultOptions: ClassTransformOptions = {},
|
||||
) {
|
||||
classTransformer = loadPackage(
|
||||
'class-transformer',
|
||||
'ClassSerializerInterceptor',
|
||||
@@ -30,7 +33,11 @@ export class ClassSerializerInterceptor implements NestInterceptor {
|
||||
}
|
||||
|
||||
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||
const options = this.getContextOptions(context);
|
||||
const contextOptions = this.getContextOptions(context);
|
||||
const options = {
|
||||
...this.defaultOptions,
|
||||
...contextOptions,
|
||||
};
|
||||
return next
|
||||
.handle()
|
||||
.pipe(
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { RuntimeException } from './runtime.exception';
|
||||
|
||||
export class UnknownElementException extends RuntimeException {
|
||||
constructor(name?: string) {
|
||||
constructor(name?: string | symbol) {
|
||||
name = name && name.toString();
|
||||
super(
|
||||
`Nest could not find ${
|
||||
name || 'given'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { BeforeApplicationShutdown } from '@nestjs/common';
|
||||
import { isNil } from '@nestjs/common/utils/shared.utils';
|
||||
import { iterate } from 'iterare';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
import {
|
||||
getNonTransientInstances,
|
||||
getTransientInstances,
|
||||
} from '../injector/transient-instances';
|
||||
} from '../injector/helpers/transient-instances';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
|
||||
/**
|
||||
* Checks if the given instance has the `beforeApplicationShutdown` function
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { OnApplicationBootstrap } from '@nestjs/common';
|
||||
import { isNil } from '@nestjs/common/utils/shared.utils';
|
||||
import { iterate } from 'iterare';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
import {
|
||||
getNonTransientInstances,
|
||||
getTransientInstances,
|
||||
} from '../injector/transient-instances';
|
||||
} from '../injector/helpers/transient-instances';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
|
||||
/**
|
||||
* Checks if the given instance has the `onApplicationBootstrap` function
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { OnApplicationShutdown } from '@nestjs/common';
|
||||
import { isNil } from '@nestjs/common/utils/shared.utils';
|
||||
import { iterate } from 'iterare';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
import {
|
||||
getNonTransientInstances,
|
||||
getTransientInstances,
|
||||
} from '../injector/transient-instances';
|
||||
} from '../injector/helpers/transient-instances';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
|
||||
/**
|
||||
* Checks if the given instance has the `onApplicationShutdown` function
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { OnModuleDestroy } from '@nestjs/common';
|
||||
import { isNil } from '@nestjs/common/utils/shared.utils';
|
||||
import { iterate } from 'iterare';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
import {
|
||||
getNonTransientInstances,
|
||||
getTransientInstances,
|
||||
} from '../injector/transient-instances';
|
||||
} from '../injector/helpers/transient-instances';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
|
||||
/**
|
||||
* Returns true or false if the given instance has a `onModuleDestroy` function
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { OnModuleInit } from '@nestjs/common';
|
||||
import { isNil } from '@nestjs/common/utils/shared.utils';
|
||||
import { iterate } from 'iterare';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
import {
|
||||
getNonTransientInstances,
|
||||
getTransientInstances,
|
||||
} from '../injector/transient-instances';
|
||||
} from '../injector/helpers/transient-instances';
|
||||
import { InstanceWrapper } from '../injector/instance-wrapper';
|
||||
import { Module } from '../injector/module';
|
||||
|
||||
/**
|
||||
* Returns true or false if the given instance has a `onModuleInit` function
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
import { Type } from '@nestjs/common';
|
||||
import { Abstract, Scope } from '@nestjs/common/interfaces';
|
||||
import { isFunction } from '@nestjs/common/utils/shared.utils';
|
||||
import { InvalidClassScopeException } from '../errors/exceptions/invalid-class-scope.exception';
|
||||
import { UnknownElementException } from '../errors/exceptions/unknown-element.exception';
|
||||
import { NestContainer } from './container';
|
||||
import { InstanceWrapper } from './instance-wrapper';
|
||||
import { Module } from './module';
|
||||
|
||||
type HostCollection = 'providers' | 'controllers' | 'injectables';
|
||||
|
||||
export class ContainerScanner {
|
||||
private flatContainer: Partial<Module>;
|
||||
|
||||
constructor(private readonly container: NestContainer) {}
|
||||
|
||||
public find<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
): TResult {
|
||||
this.initFlatContainer();
|
||||
return this.findInstanceByToken<TInput, TResult>(
|
||||
typeOrToken,
|
||||
this.flatContainer,
|
||||
);
|
||||
}
|
||||
|
||||
public getWrapperCollectionPair<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
): [InstanceWrapper<TResult>, Map<string, InstanceWrapper>] {
|
||||
this.initFlatContainer();
|
||||
return this.getWrapperCollectionPairByHost<TInput, TResult>(
|
||||
typeOrToken,
|
||||
this.flatContainer,
|
||||
);
|
||||
}
|
||||
|
||||
public findInstanceByToken<TInput = any, TResult = TInput>(
|
||||
metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
contextModule: Partial<Module>,
|
||||
): TResult {
|
||||
const [instanceWrapper] = this.getWrapperCollectionPairByHost(
|
||||
metatypeOrToken,
|
||||
contextModule,
|
||||
);
|
||||
if (
|
||||
instanceWrapper.scope === Scope.REQUEST ||
|
||||
instanceWrapper.scope === Scope.TRANSIENT
|
||||
) {
|
||||
throw new InvalidClassScopeException(metatypeOrToken);
|
||||
}
|
||||
return (instanceWrapper.instance as unknown) as TResult;
|
||||
}
|
||||
|
||||
public getWrapperCollectionPairByHost<TInput = any, TResult = TInput>(
|
||||
metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
contextModule: Partial<Module>,
|
||||
): [InstanceWrapper<TResult>, Map<string, InstanceWrapper>] {
|
||||
const name = isFunction(metatypeOrToken)
|
||||
? (metatypeOrToken as Function).name
|
||||
: metatypeOrToken;
|
||||
const collectionName = this.getHostCollection(
|
||||
name as string,
|
||||
contextModule,
|
||||
);
|
||||
const instanceWrapper = contextModule[collectionName].get(name as string);
|
||||
if (!instanceWrapper) {
|
||||
throw new UnknownElementException(name && name.toString());
|
||||
}
|
||||
return [
|
||||
instanceWrapper as InstanceWrapper<TResult>,
|
||||
contextModule[collectionName],
|
||||
];
|
||||
}
|
||||
|
||||
private initFlatContainer() {
|
||||
if (this.flatContainer) {
|
||||
return;
|
||||
}
|
||||
const modules = this.container.getModules();
|
||||
const initialValue: Record<string, any[]> = {
|
||||
providers: [],
|
||||
controllers: [],
|
||||
injectables: [],
|
||||
};
|
||||
const merge = <T = unknown>(
|
||||
initial: Map<string, T> | T[],
|
||||
arr: Map<string, T>,
|
||||
) => [...initial, ...arr];
|
||||
|
||||
const partialModule = ([...modules.values()].reduce(
|
||||
(current, next) => ({
|
||||
providers: merge(current.providers, next.providers),
|
||||
controllers: merge(current.controllers, next.controllers),
|
||||
injectables: merge(current.injectables, next.injectables),
|
||||
}),
|
||||
initialValue,
|
||||
) as any) as Partial<Module>;
|
||||
|
||||
this.flatContainer = {
|
||||
providers: new Map(partialModule.providers),
|
||||
controllers: new Map(partialModule.controllers),
|
||||
injectables: new Map(partialModule.injectables),
|
||||
};
|
||||
}
|
||||
|
||||
private getHostCollection(
|
||||
token: string,
|
||||
{ providers, controllers }: Partial<Module>,
|
||||
): HostCollection {
|
||||
if (providers.has(token)) {
|
||||
return 'providers';
|
||||
}
|
||||
if (controllers.has(token)) {
|
||||
return 'controllers';
|
||||
}
|
||||
return 'injectables';
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { iterate } from 'iterare';
|
||||
|
||||
import { InstanceWrapper } from './instance-wrapper';
|
||||
import { InstanceWrapper } from '../instance-wrapper';
|
||||
|
||||
/**
|
||||
* Returns the instances which are transient
|
||||
79
packages/core/injector/instance-links-host.ts
Normal file
79
packages/core/injector/instance-links-host.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import { Abstract, Type } from '@nestjs/common';
|
||||
import { isFunction } from '@nestjs/common/utils/shared.utils';
|
||||
import { UnknownElementException } from '../errors/exceptions/unknown-element.exception';
|
||||
import { NestContainer } from './container';
|
||||
import { InstanceWrapper } from './instance-wrapper';
|
||||
import { Module } from './module';
|
||||
|
||||
type InstanceToken = string | symbol | Type<any> | Abstract<any> | Function;
|
||||
type HostCollection = 'providers' | 'controllers' | 'injectables';
|
||||
|
||||
export interface InstanceLink<T = any> {
|
||||
token: InstanceToken;
|
||||
wrapperRef: InstanceWrapper<T>;
|
||||
collection: Map<any, InstanceWrapper>;
|
||||
moduleId: string;
|
||||
}
|
||||
|
||||
export class InstanceLinksHost {
|
||||
private readonly instanceLinks = new Map<InstanceToken, InstanceLink[]>();
|
||||
|
||||
constructor(private readonly container: NestContainer) {
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
get<T = any>(token: InstanceToken, moduleId?: string): InstanceLink<T> {
|
||||
const name = isFunction(token)
|
||||
? (token as Function).name
|
||||
: (token as string | symbol);
|
||||
const modulesMap = this.instanceLinks.get(name);
|
||||
|
||||
if (!modulesMap) {
|
||||
throw new UnknownElementException(name);
|
||||
}
|
||||
const instanceLink = moduleId
|
||||
? modulesMap.find(item => item.moduleId === moduleId)
|
||||
: modulesMap[modulesMap.length - 1];
|
||||
|
||||
if (!instanceLink) {
|
||||
throw new UnknownElementException(name);
|
||||
}
|
||||
return instanceLink;
|
||||
}
|
||||
|
||||
private initialize() {
|
||||
const modules = this.container.getModules();
|
||||
modules.forEach(moduleRef => {
|
||||
const { providers, injectables, controllers } = moduleRef;
|
||||
providers.forEach((wrapper, token) =>
|
||||
this.addLink(wrapper, token, moduleRef, 'providers'),
|
||||
);
|
||||
injectables.forEach((wrapper, token) =>
|
||||
this.addLink(wrapper, token, moduleRef, 'injectables'),
|
||||
);
|
||||
controllers.forEach((wrapper, token) =>
|
||||
this.addLink(wrapper, token, moduleRef, 'controllers'),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
private addLink(
|
||||
wrapper: InstanceWrapper,
|
||||
token: InstanceToken,
|
||||
moduleRef: Module,
|
||||
collectionName: HostCollection,
|
||||
) {
|
||||
const instanceLink: InstanceLink = {
|
||||
moduleId: moduleRef.id,
|
||||
wrapperRef: wrapper,
|
||||
collection: moduleRef[collectionName],
|
||||
token,
|
||||
};
|
||||
const existingLinks = this.instanceLinks.get(token);
|
||||
if (!existingLinks) {
|
||||
this.instanceLinks.set(token, [instanceLink]);
|
||||
} else {
|
||||
existingLinks.push(instanceLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,26 @@
|
||||
import { Type } from '@nestjs/common';
|
||||
import { IntrospectionResult, Scope, Type } from '@nestjs/common';
|
||||
import { InvalidClassScopeException } from '../errors/exceptions/invalid-class-scope.exception';
|
||||
import { UnknownElementException } from '../errors/exceptions/unknown-element.exception';
|
||||
import { getClassScope } from '../helpers/get-class-scope';
|
||||
import { NestContainer } from './container';
|
||||
import { ContainerScanner } from './container-scanner';
|
||||
import { Injector } from './injector';
|
||||
import { InstanceLinksHost } from './instance-links-host';
|
||||
import { ContextId, InstanceWrapper } from './instance-wrapper';
|
||||
import { Module } from './module';
|
||||
|
||||
export abstract class ModuleRef {
|
||||
private readonly injector = new Injector();
|
||||
private readonly containerScanner: ContainerScanner;
|
||||
private _instanceLinksHost: InstanceLinksHost;
|
||||
|
||||
constructor(protected readonly container: NestContainer) {
|
||||
this.containerScanner = new ContainerScanner(container);
|
||||
private get instanceLinksHost() {
|
||||
if (!this._instanceLinksHost) {
|
||||
this._instanceLinksHost = new InstanceLinksHost(this.container);
|
||||
}
|
||||
return this._instanceLinksHost;
|
||||
}
|
||||
|
||||
constructor(protected readonly container: NestContainer) {}
|
||||
|
||||
public abstract get<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | string | symbol,
|
||||
options?: { strict: boolean },
|
||||
@@ -27,10 +32,70 @@ export abstract class ModuleRef {
|
||||
): Promise<TResult>;
|
||||
public abstract create<T = any>(type: Type<T>): Promise<T>;
|
||||
|
||||
public introspect<T = any>(
|
||||
token: Type<T> | string | symbol,
|
||||
): IntrospectionResult {
|
||||
const { wrapperRef } = this.instanceLinksHost.get(token);
|
||||
|
||||
let scope = Scope.DEFAULT;
|
||||
if (!wrapperRef.isDependencyTreeStatic()) {
|
||||
scope = Scope.REQUEST;
|
||||
} else if (wrapperRef.isTransient) {
|
||||
scope = Scope.TRANSIENT;
|
||||
}
|
||||
return { scope };
|
||||
}
|
||||
|
||||
public registerRequestByContextId<T = any>(request: T, contextId: ContextId) {
|
||||
this.container.registerRequestProvider(request, contextId);
|
||||
}
|
||||
|
||||
protected find<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | string | symbol,
|
||||
contextModule?: Module,
|
||||
): TResult {
|
||||
return this.containerScanner.find<TInput, TResult>(typeOrToken);
|
||||
const moduleId = contextModule && contextModule.id;
|
||||
const { wrapperRef } = this.instanceLinksHost.get<TResult>(
|
||||
typeOrToken,
|
||||
moduleId,
|
||||
);
|
||||
if (
|
||||
wrapperRef.scope === Scope.REQUEST ||
|
||||
wrapperRef.scope === Scope.TRANSIENT
|
||||
) {
|
||||
throw new InvalidClassScopeException(typeOrToken);
|
||||
}
|
||||
return wrapperRef.instance;
|
||||
}
|
||||
|
||||
protected async resolvePerContext<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | string | symbol,
|
||||
contextModule: Module,
|
||||
contextId: ContextId,
|
||||
options?: { strict: boolean },
|
||||
): Promise<TResult> {
|
||||
const isStrictModeEnabled = options && options.strict;
|
||||
const instanceLink = isStrictModeEnabled
|
||||
? this.instanceLinksHost.get(typeOrToken, contextModule.id)
|
||||
: this.instanceLinksHost.get(typeOrToken);
|
||||
|
||||
const { wrapperRef, collection } = instanceLink;
|
||||
if (wrapperRef.isDependencyTreeStatic() && !wrapperRef.isTransient) {
|
||||
return this.get(typeOrToken);
|
||||
}
|
||||
|
||||
const ctorHost = wrapperRef.instance || { constructor: typeOrToken };
|
||||
const instance = await this.injector.loadPerContext(
|
||||
ctorHost,
|
||||
wrapperRef.host,
|
||||
collection,
|
||||
contextId,
|
||||
wrapperRef,
|
||||
);
|
||||
if (!instance) {
|
||||
throw new UnknownElementException();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
protected async instantiateClass<T = any>(
|
||||
@@ -66,54 +131,4 @@ export abstract class ModuleRef {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected findInstanceByToken<TInput = any, TResult = TInput>(
|
||||
metatypeOrToken: Type<TInput> | string | symbol,
|
||||
contextModule: Module,
|
||||
): TResult {
|
||||
return this.containerScanner.findInstanceByToken<TInput, TResult>(
|
||||
metatypeOrToken,
|
||||
contextModule,
|
||||
);
|
||||
}
|
||||
|
||||
protected async resolvePerContext<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | string | symbol,
|
||||
contextModule: Module,
|
||||
contextId: ContextId,
|
||||
options?: { strict: boolean },
|
||||
): Promise<TResult> {
|
||||
let wrapper: InstanceWrapper, collection: Map<string, InstanceWrapper>;
|
||||
|
||||
const isStrictModeEnabled = options && options.strict;
|
||||
if (!isStrictModeEnabled) {
|
||||
[wrapper, collection] = this.containerScanner.getWrapperCollectionPair(
|
||||
typeOrToken,
|
||||
);
|
||||
} else {
|
||||
[
|
||||
wrapper,
|
||||
collection,
|
||||
] = this.containerScanner.getWrapperCollectionPairByHost(
|
||||
typeOrToken,
|
||||
contextModule,
|
||||
);
|
||||
}
|
||||
if (wrapper.isDependencyTreeStatic() && !wrapper.isTransient) {
|
||||
throw new InvalidClassScopeException(typeOrToken);
|
||||
}
|
||||
|
||||
const ctorHost = wrapper.instance || { constructor: typeOrToken };
|
||||
const instance = await this.injector.loadPerContext(
|
||||
ctorHost,
|
||||
wrapper.host,
|
||||
collection,
|
||||
contextId,
|
||||
wrapper,
|
||||
);
|
||||
if (!instance) {
|
||||
throw new UnknownElementException();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ export class Module {
|
||||
return [...this._providers].filter(([_, wrapper]) => !wrapper.isAlias);
|
||||
}
|
||||
|
||||
public createModuleReferenceType(): any {
|
||||
public createModuleReferenceType(): Type<ModuleRef> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
const self = this;
|
||||
return class extends ModuleRef {
|
||||
@@ -491,10 +491,9 @@ export class Module {
|
||||
typeOrToken: Type<TInput> | string | symbol,
|
||||
options: { strict: boolean } = { strict: true },
|
||||
): TResult {
|
||||
if (!(options && options.strict)) {
|
||||
return this.find<TInput, TResult>(typeOrToken);
|
||||
}
|
||||
return this.findInstanceByToken<TInput, TResult>(typeOrToken, self);
|
||||
return !(options && options.strict)
|
||||
? this.find<TInput, TResult>(typeOrToken)
|
||||
: this.find<TInput, TResult>(typeOrToken, self);
|
||||
}
|
||||
|
||||
public resolve<TInput = any, TResult = TInput>(
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
LoggerService,
|
||||
ShutdownSignal,
|
||||
} from '@nestjs/common';
|
||||
import { Abstract } from '@nestjs/common/interfaces';
|
||||
import { Abstract, Scope } from '@nestjs/common/interfaces';
|
||||
import { Type } from '@nestjs/common/interfaces/type.interface';
|
||||
import { isEmpty } from '@nestjs/common/utils/shared.utils';
|
||||
import { iterate } from 'iterare';
|
||||
@@ -22,9 +22,8 @@ import {
|
||||
} from './hooks';
|
||||
import { ContextId } from './injector';
|
||||
import { NestContainer } from './injector/container';
|
||||
import { ContainerScanner } from './injector/container-scanner';
|
||||
import { Injector } from './injector/injector';
|
||||
import { InstanceWrapper } from './injector/instance-wrapper';
|
||||
import { InstanceLinksHost } from './injector/instance-links-host';
|
||||
import { Module } from './injector/module';
|
||||
|
||||
/**
|
||||
@@ -35,15 +34,20 @@ export class NestApplicationContext implements INestApplicationContext {
|
||||
protected readonly injector = new Injector();
|
||||
private shutdownCleanupRef?: (...args: unknown[]) => unknown;
|
||||
private readonly activeShutdownSignals = new Array<string>();
|
||||
private readonly containerScanner: ContainerScanner;
|
||||
private _instanceLinksHost: InstanceLinksHost;
|
||||
|
||||
private get instanceLinksHost() {
|
||||
if (!this._instanceLinksHost) {
|
||||
this._instanceLinksHost = new InstanceLinksHost(this.container);
|
||||
}
|
||||
return this._instanceLinksHost;
|
||||
}
|
||||
|
||||
constructor(
|
||||
protected readonly container: NestContainer,
|
||||
private readonly scope = new Array<Type<any>>(),
|
||||
private contextModule: Module = null,
|
||||
) {
|
||||
this.containerScanner = new ContainerScanner(container);
|
||||
}
|
||||
) {}
|
||||
|
||||
public selectContextModule() {
|
||||
const modules = this.container.getModules().values();
|
||||
@@ -68,13 +72,9 @@ export class NestApplicationContext implements INestApplicationContext {
|
||||
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
options: { strict: boolean } = { strict: false },
|
||||
): TResult {
|
||||
if (!(options && options.strict)) {
|
||||
return this.find<TInput, TResult>(typeOrToken);
|
||||
}
|
||||
return this.findInstanceByToken<TInput, TResult>(
|
||||
typeOrToken,
|
||||
this.contextModule,
|
||||
);
|
||||
return !(options && options.strict)
|
||||
? this.find<TInput, TResult>(typeOrToken)
|
||||
: this.find<TInput, TResult>(typeOrToken, this.contextModule);
|
||||
}
|
||||
|
||||
public resolve<TInput = any, TResult = TInput>(
|
||||
@@ -90,6 +90,10 @@ export class NestApplicationContext implements INestApplicationContext {
|
||||
);
|
||||
}
|
||||
|
||||
public registerRequestByContextId<T = any>(request: T, contextId: ContextId) {
|
||||
this.container.registerRequestProvider(request, contextId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initalizes the Nest application.
|
||||
* Calls the Nest lifecycle events.
|
||||
@@ -112,7 +116,7 @@ export class NestApplicationContext implements INestApplicationContext {
|
||||
await this.callBeforeShutdownHook();
|
||||
await this.dispose();
|
||||
await this.callShutdownHook();
|
||||
await this.unsubscribeFromProcessSignals();
|
||||
this.unsubscribeFromProcessSignals();
|
||||
}
|
||||
|
||||
public useLogger(logger: LoggerService) {
|
||||
@@ -256,18 +260,20 @@ export class NestApplicationContext implements INestApplicationContext {
|
||||
|
||||
protected find<TInput = any, TResult = TInput>(
|
||||
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
contextModule?: Module,
|
||||
): TResult {
|
||||
return this.containerScanner.find<TInput, TResult>(typeOrToken);
|
||||
}
|
||||
|
||||
protected findInstanceByToken<TInput = any, TResult = TInput>(
|
||||
metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
|
||||
contextModule: Partial<Module>,
|
||||
): TResult {
|
||||
return this.containerScanner.findInstanceByToken<TInput, TResult>(
|
||||
metatypeOrToken,
|
||||
contextModule,
|
||||
const moduleId = contextModule && contextModule.id;
|
||||
const { wrapperRef } = this.instanceLinksHost.get<TResult>(
|
||||
typeOrToken,
|
||||
moduleId,
|
||||
);
|
||||
if (
|
||||
wrapperRef.scope === Scope.REQUEST ||
|
||||
wrapperRef.scope === Scope.TRANSIENT
|
||||
) {
|
||||
throw new InvalidClassScopeException(typeOrToken);
|
||||
}
|
||||
return wrapperRef.instance;
|
||||
}
|
||||
|
||||
protected async resolvePerContext<TInput = any, TResult = TInput>(
|
||||
@@ -276,30 +282,20 @@ export class NestApplicationContext implements INestApplicationContext {
|
||||
contextId: ContextId,
|
||||
options?: { strict: boolean },
|
||||
): Promise<TResult> {
|
||||
let wrapper: InstanceWrapper, collection: Map<string, InstanceWrapper>;
|
||||
|
||||
const isStrictModeEnabled = options && options.strict;
|
||||
if (!isStrictModeEnabled) {
|
||||
[wrapper, collection] = this.containerScanner.getWrapperCollectionPair(
|
||||
typeOrToken,
|
||||
);
|
||||
} else {
|
||||
[
|
||||
wrapper,
|
||||
collection,
|
||||
] = this.containerScanner.getWrapperCollectionPairByHost(
|
||||
typeOrToken,
|
||||
contextModule,
|
||||
);
|
||||
}
|
||||
if (wrapper.isDependencyTreeStatic() && !wrapper.isTransient) {
|
||||
throw new InvalidClassScopeException(typeOrToken);
|
||||
const instanceLink = isStrictModeEnabled
|
||||
? this.instanceLinksHost.get(typeOrToken, contextModule.id)
|
||||
: this.instanceLinksHost.get(typeOrToken);
|
||||
|
||||
const { wrapperRef, collection } = instanceLink;
|
||||
if (wrapperRef.isDependencyTreeStatic() && !wrapperRef.isTransient) {
|
||||
return this.get(typeOrToken);
|
||||
}
|
||||
|
||||
const ctorHost = wrapper.instance || { constructor: typeOrToken };
|
||||
const ctorHost = wrapperRef.instance || { constructor: typeOrToken };
|
||||
const instance = await this.injector.loadPerContext(
|
||||
ctorHost,
|
||||
wrapper.host,
|
||||
wrapperRef.host,
|
||||
collection,
|
||||
contextId,
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/core",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
@@ -29,14 +29,14 @@
|
||||
"dependencies": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.7",
|
||||
"iterare": "1.2.0",
|
||||
"iterare": "1.2.1",
|
||||
"object-hash": "2.0.3",
|
||||
"path-to-regexp": "3.2.0",
|
||||
"tslib": "2.0.0",
|
||||
"uuid": "8.0.0"
|
||||
"uuid": "8.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/common": "7.1.3"
|
||||
"@nestjs/common": "7.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^7.0.0",
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -93,11 +93,18 @@ export class ClientKafka extends ClientProxy {
|
||||
return this.producer;
|
||||
}
|
||||
this.client = this.createClient();
|
||||
|
||||
const partitionAssigners = [
|
||||
(
|
||||
config: ConstructorParameters<
|
||||
typeof KafkaRoundRobinPartitionAssigner
|
||||
>[0],
|
||||
) => new KafkaRoundRobinPartitionAssigner(config),
|
||||
] as any[];
|
||||
|
||||
const consumerOptions = Object.assign(
|
||||
{
|
||||
partitionAssigners: [
|
||||
(config: any) => new KafkaRoundRobinPartitionAssigner(config),
|
||||
],
|
||||
partitionAssigners,
|
||||
},
|
||||
this.options.consumer || {},
|
||||
{
|
||||
|
||||
@@ -95,7 +95,9 @@ export class ClientRedis extends ClientProxy {
|
||||
public getClientOptions(error$: Subject<Error>): Partial<ClientOpts> {
|
||||
const retry_strategy = (options: RetryStrategyOptions) =>
|
||||
this.createRetryStrategy(options, error$);
|
||||
|
||||
return {
|
||||
...(this.options || {}),
|
||||
retry_strategy,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ export class ClientRMQ extends ClientProxy {
|
||||
protected queue: string;
|
||||
protected queueOptions: any;
|
||||
protected responseEmitter: EventEmitter;
|
||||
protected replyQueue: string;
|
||||
|
||||
constructor(protected readonly options: RmqOptions['options']) {
|
||||
super();
|
||||
@@ -40,7 +41,8 @@ export class ClientRMQ extends ClientProxy {
|
||||
this.queueOptions =
|
||||
this.getOptionsProp(this.options, 'queueOptions') ||
|
||||
RQM_DEFAULT_QUEUE_OPTIONS;
|
||||
|
||||
this.replyQueue =
|
||||
this.getOptionsProp(this.options, 'replyQueue') || REPLY_QUEUE;
|
||||
loadPackage('amqplib', ClientRMQ.name, () => require('amqplib'));
|
||||
rqmPackage = loadPackage('amqp-connection-manager', ClientRMQ.name, () =>
|
||||
require('amqp-connection-manager'),
|
||||
@@ -61,7 +63,7 @@ export class ClientRMQ extends ClientProxy {
|
||||
const noAck = this.getOptionsProp(this.options, 'noAck', RQM_DEFAULT_NOACK);
|
||||
this.channel.addSetup((channel: any) =>
|
||||
channel.consume(
|
||||
REPLY_QUEUE,
|
||||
this.replyQueue,
|
||||
(msg: any) =>
|
||||
this.responseEmitter.emit(msg.properties.correlationId, msg),
|
||||
{
|
||||
@@ -183,7 +185,7 @@ export class ClientRMQ extends ClientProxy {
|
||||
this.queue,
|
||||
Buffer.from(JSON.stringify(serializedPacket)),
|
||||
{
|
||||
replyTo: REPLY_QUEUE,
|
||||
replyTo: this.replyQueue,
|
||||
correlationId,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
ProducerConfig,
|
||||
} from '../external/kafka-options.interface';
|
||||
import { MqttClientOptions } from '../external/mqtt-options.interface';
|
||||
import { ClientOpts } from '../external/redis.interface';
|
||||
import { Server } from '../server/server';
|
||||
import { CustomTransportStrategy } from './custom-transport-strategy.interface';
|
||||
import { Deserializer } from './deserializer.interface';
|
||||
@@ -84,7 +85,7 @@ export interface RedisOptions {
|
||||
retryDelay?: number;
|
||||
serializer?: Serializer;
|
||||
deserializer?: Deserializer;
|
||||
};
|
||||
} & ClientOpts;
|
||||
}
|
||||
|
||||
export interface MqttOptions {
|
||||
@@ -127,6 +128,7 @@ export interface RmqOptions {
|
||||
noAck?: boolean;
|
||||
serializer?: Serializer;
|
||||
deserializer?: Deserializer;
|
||||
replyQueue?: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { DynamicModule, Module } from '@nestjs/common';
|
||||
import { DynamicModule, Module, Provider } from '@nestjs/common';
|
||||
import { ClientProxyFactory } from '../client';
|
||||
import { ClientsModuleOptions } from './interfaces/clients-module.interface';
|
||||
import {
|
||||
ClientsModuleAsyncOptions,
|
||||
ClientsModuleOptions,
|
||||
ClientsModuleOptionsFactory,
|
||||
ClientsProviderAsyncOptions,
|
||||
} from './interfaces';
|
||||
|
||||
@Module({})
|
||||
export class ClientsModule {
|
||||
@@ -15,4 +20,71 @@ export class ClientsModule {
|
||||
exports: clients,
|
||||
};
|
||||
}
|
||||
|
||||
static registerAsync(options: ClientsModuleAsyncOptions): DynamicModule {
|
||||
const providers: Provider[] = options.reduce(
|
||||
(accProviders: Provider[], item) =>
|
||||
accProviders
|
||||
.concat(this.createAsyncProviders(item))
|
||||
.concat(item.extraProviders || []),
|
||||
[],
|
||||
);
|
||||
const imports = options.reduce(
|
||||
(accImports, option) =>
|
||||
option.imports && !accImports.includes(option.imports)
|
||||
? accImports.concat(option.imports)
|
||||
: accImports,
|
||||
[],
|
||||
);
|
||||
return {
|
||||
module: ClientsModule,
|
||||
imports,
|
||||
providers: providers,
|
||||
exports: providers,
|
||||
};
|
||||
}
|
||||
|
||||
private static createAsyncProviders(
|
||||
options: ClientsProviderAsyncOptions,
|
||||
): Provider[] {
|
||||
if (options.useExisting || options.useFactory) {
|
||||
return [this.createAsyncOptionsProvider(options)];
|
||||
}
|
||||
return [
|
||||
this.createAsyncOptionsProvider(options),
|
||||
{
|
||||
provide: options.useClass,
|
||||
useClass: options.useClass,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
private static createAsyncOptionsProvider(
|
||||
options: ClientsProviderAsyncOptions,
|
||||
): Provider {
|
||||
if (options.useFactory) {
|
||||
return {
|
||||
provide: options.name,
|
||||
useFactory: this.createFactoryWrapper(options.useFactory),
|
||||
inject: options.inject || [],
|
||||
};
|
||||
}
|
||||
return {
|
||||
provide: options.name,
|
||||
useFactory: this.createFactoryWrapper(
|
||||
(optionsFactory: ClientsModuleOptionsFactory) =>
|
||||
optionsFactory.createClientOptions(),
|
||||
),
|
||||
inject: [options.useExisting || options.useClass],
|
||||
};
|
||||
}
|
||||
|
||||
private static createFactoryWrapper(
|
||||
useFactory: ClientsProviderAsyncOptions['useFactory'],
|
||||
) {
|
||||
return async (...args: any[]) => {
|
||||
const clientOptions = await useFactory(...args);
|
||||
return ClientProxyFactory.create(clientOptions);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from './clients.module';
|
||||
export * from './interfaces';
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
import { ClientOptions } from '../../interfaces';
|
||||
import { Type, Provider, ModuleMetadata } from '@nestjs/common/interfaces';
|
||||
|
||||
export type ClientProviderOptions = ClientOptions & {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type ClientsModuleOptions = Array<ClientProviderOptions>;
|
||||
|
||||
export interface ClientsModuleOptionsFactory {
|
||||
createClientOptions(): Promise<ClientOptions> | ClientOptions;
|
||||
}
|
||||
|
||||
export interface ClientsProviderAsyncOptions
|
||||
extends Pick<ModuleMetadata, 'imports'> {
|
||||
useExisting?: Type<ClientsModuleOptionsFactory>;
|
||||
useClass?: Type<ClientsModuleOptionsFactory>;
|
||||
useFactory?: (...args: any[]) => Promise<ClientOptions> | ClientOptions;
|
||||
inject?: any[];
|
||||
extraProviders?: Provider[];
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type ClientsModuleAsyncOptions = Array<ClientsProviderAsyncOptions>;
|
||||
|
||||
1
packages/microservices/module/interfaces/index.ts
Normal file
1
packages/microservices/module/interfaces/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './clients-module.interface';
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/microservices",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
@@ -17,13 +17,13 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"iterare": "1.2.0",
|
||||
"iterare": "1.2.1",
|
||||
"json-socket": "0.3.0",
|
||||
"tslib": "2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/common": "7.1.3",
|
||||
"@nestjs/core": "7.1.3"
|
||||
"@nestjs/common": "7.3.2",
|
||||
"@nestjs/core": "7.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^7.0.0",
|
||||
|
||||
@@ -117,7 +117,7 @@ export class ServerKafka extends Server implements CustomTransportStrategy {
|
||||
await consumer.run(consumerRunOptions);
|
||||
}
|
||||
|
||||
public getMessageHandler(): Function {
|
||||
public getMessageHandler() {
|
||||
return async (payload: EachMessagePayload) => this.handleMessage(payload);
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,9 @@ export class ServerRedis extends Server implements CustomTransportStrategy {
|
||||
public getClientOptions(): Partial<ClientOpts> {
|
||||
const retry_strategy = (options: RetryStrategyOptions) =>
|
||||
this.createRetryStrategy(options);
|
||||
|
||||
return {
|
||||
...(this.options || {}),
|
||||
retry_strategy,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -80,8 +80,9 @@ export class ServerRMQ extends Server implements CustomTransportStrategy {
|
||||
setup: (channel: any) => this.setupChannel(channel, callback),
|
||||
});
|
||||
});
|
||||
this.server.on(DISCONNECT_EVENT, () => {
|
||||
this.server.on(DISCONNECT_EVENT, (err: any) => {
|
||||
this.logger.error(DISCONNECTED_RMQ_MESSAGE);
|
||||
this.logger.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import { catchError, finalize, publish } from 'rxjs/operators';
|
||||
import { NO_EVENT_HANDLER } from '../constants';
|
||||
import { BaseRpcContext } from '../ctx-host/base-rpc.context';
|
||||
import { IncomingRequestDeserializer } from '../deserializers/incoming-request.deserializer';
|
||||
import {
|
||||
@@ -30,7 +31,6 @@ import { ConsumerDeserializer } from '../interfaces/deserializer.interface';
|
||||
import { ConsumerSerializer } from '../interfaces/serializer.interface';
|
||||
import { IdentitySerializer } from '../serializers/identity.serializer';
|
||||
import { transformPatternToRoute } from '../utils';
|
||||
import { NO_EVENT_HANDLER } from '../constants';
|
||||
|
||||
export abstract class Server {
|
||||
protected readonly messageHandlers = new Map<string, MessageHandler>();
|
||||
@@ -43,7 +43,7 @@ export abstract class Server {
|
||||
callback: MessageHandler,
|
||||
isEventHandler = false,
|
||||
) {
|
||||
const route = transformPatternToRoute(pattern);
|
||||
const route = this.normalizePattern(pattern);
|
||||
callback.isEventHandler = isEventHandler;
|
||||
this.messageHandlers.set(route, callback);
|
||||
}
|
||||
@@ -176,6 +176,10 @@ export abstract class Server {
|
||||
// Uses a fundamental object (`pattern` variable without any conversion)
|
||||
validPattern = pattern;
|
||||
}
|
||||
return transformPatternToRoute(validPattern);
|
||||
return this.normalizePattern(validPattern);
|
||||
}
|
||||
|
||||
protected normalizePattern(pattern: MsPattern): string {
|
||||
return transformPatternToRoute(pattern);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Observable } from 'rxjs';
|
||||
import * as sinon from 'sinon';
|
||||
import { ClientProxy } from '../../client/client-proxy';
|
||||
import { ReadPacket } from '../../interfaces';
|
||||
import * as Utils from '../../utils';
|
||||
|
||||
class TestClientProxy extends ClientProxy {
|
||||
protected async dispatchEvent<T = any>(
|
||||
@@ -174,23 +173,4 @@ describe('ClientProxy', function () {
|
||||
expect(err$).to.be.instanceOf(Observable);
|
||||
});
|
||||
});
|
||||
|
||||
describe('normalizePattern', () => {
|
||||
describe(`when gets 'string' pattern`, () => {
|
||||
it(`should call 'transformPatternToRoute' with 'string' argument`, () => {
|
||||
const inputPattern = 'hello';
|
||||
const msvcUtilTransformPatternToRouteStub = sinon.spy(
|
||||
Utils,
|
||||
'transformPatternToRoute',
|
||||
);
|
||||
(client as any).normalizePattern(inputPattern);
|
||||
|
||||
expect(msvcUtilTransformPatternToRouteStub.args[0][0]).to.be.equal(
|
||||
inputPattern,
|
||||
);
|
||||
|
||||
msvcUtilTransformPatternToRouteStub.restore();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,27 +1,118 @@
|
||||
import { DynamicModule } from '@nestjs/common';
|
||||
import { DynamicModule, FactoryProvider, Injectable } from '@nestjs/common';
|
||||
import { expect } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import { ClientProxyFactory } from '../../client';
|
||||
import { ClientsModule } from '../../module';
|
||||
import { ClientsModule, ClientsModuleOptionsFactory } from '../../module';
|
||||
import { ClientOptions } from '../../interfaces';
|
||||
import { Transport } from '../../enums';
|
||||
|
||||
describe('ClientsModule', () => {
|
||||
let dynamicModule: DynamicModule;
|
||||
beforeEach(() => {
|
||||
dynamicModule = ClientsModule.register([
|
||||
{
|
||||
name: 'test',
|
||||
options: {},
|
||||
},
|
||||
]);
|
||||
describe('register', () => {
|
||||
beforeEach(() => {
|
||||
dynamicModule = ClientsModule.register([
|
||||
{
|
||||
name: 'test',
|
||||
options: {},
|
||||
},
|
||||
]);
|
||||
});
|
||||
it('should return an expected module ref', () => {
|
||||
expect(dynamicModule.module).to.be.eql(ClientsModule);
|
||||
});
|
||||
it('should return an expected providers array', () => {
|
||||
expect(dynamicModule.providers).to.be.deep.eq([
|
||||
{
|
||||
provide: 'test',
|
||||
useValue: ClientProxyFactory.create({}),
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
it('should return an expected module ref', () => {
|
||||
expect(dynamicModule.module).to.be.eql(ClientsModule);
|
||||
});
|
||||
it('should return an expected providers array', () => {
|
||||
expect(dynamicModule.providers).to.be.deep.eq([
|
||||
{
|
||||
provide: 'test',
|
||||
useValue: ClientProxyFactory.create({}),
|
||||
},
|
||||
]);
|
||||
describe('registerAsync', () => {
|
||||
const useFactory = () => ({
|
||||
options: {},
|
||||
});
|
||||
const registerOption = {
|
||||
name: 'test',
|
||||
useFactory,
|
||||
};
|
||||
|
||||
it('should return an expected module ref', () => {
|
||||
dynamicModule = ClientsModule.registerAsync([registerOption]);
|
||||
expect(dynamicModule.module).to.be.eql(ClientsModule);
|
||||
});
|
||||
|
||||
describe('when useFactory', () => {
|
||||
it('should return an expected providers array with useFactory', () => {
|
||||
dynamicModule = ClientsModule.registerAsync([registerOption]);
|
||||
expect(dynamicModule.imports).to.be.deep.eq([]);
|
||||
expect(dynamicModule.exports).to.be.eq(dynamicModule.providers);
|
||||
expect(dynamicModule.providers).to.be.have.length(1);
|
||||
|
||||
const provider = dynamicModule.providers[0] as FactoryProvider;
|
||||
expect(provider.provide).to.be.eql('test');
|
||||
expect(provider.inject).to.be.deep.eq([]);
|
||||
expect(provider.useFactory).to.be.an.instanceOf(Function);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useClass', () => {
|
||||
it('should return an expected providers array with useClass', () => {
|
||||
@Injectable()
|
||||
class ClientOptionService implements ClientsModuleOptionsFactory {
|
||||
createClientOptions(): Promise<ClientOptions> | ClientOptions {
|
||||
return {
|
||||
transport: Transport.TCP,
|
||||
options: {},
|
||||
};
|
||||
}
|
||||
}
|
||||
const useClassOption = {
|
||||
name: 'classTest',
|
||||
useClass: ClientOptionService,
|
||||
};
|
||||
dynamicModule = ClientsModule.registerAsync([useClassOption]);
|
||||
expect(dynamicModule.imports).to.be.deep.eq([]);
|
||||
expect(dynamicModule.providers).to.be.have.length(2);
|
||||
|
||||
const classTestProvider = dynamicModule.providers[0] as FactoryProvider;
|
||||
expect(classTestProvider.provide).to.be.eql('classTest');
|
||||
expect(classTestProvider.inject).to.be.deep.eq([ClientOptionService]);
|
||||
expect(classTestProvider.useFactory).to.be.an.instanceOf(Function);
|
||||
});
|
||||
it('provider should call "createClientOptions"', async () => {
|
||||
const asyncOptions = {
|
||||
useClass: Object,
|
||||
};
|
||||
const dynamicModule = ClientsModule.registerAsync([
|
||||
asyncOptions as any,
|
||||
]);
|
||||
const optionsFactory = {
|
||||
createClientOptions: sinon.spy(),
|
||||
};
|
||||
try {
|
||||
await ((dynamicModule.providers[0] as any).useFactory as any)(
|
||||
optionsFactory,
|
||||
);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
expect(optionsFactory.createClientOptions.called).to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useExisting', () => {
|
||||
it('should provide an options', () => {
|
||||
const asyncOptions = {
|
||||
useExisting: Object,
|
||||
};
|
||||
dynamicModule = ClientsModule.registerAsync([asyncOptions as any]);
|
||||
expect(dynamicModule.providers).to.have.length(1);
|
||||
expect(dynamicModule.imports).to.be.deep.eq([]);
|
||||
const classTestProvider = dynamicModule.providers[0] as FactoryProvider;
|
||||
expect(classTestProvider.useFactory).to.be.an.instanceOf(Function);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,6 @@ import { expect } from 'chai';
|
||||
import { Observable, of, throwError as _throw } from 'rxjs';
|
||||
import * as sinon from 'sinon';
|
||||
import { Server } from '../../server/server';
|
||||
import * as Utils from '../../utils';
|
||||
|
||||
class TestServer extends Server {
|
||||
public listen(callback: () => void) {}
|
||||
@@ -28,8 +27,8 @@ describe('Server', () => {
|
||||
(server as any).messageHandlers,
|
||||
'set',
|
||||
);
|
||||
const msvcUtilTransformPatternToRouteStub = sinon
|
||||
.stub(Utils, 'transformPatternToRoute')
|
||||
const normalizePatternStub = sinon
|
||||
.stub(server as any, 'normalizePattern')
|
||||
.returns(handlerRoute);
|
||||
|
||||
server.addHandler(pattern, callback as any);
|
||||
@@ -38,22 +37,19 @@ describe('Server', () => {
|
||||
expect(messageHandlersSetSpy.args[0][0]).to.be.equal(handlerRoute);
|
||||
expect(messageHandlersSetSpy.args[0][1]).to.be.equal(callback);
|
||||
|
||||
msvcUtilTransformPatternToRouteStub.restore();
|
||||
normalizePatternStub.restore();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getRouteFromPattern', () => {
|
||||
let msvcUtilTransformPatternToRouteStub: sinon.SinonSpy;
|
||||
let normalizePatternStub: sinon.SinonStub;
|
||||
|
||||
beforeEach(() => {
|
||||
msvcUtilTransformPatternToRouteStub = sinon.spy(
|
||||
Utils,
|
||||
'transformPatternToRoute',
|
||||
);
|
||||
normalizePatternStub = sinon.stub(server as any, 'normalizePattern');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
msvcUtilTransformPatternToRouteStub.restore();
|
||||
normalizePatternStub.restore();
|
||||
});
|
||||
|
||||
describe(`when gets 'string' pattern`, () => {
|
||||
@@ -62,7 +58,7 @@ describe('Server', () => {
|
||||
const transformedServerPattern = inputServerPattern;
|
||||
(server as any).getRouteFromPattern(inputServerPattern);
|
||||
|
||||
expect(msvcUtilTransformPatternToRouteStub.args[0][0]).to.be.equal(
|
||||
expect(normalizePatternStub.args[0][0]).to.be.equal(
|
||||
transformedServerPattern,
|
||||
);
|
||||
});
|
||||
@@ -77,7 +73,7 @@ describe('Server', () => {
|
||||
};
|
||||
(server as any).getRouteFromPattern(inputServerPattern);
|
||||
|
||||
expect(msvcUtilTransformPatternToRouteStub.args[0][0]).to.be.deep.equal(
|
||||
expect(normalizePatternStub.args[0][0]).to.be.deep.equal(
|
||||
transformedServerPattern,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/platform-express",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
@@ -24,8 +24,8 @@
|
||||
"tslib": "2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/common": "7.1.3",
|
||||
"@nestjs/core": "7.1.3"
|
||||
"@nestjs/common": "7.3.2",
|
||||
"@nestjs/core": "7.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^7.0.0",
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -101,8 +101,16 @@ export class FastifyAdapter<TInstance = any> extends AbstractHttpAdapter {
|
||||
return this.instance.inject(...args);
|
||||
}
|
||||
|
||||
public close() {
|
||||
return this.instance.close();
|
||||
public async close() {
|
||||
try {
|
||||
return await this.instance.close();
|
||||
} catch (err) {
|
||||
// Check if server is still running
|
||||
if (err.code !== 'ERR_SERVER_NOT_RUNNING') {
|
||||
throw err;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public initHttpServer(options: NestApplicationOptions) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/platform-fastify",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
@@ -17,7 +17,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"fastify": "2.14.1",
|
||||
"fastify": "2.15.1",
|
||||
"fastify-cors": "3.0.3",
|
||||
"fastify-formbody": "3.2.0",
|
||||
"path-to-regexp": "3.2.0",
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/platform-socket.io",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-socket.io)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/platform-ws",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@platform-ws)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "2.0.0",
|
||||
"ws": "7.3.0"
|
||||
"ws": "7.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^7.0.0",
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/testing",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@testing)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -3,13 +3,17 @@ import {
|
||||
INestApplication,
|
||||
INestMicroservice,
|
||||
Logger,
|
||||
NestApplicationOptions,
|
||||
Type,
|
||||
} from '@nestjs/common';
|
||||
import { NestMicroserviceOptions } from '@nestjs/common/interfaces/microservices/nest-microservice-options.interface';
|
||||
import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface';
|
||||
import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface';
|
||||
import { Type } from '@nestjs/common/interfaces/type.interface';
|
||||
import { loadPackage } from '@nestjs/common/utils/load-package.util';
|
||||
import { NestApplication, NestApplicationContext } from '@nestjs/core';
|
||||
import {
|
||||
AbstractHttpAdapter,
|
||||
NestApplication,
|
||||
NestApplicationContext,
|
||||
} from '@nestjs/core';
|
||||
import { ApplicationConfig } from '@nestjs/core/application-config';
|
||||
import { NestContainer } from '@nestjs/core/injector/container';
|
||||
import { Module } from '@nestjs/core/injector/module';
|
||||
@@ -25,7 +29,7 @@ export class TestingModule extends NestApplicationContext {
|
||||
}
|
||||
|
||||
public createNestApplication<T extends INestApplication = INestApplication>(
|
||||
httpAdapter?: HttpServer,
|
||||
httpAdapter?: HttpServer | AbstractHttpAdapter,
|
||||
options?: NestApplicationOptions,
|
||||
): T {
|
||||
httpAdapter = httpAdapter || this.createHttpAdapter();
|
||||
@@ -58,7 +62,7 @@ export class TestingModule extends NestApplicationContext {
|
||||
);
|
||||
}
|
||||
|
||||
private createHttpAdapter<T = any>(httpServer?: T): HttpServer {
|
||||
private createHttpAdapter<T = any>(httpServer?: T): AbstractHttpAdapter {
|
||||
const { ExpressAdapter } = loadPackage(
|
||||
'@nestjs/platform-express',
|
||||
'NestFactory',
|
||||
|
||||
@@ -54,9 +54,11 @@ With official support, you can get expert help straight from Nest core team. We
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
#### Principal Sponsor
|
||||
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="220" /></a>
|
||||
#### Principal Sponsors
|
||||
<table style="text-align:center;"><tr><td>
|
||||
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
|
||||
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
|
||||
</tr></table>
|
||||
|
||||
#### Silver Sponsors
|
||||
|
||||
@@ -84,8 +86,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td></tr></table>
|
||||
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td></tr></table>
|
||||
|
||||
## Backers
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/websockets",
|
||||
"version": "7.1.3",
|
||||
"version": "7.3.2",
|
||||
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
@@ -12,12 +12,12 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"iterare": "1.2.0",
|
||||
"iterare": "1.2.1",
|
||||
"tslib": "2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/common": "7.1.3",
|
||||
"@nestjs/core": "7.1.3"
|
||||
"@nestjs/common": "7.3.2",
|
||||
"@nestjs/core": "7.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^7.0.0",
|
||||
|
||||
@@ -5,13 +5,6 @@
|
||||
{
|
||||
"depTypeList": ["devDependencies"],
|
||||
"automerge": true
|
||||
},
|
||||
{
|
||||
"packagePatterns": ["*"],
|
||||
"minor": {
|
||||
"groupName": "all non-major dependencies",
|
||||
"groupSlug": "all-minor-patch"
|
||||
}
|
||||
}
|
||||
],
|
||||
"schedule": ["every weekday"]
|
||||
|
||||
3534
sample/01-cats-app/package-lock.json
generated
3534
sample/01-cats-app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,36 +19,36 @@
|
||||
"test:e2e": "jest --config ./e2e/jest-e2e.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/jest": "25.2.1",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/jest": "26.0.3",
|
||||
"@types/node": "10.17.3",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
|
||||
3442
sample/02-gateways/package-lock.json
generated
3442
sample/02-gateways/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,40 +19,40 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/platform-socket.io": "7.0.11",
|
||||
"@nestjs/websockets": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/platform-socket.io": "7.3.1",
|
||||
"@nestjs/websockets": "7.3.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5",
|
||||
"socket.io-redis": "5.2.0"
|
||||
"rxjs": "6.6.0",
|
||||
"socket.io-redis": "5.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/socket.io": "2.1.3",
|
||||
"@types/socket.io-redis": "1.0.25",
|
||||
"@types/ws": "7.2.4",
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/socket.io": "2.1.8",
|
||||
"@types/socket.io-redis": "1.0.26",
|
||||
"@types/ws": "7.2.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "7.10.9",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3403
sample/03-microservices/package-lock.json
generated
3403
sample/03-microservices/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,36 +19,36 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/microservices": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/microservices": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/amqplib": "0.5.13",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3907
sample/04-grpc/package-lock.json
generated
3907
sample/04-grpc/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -20,36 +20,36 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@grpc/proto-loader": "0.5.4",
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/microservices": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/microservices": "7.3.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"grpc": "1.24.2",
|
||||
"grpc": "1.24.3",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "10.17.3",
|
||||
"@types/supertest": "2.0.9",
|
||||
"@types/ws": "7.2.4",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"@types/ws": "7.2.6",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
4201
sample/05-sql-typeorm/package-lock.json
generated
4201
sample/05-sql-typeorm/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,36 +19,36 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/typeorm": "7.0.0",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/typeorm": "7.1.0",
|
||||
"mysql": "2.18.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5",
|
||||
"typeorm": "0.2.24"
|
||||
"rxjs": "6.6.0",
|
||||
"typeorm": "0.2.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "7.10.9",
|
||||
"@types/supertest": "2.0.9",
|
||||
"@types/ws": "7.2.4",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"@types/ws": "7.2.6",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3432
sample/06-mongoose/package-lock.json
generated
3432
sample/06-mongoose/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,36 +19,36 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/mongoose": "7.0.1",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"mongoose": "5.9.13",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/mongoose": "7.0.2",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"mongoose": "5.9.22",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mongoose": "5.7.16",
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/mongoose": "5.7.30",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"@types/ws": "7.2.4",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"@types/ws": "7.2.6",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3435
sample/07-sequelize/package-lock.json
generated
3435
sample/07-sequelize/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,39 +19,39 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/sequelize": "0.1.0",
|
||||
"mysql2": "2.1.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5",
|
||||
"sequelize": "5.21.8",
|
||||
"rxjs": "6.6.0",
|
||||
"sequelize": "5.22.3",
|
||||
"sequelize-typescript": "1.1.0",
|
||||
"typescript": "3.7.2"
|
||||
"typescript": "3.9.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/sequelize": "4.28.8",
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/sequelize": "4.28.9",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"@types/ws": "7.2.4",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"@types/ws": "7.2.6",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
873
sample/08-webpack/package-lock.json
generated
873
sample/08-webpack/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,25 +11,25 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.5",
|
||||
"typescript": "3.7.2"
|
||||
"rxjs": "6.6.0",
|
||||
"typescript": "3.9.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "12.12.31",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"start-server-webpack-plugin": "2.2.5",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"webpack": "4.43.0",
|
||||
"webpack-cli": "3.3.11",
|
||||
"webpack-cli": "3.3.12",
|
||||
"webpack-node-externals": "1.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
4941
sample/09-babel-example/package-lock.json
generated
4941
sample/09-babel-example/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,26 +13,26 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/microservices": "7.0.11",
|
||||
"@nestjs/websockets": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/microservices": "7.3.1",
|
||||
"@nestjs/websockets": "7.3.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.8.4",
|
||||
"@babel/core": "7.9.6",
|
||||
"@babel/node": "7.8.7",
|
||||
"@babel/plugin-proposal-decorators": "7.8.3",
|
||||
"@babel/plugin-transform-runtime": "7.9.6",
|
||||
"@babel/preset-env": "7.9.6",
|
||||
"@babel/register": "7.9.0",
|
||||
"@babel/runtime": "7.9.6",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"jest": "26.0.1",
|
||||
"nodemon": "2.0.3",
|
||||
"@babel/cli": "7.10.4",
|
||||
"@babel/core": "7.10.4",
|
||||
"@babel/node": "7.10.4",
|
||||
"@babel/plugin-proposal-decorators": "7.10.4",
|
||||
"@babel/plugin-transform-runtime": "7.10.4",
|
||||
"@babel/preset-env": "7.10.4",
|
||||
"@babel/register": "7.10.4",
|
||||
"@babel/runtime": "7.10.4",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"jest": "26.1.0",
|
||||
"nodemon": "2.0.4",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2"
|
||||
},
|
||||
|
||||
3393
sample/10-fastify/package-lock.json
generated
3393
sample/10-fastify/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,35 +19,35 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-fastify": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-fastify": "7.3.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"@types/ws": "7.2.4",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"@types/ws": "7.2.6",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3386
sample/11-swagger/package-lock.json
generated
3386
sample/11-swagger/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,36 +19,36 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/swagger": "4.5.5",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/swagger": "4.5.12",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5",
|
||||
"rxjs": "6.6.0",
|
||||
"swagger-ui-express": "4.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "10.17.3",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
7281
sample/12-graphql-schema-first/package-lock.json
generated
7281
sample/12-graphql-schema-first/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,39 +19,39 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/graphql": "7.3.7",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"apollo-server": "2.13.1",
|
||||
"apollo-server-express": "2.13.1",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/graphql": "7.5.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"apollo-server": "2.15.1",
|
||||
"apollo-server-express": "2.15.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"graphql": "14.6.0",
|
||||
"graphql": "15.3.0",
|
||||
"graphql-subscriptions": "1.1.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
4212
sample/13-mongo-typeorm/package-lock.json
generated
4212
sample/13-mongo-typeorm/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,35 +19,35 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/typeorm": "7.0.0",
|
||||
"mongodb": "3.5.7",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/typeorm": "7.1.0",
|
||||
"mongodb": "3.5.9",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5",
|
||||
"typeorm": "0.2.24"
|
||||
"rxjs": "6.6.0",
|
||||
"typeorm": "0.2.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3380
sample/14-mongoose-base/package-lock.json
generated
3380
sample/14-mongoose-base/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,33 +19,33 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"mongoose": "5.9.13",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"mongoose": "5.9.22",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "7.10.9",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3856
sample/15-mvc/package-lock.json
generated
3856
sample/15-mvc/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,34 +19,34 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"hbs": "4.1.1",
|
||||
"pug": "3.0.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.5.5"
|
||||
"rxjs": "6.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "8.10.58",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
3428
sample/16-gateways-ws/package-lock.json
generated
3428
sample/16-gateways-ws/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,38 +19,38 @@
|
||||
"test:e2e": "echo 'No e2e tests implemented yet.'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "7.0.11",
|
||||
"@nestjs/core": "7.0.11",
|
||||
"@nestjs/platform-express": "7.0.11",
|
||||
"@nestjs/platform-ws": "7.0.11",
|
||||
"@nestjs/websockets": "7.0.11",
|
||||
"@nestjs/common": "7.3.1",
|
||||
"@nestjs/core": "7.3.1",
|
||||
"@nestjs/platform-express": "7.3.1",
|
||||
"@nestjs/platform-ws": "7.3.1",
|
||||
"@nestjs/websockets": "7.3.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.12.2",
|
||||
"rimraf": "3.0.2",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.5",
|
||||
"ws": "7.3.0"
|
||||
"rxjs": "6.6.0",
|
||||
"ws": "7.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ws": "7.2.4",
|
||||
"@nestjs/cli": "7.1.5",
|
||||
"@nestjs/schematics": "7.0.0",
|
||||
"@nestjs/testing": "7.0.11",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/ws": "7.2.6",
|
||||
"@nestjs/cli": "7.4.1",
|
||||
"@nestjs/schematics": "7.0.1",
|
||||
"@nestjs/testing": "7.3.1",
|
||||
"@types/express": "4.17.7",
|
||||
"@types/node": "12.12.31",
|
||||
"@types/supertest": "2.0.9",
|
||||
"jest": "26.0.1",
|
||||
"@types/supertest": "2.0.10",
|
||||
"jest": "26.1.0",
|
||||
"prettier": "2.0.5",
|
||||
"supertest": "4.0.2",
|
||||
"ts-jest": "26.0.0",
|
||||
"ts-loader": "7.0.4",
|
||||
"ts-node": "8.10.1",
|
||||
"ts-jest": "26.1.1",
|
||||
"ts-loader": "7.0.5",
|
||||
"ts-node": "8.10.2",
|
||||
"tsconfig-paths": "3.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.0.0",
|
||||
"@typescript-eslint/parser": "3.0.0",
|
||||
"eslint": "7.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "3.6.0",
|
||||
"@typescript-eslint/parser": "3.6.0",
|
||||
"eslint": "7.4.0",
|
||||
"eslint-config-prettier": "6.11.0",
|
||||
"eslint-plugin-import": "2.20.2",
|
||||
"typescript": "3.7.2"
|
||||
"eslint-plugin-import": "2.22.0",
|
||||
"typescript": "3.9.6"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user