Compare commits

..

43 Commits

Author SHA1 Message Date
Kamil Myśliwiec
d7250e42e5 tests() exclude async hooks 2018-12-29 12:45:42 +01:00
Kamil Myśliwiec
6a084a36b6 feature() add async_hooks module (async storage) 2018-12-29 10:59:57 +01:00
Kamil Myśliwiec
00554ee913 tests(core) update middleware builder/module unit tests 2018-12-24 15:21:16 +01:00
Kamil Myśliwiec
87c1ef35b0 sample() update samples 2018-12-24 15:20:55 +01:00
Kamil Myśliwiec
4ca914e0c7 Merge branch 'feature/di-scopes' into feature/middleware-api 2018-12-24 15:08:22 +01:00
Kamil Myśliwiec
0e258842a6 cleanup(core) remove async hooks module 2018-12-24 15:06:34 +01:00
Kamil Myśliwiec
3da97c684c refactor(common/core) simplify middleware interface 2018-12-24 15:01:04 +01:00
Kamil Myśliwiec
06dec9a897 feature() transient/request scope with circular deps 2018-12-24 14:45:32 +01:00
Kamil Myśliwiec
ed96171f38 chore() resolve conflicts (merge) 2018-12-21 10:19:24 +01:00
Kamil Myśliwiec
2e992d39ea tests() fix unit tests, update enhancers 2018-12-18 16:51:47 +01:00
Kamil Myśliwiec
cb062be24f feature() wip DI scopes 2018-12-17 10:13:49 +01:00
Kamil Myśliwiec
5352bba8f7 feature() fix request scoped 2018-12-15 23:02:04 +01:00
Kamil Myśliwiec
5cd3448670 feature() fix request scoped 2018-12-15 23:01:48 +01:00
Kamil Myśliwiec
17e0ae6c63 feature() wip: DI scopes 2018-12-15 21:22:36 +01:00
Kamil Myśliwiec
6071ea80c8 feature(common) enhance internal logger 2018-12-13 11:15:51 +01:00
Kamil Myśliwiec
53687ba46a feature(websockets) extract web sockets drivers 2018-12-12 23:35:27 +01:00
Kamil Myśliwiec
03b0cf838a chore() merge latest changes (resolve conflicts) 2018-12-10 22:57:45 +01:00
Kamil Mysliwiec
15bdbacc4b Merge pull request #1328 from nestjs/bugfix/interceptor-flow
bugfix(core) fix interceptors execution flow
2018-12-10 22:40:02 +01:00
Kamil Mysliwiec
f96b2a8c9b Merge pull request #1161 from nestjs/refactor/microservices
refactor(microservices) refactor, improvements, use es6 map
2018-12-10 22:38:50 +01:00
Kamil Myśliwiec
4ec8e3436c test(microservices) fix unit tests 2018-12-10 22:33:48 +01:00
Kamil Myśliwiec
4796023e02 chore() resolve conflicts 2018-12-10 22:03:06 +01:00
Kamil Myśliwiec
30b6c50dd8 merge() resolve conflicts 2018-12-10 21:48:06 +01:00
Kamil Myśliwiec
42e1e79b31 test(): fix e2e tests 2018-12-05 23:08:03 +01:00
Kamil Myśliwiec
a3fbb8816e feature() extract fastify, multer, cors, adapters 2018-12-01 21:02:36 +01:00
Kamil Myśliwiec
bc4a8a556c feature(core/common) extract HTTP adapters (express/fastify) 2018-11-30 16:48:04 +01:00
Kamil Myśliwiec
ead8d55538 refactor: fix typings (tuples, binding checks) 2018-11-30 14:52:01 +01:00
Kamil Myśliwiec
e3cbab771a merge: resolve conflicts 2018-11-30 14:28:00 +01:00
Kamil Mysliwiec
df9c8215ca Merge pull request #1322 from nestjs/refactor/remove-deprecations
refactor: remove deprecations, update to TypeScript 3.0+
2018-11-30 14:09:24 +01:00
Kamil Myśliwiec
af923ced97 lint() update ts-lint package (ts compatibility) 2018-11-30 14:04:02 +01:00
Kamil Myśliwiec
ee9360dcff fix: quick fix 2018-11-30 14:01:40 +01:00
Kamil Myśliwiec
2c87615f8e ci() fix travis build (update lock file) 2018-11-30 13:59:54 +01:00
Kamil Myśliwiec
7fd9849a6c merge: resolve conflicts 2018-11-30 13:47:00 +01:00
Kamil Mysliwiec
1c320071aa Merge pull request #1312 from nestjs/refactor/injector
refactor: general refactor (explicit types, generics, components)
2018-11-30 13:43:51 +01:00
Kamil Myśliwiec
93bdb62df2 merge: resolve conflicts 2018-11-30 13:41:53 +01:00
Kamil Myśliwiec
ae4e7d3b12 test(core) fix broken unit tests (interceptors) 2018-11-30 11:06:59 +01:00
Kamil Myśliwiec
d534c47455 sample() update examples with new API 2018-11-30 10:13:57 +01:00
Kamil Myśliwiec
cfa96f08fa bugfix(core) fix interceptors execution flow 2018-11-30 10:08:13 +01:00
Kamil Myśliwiec
5588470479 refactor: remove deprecations and update to typescript 3.0 2018-11-28 23:59:57 +01:00
Kamil Myśliwiec
773d062e41 feature(core) add HttpServer typings 2018-11-28 23:27:54 +01:00
Kamil Myśliwiec
1cac0a99fd feature: more typings, refactor 2018-11-28 23:08:27 +01:00
Kamil Myśliwiec
0b23422ab1 refactor: reduce implicit types 2018-11-24 17:28:28 +01:00
Kamil Myśliwiec
1cb3ed7f87 refactor: general refactor reorganize, rename things 2018-11-24 16:01:29 +01:00
Kamil Myśliwiec
f802f94c0f refactor(microservices) refactor, improvements, use es6 map 2018-10-03 22:15:29 +02:00
452 changed files with 18507 additions and 8513 deletions

View File

@@ -16,7 +16,6 @@
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#8" alt="Coverage" /></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
<a href="https://discord.gg/G7Qnnhy"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
@@ -49,21 +48,17 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
#### Base Sponsor
#### Gold Sponsors
<a href="https://blueanchor.io/"><img src="https://nestjs.com/img/blueanchor.png" width="300" /></a>
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="220" /></a>
#### Silver Sponsors
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> &nbsp;
<a href="http://gojob.com"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" height="95" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" valign="middle" /> </a> &nbsp; &nbsp;
<a href="https://yakaz.com/"><img src="https://nestjs.com/img/yakaz.png" width="100" valign="middle" /></a>
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="150" valign="middle" /></a>
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp;
<a href="http://gojob.com"><img src="http://nestjs.com/img/gojob-logo.png" valign="bottom" height="95" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /> </a>
#### Sponsors
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" valign="middle" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" valign="middle" /></a> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" valign="middle" /></a> &nbsp; <a href="https://genuinebee.com/"><img src="https://nestjs.com/img/genuinebee.svg" height="38" valign="middle" /></a> &nbsp; <a href="http://architectnow.net/"><img src="https://nestjs.com/img/architectnow.png" height="24" valign="middle" /></a> &nbsp; <a href="https://quander.io/"><img src="https://nestjs.com/img/quander.png" height="28" valign="middle" /></a> &nbsp; <a href="https://mantro.net/"><img src="https://nestjs.com/img/mantro-logo.svg" height="20" valign="middle" /></a> &nbsp;
<a href="https://triplebyte.com/"><img src="https://nestjs.com/img/triplebyte.png" height="30" valign="middle" /></a>
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a> &nbsp; <a href="https://genuinebee.com/"><img src="https://nestjs.com/img/genuinebee.svg" height="38" /></a> &nbsp; <a href="http://architectnow.net/"><img src="https://nestjs.com/img/architectnow.png" height="24" /></a> &nbsp; <a href="https://quander.io/"><img src="https://nestjs.com/img/quander.png" height="28" /></a>
## Backers

View File

@@ -1,28 +1,50 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
'use strict';
var __decorate =
(this && this.__decorate) ||
function(decorators, target, key, desc) {
var c = arguments.length,
r =
c < 3
? target
: desc === null
? (desc = Object.getOwnPropertyDescriptor(target, key))
: desc,
d;
if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if ((d = decorators[i]))
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("@nestjs/common");
};
var __metadata =
(this && this.__metadata) ||
function(k, v) {
if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
return Reflect.metadata(k, v);
};
Object.defineProperty(exports, '__esModule', { value: true });
const common_1 = require('@nestjs/common');
let AppController = class AppController {
root() {
return 'Hello world!';
}
root() {
return 'Hello world!';
}
};
__decorate([
__decorate(
[
common_1.Get(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", String)
], AppController.prototype, "root", null);
AppController = __decorate([
common_1.Controller()
], AppController);
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', String),
],
AppController.prototype,
'root',
null,
);
AppController = __decorate(
[common_1.Controller({ scope: common_1.Scope.REQUEST })],
AppController,
);
exports.AppController = AppController;
//# sourceMappingURL=app.controller.js.map
//# sourceMappingURL=app.controller.js.map

View File

@@ -12,6 +12,16 @@ const packages = {
microservices: ts.createProject('packages/microservices/tsconfig.json'),
websockets: ts.createProject('packages/websockets/tsconfig.json'),
testing: ts.createProject('packages/testing/tsconfig.json'),
'platform-express': ts.createProject(
'packages/platform-express/tsconfig.json',
),
'platform-fastify': ts.createProject(
'packages/platform-fastify/tsconfig.json',
),
'platform-socket.io': ts.createProject(
'packages/platform-socket.io/tsconfig.json',
),
'platform-ws': ts.createProject('packages/platform-ws/tsconfig.json'),
};
const modules = Object.keys(packages);
const source = 'packages';
@@ -34,14 +44,21 @@ gulp.task('copy-misc', function() {
.pipe(gulp.dest(`${source}/core`))
.pipe(gulp.dest(`${source}/microservices`))
.pipe(gulp.dest(`${source}/websockets`))
.pipe(gulp.dest(`${source}/testing`));
.pipe(gulp.dest(`${source}/testing`))
.pipe(gulp.dest(`${source}/platform-fastify`))
.pipe(gulp.dest(`${source}/platform-express`))
.pipe(gulp.dest(`${source}/platform-ws`))
.pipe(gulp.dest(`${source}/platform-socket.io`));
});
gulp.task('clean:output', function() {
return gulp
.src([`${source}/**/*.js`, `${source}/**/*.d.ts`], {
read: false,
})
.src(
[`${source}/**/*.js`, `${source}/**/*.d.ts`, `${source}/**/*.js.map`],
{
read: false,
},
)
.pipe(clean());
});

View File

@@ -1,4 +1,4 @@
import { INestApplication } from '@nestjs/common';
/*import { INestApplication } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import * as request from 'supertest';
import { AsyncClassApplicationModule } from '../src/async-options-class.module';
@@ -36,3 +36,4 @@ describe('GraphQL (async class)', () => {
await app.close();
});
});
*/

View File

@@ -1,4 +1,4 @@
import { INestApplication } from '@nestjs/common';
/*import { INestApplication } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import * as request from 'supertest';
import { AsyncExistingApplicationModule } from '../src/async-options-existing.module';
@@ -36,3 +36,4 @@ describe('GraphQL (async existing)', () => {
await app.close();
});
});
*/

View File

@@ -1,4 +1,4 @@
import { INestApplication } from '@nestjs/common';
/*import { INestApplication } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import * as request from 'supertest';
import { AsyncApplicationModule } from '../src/async-options.module';
@@ -34,3 +34,4 @@ describe('GraphQL (async configuration)', () => {
await app.close();
});
});
*/

View File

@@ -1,4 +1,4 @@
import { INestApplication } from '@nestjs/common';
/*import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import * as request from 'supertest';
import { ApplicationModule } from '../src/app.module';
@@ -38,3 +38,4 @@ describe('GraphQL', () => {
await app.close();
});
});
*/

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"start:prod": "node dist/main.js"
},
"dependencies": {
"@nestjs/common": "5.6.2",
"@nestjs/common": "^5.1.0",
"@nestjs/core": "^5.1.0",
"@nestjs/graphql": "^5.0.0",
"apollo-server-express": "^2.0.4",
@@ -18,7 +18,7 @@
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"subscriptions-transport-ws": "^0.9.5",
"typescript": "^2.8.0",
"typescript": "^3.1.0",
"ws": "^4.0.0"
},
"devDependencies": {

View File

@@ -1,7 +1,8 @@
import { INestApplication } from '@nestjs/common';
import { ExpressAdapter } from '@nestjs/platform-express';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { Test } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { ApplicationModule } from '../src/app.module';
describe('Hello world (express instance)', () => {
@@ -11,10 +12,9 @@ describe('Hello world (express instance)', () => {
beforeEach(async () => {
const module = await Test.createTestingModule({
imports: [ApplicationModule],
})
.compile();
}).compile();
app = module.createNestApplication(express());
app = module.createNestApplication(new ExpressAdapter(express()));
server = app.getHttpServer();
await app.init();
});

View File

@@ -1,19 +1,22 @@
import { INestApplication } from '@nestjs/common';
import { INestFastifyApplication } from '@nestjs/common/interfaces/nest-fastify-application.interface';
import { FastifyAdapter } from '@nestjs/core/adapters/fastify-adapter';
import {
FastifyAdapter,
INestFastifyApplication,
} from '@nestjs/platform-fastify';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import { ApplicationModule } from '../src/app.module';
describe('Hello world (fastify adapter)', () => {
let app: INestApplication & INestFastifyApplication;
let app: INestFastifyApplication;
beforeEach(async () => {
const module = await Test.createTestingModule({
imports: [ApplicationModule],
}).compile();
app = module.createNestApplication(new FastifyAdapter());
app = module.createNestApplication<INestFastifyApplication>(
new FastifyAdapter(),
);
await app.init();
});

View File

@@ -1,24 +1,30 @@
import * as request from 'supertest';
import { Test } from '@nestjs/testing';
import { INestApplication, Injectable } from '@nestjs/common';
import { ApplicationModule } from '../src/app.module';
import {
CallHandler,
ExecutionContext,
INestApplication,
Injectable,
NestInterceptor,
} from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { Test } from '@nestjs/testing';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import * as request from 'supertest';
import { ApplicationModule } from '../src/app.module';
const RETURN_VALUE = 'test';
@Injectable()
export class OverrideInterceptor {
intercept(context, stream) {
export class OverrideInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler) {
return of(RETURN_VALUE);
}
}
@Injectable()
export class TransformInterceptor {
intercept(context, stream) {
return stream.pipe(map(data => ({ data })));
intercept(context: ExecutionContext, next: CallHandler) {
return next.handle().pipe(map(data => ({ data })));
}
}
@@ -41,7 +47,7 @@ describe('Interceptors', () => {
app = (await createTestModule(
new OverrideInterceptor(),
)).createNestApplication();
await app.init();
return request(app.getHttpServer())
.get('/hello')
@@ -52,7 +58,7 @@ describe('Interceptors', () => {
app = (await createTestModule(
new TransformInterceptor(),
)).createNestApplication();
await app.init();
return request(app.getHttpServer())
.get('/hello')
@@ -63,7 +69,7 @@ describe('Interceptors', () => {
app = (await createTestModule(
new TransformInterceptor(),
)).createNestApplication();
await app.init();
return request(app.getHttpServer())
.get('/hello/stream')
@@ -74,7 +80,7 @@ describe('Interceptors', () => {
app = (await createTestModule(
new TransformInterceptor(),
)).createNestApplication();
await app.init();
return request(app.getHttpServer())
.get('/hello/async')

View File

@@ -5,11 +5,11 @@
"requires": true,
"dependencies": {
"@nestjs/common": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.6.2.tgz",
"integrity": "sha512-LJkG60HXtOL0/8MgdITMUEMF9CCMa3gtmxcnxfxvqZN/cFGEFZ5QzMWbEdcP5N+kUJY2BL8gENdmPGyqBNJm0A==",
"version": "5.3.15",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.3.15.tgz",
"integrity": "sha512-RL99PBD1Ov4Q6J2xdt6fb3FE79awfKmV2rtloG0rqxfnHUvjK2Dz5dqYkH2vuKQV6ae+Z+UB+A677WSCqbuTLQ==",
"requires": {
"axios": "0.18.0",
"axios": "0.17.1",
"cli-color": "1.2.0",
"deprecate": "1.0.0",
"multer": "1.3.0",
@@ -184,11 +184,11 @@
}
},
"axios": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz",
"integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=",
"requires": {
"follow-redirects": "^1.3.0",
"follow-redirects": "^1.2.5",
"is-buffer": "^1.1.5"
}
},
@@ -367,7 +367,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
@@ -566,9 +566,9 @@
}
},
"es5-ext": {
"version": "0.10.47",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.47.tgz",
"integrity": "sha512-/1TItLfj+TTfWoeRcDn/0FbGV6SNo4R+On2GGVucPU/j3BWnXE2Co8h8CTo4Tu34gFJtnmwS9xiScKs4EjZhdw==",
"version": "0.10.46",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz",
"integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==",
"requires": {
"es6-iterator": "~2.0.3",
"es6-symbol": "~3.1.1",
@@ -878,9 +878,9 @@
"integrity": "sha512-YXblbv/vc1zuVVUtnKl1hPqqk7TalZCppnKE7Pr8FI/Rp48vzckS/4SJ4Y9O9RNiI82Vcw/FydmtqdQOg1Dpqw=="
},
"follow-redirects": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz",
"integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==",
"version": "1.5.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.9.tgz",
"integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==",
"requires": {
"debug": "=3.1.0"
}
@@ -1310,7 +1310,7 @@
},
"readable-stream": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",

View File

@@ -7,7 +7,7 @@
"start": "ts-node src/main"
},
"dependencies": {
"@nestjs/common": "5.6.2",
"@nestjs/common": "^5.0.0",
"@nestjs/core": "^5.0.0",
"@nestjs/microservices": "^5.0.0",
"@nestjs/testing": "^5.0.0",
@@ -17,7 +17,7 @@
"fastify": "^1.1.1",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typescript": "^2.8.0"
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/node": "^7.0.41",

View File

@@ -1,4 +1,4 @@
import { Get, BadRequestException, Controller } from '@nestjs/common';
import { BadRequestException, Controller, Get } from '@nestjs/common';
@Controller()
export class ErrorsController {
@@ -13,6 +13,10 @@ export class ErrorsController {
}
throwError() {
throw new BadRequestException('Integration test');
throw new BadRequestException({
statusCode: 400,
error: 'Bad Request',
message: 'Integration test',
});
}
}

View File

@@ -16,7 +16,7 @@
"class-validator": "^0.7.2",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typescript": "^2.8.0"
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/node": "^7.0.41",

View File

@@ -1,8 +1,7 @@
import * as express from 'express';
import * as request from 'supertest';
import { Test } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as request from 'supertest';
import { MqttBroadcastController } from '../src/mqtt/mqtt-broadcast.controller';
describe('MQTT transport', () => {
@@ -14,8 +13,9 @@ describe('MQTT transport', () => {
controllers: [MqttBroadcastController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.MQTT,
});

View File

@@ -1,8 +1,7 @@
import * as express from 'express';
import * as request from 'supertest';
import { Test } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as request from 'supertest';
import { NatsBroadcastController } from '../src/nats/nats-broadcast.controller';
describe('NATS transport', () => {
@@ -14,8 +13,9 @@ describe('NATS transport', () => {
controllers: [NatsBroadcastController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.NATS,
});

View File

@@ -1,9 +1,7 @@
import * as express from 'express';
import * as request from 'supertest';
import { Test } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { RedisController } from '../src/redis/redis.controller';
import { Test } from '@nestjs/testing';
import * as request from 'supertest';
import { RedisBroadcastController } from '../src/redis/redis-broadcast.controller';
describe('REDIS transport', () => {
@@ -15,8 +13,9 @@ describe('REDIS transport', () => {
controllers: [RedisBroadcastController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.REDIS,
});

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { DisconnectedClientController } from '../src/disconnected.controller';
@@ -14,8 +13,9 @@ describe('Disconnected client', () => {
controllers: [DisconnectedClientController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
await app.init();
});

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import { join } from 'path';
import * as request from 'supertest';
import { GrpcController } from '../src/grpc/grpc.controller';
@@ -15,8 +14,9 @@ describe('GRPC transport', () => {
controllers: [GrpcController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.GRPC,
options: {
@@ -32,7 +32,7 @@ describe('GRPC transport', () => {
return request(server)
.post('/')
.send([1, 2, 3, 4, 5])
.expect(200, { result: 15 });
.expect(200, { result: '15' });
});
afterEach(async () => {

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { MqttController } from '../src/mqtt/mqtt.controller';
@@ -14,8 +13,9 @@ describe('MQTT transport', () => {
controllers: [MqttController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.MQTT,
});

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { NatsController } from '../src/nats/nats.controller';
@@ -14,8 +13,9 @@ describe('NATS transport', () => {
controllers: [NatsController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.NATS,
options: {

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { RedisController } from '../src/redis/redis.controller';
@@ -14,8 +13,9 @@ describe('REDIS transport', () => {
controllers: [RedisController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.REDIS,
});

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { RMQController } from '../src/rmq/rmq.controller';
@@ -14,8 +13,9 @@ describe('RabbitMQ transport', () => {
controllers: [RMQController],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.RMQ,
options: {

View File

@@ -1,7 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { Transport } from '@nestjs/microservices';
import { Test } from '@nestjs/testing';
import * as express from 'express';
import * as request from 'supertest';
import { ApplicationModule } from '../src/app.module';
@@ -14,8 +13,9 @@ describe('RPC transport', () => {
imports: [ApplicationModule],
}).compile();
server = express();
app = module.createNestApplication(server);
app = module.createNestApplication();
server = app.getHttpAdapter().getInstance();
app.connectMicroservice({
transport: Transport.TCP,
});

View File

@@ -17,7 +17,7 @@
"class-validator": "^0.7.2",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typescript": "^2.8.0"
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/node": "^7.0.41",

View File

@@ -5,49 +5,33 @@
"requires": true,
"dependencies": {
"@nestjs/common": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.6.2.tgz",
"integrity": "sha512-LJkG60HXtOL0/8MgdITMUEMF9CCMa3gtmxcnxfxvqZN/cFGEFZ5QzMWbEdcP5N+kUJY2BL8gENdmPGyqBNJm0A==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.0.1.tgz",
"integrity": "sha512-DWd/kieJk5zLit9IW02Snc/8tdO8hus+zFqEnHQEFYDh6FJy0hTCSc45AqEXjei1uVrzrncYFZClTstOugs2XQ==",
"requires": {
"axios": "0.18.0",
"axios": "0.17.1",
"cli-color": "1.2.0",
"deprecate": "1.0.0",
"multer": "1.3.0",
"uuid": "3.3.2"
"multer": "1.3.0"
}
},
"@nestjs/core": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-5.6.2.tgz",
"integrity": "sha512-XuCK/veePY4ggEmGSj9XZFd1+rQdjmHXovdbkEFSmORl7gIwzxk6qupCRq8BuTCHqbMYj8qcgBRk9YXmHMR1TA==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-5.0.1.tgz",
"integrity": "sha512-QJpT869H8AlxL8P4OnMGZ7DRcbyYt3URhfxZ6agGKohrlqm4nspCHu1eMT3WjzhcobryFtL0/ZZVir18OQ9rgw==",
"requires": {
"@nuxtjs/opencollective": "0.1.0",
"body-parser": "1.18.3",
"body-parser": "1.18.2",
"cors": "2.8.4",
"express": "4.16.3",
"fast-safe-stringify": "1.2.0",
"iterare": "0.0.8",
"object-hash": "1.3.0",
"optional": "0.1.4",
"path-to-regexp": "2.2.1",
"uuid": "3.3.2"
"optional": "0.1.4"
}
},
"@nestjs/mongoose": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/@nestjs/mongoose/-/mongoose-5.2.2.tgz",
"integrity": "sha512-OwdZWsatFPvEAjvMAmje9sGryo69oilSvt5iRf7jYacfa03zlsTpHecmDwrADsBmdP3FDmEDLEFxsJQosnO+wg=="
},
"@nuxtjs/opencollective": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.1.0.tgz",
"integrity": "sha512-e09TxGpTxMOfVwvVWPKNttKslnCtbvp5ofc0EwlKdA4IA8AUIyeteGraGZGs+JO4zw4y2+YxRlNN2xQ+c6KFjw==",
"requires": {
"chalk": "^2.4.1",
"consola": "^1.4.3",
"esm": "^3.0.79",
"node-fetch": "^2.2.0"
}
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@nestjs/mongoose/-/mongoose-4.0.0.tgz",
"integrity": "sha512-S0rFw9JGKpxJ40obxOy57X22HF1IYJKXx403qt3LaJTbI8yHucICRZsBe7pVAA/0LHoNjMJIarM1sUqvtchw7g=="
},
"@types/bson": {
"version": "1.0.7",
@@ -97,7 +81,7 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "~2.1.18",
"mime-types": "2.1.18",
"negotiator": "0.6.1"
}
},
@@ -110,6 +94,7 @@
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "1.9.1"
}
@@ -148,12 +133,12 @@
}
},
"axios": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz",
"integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=",
"requires": {
"follow-redirects": "^1.3.0",
"is-buffer": "^1.1.5"
"follow-redirects": "1.5.0",
"is-buffer": "1.1.6"
}
},
"babel-code-frame": {
@@ -206,20 +191,20 @@
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
},
"body-parser": {
"version": "1.18.3",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"content-type": "1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "~1.6.3",
"iconv-lite": "0.4.23",
"on-finished": "~2.3.0",
"qs": "6.5.2",
"raw-body": "2.3.3",
"type-is": "~1.6.16"
"depd": "1.1.2",
"http-errors": "1.6.3",
"iconv-lite": "0.4.19",
"on-finished": "2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "1.6.16"
}
},
"brace-expansion": {
@@ -254,7 +239,7 @@
"integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=",
"requires": {
"dicer": "0.2.5",
"readable-stream": "1.1.x"
"readable-stream": "1.1.14"
}
},
"bytes": {
@@ -266,34 +251,31 @@
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "3.2.1",
"escape-string-regexp": "1.0.5",
"supports-color": "5.4.0"
}
},
"ci-info": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz",
"integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A=="
},
"cli-color": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.2.0.tgz",
"integrity": "sha1-OlrnT9drYmevZm5p4q+70B3vNNE=",
"requires": {
"ansi-regex": "^2.1.1",
"d": "1",
"es5-ext": "^0.10.12",
"es6-iterator": "2",
"memoizee": "^0.4.3",
"timers-ext": "0.1"
"ansi-regex": "2.1.1",
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-iterator": "2.0.3",
"memoizee": "0.4.12",
"timers-ext": "0.1.5"
}
},
"color-convert": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
"integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
@@ -301,7 +283,8 @@
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"commander": {
"version": "2.15.1",
@@ -320,10 +303,10 @@
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
"buffer-from": "1.0.0",
"inherits": "2.0.3",
"readable-stream": "2.3.6",
"typedarray": "0.0.6"
},
"dependencies": {
"isarray": {
@@ -336,13 +319,13 @@
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.2",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"string_decoder": {
@@ -350,22 +333,11 @@
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
"safe-buffer": "5.1.2"
}
}
}
},
"consola": {
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/consola/-/consola-1.4.5.tgz",
"integrity": "sha512-movqq3MbyXbSf7cG/x+EbO3VjKQVZPB/zeB5+lN1TuBYh9BWDemLQca9P+a4xpO4lXva9rz+Bd8XyqlH136Lww==",
"requires": {
"chalk": "^2.3.2",
"figures": "^2.0.0",
"lodash": "^4.17.5",
"std-env": "^1.1.0"
}
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
@@ -396,8 +368,8 @@
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
"integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
"requires": {
"object-assign": "^4",
"vary": "^1"
"object-assign": "4.1.1",
"vary": "1.1.2"
},
"dependencies": {
"object-assign": {
@@ -412,7 +384,7 @@
"resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
"integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
"requires": {
"es5-ext": "^0.10.9"
"es5-ext": "0.10.42"
}
},
"debug": {
@@ -443,7 +415,7 @@
"resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz",
"integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=",
"requires": {
"readable-stream": "1.1.x",
"readable-stream": "1.1.14",
"streamsearch": "0.1.2"
}
},
@@ -464,13 +436,13 @@
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"es5-ext": {
"version": "0.10.47",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.47.tgz",
"integrity": "sha512-/1TItLfj+TTfWoeRcDn/0FbGV6SNo4R+On2GGVucPU/j3BWnXE2Co8h8CTo4Tu34gFJtnmwS9xiScKs4EjZhdw==",
"version": "0.10.42",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz",
"integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==",
"requires": {
"es6-iterator": "~2.0.3",
"es6-symbol": "~3.1.1",
"next-tick": "1"
"es6-iterator": "2.0.3",
"es6-symbol": "3.1.1",
"next-tick": "1.0.0"
}
},
"es6-iterator": {
@@ -478,9 +450,9 @@
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
"integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
"requires": {
"d": "1",
"es5-ext": "^0.10.35",
"es6-symbol": "^3.1.1"
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-symbol": "3.1.1"
}
},
"es6-symbol": {
@@ -488,8 +460,8 @@
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
"integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=",
"requires": {
"d": "1",
"es5-ext": "~0.10.14"
"d": "1.0.0",
"es5-ext": "0.10.42"
}
},
"es6-weak-map": {
@@ -497,10 +469,10 @@
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz",
"integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=",
"requires": {
"d": "1",
"es5-ext": "^0.10.14",
"es6-iterator": "^2.0.1",
"es6-symbol": "^3.1.1"
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-iterator": "2.0.3",
"es6-symbol": "3.1.1"
}
},
"escape-html": {
@@ -511,12 +483,8 @@
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"esm": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.0.tgz",
"integrity": "sha512-yK4IiHmmInOk9q4xbJXdUfPV0ju7GbRCbhtpe5/gH7nRiD6RAb12Ix7zfsqQkDL5WERwzFlq/eT6zTXDWwIk+w=="
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"esprima": {
"version": "4.0.0",
@@ -540,8 +508,8 @@
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
"integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=",
"requires": {
"d": "1",
"es5-ext": "~0.10.14"
"d": "1.0.0",
"es5-ext": "0.10.42"
}
},
"express": {
@@ -549,104 +517,38 @@
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
"requires": {
"accepts": "~1.3.5",
"accepts": "1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.2",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"content-type": "1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"depd": "1.1.2",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"methods": "1.1.2",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.3",
"proxy-addr": "2.0.3",
"qs": "6.5.1",
"range-parser": "~1.2.0",
"range-parser": "1.2.0",
"safe-buffer": "5.1.1",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"statuses": "1.4.0",
"type-is": "1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
"vary": "1.1.2"
},
"dependencies": {
"body-parser": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.1",
"http-errors": "~1.6.2",
"iconv-lite": "0.4.19",
"on-finished": "~2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "~1.6.15"
}
},
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"qs": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
},
"raw-body": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.2",
"iconv-lite": "0.4.19",
"unpipe": "1.0.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
"requires": {
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": ">= 1.3.1 < 2"
}
},
"setprototypeof": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
}
}
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
@@ -659,31 +561,18 @@
}
}
},
"fast-safe-stringify": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-1.2.0.tgz",
"integrity": "sha1-69QmZv0Y/k8rpPDSlQZfP4XK3pY="
},
"figures": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
"requires": {
"escape-string-regexp": "^1.0.5"
}
},
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"statuses": "1.4.0",
"unpipe": "1.0.0"
},
"dependencies": {
"statuses": {
@@ -694,11 +583,11 @@
}
},
"follow-redirects": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz",
"integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz",
"integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==",
"requires": {
"debug": "=3.1.0"
"debug": "3.1.0"
},
"dependencies": {
"debug": {
@@ -753,26 +642,24 @@
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"depd": "1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
"statuses": "1.5.0"
}
},
"iconv-lite": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
"integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"inflight": {
"version": "1.0.6",
@@ -790,23 +677,15 @@
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz",
"integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs="
},
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"is-ci": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz",
"integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==",
"requires": {
"ci-info": "^1.5.0"
}
},
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
@@ -858,7 +737,7 @@
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
"integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=",
"requires": {
"es5-ext": "~0.10.2"
"es5-ext": "0.10.42"
}
},
"make-error": {
@@ -873,18 +752,18 @@
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"memoizee": {
"version": "0.4.14",
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz",
"integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==",
"version": "0.4.12",
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.12.tgz",
"integrity": "sha512-sprBu6nwxBWBvBOh5v2jcsGqiGLlL2xr2dLub3vR8dnE8YB17omwtm/0NSHl8jjNbcsJd5GMWJAnTSVe/O0Wfg==",
"requires": {
"d": "1",
"es5-ext": "^0.10.45",
"es6-weak-map": "^2.0.2",
"event-emitter": "^0.3.5",
"is-promise": "^2.1",
"lru-queue": "0.1",
"next-tick": "1",
"timers-ext": "^0.1.5"
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-weak-map": "2.0.2",
"event-emitter": "0.3.5",
"is-promise": "2.1.0",
"lru-queue": "0.1.0",
"next-tick": "1.0.0",
"timers-ext": "0.1.5"
}
},
"merge-descriptors": {
@@ -903,16 +782,16 @@
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
},
"mime-db": {
"version": "1.37.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
"integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg=="
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
"integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ=="
},
"mime-types": {
"version": "2.1.21",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
"integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
"version": "2.1.18",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"requires": {
"mime-db": "~1.37.0"
"mime-db": "1.33.0"
}
},
"minimatch": {
@@ -1010,14 +889,14 @@
"resolved": "https://registry.npmjs.org/multer/-/multer-1.3.0.tgz",
"integrity": "sha1-CSsmcPaEb6SRSWXvyM+Uwg/sbNI=",
"requires": {
"append-field": "^0.1.0",
"busboy": "^0.2.11",
"concat-stream": "^1.5.0",
"mkdirp": "^0.5.1",
"object-assign": "^3.0.0",
"on-finished": "^2.3.0",
"type-is": "^1.6.4",
"xtend": "^4.0.0"
"append-field": "0.1.0",
"busboy": "0.2.14",
"concat-stream": "1.6.2",
"mkdirp": "0.5.1",
"object-assign": "3.0.0",
"on-finished": "2.3.0",
"type-is": "1.6.16",
"xtend": "4.0.1"
}
},
"negotiator": {
@@ -1030,11 +909,6 @@
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node-fetch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz",
"integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA=="
},
"object-assign": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz",
@@ -1085,9 +959,9 @@
"dev": true
},
"path-to-regexp": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz",
"integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ=="
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"process-nextick-args": {
"version": "2.0.0",
@@ -1095,18 +969,18 @@
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
"proxy-addr": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
"integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz",
"integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.8.0"
"forwarded": "0.1.2",
"ipaddr.js": "1.6.0"
}
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
},
"range-parser": {
"version": "1.2.0",
@@ -1114,14 +988,37 @@
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4="
},
"raw-body": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz",
"integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.23",
"http-errors": "1.6.2",
"iconv-lite": "0.4.19",
"unpipe": "1.0.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
"requires": {
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": "1.5.0"
}
},
"setprototypeof": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
}
}
},
"readable-stream": {
@@ -1129,10 +1026,10 @@
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
"string_decoder": "0.10.31"
}
},
"reflect-metadata": {
@@ -1181,11 +1078,6 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
@@ -1197,18 +1089,18 @@
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"depd": "1.1.2",
"destroy": "1.0.4",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"http-errors": "1.6.3",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
"on-finished": "2.3.0",
"range-parser": "1.2.0",
"statuses": "1.4.0"
},
"dependencies": {
"statuses": {
@@ -1223,9 +1115,9 @@
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"parseurl": "1.3.2",
"send": "0.16.2"
}
},
@@ -1266,14 +1158,6 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"std-env": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-1.3.1.tgz",
"integrity": "sha512-KI2F2pPJpd3lHjng+QLezu0eq+QDtXcv1um016mhOPAJFHKL+09ykK5PUBWta2pZDC8BVV0VPya08A15bUXSLQ==",
"requires": {
"is-ci": "^1.1.0"
}
},
"streamsearch": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
@@ -1297,17 +1181,18 @@
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "3.0.0"
}
},
"timers-ext": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
"integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.5.tgz",
"integrity": "sha512-tsEStd7kmACHENhsUPaxb8Jf8/+GZZxyNFQbZD07HQOyooOa6At1rQqjffgvg7n+dxscQa9cjjMdWhJtsP2sxg==",
"requires": {
"es5-ext": "~0.10.46",
"next-tick": "1"
"es5-ext": "0.10.42",
"next-tick": "1.0.0"
}
},
"ts-node": {
@@ -1374,7 +1259,7 @@
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.18"
"mime-types": "2.1.18"
}
},
"typedarray": {
@@ -1402,11 +1287,6 @@
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",

View File

@@ -9,13 +9,13 @@
"start:prod": "node dist/main.js"
},
"dependencies": {
"@nestjs/common": "5.6.2",
"@nestjs/common": "^5.2.0",
"@nestjs/core": "^5.2.0",
"@nestjs/mongoose": "^5.2.0",
"mongoose": "^5.0.1",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typescript": "^2.8.0"
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/mongoose": "^4.7.23",

21
integration/scopes/.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
# dependencies
/node_modules
# IDE
/.idea
/.awcache
/.vscode
# misc
npm-debug.log
# example
/quick-start
# tests
/test
/coverage
/.nyc_output
# dist
/dist

View File

@@ -0,0 +1,71 @@
import { INestApplication, Scope } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as request from 'supertest';
import { HelloController } from '../src/circular-hello/hello.controller';
import { HelloModule } from '../src/circular-hello/hello.module';
import { HelloService } from '../src/circular-hello/hello.service';
import { UsersService } from '../src/circular-hello/users/users.service';
class Meta {
static COUNTER = 0;
constructor(private readonly helloService: HelloService) {
Meta.COUNTER++;
}
}
describe('Circular request scope', () => {
let server;
let app: INestApplication;
before(async () => {
const module = await Test.createTestingModule({
imports: [
HelloModule.forRoot({
provide: 'META',
useClass: Meta,
scope: Scope.REQUEST,
}),
],
}).compile();
app = module.createNestApplication();
server = app.getHttpServer();
await app.init();
});
describe('when one service is request scoped', () => {
before(async () => {
const performHttpCall = end =>
request(server)
.get('/hello')
.end((err, res) => {
if (err) return end(err);
end();
});
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
});
it(`should create controller for each request`, async () => {
expect(HelloController.COUNTER).to.be.eql(3);
});
it(`should create service for each request`, async () => {
expect(UsersService.COUNTER).to.be.eql(3);
});
it(`should create service for each request`, async () => {
expect(HelloService.COUNTER).to.be.eql(3);
});
it(`should create provider for each inquirer`, async () => {
expect(Meta.COUNTER).to.be.eql(3);
});
});
after(async () => {
await app.close();
});
});

View File

@@ -0,0 +1,71 @@
import { INestApplication, Scope } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as request from 'supertest';
import { HelloController } from '../src/circular-transient/hello.controller';
import { HelloModule } from '../src/circular-transient/hello.module';
import { HelloService } from '../src/circular-transient/hello.service';
import { UsersService } from '../src/circular-transient/users/users.service';
class Meta {
static COUNTER = 0;
constructor(private readonly helloService: HelloService) {
Meta.COUNTER++;
}
}
describe('Circular transient scope', () => {
let server;
let app: INestApplication;
before(async () => {
const module = await Test.createTestingModule({
imports: [
HelloModule.forRoot({
provide: 'META',
useClass: Meta,
scope: Scope.TRANSIENT,
}),
],
}).compile();
app = module.createNestApplication();
server = app.getHttpServer();
await app.init();
});
describe('when one service is request scoped', () => {
before(async () => {
const performHttpCall = end =>
request(server)
.get('/hello')
.end((err, res) => {
if (err) return end(err);
end();
});
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
});
it(`should create controller for each request`, async () => {
expect(HelloController.COUNTER).to.be.eql(3);
});
it(`should create service for each request`, async () => {
expect(UsersService.COUNTER).to.be.eql(3);
});
it(`should create service for each request`, async () => {
expect(HelloService.COUNTER).to.be.eql(3);
});
it(`should create provider for each inquirer`, async () => {
expect(Meta.COUNTER).to.be.eql(7);
});
});
after(async () => {
await app.close();
});
});

View File

@@ -0,0 +1,80 @@
import { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as request from 'supertest';
import { Guard } from '../src/hello/guards/request-scoped.guard';
import { HelloController } from '../src/hello/hello.controller';
import { HelloModule } from '../src/hello/hello.module';
import { Interceptor } from '../src/hello/interceptors/logging.interceptor';
import { UserByIdPipe } from '../src/hello/users/user-by-id.pipe';
import { UsersService } from '../src/hello/users/users.service';
class Meta {
static COUNTER = 0;
constructor() {
Meta.COUNTER++;
}
}
describe('Request scope', () => {
let server;
let app: INestApplication;
before(async () => {
const module = await Test.createTestingModule({
imports: [
HelloModule.forRoot({
provide: 'META',
useClass: Meta,
}),
],
}).compile();
app = module.createNestApplication();
server = app.getHttpServer();
await app.init();
});
describe('when one service is request scoped', () => {
before(async () => {
const performHttpCall = end =>
request(server)
.get('/hello')
.end((err, res) => {
if (err) return end(err);
end();
});
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
});
it(`should create controller for each request`, async () => {
expect(HelloController.COUNTER).to.be.eql(3);
});
it(`should create service for each request`, async () => {
expect(UsersService.COUNTER).to.be.eql(3);
});
it(`should share static provider across requests`, async () => {
expect(Meta.COUNTER).to.be.eql(1);
});
it(`should create request scoped pipe for each request`, async () => {
expect(UserByIdPipe.COUNTER).to.be.eql(3);
});
it(`should create request scoped interceptor for each request`, async () => {
expect(Interceptor.COUNTER).to.be.eql(3);
});
it(`should create request scoped guard for each request`, async () => {
expect(Guard.COUNTER).to.be.eql(3);
});
});
after(async () => {
await app.close();
});
});

View File

@@ -0,0 +1,81 @@
import { INestApplication, Scope } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { expect } from 'chai';
import * as request from 'supertest';
import { Guard } from '../src/transient/guards/request-scoped.guard';
import { HelloController } from '../src/transient/hello.controller';
import { HelloModule } from '../src/transient/hello.module';
import { Interceptor } from '../src/transient/interceptors/logging.interceptor';
import { UserByIdPipe } from '../src/transient/users/user-by-id.pipe';
import { UsersService } from '../src/transient/users/users.service';
class Meta {
static COUNTER = 0;
constructor() {
Meta.COUNTER++;
}
}
describe('Transient scope', () => {
let server;
let app: INestApplication;
before(async () => {
const module = await Test.createTestingModule({
imports: [
HelloModule.forRoot({
provide: 'META',
useClass: Meta,
scope: Scope.TRANSIENT,
}),
],
}).compile();
app = module.createNestApplication();
server = app.getHttpServer();
await app.init();
});
describe('when one service is request scoped', () => {
before(async () => {
const performHttpCall = end =>
request(server)
.get('/hello')
.end((err, res) => {
if (err) return end(err);
end();
});
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
await new Promise(resolve => performHttpCall(resolve));
});
it(`should create controller for each request`, async () => {
expect(HelloController.COUNTER).to.be.eql(3);
});
it(`should create service for each request`, async () => {
expect(UsersService.COUNTER).to.be.eql(3);
});
it(`should create provider for each inquirer`, async () => {
expect(Meta.COUNTER).to.be.eql(7);
});
it(`should create transient pipe for each controller`, async () => {
expect(UserByIdPipe.COUNTER).to.be.eql(2);
});
it(`should create transient interceptor for each controller`, async () => {
expect(Interceptor.COUNTER).to.be.eql(2);
});
it(`should create transient guard for each controller`, async () => {
expect(Guard.COUNTER).to.be.eql(2);
});
});
after(async () => {
await app.close();
});
});

1775
integration/scopes/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
{
"name": "nest-typescript-starter",
"version": "1.0.0",
"description": "Nest TypeScript starter repository",
"license": "MIT",
"scripts": {
"start": "ts-node src/main"
},
"dependencies": {
"@nestjs/common": "^5.0.0",
"@nestjs/core": "^5.0.0",
"@nestjs/microservices": "^5.0.0",
"@nestjs/testing": "^5.0.0",
"@nestjs/websockets": "^5.0.0",
"class-transformer": "^0.1.7",
"class-validator": "^0.7.2",
"fastify": "^1.1.1",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/node": "^7.0.41",
"supertest": "^3.0.0",
"ts-node": "^6.0.0"
}
}

View File

@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { HelloModule } from './hello/hello.module';
@Module({
imports: [HelloModule.forRoot({ provide: 'META', useValue: true })],
})
export class ApplicationModule {}

View File

@@ -0,0 +1,10 @@
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';
export class TestDto {
@IsString()
@IsNotEmpty()
string: string;
@IsNumber()
number: number;
}

View File

@@ -0,0 +1,21 @@
import {
CanActivate,
ExecutionContext,
Injectable,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.REQUEST })
export class Guard implements CanActivate {
static COUNTER = 0;
constructor() {
Guard.COUNTER++;
}
canActivate(
context: ExecutionContext,
): boolean | Promise<boolean> | Observable<boolean> {
return true;
}
}

View File

@@ -0,0 +1,30 @@
import {
Controller,
Get,
Param,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Guard } from './guards/request-scoped.guard';
import { HelloService } from './hello.service';
import { Interceptor } from './interceptors/logging.interceptor';
import { UserByIdPipe } from './users/user-by-id.pipe';
import { UsersService } from './users/users.service';
@Controller('hello')
export class HelloController {
static COUNTER = 0;
constructor(
private readonly helloService: HelloService,
private readonly usersService: UsersService,
) {
HelloController.COUNTER++;
}
@UseGuards(Guard)
@UseInterceptors(Interceptor)
@Get()
greeting(@Param('id', UserByIdPipe) id): string {
return this.helloService.greeting();
}
}

View File

@@ -0,0 +1,19 @@
import { DynamicModule, Inject, Module, Provider } from '@nestjs/common';
import { HelloController } from './hello.controller';
import { HelloService } from './hello.service';
import { UsersService } from './users/users.service';
@Module({
controllers: [HelloController],
providers: [HelloService, UsersService],
})
export class HelloModule {
constructor(@Inject('META') private readonly meta) {}
static forRoot(meta: Provider): DynamicModule {
return {
module: HelloModule,
providers: [meta],
};
}
}

View File

@@ -0,0 +1,13 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class HelloService {
static COUNTER = 0;
constructor(@Inject('META') private readonly meta) {
HelloService.COUNTER++;
}
greeting(): string {
return 'Hello world!';
}
}

View File

@@ -0,0 +1,19 @@
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.REQUEST })
export class Interceptor implements NestInterceptor {
static COUNTER = 0;
constructor() {
Interceptor.COUNTER++;
}
intercept(context: ExecutionContext, call: CallHandler): Observable<any> {
return call.handle();
}
}

View File

@@ -0,0 +1,14 @@
import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';
import { UsersService } from './users.service';
@Injectable()
export class UserByIdPipe implements PipeTransform<string> {
static COUNTER = 0;
constructor(private readonly usersService: UsersService) {
UserByIdPipe.COUNTER++;
}
transform(value: string, metadata: ArgumentMetadata) {
return this.usersService.findById(value);
}
}

View File

@@ -0,0 +1,13 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class UsersService {
static COUNTER = 0;
constructor(@Inject('META') private readonly meta) {
UsersService.COUNTER++;
}
findById(id: string) {
return { id };
}
}

View File

@@ -0,0 +1,10 @@
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';
export class TestDto {
@IsString()
@IsNotEmpty()
string: string;
@IsNumber()
number: number;
}

View File

@@ -0,0 +1,21 @@
import {
CanActivate,
ExecutionContext,
Injectable,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.TRANSIENT })
export class Guard implements CanActivate {
static COUNTER = 0;
constructor() {
Guard.COUNTER++;
}
canActivate(
context: ExecutionContext,
): boolean | Promise<boolean> | Observable<boolean> {
return true;
}
}

View File

@@ -0,0 +1,30 @@
import {
Controller,
Get,
Param,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Guard } from './guards/request-scoped.guard';
import { HelloService } from './hello.service';
import { Interceptor } from './interceptors/logging.interceptor';
import { UserByIdPipe } from './users/user-by-id.pipe';
import { UsersService } from './users/users.service';
@Controller('hello')
export class HelloController {
static COUNTER = 0;
constructor(
private readonly helloService: HelloService,
private readonly usersService: UsersService,
) {
HelloController.COUNTER++;
}
@UseGuards(Guard)
@UseInterceptors(Interceptor)
@Get()
greeting(@Param('id', UserByIdPipe) id): string {
return this.helloService.greeting();
}
}

View File

@@ -0,0 +1,20 @@
import { DynamicModule, Inject, Module, Provider } from '@nestjs/common';
import { HelloController } from './hello.controller';
import { HelloService } from './hello.service';
import { TestController } from './test.controller';
import { UsersService } from './users/users.service';
@Module({
controllers: [HelloController, TestController],
providers: [HelloService, UsersService],
})
export class HelloModule {
constructor(@Inject('META') private readonly meta) {}
static forRoot(meta: Provider): DynamicModule {
return {
module: HelloModule,
providers: [meta],
};
}
}

View File

@@ -0,0 +1,13 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class HelloService {
static COUNTER = 0;
constructor(@Inject('META') private readonly meta) {
HelloService.COUNTER++;
}
greeting(): string {
return 'Hello world!';
}
}

View File

@@ -0,0 +1,19 @@
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.TRANSIENT })
export class Interceptor implements NestInterceptor {
static COUNTER = 0;
constructor() {
Interceptor.COUNTER++;
}
intercept(context: ExecutionContext, call: CallHandler): Observable<any> {
return call.handle();
}
}

View File

@@ -0,0 +1,20 @@
import {
Controller,
Get,
Param,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Guard } from './guards/request-scoped.guard';
import { Interceptor } from './interceptors/logging.interceptor';
import { UserByIdPipe } from './users/user-by-id.pipe';
@Controller('test')
export class TestController {
@UseGuards(Guard)
@UseInterceptors(Interceptor)
@Get()
greeting(@Param('id', UserByIdPipe) id): string {
return 'hey';
}
}

View File

@@ -0,0 +1,18 @@
import {
ArgumentMetadata,
Injectable,
PipeTransform,
Scope,
} from '@nestjs/common';
@Injectable({ scope: Scope.TRANSIENT })
export class UserByIdPipe implements PipeTransform<string> {
static COUNTER = 0;
constructor() {
UserByIdPipe.COUNTER++;
}
transform(value: string, metadata: ArgumentMetadata) {
return value;
}
}

View File

@@ -0,0 +1,13 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class UsersService {
static COUNTER = 0;
constructor(@Inject('META') private readonly meta) {
UsersService.COUNTER++;
}
findById(id: string) {
return { id };
}
}

View File

@@ -0,0 +1,10 @@
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';
export class TestDto {
@IsString()
@IsNotEmpty()
string: string;
@IsNumber()
number: number;
}

View File

@@ -0,0 +1,21 @@
import {
CanActivate,
ExecutionContext,
Injectable,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.REQUEST })
export class Guard implements CanActivate {
static COUNTER = 0;
constructor() {
Guard.COUNTER++;
}
canActivate(
context: ExecutionContext,
): boolean | Promise<boolean> | Observable<boolean> {
return true;
}
}

View File

@@ -0,0 +1,30 @@
import {
Controller,
Get,
Param,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Guard } from './guards/request-scoped.guard';
import { HelloService } from './hello.service';
import { Interceptor } from './interceptors/logging.interceptor';
import { UserByIdPipe } from './users/user-by-id.pipe';
import { UsersService } from './users/users.service';
@Controller('hello')
export class HelloController {
static COUNTER = 0;
constructor(
private readonly helloService: HelloService,
private readonly usersService: UsersService,
) {
HelloController.COUNTER++;
}
@UseGuards(Guard)
@UseInterceptors(Interceptor)
@Get()
greeting(@Param('id', UserByIdPipe) id): string {
return this.helloService.greeting();
}
}

View File

@@ -0,0 +1,19 @@
import { DynamicModule, Inject, Module, Provider } from '@nestjs/common';
import { HelloController } from './hello.controller';
import { HelloService } from './hello.service';
import { UsersService } from './users/users.service';
@Module({
controllers: [HelloController],
providers: [HelloService, UsersService],
})
export class HelloModule {
constructor(@Inject('META') private readonly meta) {}
static forRoot(meta: Provider): DynamicModule {
return {
module: HelloModule,
providers: [meta],
};
}
}

View File

@@ -0,0 +1,10 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class HelloService {
constructor(@Inject('META') private readonly meta) {}
greeting(): string {
return 'Hello world!';
}
}

View File

@@ -0,0 +1,19 @@
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.REQUEST })
export class Interceptor implements NestInterceptor {
static COUNTER = 0;
constructor() {
Interceptor.COUNTER++;
}
intercept(context: ExecutionContext, call: CallHandler): Observable<any> {
return call.handle();
}
}

View File

@@ -0,0 +1,14 @@
import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';
import { UsersService } from './users.service';
@Injectable()
export class UserByIdPipe implements PipeTransform<string> {
static COUNTER = 0;
constructor(private readonly usersService: UsersService) {
UserByIdPipe.COUNTER++;
}
transform(value: string, metadata: ArgumentMetadata) {
return this.usersService.findById(value);
}
}

View File

@@ -0,0 +1,13 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class UsersService {
static COUNTER = 0;
constructor(@Inject('META') private readonly meta) {
UsersService.COUNTER++;
}
findById(id: string) {
return { id };
}
}

View File

@@ -0,0 +1,8 @@
import { NestFactory } from '@nestjs/core';
import { ApplicationModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(ApplicationModule);
await app.listen(3000);
}
bootstrap();

View File

@@ -0,0 +1,10 @@
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';
export class TestDto {
@IsString()
@IsNotEmpty()
string: string;
@IsNumber()
number: number;
}

View File

@@ -0,0 +1,21 @@
import {
CanActivate,
ExecutionContext,
Injectable,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.TRANSIENT })
export class Guard implements CanActivate {
static COUNTER = 0;
constructor() {
Guard.COUNTER++;
}
canActivate(
context: ExecutionContext,
): boolean | Promise<boolean> | Observable<boolean> {
return true;
}
}

View File

@@ -0,0 +1,30 @@
import {
Controller,
Get,
Param,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Guard } from './guards/request-scoped.guard';
import { HelloService } from './hello.service';
import { Interceptor } from './interceptors/logging.interceptor';
import { UserByIdPipe } from './users/user-by-id.pipe';
import { UsersService } from './users/users.service';
@Controller('hello')
export class HelloController {
static COUNTER = 0;
constructor(
private readonly helloService: HelloService,
private readonly usersService: UsersService,
) {
HelloController.COUNTER++;
}
@UseGuards(Guard)
@UseInterceptors(Interceptor)
@Get()
greeting(@Param('id', UserByIdPipe) id): string {
return this.helloService.greeting();
}
}

View File

@@ -0,0 +1,20 @@
import { DynamicModule, Inject, Module, Provider } from '@nestjs/common';
import { HelloController } from './hello.controller';
import { HelloService } from './hello.service';
import { TestController } from './test.controller';
import { UsersService } from './users/users.service';
@Module({
controllers: [HelloController, TestController],
providers: [HelloService, UsersService],
})
export class HelloModule {
constructor(@Inject('META') private readonly meta) {}
static forRoot(meta: Provider): DynamicModule {
return {
module: HelloModule,
providers: [meta],
};
}
}

View File

@@ -0,0 +1,10 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class HelloService {
constructor(@Inject('META') private readonly meta) {}
greeting(): string {
return 'Hello world!';
}
}

View File

@@ -0,0 +1,19 @@
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable({ scope: Scope.TRANSIENT })
export class Interceptor implements NestInterceptor {
static COUNTER = 0;
constructor() {
Interceptor.COUNTER++;
}
intercept(context: ExecutionContext, call: CallHandler): Observable<any> {
return call.handle();
}
}

View File

@@ -0,0 +1,20 @@
import {
Controller,
Get,
Param,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Guard } from './guards/request-scoped.guard';
import { Interceptor } from './interceptors/logging.interceptor';
import { UserByIdPipe } from './users/user-by-id.pipe';
@Controller('test')
export class TestController {
@UseGuards(Guard)
@UseInterceptors(Interceptor)
@Get()
greeting(@Param('id', UserByIdPipe) id): string {
return 'hey';
}
}

View File

@@ -0,0 +1,18 @@
import {
ArgumentMetadata,
Injectable,
PipeTransform,
Scope,
} from '@nestjs/common';
@Injectable({ scope: Scope.TRANSIENT })
export class UserByIdPipe implements PipeTransform<string> {
static COUNTER = 0;
constructor() {
UserByIdPipe.COUNTER++;
}
transform(value: string, metadata: ArgumentMetadata) {
return value;
}
}

View File

@@ -0,0 +1,13 @@
import { Inject, Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class UsersService {
static COUNTER = 0;
constructor(@Inject('META') private readonly meta) {
UsersService.COUNTER++;
}
findById(id: string) {
return { id };
}
}

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"sourceMap": true,
"allowJs": true,
"outDir": "./dist"
},
"include": [
"src/**/*",
"e2e/**/*"
],
"exclude": [
"node_modules",
]
}

View File

@@ -0,0 +1,53 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {
"no-unused-expression": true
},
"rules": {
"eofline": false,
"quotemark": [
true,
"single"
],
"ordered-imports": [
false
],
"max-line-length": [
150
],
"member-ordering": [
false
],
"curly": false,
"interface-name": [
false
],
"array-type": [
false
],
"member-access": [
false
],
"no-empty-interface": false,
"no-empty": false,
"arrow-parens": false,
"object-literal-sort-keys": false,
"no-unused-expression": false,
"max-classes-per-file": [
false
],
"variable-name": [
false
],
"one-line": [
false
],
"one-variable-per-declaration": [
false
]
},
"rulesDirectory": []
}

View File

@@ -5,64 +5,32 @@
"requires": true,
"dependencies": {
"@nestjs/common": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.6.2.tgz",
"integrity": "sha512-LJkG60HXtOL0/8MgdITMUEMF9CCMa3gtmxcnxfxvqZN/cFGEFZ5QzMWbEdcP5N+kUJY2BL8gENdmPGyqBNJm0A==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.0.0.tgz",
"integrity": "sha512-6TXXAp6s1gQ7P1Wuu9Njb7vZymRvVvT+ao/4BZETHp2gebk6RZJO1SPLBf4U81dTnm0LRFxupkIWu6mXEDnalg==",
"requires": {
"axios": "0.18.0",
"axios": "0.17.1",
"cli-color": "1.2.0",
"deprecate": "1.0.0",
"multer": "1.3.0",
"uuid": "3.3.2"
"multer": "1.3.0"
}
},
"@nestjs/core": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-5.6.2.tgz",
"integrity": "sha512-XuCK/veePY4ggEmGSj9XZFd1+rQdjmHXovdbkEFSmORl7gIwzxk6qupCRq8BuTCHqbMYj8qcgBRk9YXmHMR1TA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-5.0.0.tgz",
"integrity": "sha512-O7uvX8NlsP+wg55wlDbMprLOqYDypQepOb3RWpBL2Y7b59eZK6hMJfJIRKHAUzs28C87gIISmYfjrMt2QNr+rA==",
"requires": {
"@nuxtjs/opencollective": "0.1.0",
"body-parser": "1.18.3",
"body-parser": "1.18.2",
"cors": "2.8.4",
"express": "4.16.3",
"fast-safe-stringify": "1.2.0",
"iterare": "0.0.8",
"object-hash": "1.3.0",
"optional": "0.1.4",
"path-to-regexp": "2.2.1",
"uuid": "3.3.2"
"optional": "0.1.4"
}
},
"@nestjs/typeorm": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-5.2.2.tgz",
"integrity": "sha512-D1xtTYFn+Pbf0yEY+mj3m3AwSyr+J8PW5UPYDLTGTR6gbLQvgOM/R+TddIgU0M0C/jxsvSXEVsVPtWaG6SIlzw==",
"requires": {
"uuid": "3.3.2"
}
},
"@nuxtjs/opencollective": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.1.0.tgz",
"integrity": "sha512-e09TxGpTxMOfVwvVWPKNttKslnCtbvp5ofc0EwlKdA4IA8AUIyeteGraGZGs+JO4zw4y2+YxRlNN2xQ+c6KFjw==",
"requires": {
"chalk": "^2.4.1",
"consola": "^1.4.3",
"esm": "^3.0.79",
"node-fetch": "^2.2.0"
},
"dependencies": {
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
}
}
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@nestjs/typeorm/-/typeorm-3.0.2.tgz",
"integrity": "sha512-K5oL0toR39qqcoBp8k0Jn7fcS1yOPQdbS/tkAgHafSLQsa4jxb/8bOO2PqK343H7PT3YWTNVI698r68sgS3JOw=="
},
"@types/node": {
"version": "7.0.57",
@@ -75,7 +43,7 @@
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "~2.1.18",
"mime-types": "2.1.18",
"negotiator": "0.6.1"
}
},
@@ -127,12 +95,12 @@
"dev": true
},
"axios": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz",
"integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=",
"requires": {
"follow-redirects": "^1.3.0",
"is-buffer": "^1.1.5"
"follow-redirects": "1.5.0",
"is-buffer": "1.1.6"
}
},
"babel-code-frame": {
@@ -199,20 +167,20 @@
"integrity": "sha512-LDXpJKVzEx2/OqNbG9mXBNvHuiRL4PzHCGfnANHMJ+fv68Ads3exDVJeGDJws+AoNEuca93bU3q+S0woeUaCdg=="
},
"body-parser": {
"version": "1.18.3",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"content-type": "1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "~1.6.3",
"iconv-lite": "0.4.23",
"on-finished": "~2.3.0",
"qs": "6.5.2",
"raw-body": "2.3.3",
"type-is": "~1.6.16"
"depd": "1.1.2",
"http-errors": "1.6.3",
"iconv-lite": "0.4.19",
"on-finished": "2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "1.6.16"
},
"dependencies": {
"debug": {
@@ -250,7 +218,7 @@
"integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=",
"requires": {
"dicer": "0.2.5",
"readable-stream": "1.1.x"
"readable-stream": "1.1.14"
},
"dependencies": {
"isarray": {
@@ -263,10 +231,10 @@
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
"string_decoder": "0.10.31"
}
},
"string_decoder": {
@@ -296,22 +264,17 @@
"supports-color": "5.3.0"
}
},
"ci-info": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz",
"integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A=="
},
"cli-color": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.2.0.tgz",
"integrity": "sha1-OlrnT9drYmevZm5p4q+70B3vNNE=",
"requires": {
"ansi-regex": "^2.1.1",
"d": "1",
"es5-ext": "^0.10.12",
"es6-iterator": "2",
"memoizee": "^0.4.3",
"timers-ext": "0.1"
"ansi-regex": "2.1.1",
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-iterator": "2.0.3",
"memoizee": "0.4.12",
"timers-ext": "0.1.5"
},
"dependencies": {
"ansi-regex": {
@@ -398,21 +361,10 @@
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
}
},
"consola": {
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/consola/-/consola-1.4.5.tgz",
"integrity": "sha512-movqq3MbyXbSf7cG/x+EbO3VjKQVZPB/zeB5+lN1TuBYh9BWDemLQca9P+a4xpO4lXva9rz+Bd8XyqlH136Lww==",
"requires": {
"chalk": "^2.3.2",
"figures": "^2.0.0",
"lodash": "^4.17.5",
"std-env": "^1.1.0"
"buffer-from": "1.0.0",
"inherits": "2.0.3",
"readable-stream": "2.3.3",
"typedarray": "0.0.6"
}
},
"content-disposition": {
@@ -445,8 +397,8 @@
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
"integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
"requires": {
"object-assign": "^4",
"vary": "^1"
"object-assign": "4.1.1",
"vary": "1.1.2"
}
},
"cross-spawn": {
@@ -464,7 +416,7 @@
"resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
"integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
"requires": {
"es5-ext": "^0.10.9"
"es5-ext": "0.10.42"
}
},
"debug": {
@@ -500,7 +452,7 @@
"resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz",
"integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=",
"requires": {
"readable-stream": "1.1.x",
"readable-stream": "1.1.14",
"streamsearch": "0.1.2"
},
"dependencies": {
@@ -514,10 +466,10 @@
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
"string_decoder": "0.10.31"
}
},
"string_decoder": {
@@ -557,13 +509,13 @@
}
},
"es5-ext": {
"version": "0.10.47",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.47.tgz",
"integrity": "sha512-/1TItLfj+TTfWoeRcDn/0FbGV6SNo4R+On2GGVucPU/j3BWnXE2Co8h8CTo4Tu34gFJtnmwS9xiScKs4EjZhdw==",
"version": "0.10.42",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz",
"integrity": "sha512-AJxO1rmPe1bDEfSR6TJ/FgMFYuTBhR5R57KW58iCkYACMyFbrkqVyzXSurYoScDGvgyMpk7uRF/lPUPPTmsRSA==",
"requires": {
"es6-iterator": "~2.0.3",
"es6-symbol": "~3.1.1",
"next-tick": "1"
"es6-iterator": "2.0.3",
"es6-symbol": "3.1.1",
"next-tick": "1.0.0"
}
},
"es6-iterator": {
@@ -571,9 +523,9 @@
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
"integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
"requires": {
"d": "1",
"es5-ext": "^0.10.35",
"es6-symbol": "^3.1.1"
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-symbol": "3.1.1"
}
},
"es6-symbol": {
@@ -581,8 +533,8 @@
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
"integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=",
"requires": {
"d": "1",
"es5-ext": "~0.10.14"
"d": "1.0.0",
"es5-ext": "0.10.42"
}
},
"es6-weak-map": {
@@ -590,10 +542,10 @@
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz",
"integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=",
"requires": {
"d": "1",
"es5-ext": "^0.10.14",
"es6-iterator": "^2.0.1",
"es6-symbol": "^3.1.1"
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-iterator": "2.0.3",
"es6-symbol": "3.1.1"
}
},
"escape-html": {
@@ -606,11 +558,6 @@
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"esm": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.0.tgz",
"integrity": "sha512-yK4IiHmmInOk9q4xbJXdUfPV0ju7GbRCbhtpe5/gH7nRiD6RAb12Ix7zfsqQkDL5WERwzFlq/eT6zTXDWwIk+w=="
},
"esprima": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
@@ -632,8 +579,8 @@
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
"integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=",
"requires": {
"d": "1",
"es5-ext": "~0.10.14"
"d": "1.0.0",
"es5-ext": "0.10.42"
}
},
"execa": {
@@ -655,55 +602,38 @@
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
"requires": {
"accepts": "~1.3.5",
"accepts": "1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.2",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"content-type": "1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"depd": "1.1.2",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"methods": "1.1.2",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.3",
"proxy-addr": "2.0.3",
"qs": "6.5.1",
"range-parser": "~1.2.0",
"range-parser": "1.2.0",
"safe-buffer": "5.1.1",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"statuses": "1.4.0",
"type-is": "1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
"vary": "1.1.2"
},
"dependencies": {
"body-parser": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.1",
"http-errors": "~1.6.2",
"iconv-lite": "0.4.19",
"on-finished": "~2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "~1.6.15"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -712,55 +642,6 @@
"ms": "2.0.0"
}
},
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"qs": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
},
"raw-body": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.2",
"iconv-lite": "0.4.19",
"unpipe": "1.0.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
"requires": {
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": ">= 1.3.1 < 2"
}
},
"setprototypeof": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
}
}
},
"statuses": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
@@ -768,36 +649,23 @@
}
}
},
"fast-safe-stringify": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-1.2.0.tgz",
"integrity": "sha1-69QmZv0Y/k8rpPDSlQZfP4XK3pY="
},
"figlet": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/figlet/-/figlet-1.2.0.tgz",
"integrity": "sha1-bEZTc3j6tkkUa1phQ92gGbQwtBA="
},
"figures": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
"requires": {
"escape-string-regexp": "^1.0.5"
}
},
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"statuses": "1.4.0",
"unpipe": "1.0.0"
},
"dependencies": {
"debug": {
@@ -824,11 +692,11 @@
}
},
"follow-redirects": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz",
"integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==",
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz",
"integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==",
"requires": {
"debug": "=3.1.0"
"debug": "3.1.0"
}
},
"forwarded": {
@@ -909,19 +777,16 @@
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"depd": "1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
"statuses": "1.5.0"
}
},
"iconv-lite": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
"integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"inflight": {
"version": "1.0.6",
@@ -943,9 +808,9 @@
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
},
"ipaddr.js": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz",
"integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs="
},
"is-arrayish": {
"version": "0.2.1",
@@ -965,14 +830,6 @@
"builtin-modules": "1.1.1"
}
},
"is-ci": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz",
"integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==",
"requires": {
"ci-info": "^1.5.0"
}
},
"is-fullwidth-code-point": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
@@ -1046,11 +903,6 @@
"path-exists": "3.0.0"
}
},
"lodash": {
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
},
"lru-cache": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz",
@@ -1065,7 +917,7 @@
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
"integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=",
"requires": {
"es5-ext": "~0.10.2"
"es5-ext": "0.10.42"
}
},
"make-error": {
@@ -1088,18 +940,18 @@
}
},
"memoizee": {
"version": "0.4.14",
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz",
"integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==",
"version": "0.4.12",
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.12.tgz",
"integrity": "sha512-sprBu6nwxBWBvBOh5v2jcsGqiGLlL2xr2dLub3vR8dnE8YB17omwtm/0NSHl8jjNbcsJd5GMWJAnTSVe/O0Wfg==",
"requires": {
"d": "1",
"es5-ext": "^0.10.45",
"es6-weak-map": "^2.0.2",
"event-emitter": "^0.3.5",
"is-promise": "^2.1",
"lru-queue": "0.1",
"next-tick": "1",
"timers-ext": "^0.1.5"
"d": "1.0.0",
"es5-ext": "0.10.42",
"es6-weak-map": "2.0.2",
"event-emitter": "0.3.5",
"is-promise": "2.1.0",
"lru-queue": "0.1.0",
"next-tick": "1.0.0",
"timers-ext": "0.1.5"
}
},
"merge-descriptors": {
@@ -1118,16 +970,16 @@
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
},
"mime-db": {
"version": "1.37.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
"integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg=="
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
"integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ=="
},
"mime-types": {
"version": "2.1.21",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
"integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
"version": "2.1.18",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"requires": {
"mime-db": "~1.37.0"
"mime-db": "1.33.0"
}
},
"mimic-fn": {
@@ -1166,14 +1018,14 @@
"resolved": "https://registry.npmjs.org/multer/-/multer-1.3.0.tgz",
"integrity": "sha1-CSsmcPaEb6SRSWXvyM+Uwg/sbNI=",
"requires": {
"append-field": "^0.1.0",
"busboy": "^0.2.11",
"concat-stream": "^1.5.0",
"mkdirp": "^0.5.1",
"object-assign": "^3.0.0",
"on-finished": "^2.3.0",
"type-is": "^1.6.4",
"xtend": "^4.0.0"
"append-field": "0.1.0",
"busboy": "0.2.14",
"concat-stream": "1.6.2",
"mkdirp": "0.5.1",
"object-assign": "3.0.0",
"on-finished": "2.3.0",
"type-is": "1.6.16",
"xtend": "4.0.1"
},
"dependencies": {
"object-assign": {
@@ -1214,11 +1066,6 @@
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node-fetch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz",
"integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA=="
},
"normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
@@ -1248,11 +1095,6 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"object-hash": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.0.tgz",
"integrity": "sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ=="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
@@ -1365,9 +1207,9 @@
"dev": true
},
"path-to-regexp": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz",
"integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ=="
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"path-type": {
"version": "2.0.0",
@@ -1388,12 +1230,12 @@
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
},
"proxy-addr": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
"integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz",
"integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.8.0"
"forwarded": "0.1.2",
"ipaddr.js": "1.6.0"
}
},
"pseudomap": {
@@ -1402,9 +1244,9 @@
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
},
"range-parser": {
"version": "1.2.0",
@@ -1412,14 +1254,37 @@
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4="
},
"raw-body": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz",
"integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.23",
"http-errors": "1.6.2",
"iconv-lite": "0.4.19",
"unpipe": "1.0.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
"requires": {
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": "1.5.0"
}
},
"setprototypeof": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
}
}
},
"read-pkg": {
@@ -1492,11 +1357,6 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
@@ -1513,18 +1373,18 @@
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"depd": "1.1.2",
"destroy": "1.0.4",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"http-errors": "1.6.3",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
"on-finished": "2.3.0",
"range-parser": "1.2.0",
"statuses": "1.4.0"
},
"dependencies": {
"debug": {
@@ -1547,9 +1407,9 @@
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"parseurl": "1.3.2",
"send": "0.16.2"
}
},
@@ -1640,14 +1500,6 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"std-env": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-1.3.1.tgz",
"integrity": "sha512-KI2F2pPJpd3lHjng+QLezu0eq+QDtXcv1um016mhOPAJFHKL+09ykK5PUBWta2pZDC8BVV0VPya08A15bUXSLQ==",
"requires": {
"is-ci": "^1.1.0"
}
},
"streamsearch": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
@@ -1713,12 +1565,12 @@
}
},
"timers-ext": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
"integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.5.tgz",
"integrity": "sha512-tsEStd7kmACHENhsUPaxb8Jf8/+GZZxyNFQbZD07HQOyooOa6At1rQqjffgvg7n+dxscQa9cjjMdWhJtsP2sxg==",
"requires": {
"es5-ext": "~0.10.46",
"next-tick": "1"
"es5-ext": "0.10.42",
"next-tick": "1.0.0"
}
},
"ts-node": {
@@ -1785,7 +1637,7 @@
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.18"
"mime-types": "2.1.18"
}
},
"typedarray": {
@@ -1839,11 +1691,6 @@
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
},
"validate-npm-package-license": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz",

View File

@@ -9,14 +9,14 @@
"start:prod": "node dist/main.js"
},
"dependencies": {
"@nestjs/common": "5.6.2",
"@nestjs/common": "^5.2.0",
"@nestjs/core": "^5.2.0",
"@nestjs/typeorm": "^5.2.0",
"mysql": "^2.15.0",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typeorm": "^0.1.16",
"typescript": "^2.8.0"
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/node": "^7.0.41",

View File

@@ -15,7 +15,6 @@ async function createNestApp(...gateways): Promise<INestApplication> {
}
describe('WebSocketGateway', () => {
const event = 'push';
let ws, app;
it(`should handle message (2nd port)`, async () => {

View File

@@ -1,6 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { WsAdapter } from '@nestjs/platform-ws';
import { Test } from '@nestjs/testing';
import { WsAdapter } from '@nestjs/websockets/adapters/ws-adapter';
import { expect } from 'chai';
import * as WebSocket from 'ws';
import { ApplicationGateway } from '../src/app.gateway';

View File

@@ -16,7 +16,7 @@
"class-validator": "^0.7.2",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.0.0",
"typescript": "^2.8.0"
"typescript": "^3.1.0"
},
"devDependencies": {
"@types/node": "^7.0.41",

View File

@@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "5.7.0"
"version": "5.5.0"
}

289
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "nestjs",
"version": "5.6.2",
"version": "5.4.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -111,9 +111,9 @@
}
},
"@nestjs/common": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.6.2.tgz",
"integrity": "sha512-LJkG60HXtOL0/8MgdITMUEMF9CCMa3gtmxcnxfxvqZN/cFGEFZ5QzMWbEdcP5N+kUJY2BL8gENdmPGyqBNJm0A==",
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-5.5.0.tgz",
"integrity": "sha512-Ifh1D4ypsJYs/3YBIocU+X5yuAZSVKuCsz8kaKB4ZUO5WwJjh4/x6hlr4A+9XUMe8fPLtYXVohJoRUU5HbwyIA==",
"requires": {
"axios": "0.18.0",
"cli-color": "1.2.0",
@@ -124,7 +124,7 @@
"dependencies": {
"axios": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"requires": {
"follow-redirects": "^1.3.0",
@@ -171,7 +171,7 @@
},
"express": {
"version": "4.16.3",
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
"resolved": "http://registry.npmjs.org/express/-/express-4.16.3.tgz",
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
"requires": {
"accepts": "~1.3.5",
@@ -237,7 +237,7 @@
},
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
"resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
@@ -340,9 +340,9 @@
}
},
"@nestjs/microservices": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-5.5.0.tgz",
"integrity": "sha512-sOZ2+dPxHvb+RNbmn4wo+MFg9ZHxx9N9RGZmlYQEJQ+s4zk0rJBalzJhKNuNkiL6oJDYYNom98YhWRVvuAkvwg==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-5.1.0.tgz",
"integrity": "sha512-g9ez7N+QgjlJSSak27KhUHXi1YMnk/DuGpAn/TWlm5rSmcsrArdTSvinGBMyb0mL3CMJJz8y0/CZwAUdy9HQzA==",
"requires": {
"iterare": "0.0.8",
"json-socket": "^0.2.1",
@@ -598,9 +598,9 @@
"dev": true
},
"@types/node": {
"version": "7.0.48",
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.48.tgz",
"integrity": "sha512-LLlXafM3BD52MH056tHxTXO8JFCnpJJQkdzIU3+m8ew+CXJY/5zIXgDNb4TK/QFvlI8QexLS5tL+sE0Qhegr1w=="
"version": "10.12.14",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.14.tgz",
"integrity": "sha512-0rVcFRhM93kRGAU88ASCjX9Y3FWDCh+33G5Z5evpKOea4xcpLqDGwmo64+DjgaSezTN5j9KdnUzvxhOw7fNciQ=="
},
"@types/pino": {
"version": "4.7.1",
@@ -1698,9 +1698,9 @@
"dev": true
},
"buffer-from": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz",
"integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"buffer-more-ints": {
@@ -4984,6 +4984,30 @@
}
}
},
"fastify-cors": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/fastify-cors/-/fastify-cors-0.2.0.tgz",
"integrity": "sha512-bw14FmjHm8oF4TDLkwj2TpssH6O2gE0NpsRqLe7F1Gh9Jf30Lx9ZzIznhqaAKOYS+LJqLIt5snurv7urgqYntA==",
"requires": {
"fastify-plugin": "^1.2.0",
"vary": "^1.1.2"
},
"dependencies": {
"fastify-plugin": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-1.4.0.tgz",
"integrity": "sha512-l6uqDyBp3gBjLQRAi3j2NwSvlbe9LuqULZugnO9iRFfYHWd2SpsZBLI1l4Jakk0VMGfYlB322JPIPYh/2qSHig==",
"requires": {
"semver": "^5.5.0"
}
},
"semver": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
}
}
},
"fastify-formbody": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fastify-formbody/-/fastify-formbody-2.0.0.tgz",
@@ -5327,8 +5351,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
@@ -5352,15 +5375,13 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -5377,22 +5398,19 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
@@ -5523,8 +5541,7 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
@@ -5538,7 +5555,6 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -5555,7 +5571,6 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -5564,15 +5579,13 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz",
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@@ -5593,7 +5606,6 @@
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -5689,8 +5701,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
@@ -5704,7 +5715,6 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -5800,8 +5810,7 @@
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -5843,7 +5852,6 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -5865,7 +5873,6 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -5914,15 +5921,13 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"dev": true,
"optional": true
"dev": true
}
}
},
@@ -6288,8 +6293,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
@@ -6313,15 +6317,13 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -6338,22 +6340,19 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
@@ -6484,8 +6483,7 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
@@ -6499,7 +6497,6 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -6516,7 +6513,6 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -6525,15 +6521,13 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz",
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@@ -6554,7 +6548,6 @@
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -6643,8 +6636,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
@@ -6658,7 +6650,6 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -6754,8 +6745,7 @@
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -6797,7 +6787,6 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -6819,7 +6808,6 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -6868,15 +6856,13 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"dev": true,
"optional": true
"dev": true
}
}
},
@@ -8517,6 +8503,11 @@
"sshpk": "^1.7.0"
}
},
"http2": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/http2/-/http2-3.3.7.tgz",
"integrity": "sha512-puSi8M8WNlFJm9Pk4c/Mbz9Gwparuj3gO9/RRO5zv6piQ0FY+9Qywp0PdWshYgsMJSalixFY7eC6oPu0zRxLAQ=="
},
"husky": {
"version": "0.14.3",
"resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz",
@@ -10513,9 +10504,9 @@
}
},
"make-error": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz",
"integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==",
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz",
"integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==",
"dev": true
},
"make-iterator": {
@@ -11495,7 +11486,6 @@
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true,
"optional": true,
"requires": {
"kind-of": "^3.0.2",
"longest": "^1.0.1",
@@ -12140,8 +12130,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true,
"optional": true
"dev": true
},
"lru-cache": {
"version": "4.0.2",
@@ -13472,9 +13461,9 @@
"dev": true
},
"prettier": {
"version": "1.10.2",
"resolved": "http://192.168.228.42:5000/prettier/-/prettier-1.10.2.tgz",
"integrity": "sha512-TcdNoQIWFoHblurqqU6d1ysopjq7UX0oRcT/hJ8qvBAELiYWn+Ugf0AXdnzISEJ7vuhNnQ98N8jR8Sh53x4IZg==",
"version": "1.15.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz",
"integrity": "sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==",
"dev": true
},
"pretty-format": {
@@ -15471,47 +15460,21 @@
}
},
"ts-node": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.0.1.tgz",
"integrity": "sha512-LDS8WJRTEztvQEXbRK/0l/apWE0BNR/USGUhVcJDe2/hbNiB/v/lCqk6YJzgwKjScgdWOAhPQsfur7hmQ1Y1jA==",
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz",
"integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==",
"dev": true,
"requires": {
"arrify": "^1.0.0",
"chalk": "^2.3.0",
"buffer-from": "^1.1.0",
"diff": "^3.1.0",
"make-error": "^1.1.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map-support": "^0.5.3",
"source-map-support": "^0.5.6",
"yn": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -15519,23 +15482,14 @@
"dev": true
},
"source-map-support": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz",
"integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==",
"version": "0.5.9",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz",
"integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"supports-color": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
@@ -15620,9 +15574,9 @@
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ=="
},
"tslint": {
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.9.1.tgz",
"integrity": "sha1-ElX4ej/1frCw4fDmEKi0dIBGya4=",
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz",
"integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
@@ -15636,7 +15590,7 @@
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.12.1"
"tsutils": "^2.27.2"
},
"dependencies": {
"ansi-styles": {
@@ -15649,9 +15603,9 @@
}
},
"chalk": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.0.tgz",
"integrity": "sha512-Wr/w0f4o9LuE7K53cD0qmbAMM+2XNLzR29vFn5hqko4sxGlUsyy363NvmyGIyk5tpe9cjTr9SJYbysEyPkRnFw==",
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
@@ -15660,31 +15614,17 @@
}
},
"commander": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
"dev": true
},
"esprima": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
@@ -15692,34 +15632,25 @@
"dev": true
},
"js-yaml": {
"version": "3.11.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz",
"integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==",
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
"integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"semver": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
"dev": true
},
"supports-color": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
@@ -15728,9 +15659,9 @@
}
},
"tsutils": {
"version": "2.26.1",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.26.1.tgz",
"integrity": "sha512-bnm9bcjOqOr1UljleL94wVCDlpa6KjfGaTkefeLch4GRafgDkROxPizbB/FxTEdI++5JqhxczRy/Qub0syNqZA==",
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
@@ -15779,9 +15710,9 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"typescript": {
"version": "2.8.1",
"resolved": "http://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz",
"integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg==",
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz",
"integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==",
"dev": true
},
"uglify-js": {

View File

@@ -1,34 +1,25 @@
{
"name": "nestjs",
"version": "5.6.2",
"version": "5.4.1",
"description": "Modern, fast, powerful node.js web framework",
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"precommit": "lint-staged",
"test":
"nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec --require 'node_modules/reflect-metadata/Reflect.js'",
"integration-test":
"mocha integration/**/*.spec.ts --reporter spec --require ts-node/register --require 'node_modules/reflect-metadata/Reflect.js'",
"lint":
"tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
"format":
"prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec --require 'node_modules/reflect-metadata/Reflect.js'",
"integration-test": "mocha integration/**/*.spec.ts --reporter spec --require ts-node/register --require 'node_modules/reflect-metadata/Reflect.js'",
"lint": "tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
"clean": "gulp clean:bundle",
"build": "npm run clean && gulp build",
"prebuild:dev": "rm -rf node_modules/@nestjs",
"build:dev": "gulp build --dist node_modules/@nestjs && gulp move",
"postinstall": "opencollective",
"prerelease": "gulp copy-misc && gulp build --dist node_modules/@nestjs",
"publish":
"npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --exact -m \"chore(@nestjs) publish %s release\"",
"publish:rc":
"npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
"publish:next":
"npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:beta":
"npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
"publish:test":
"npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
"publish": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --exact -m \"chore(@nestjs) publish %s release\"",
"publish:rc": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
"publish:next": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
"publish:beta": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
"publish:test": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
},
"engines": {
"node": ">= 8.9.0"
@@ -41,9 +32,9 @@
"license": "MIT",
"dependencies": {
"@grpc/proto-loader": "^0.3.0",
"@nestjs/common": "5.6.2",
"@nestjs/common": "^5.5.0",
"@nestjs/core": "^5.5.0",
"@nestjs/microservices": "5.5.0",
"@nestjs/microservices": "5.1.0",
"@nestjs/testing": "5.1.0",
"@nestjs/websockets": "5.1.0",
"@nuxtjs/opencollective": "^0.1.0",
@@ -56,15 +47,16 @@
"cli-color": "^1.1.0",
"connect": "^3.6.6",
"cors": "^2.8.4",
"deprecate": "^1.0.0",
"engine.io-client": "^3.1.1",
"express": "^4.16.2",
"fast-json-stringify": "^1.5.4",
"fast-safe-stringify": "^1.2.0",
"fastify": "^1.1.1",
"fastify-cors": "^0.2.0",
"fastify-formbody": "^2.0.0",
"fastify-multipart": "^0.4.1",
"grpc": "^1.14.1",
"http2": "^3.3.7",
"iterare": "0.0.8",
"json-socket": "^0.2.1",
"mqtt": "^2.16.0",
@@ -92,7 +84,7 @@
"@types/express": "^4.0.39",
"@types/kafka-node": "^2.0.6",
"@types/mocha": "^2.2.38",
"@types/node": "^7.0.5",
"@types/node": "^10.12.14",
"@types/redis": "^0.12.36",
"@types/reflect-metadata": "0.0.5",
"@types/sinon": "^1.16.36",
@@ -124,14 +116,14 @@
"mocha": "^3.2.0",
"nodemon": "^1.18.4",
"nyc": "^10.1.2",
"prettier": "^1.9.2",
"prettier": "^1.15.3",
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
"socket.io-client": "^2.0.4",
"supertest": "^3.0.0",
"ts-node": "^6.0.0",
"tslint": "^5.9.1",
"typescript": "^2.8.1"
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.2.2"
},
"collective": {
"type": "opencollective",
@@ -141,16 +133,18 @@
}
},
"nyc": {
"include": ["packages/**/*.ts"],
"include": [
"packages/**/*.ts"
],
"exclude": [
"node_modules/",
"packages/**/*.spec.ts",
"packages/core/adapters/*.ts",
"packages/websockets/adapters/*.ts",
"packages/**/adapters/*.ts",
"packages/**/nest-*.ts",
"packages/core/errors/**/*",
"packages/common/exceptions/*.ts",
"packages/common/http/*.ts",
"packages/common/hooks/*.ts",
"packages/common/utils/load-package.util.ts",
"packages/microservices/exceptions/",
"packages/microservices/microservices-module.ts",
@@ -161,13 +155,23 @@
"packages/common/serializer/**/*",
"packages/common/services/logger.service.ts"
],
"extension": [".ts"],
"require": ["ts-node/register"],
"reporter": ["text-summary", "html"],
"extension": [
".ts"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"html"
],
"sourceMap": true,
"instrument": true
},
"lint-staged": {
"packages/**/*.{ts,json}": ["npm run format", "git add"]
"packages/**/*.{ts,json}": [
"npm run format",
"git add"
]
}
}

View File

@@ -1,6 +1,6 @@
(The MIT License)
Copyright (c) 2017 Kamil Myśliwiec <http://kamilmysliwiec.com>
Copyright (c) 2018 Kamil Myśliwiec <https://kamilmysliwiec.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -16,7 +16,6 @@
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#8" alt="Coverage" /></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
<a href="https://discord.gg/G7Qnnhy"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
@@ -49,10 +48,13 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
#### Gold Sponsors
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="220" /></a>
#### Silver Sponsors
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp;
<a href="http://gojob.com"><img src="http://nestjs.com/img/gojob-logo.png" valign="bottom" height="95" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /> </a> &nbsp;
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="150" /></a>
<a href="http://gojob.com"><img src="http://nestjs.com/img/gojob-logo.png" valign="bottom" height="95" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /> </a>
#### Sponsors

View File

@@ -1,39 +1,50 @@
import { Observable, of } from 'rxjs';
import { tap } from 'rxjs/operators';
import { Inject, Injectable, Optional } from '../../decorators';
import { ExecutionContext, NestInterceptor } from '../../interfaces';
import {
CallHandler,
ExecutionContext,
HttpServer,
NestInterceptor,
} from '../../interfaces';
import { CACHE_KEY_METADATA, CACHE_MANAGER } from '../cache.constants';
const APPLICATION_REFERENCE_HOST = 'ApplicationReferenceHost';
const REFLECTOR = 'Reflector';
export interface ApplicationHost<T extends HttpServer = any> {
applicationRef: T;
}
@Injectable()
export class CacheInterceptor implements NestInterceptor {
@Optional()
@Inject(APPLICATION_REFERENCE_HOST)
protected readonly applicationRefHost: any;
protected readonly applicationRefHost: ApplicationHost;
constructor(
@Inject(CACHE_MANAGER) protected readonly cacheManager: any,
@Inject(REFLECTOR) protected readonly reflector,
@Inject(REFLECTOR) protected readonly reflector: any,
) {}
async intercept(
context: ExecutionContext,
call$: Observable<any>,
next: CallHandler,
): Promise<Observable<any>> {
const key = this.trackBy(context);
if (!key) {
return call$;
return next.handle();
}
try {
const value = await this.cacheManager.get(key);
if (value) {
return of(value);
}
return call$.pipe(tap(response => this.cacheManager.set(key, response)));
return next
.handle()
.pipe(tap(response => this.cacheManager.set(key, response)));
} catch {
return call$;
return next.handle();
}
}

View File

@@ -1,20 +1,19 @@
export const METADATA = {
MODULES: 'modules',
IMPORTS: 'imports',
COMPONENTS: 'components',
PROVIDERS: 'providers',
CONTROLLERS: 'controllers',
EXPORTS: 'exports',
};
export const SHARED_MODULE_METADATA = '__sharedModule__';
export const GLOBAL_MODULE_METADATA = '__globalModule__';
export const SHARED_MODULE_METADATA = '__module:shared__';
export const GLOBAL_MODULE_METADATA = '__module:global__';
export const PATH_METADATA = 'path';
export const PARAMTYPES_METADATA = 'design:paramtypes';
export const SELF_DECLARED_DEPS_METADATA = 'self:paramtypes';
export const OPTIONAL_DEPS_METADATA = 'optional:paramtypes';
export const PROPERTY_DEPS_METADATA = 'self:properties_metadata';
export const OPTIONAL_PROPERTY_DEPS_METADATA = 'optional:properties_metadata';
export const SCOPE_OPTIONS_METADATA = 'scope:options';
export const METHOD_METADATA = 'method';
export const ROUTE_ARGS_METADATA = '__routeArguments__';
@@ -26,7 +25,6 @@ export const GUARDS_METADATA = '__guards__';
export const RENDER_METADATA = '__renderTemplate__';
export const INTERCEPTORS_METADATA = '__interceptors__';
export const HTTP_CODE_METADATA = '__httpCode__';
export const GATEWAY_MIDDLEWARES = '__gatewayMiddleware';
export const MODULE_PATH = '__module_path__';
export const HEADERS_METADATA = '__headers__';
export const REDIRECT_METADATA = '__redirect__';

View File

@@ -1,10 +1,14 @@
/**
* Binds parameters decorators to the particular method
* Binds parameter decorators to the method
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
* @param {} ...decorators
*/
export function Bind(...decorators: any[]) {
return (target: object, key, descriptor) => {
export function Bind(...decorators: any[]): MethodDecorator {
return <T>(
target: object,
key: string | symbol,
descriptor: TypedPropertyDescriptor<T>,
) => {
decorators.forEach((fn, index) => fn(target, key, index));
return descriptor;
};

View File

@@ -2,7 +2,7 @@ import { FILTER_CATCH_EXCEPTIONS } from '../../constants';
import { Type } from '../../interfaces';
/**
* Defines the Exceptions Filter. Takes set of exception types as an argument which has to be caught by this Filter.
* Defines an exception filter. Takes set of exception types as arguments which have to be caught by this filter.
* The class should implement the `ExceptionFilter` interface.
*/
export function Catch(...exceptions: Type<any>[]): ClassDecorator {

View File

@@ -1,74 +0,0 @@
import * as deprecate from 'deprecate';
import * as uuid from 'uuid/v4';
/**
* Defines the injectable class. This class can inject dependencies through constructor.
* Those dependencies have to belong to the same module.
*/
export function Injectable(): ClassDecorator {
return (target: object) => {};
}
/**
* @deprecated
* Defines the Component. The component can inject dependencies through constructor.
* Those dependencies have to belong to the same module.
*/
export function Component(): ClassDecorator {
deprecate(
'The @Component() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
);
return (target: object) => {};
}
/**
* @deprecated
* Defines the Pipe. The Pipe should implement the `PipeTransform` interface.
*/
export function Pipe(): ClassDecorator {
deprecate(
'The @Pipe() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
);
return (target: object) => {};
}
/**
* @deprecated
* Defines the Guard. The Guard should implement the `CanActivate` interface.
*/
export function Guard(): ClassDecorator {
deprecate(
'The @Guard() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
);
return (target: object) => {};
}
/**
* @deprecated
* Defines the Middleware. The Middleware should implement the `NestMiddleware` interface.
*/
export function Middleware(): ClassDecorator {
deprecate(
'The @Middleware() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
);
return (target: object) => {};
}
/**
* @deprecated
* Defines the Interceptor. The Interceptor should implement `HttpInterceptor`, `RpcInterceptor` or `WsInterceptor` interface.
*/
export function Interceptor(): ClassDecorator {
deprecate(
'The @Interceptor() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
);
return (target: object) => {};
}
export function mixin(mixinClass) {
Object.defineProperty(mixinClass, 'name', {
value: uuid(),
});
Injectable()(mixinClass);
return mixinClass;
}

View File

@@ -1,8 +1,8 @@
import { isUndefined } from '../../utils/shared.utils';
import { PATH_METADATA } from '../../constants';
import { isUndefined } from '../../utils/shared.utils';
/**
* Defines the Controller. The controller can inject dependencies through constructor.
* Defines the controller. Controller can inject dependencies through constructor.
* Those dependencies have to belong to the same module.
*/
export function Controller(prefix?: string): ClassDecorator {

View File

@@ -1,8 +1,10 @@
import { PARAMTYPES_METADATA } from '../../constants';
export function flatten(arr: any[]) {
export function flatten<T extends any[] = any, R extends any[] = any>(
arr: T,
): R {
const flat = [].concat(...arr);
return flat.some(Array.isArray) ? flatten(flat) : flat;
return (flat.some(Array.isArray) ? flatten(flat) : flat) as R;
}
export const Dependencies = (...dependencies: any[]): ClassDecorator => {

View File

@@ -5,9 +5,12 @@ import { isFunction } from '../../utils/shared.utils';
import { validateEach } from '../../utils/validate-each.util';
const defineFiltersMetadata = (...filters: (Function | ExceptionFilter)[]) => {
return (target: any, key?, descriptor?) => {
const isFilterValid = filter =>
filter && (isFunction(filter) || isFunction(filter.catch));
return (target: any, key?: string, descriptor?: any) => {
const isFilterValid = <T extends Function | Record<string, any>>(
filter: T,
) =>
filter &&
(isFunction(filter) || isFunction((filter as Record<string, any>).catch));
if (descriptor) {
validateEach(
@@ -31,12 +34,12 @@ const defineFiltersMetadata = (...filters: (Function | ExceptionFilter)[]) => {
};
/**
* Setups exception filters to the chosen context.
* Bounds exception filters to the chosen context.
* When the `@UseFilters()` is used on the controller level:
* - Exception Filter will be set up to every handler (every method)
*
* When the `@UseFilters()` is used on the handle level:
* - Exception Filter will be set up only to specified method
* - Exception Filter will be set up only to the specified method
*
* @param {ExceptionFilter[]} ...filters
*/

View File

@@ -1,10 +1,10 @@
export * from './bind.decorator';
export * from './catch.decorator';
export * from './component.decorator';
export * from './controller.decorator';
export * from './dependencies.decorator';
export * from './exception-filters.decorator';
export * from './inject.decorator';
export * from './injectable.decorator';
export * from './optional.decorator';
export * from './reflect-metadata.decorator';
export * from './use-guards.decorator';

View File

@@ -6,7 +6,7 @@ import { isFunction, isUndefined } from '../../utils/shared.utils';
/**
* Injects provider which has to be available in the current injector (module) scope.
* Providers are recognized by types or tokens.
* Providers are recognized by either types or tokens.
*/
export function Inject<T = any>(token?: T) {
return (target: Object, key: string | symbol, index?: number) => {

View File

@@ -0,0 +1,24 @@
import * as uuid from 'uuid/v4';
import { ScopeOptions } from '../../interfaces/scope-options.interface';
import { SCOPE_OPTIONS_METADATA } from './../../constants';
import { Type } from './../../interfaces/type.interface';
export interface InjectableOptions extends ScopeOptions {}
/**
* Defines the injectable class. This class can inject dependencies through constructor.
* Those dependencies have to belong to the same module.
*/
export function Injectable(options?: InjectableOptions): ClassDecorator {
return (target: object) => {
Reflect.defineMetadata(SCOPE_OPTIONS_METADATA, options, target);
};
}
export function mixin(mixinClass: Type<any>) {
Object.defineProperty(mixinClass, 'name', {
value: uuid(),
});
Injectable()(mixinClass);
return mixinClass;
}

View File

@@ -2,11 +2,10 @@
* Assigns the metadata to the class/function under specified `key`.
* This metadata can be reflected using `Reflector` class.
*/
export const ReflectMetadata = <K = any, V = any>(metadataKey: K, metadataValue: V) => (
target: object,
key?,
descriptor?,
) => {
export const ReflectMetadata = <K = any, V = any>(
metadataKey: K,
metadataValue: V,
) => (target: object, key?: any, descriptor?: any) => {
if (descriptor) {
Reflect.defineMetadata(metadataKey, metadataValue, descriptor.value);
return descriptor;

View File

@@ -1,8 +1,8 @@
import { GUARDS_METADATA } from '../../constants';
import { extendArrayMetadata } from '../../utils/extend-metadata.util';
import { validateEach } from '../../utils/validate-each.util';
import { isFunction } from '../../utils/shared.utils';
import { CanActivate } from '../../interfaces';
import { extendArrayMetadata } from '../../utils/extend-metadata.util';
import { isFunction } from '../../utils/shared.utils';
import { validateEach } from '../../utils/validate-each.util';
/**
* Binds guards to the particular context.
@@ -10,14 +10,16 @@ import { CanActivate } from '../../interfaces';
* - Guard will be register to each handler (every method)
*
* When the `@UseGuards()` is used on the handler level:
* - Guard will be registered only to specified method
* - Guard will be registered only to the specified method
*
* @param {} ...guards
*/
export function UseGuards(...guards: (CanActivate | Function)[]) {
return (target: any, key?, descriptor?) => {
const isValidGuard = guard =>
guard && (isFunction(guard) || isFunction(guard.canActivate));
return (target: any, key?: string, descriptor?: any) => {
const isValidGuard = <T extends Function | Record<string, any>>(guard: T) =>
guard &&
(isFunction(guard) ||
isFunction((guard as Record<string, any>).canActivate));
if (descriptor) {
validateEach(

View File

@@ -10,17 +10,20 @@ import { validateEach } from '../../utils/validate-each.util';
* - Interceptor will be register to each handler (every method)
*
* When the `@UseInterceptors()` is used on the handle level:
* - Interceptor will be registered only to specified method
* - Interceptor will be registered only to the specified method
*
* @param {} ...interceptors
*/
export function UseInterceptors(
...interceptors: (NestInterceptor | Function)[]
) {
return (target: any, key?, descriptor?) => {
const isValidInterceptor = interceptor =>
return (target: any, key?: string, descriptor?: any) => {
const isValidInterceptor = <T extends Function | Record<string, any>>(
interceptor: T,
) =>
interceptor &&
(isFunction(interceptor) || isFunction(interceptor.intercept));
(isFunction(interceptor) ||
isFunction((interceptor as Record<string, any>).intercept));
if (descriptor) {
validateEach(

View File

@@ -1,8 +1,8 @@
import { PipeTransform } from '../../interfaces/index';
import { PIPES_METADATA } from '../../constants';
import { PipeTransform } from '../../interfaces/index';
import { extendArrayMetadata } from '../../utils/extend-metadata.util';
import { validateEach } from '../../utils/validate-each.util';
import { isFunction } from '../../utils/shared.utils';
import { validateEach } from '../../utils/validate-each.util';
/**
* Binds pipes to the particular context.
@@ -10,14 +10,16 @@ import { isFunction } from '../../utils/shared.utils';
* - Pipe will be register to each handler (every method)
*
* When the `@UsePipes()` is used on the handle level:
* - Pipe will be registered only to specified method
* - Pipe will be registered only to the specified method
*
* @param {PipeTransform[]} ...pipes
*/
export function UsePipes(...pipes: (PipeTransform | Function)[]) {
return (target: any, key?, descriptor?) => {
const isPipeValid = pipe =>
pipe && (isFunction(pipe) || isFunction(pipe.transform));
return (target: any, key?: string, descriptor?: any) => {
const isPipeValid = <T extends Function | Record<string, any>>(pipe: T) =>
pipe &&
(isFunction(pipe) || isFunction((pipe as Record<string, any>).transform));
if (descriptor) {
extendArrayMetadata(PIPES_METADATA, pipes, descriptor.value);
return descriptor;

View File

@@ -1,4 +1,3 @@
import * as deprecate from 'deprecate';
import * as uuid from 'uuid/v4';
import {
CUSTOM_ROUTE_AGRS_METADATA,
@@ -47,7 +46,7 @@ export function createParamDecorator(
const args =
Reflect.getMetadata(ROUTE_ARGS_METADATA, target.constructor, key) || {};
const isPipe = pipe =>
const isPipe = (pipe: any) =>
pipe &&
((isFunction(pipe) && pipe.prototype) || isFunction(pipe.transform));
@@ -71,20 +70,3 @@ export function createParamDecorator(
enhancers.forEach(fn => fn(target, key, index));
};
}
/**
* Defines HTTP route param decorator
* @deprecated
* @param factory
*/
export function createRouteParamDecorator(
factory: CustomParamFactory,
): (
data?: any,
...pipes: (Type<PipeTransform> | PipeTransform)[]
) => ParameterDecorator {
deprecate(
'The "createRouteParamDecorator" function is deprecated and will be removed within next major release. Use "createParamDecorator" instead.',
);
return createParamDecorator(factory);
}

Some files were not shown because too many files have changed in this diff Show More