mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix(): resolve merge conflicts
This commit is contained in:
@@ -86,6 +86,9 @@ jobs:
|
||||
- run:
|
||||
name: Lint
|
||||
command: npm run lint
|
||||
- run:
|
||||
name: Lint commit
|
||||
command: ./node_modules/.bin/commitlint-circle -c .commitlintrc.json
|
||||
|
||||
integration_tests:
|
||||
working_directory: ~/nest
|
||||
@@ -142,6 +145,8 @@ jobs:
|
||||
working_directory: ~/nest
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
environment:
|
||||
- DISABLE_OPENCOLLECTIVE: true
|
||||
steps:
|
||||
- checkout
|
||||
- *restore-cache
|
||||
|
||||
28
.commitlintrc.json
Normal file
28
.commitlintrc.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"extends": ["@commitlint/config-angular"],
|
||||
"rules": {
|
||||
"subject-case": [
|
||||
2,
|
||||
"always",
|
||||
["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"]
|
||||
],
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"build",
|
||||
"chore",
|
||||
"ci",
|
||||
"docs",
|
||||
"feat",
|
||||
"fix",
|
||||
"perf",
|
||||
"refactor",
|
||||
"revert",
|
||||
"style",
|
||||
"test",
|
||||
"sample"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
1
.eslintignore
Normal file
1
.eslintignore
Normal file
@@ -0,0 +1 @@
|
||||
**/node_modules/**
|
||||
24
.eslintrc.js
Normal file
24
.eslintrc.js
Normal file
@@ -0,0 +1,24 @@
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
'prettier/@typescript-eslint',
|
||||
],
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/interface-name-prefix': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
},
|
||||
};
|
||||
13
.eslintrc.spec.js
Normal file
13
.eslintrc.spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const baseConfig = require('./.eslintrc');
|
||||
|
||||
module.exports = {
|
||||
...baseConfig,
|
||||
parserOptions: {
|
||||
project: 'tsconfig.spec.json',
|
||||
sourceType: 'module',
|
||||
},
|
||||
rules: {
|
||||
...baseConfig.rules,
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
},
|
||||
};
|
||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1,3 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [kamilmysliwiec]
|
||||
open_collective: nest
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
}
|
||||
|
||||
76
CODE_OF_CONDUCT.md
Normal file
76
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at support@nestjs.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
@@ -236,8 +236,8 @@ Footer should contain a [closing reference to an issue](https://help.github.com/
|
||||
Samples: (even more [samples](https://github.com/nestjs/nest/commits/master))
|
||||
|
||||
```
|
||||
docs(changelog) update change log to beta.5
|
||||
bugfix(core) need to depend on latest rxjs and zone.js
|
||||
docs(changelog): update change log to beta.5
|
||||
bugfix(core): need to depend on latest rxjs and zone.js
|
||||
```
|
||||
|
||||
### Revert
|
||||
@@ -252,7 +252,7 @@ Must be one of the following:
|
||||
- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
||||
- **docs**: Documentation only changes
|
||||
- **feature**: A new feature
|
||||
- **bugfix**: A bug fix
|
||||
- **fix**: A bug fix
|
||||
- **perf**: A code change that improves performance
|
||||
- **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
|
||||
17
Readme.md
17
Readme.md
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
|
||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
||||
</p>
|
||||
|
||||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
||||
@@ -9,13 +9,14 @@
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
|
||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
|
||||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
|
||||
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
|
||||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
|
||||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
|
||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
|
||||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
|
||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
|
||||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
||||
</p>
|
||||
<!--[](https://opencollective.com/nest#backer)
|
||||
@@ -58,18 +59,18 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
#### Sponsors
|
||||
|
||||
<a href="https://www.swingdev.io" target="_blank"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="110" valign="middle" /> </a> <a href="https://blueanchor.io/" target="_blank"><img src="https://nestjs.com/img/blueanchor.png" width="150" valign="middle" /></a>
|
||||
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="110" valign="middle" /></a>
|
||||
<a href="https://scal.io" target="_blank"><img src="https://nestjs.com/img/scalio-logo.svg" width="80" valign="middle" /></a> <a href="http://angularity.io" target="_blank"><img src="http://angularity.io/media/logo.svg" height="22" valign="middle" /></a> <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> --> <a href="https://hostpresto.com" target="_blank"><img src="https://nestjs.com/img/hostpresto.png" height="24" valign="middle" /></a>
|
||||
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="110" valign="middle" /></a> <a href="https://hostpresto.com" target="_blank"><img src="https://nestjs.com/img/hostpresto.png" height="24" valign="middle" /></a>
|
||||
<a href="https://ever.co/" target="_blank"><img src="https://nestjs.com/img/ever-logo.png" height="14" valign="middle" /></a>
|
||||
<a href="https://buddy.works/" target="_blank"><img src="https://nestjs.com/img/buddy-logo.svg" height="25" valign="middle" /></a>
|
||||
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" height="25" valign="middle" /></a> <a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" height="24" valign="middle" /></a> <a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" height="20" valign="middle" /></a> <a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" height="22" valign="middle" /></a> <a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" height="19" valign="middle" /></a> <a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" height="20" valign="middle" /></a>
|
||||
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" height="18" valign="middle" /></a> <a href="https://yakaz.com/" target="_blank"><img src="https://nestjs.com/img/yakaz.png" width="70" valign="middle" /></a>
|
||||
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" height="25" valign="middle" /></a> <a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" height="27" valign="middle" /></a> <a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" height="20" valign="middle" /></a> <a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" height="22" valign="middle" /></a> <a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" height="19" valign="middle" /></a> <a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" height="20" valign="middle" /></a>
|
||||
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" height="18" valign="middle" /></a>
|
||||
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="100" valign="middle" /></a>
|
||||
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="75" valign="middle" /></a>
|
||||
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="120" valign="middle" /></a>
|
||||
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a>
|
||||
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a>
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a>
|
||||
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a>
|
||||
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a>
|
||||
|
||||
|
||||
## Backers
|
||||
@@ -78,7 +79,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
|
||||
## Stay in touch
|
||||
|
||||
* Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
|
||||
* Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
|
||||
* Website - [https://nestjs.com](https://nestjs.com/)
|
||||
* Twitter - [@nestframework](https://twitter.com/nestframework)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ services:
|
||||
- "9001:9001"
|
||||
restart: always
|
||||
mysql:
|
||||
image: mysql:5.7.27
|
||||
image: mysql:5.7.29
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: test
|
||||
@@ -48,7 +48,7 @@ services:
|
||||
zookeeper:
|
||||
container_name: test-zookeeper
|
||||
hostname: zookeeper
|
||||
image: confluentinc/cp-zookeeper:5.3.1
|
||||
image: confluentinc/cp-zookeeper:5.3.2
|
||||
ports:
|
||||
- "2181:2181"
|
||||
environment:
|
||||
@@ -57,7 +57,7 @@ services:
|
||||
kafka:
|
||||
container_name: test-kafka
|
||||
hostname: kafka
|
||||
image: confluentinc/cp-kafka:5.3.1
|
||||
image: confluentinc/cp-kafka:5.3.2
|
||||
depends_on:
|
||||
- zookeeper
|
||||
ports:
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('TypeGraphQL', () => {
|
||||
describe('GraphQL - Code-first', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,24 +9,23 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.7.2",
|
||||
"@nestjs/core": "6.7.2",
|
||||
"@nestjs/graphql": "6.5.1",
|
||||
"apollo-server-express": "2.9.4",
|
||||
"@nestjs/common": "6.11.7",
|
||||
"@nestjs/core": "6.11.7",
|
||||
"@nestjs/graphql": "7.0.0-next.1",
|
||||
"apollo-server-express": "2.10.1",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.1",
|
||||
"graphql": "14.5.8",
|
||||
"graphql-tools": "4.0.5",
|
||||
"class-validator": "0.11.0",
|
||||
"graphql": "14.6.0",
|
||||
"graphql-tools": "4.0.7",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.3",
|
||||
"rxjs": "6.5.4",
|
||||
"subscriptions-transport-ws": "0.9.16",
|
||||
"type-graphql": "0.17.5",
|
||||
"typescript": "3.6.3",
|
||||
"ws": "7.1.2"
|
||||
"typescript": "3.7.2",
|
||||
"ws": "7.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0"
|
||||
"@types/node": "7.10.9",
|
||||
"ts-node": "8.6.2",
|
||||
"tslint": "5.20.1"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
# -----------------------------------------------
|
||||
# !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
|
||||
# !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
|
||||
# -----------------------------------------------
|
||||
# ------------------------------------------------------
|
||||
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
|
||||
# ------------------------------------------------------
|
||||
|
||||
"""Date custom scalar type"""
|
||||
scalar Date
|
||||
@@ -9,7 +9,10 @@ import { RecipesModule } from './recipes/recipes.module';
|
||||
GraphQLModule.forRoot({
|
||||
debug: false,
|
||||
installSubscriptionHandlers: true,
|
||||
autoSchemaFile: join(process.cwd(), 'integration/typegraphql/schema.gql'),
|
||||
autoSchemaFile: join(
|
||||
process.cwd(),
|
||||
'integration/graphql-code-first/schema.gql',
|
||||
),
|
||||
}),
|
||||
],
|
||||
})
|
||||
@@ -10,6 +10,6 @@ import { tap } from 'rxjs/operators';
|
||||
@Injectable()
|
||||
export class DataInterceptor implements NestInterceptor {
|
||||
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||
return next.handle().pipe(tap(data => console.log(data)));
|
||||
return next.handle().pipe(tap(data => data));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Field, InputType } from '@nestjs/graphql';
|
||||
import { Type } from 'class-transformer';
|
||||
import { Length, MaxLength } from 'class-validator';
|
||||
import { Field, InputType } from 'type-graphql';
|
||||
|
||||
@InputType()
|
||||
export class NewRecipeInput {
|
||||
@@ -1,14 +1,14 @@
|
||||
import { ArgsType, Field, Int } from '@nestjs/graphql';
|
||||
import { Max, Min } from 'class-validator';
|
||||
import { ArgsType, Field, Int } from 'type-graphql';
|
||||
|
||||
@ArgsType()
|
||||
export class RecipesArgs {
|
||||
@Field(type => Int)
|
||||
@Min(0)
|
||||
skip: number = 0;
|
||||
skip = 0;
|
||||
|
||||
@Field(type => Int)
|
||||
@Min(1)
|
||||
@Max(50)
|
||||
take: number = 25;
|
||||
take = 25;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Field, ID, ObjectType } from 'type-graphql';
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
@ObjectType()
|
||||
export class Recipe {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { APP_FILTER } from '@nestjs/core';
|
||||
import { UnauthorizedFilter } from '../common/filters/unathorized.filter';
|
||||
import { UnauthorizedFilter } from '../common/filters/unauthorized.filter';
|
||||
import { DateScalar } from '../common/scalars/date.scalar';
|
||||
import { RecipesResolver } from './recipes.resolver';
|
||||
import { RecipesService } from './recipes.service';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,21 +9,21 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.7.2",
|
||||
"@nestjs/core": "6.7.2",
|
||||
"@nestjs/graphql": "6.5.1",
|
||||
"apollo-server-express": "2.9.4",
|
||||
"graphql": "14.5.8",
|
||||
"graphql-tools": "4.0.5",
|
||||
"@nestjs/common": "6.11.7",
|
||||
"@nestjs/core": "6.11.7",
|
||||
"@nestjs/graphql": "6.5.4",
|
||||
"apollo-server-express": "2.10.1",
|
||||
"graphql": "14.6.0",
|
||||
"graphql-tools": "4.0.7",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.3",
|
||||
"rxjs": "6.5.4",
|
||||
"subscriptions-transport-ws": "0.9.16",
|
||||
"typescript": "3.6.3",
|
||||
"ws": "7.1.2"
|
||||
"typescript": "3.7.2",
|
||||
"ws": "7.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0"
|
||||
"@types/node": "7.10.9",
|
||||
"ts-node": "8.6.2",
|
||||
"tslint": "5.20.1"
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export class CatsResolvers {
|
||||
@Query()
|
||||
@UseGuards(CatsGuard)
|
||||
async getCats() {
|
||||
return await this.catsService.findAll();
|
||||
return this.catsService.findAll();
|
||||
}
|
||||
|
||||
@Query('cat')
|
||||
@@ -22,7 +22,7 @@ export class CatsResolvers {
|
||||
@Args('id', ParseIntPipe)
|
||||
id: number,
|
||||
): Promise<Cat> {
|
||||
return await this.catsService.findOneById(id);
|
||||
return this.catsService.findOneById(id);
|
||||
}
|
||||
|
||||
@Mutation('createCat')
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
"defaultSeverity": "error",
|
||||
"extends": [
|
||||
"tslint:recommended"
|
||||
],
|
||||
"jsRules": {
|
||||
"no-unused-expression": true
|
||||
},
|
||||
"rules": {
|
||||
"eofline": false,
|
||||
"quotemark": [
|
||||
true,
|
||||
"single"
|
||||
],
|
||||
"indent": false,
|
||||
"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": []
|
||||
}
|
||||
@@ -40,6 +40,17 @@ describe('Hello world (express instance)', () => {
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET { host: ":tenant.example.com" } not matched`, () => {
|
||||
return request(server)
|
||||
.get('/host')
|
||||
.expect(404)
|
||||
.expect({
|
||||
statusCode: 404,
|
||||
error: 'Not Found',
|
||||
message: 'Cannot GET /host',
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await app.close();
|
||||
});
|
||||
|
||||
76
integration/hello-world/e2e/express-multiple.spec.ts
Normal file
76
integration/hello-world/e2e/express-multiple.spec.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
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 { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (express instance with multiple applications)', () => {
|
||||
let server;
|
||||
let apps: INestApplication[];
|
||||
|
||||
beforeEach(async () => {
|
||||
const module1 = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
}).compile();
|
||||
const module2 = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
}).compile();
|
||||
|
||||
const adapter = new ExpressAdapter(express());
|
||||
|
||||
apps = [
|
||||
module1.createNestApplication(adapter),
|
||||
module2.createNestApplication(adapter).setGlobalPrefix('/app2'),
|
||||
];
|
||||
await Promise.all(apps.map(app => app.init()));
|
||||
|
||||
server = adapter.getInstance();
|
||||
});
|
||||
|
||||
it(`/GET`, () => {
|
||||
return request(server)
|
||||
.get('/hello')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET (app2)`, () => {
|
||||
return request(server)
|
||||
.get('/app2/hello')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET (Promise/async)`, () => {
|
||||
return request(server)
|
||||
.get('/hello/async')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET (app2 Promise/async)`, () => {
|
||||
return request(server)
|
||||
.get('/app2/hello/async')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET (Observable stream)`, () => {
|
||||
return request(server)
|
||||
.get('/hello/stream')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET (app2 Observable stream)`, () => {
|
||||
return request(server)
|
||||
.get('/app2/hello/stream')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(apps.map(app => app.close()));
|
||||
});
|
||||
});
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
NestFastifyApplication,
|
||||
} from '@nestjs/platform-fastify';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { fail } from 'assert';
|
||||
import { expect } from 'chai';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
@@ -47,6 +48,27 @@ describe('Hello world (fastify adapter)', () => {
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
it(`/GET { host: ":tenant.example.com" } not matched`, () => {
|
||||
return app
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/host',
|
||||
})
|
||||
.then(
|
||||
({ payload }) => {
|
||||
fail(`Unexpected success: ${payload}`);
|
||||
},
|
||||
err => {
|
||||
expect(err.message).to.be.eql({
|
||||
error: 'Internal Server Error',
|
||||
message:
|
||||
'HTTP adapter does not support filtering on host: ":tenant.example.com"',
|
||||
statusCode: 500,
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await app.close();
|
||||
});
|
||||
|
||||
91
integration/hello-world/e2e/fastify-multiple.spec.ts
Normal file
91
integration/hello-world/e2e/fastify-multiple.spec.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/* Temporarily disabled due to various regressions
|
||||
|
||||
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (fastify adapter with multiple applications)', () => {
|
||||
let adapter: FastifyAdapter;
|
||||
let apps: NestFastifyApplication[];
|
||||
|
||||
beforeEach(async () => {
|
||||
const module1 = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
}).compile();
|
||||
const module2 = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
}).compile();
|
||||
|
||||
adapter = new FastifyAdapter();
|
||||
|
||||
apps = [
|
||||
module1.createNestApplication<NestFastifyApplication>(adapter),
|
||||
module2
|
||||
.createNestApplication<NestFastifyApplication>(adapter, {
|
||||
bodyParser: false,
|
||||
})
|
||||
.setGlobalPrefix('/app2'),
|
||||
];
|
||||
await Promise.all(apps.map(app => app.init()));
|
||||
});
|
||||
|
||||
it(`/GET`, () => {
|
||||
return adapter
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/hello',
|
||||
})
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
it(`/GET (app2)`, () => {
|
||||
return adapter
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/app2/hello',
|
||||
})
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
it(`/GET (Promise/async)`, () => {
|
||||
return adapter
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/hello/async',
|
||||
})
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
it(`/GET (app2 Promise/async)`, () => {
|
||||
return adapter
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/app2/hello/async',
|
||||
})
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
it(`/GET (Observable stream)`, () => {
|
||||
return adapter
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/hello/stream',
|
||||
})
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
it(`/GET (app2 Observable stream)`, () => {
|
||||
return adapter
|
||||
.inject({
|
||||
method: 'GET',
|
||||
url: '/app2/hello/stream',
|
||||
})
|
||||
.then(({ payload }) => expect(payload).to.be.eql('Hello world!'));
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(apps.map(app => app.close()));
|
||||
await adapter.close();
|
||||
});
|
||||
});*/
|
||||
@@ -1,8 +1,12 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication, Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import {
|
||||
INestApplication,
|
||||
Injectable,
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
@Injectable()
|
||||
export class AuthGuard {
|
||||
@@ -30,10 +34,8 @@ describe('Guards', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
it(`should prevent access (unauthorized)`, async () => {
|
||||
app = (await createTestModule(
|
||||
new AuthGuard(),
|
||||
)).createNestApplication();
|
||||
|
||||
app = (await createTestModule(new AuthGuard())).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
.get('/hello')
|
||||
|
||||
@@ -10,42 +10,60 @@ describe('Hello world (default adapter)', () => {
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
})
|
||||
.compile();
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
server = app.getHttpServer();
|
||||
await app.init();
|
||||
});
|
||||
|
||||
describe('/GET', () => {
|
||||
it(`should return "Hello world!"`, () => {
|
||||
return request(server)
|
||||
.get('/hello')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
[
|
||||
{
|
||||
host: 'example.com',
|
||||
path: '/hello',
|
||||
greeting: 'Hello world!',
|
||||
},
|
||||
{
|
||||
host: 'acme.example.com',
|
||||
path: '/host',
|
||||
greeting: 'Host Greeting! tenant=acme',
|
||||
},
|
||||
].forEach(({ host, path, greeting }) => {
|
||||
describe(`host=${host}`, () => {
|
||||
describe('/GET', () => {
|
||||
it(`should return "${greeting}"`, () => {
|
||||
return request(server)
|
||||
.get(path)
|
||||
.set('Host', host)
|
||||
.expect(200)
|
||||
.expect(greeting);
|
||||
});
|
||||
|
||||
it(`should attach response header`, () => {
|
||||
return request(server)
|
||||
.get(path)
|
||||
.set('Host', host)
|
||||
.expect(200)
|
||||
.expect('Authorization', 'Bearer');
|
||||
});
|
||||
});
|
||||
|
||||
it(`/GET (Promise/async) returns "${greeting}"`, () => {
|
||||
return request(server)
|
||||
.get(`${path}/async`)
|
||||
.set('Host', host)
|
||||
.expect(200)
|
||||
.expect(greeting);
|
||||
});
|
||||
|
||||
it(`/GET (Observable stream) "${greeting}"`, () => {
|
||||
return request(server)
|
||||
.get(`${path}/stream`)
|
||||
.set('Host', host)
|
||||
.expect(200)
|
||||
.expect(greeting);
|
||||
});
|
||||
});
|
||||
|
||||
it(`should attach response header`, () => {
|
||||
return request(server)
|
||||
.get('/hello')
|
||||
.expect(200)
|
||||
.expect('Authorization', 'Bearer');
|
||||
});
|
||||
});
|
||||
|
||||
it(`/GET (Promise/async)`, () => {
|
||||
return request(server)
|
||||
.get('/hello/async')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
it(`/GET (Observable stream)`, () => {
|
||||
return request(server)
|
||||
.get('/hello/stream')
|
||||
.expect(200)
|
||||
.expect('Hello world!');
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
@@ -30,7 +30,7 @@ export class TransformInterceptor {
|
||||
|
||||
@Injectable()
|
||||
export class StatusInterceptor {
|
||||
constructor(private statusCode: number) {}
|
||||
constructor(private readonly statusCode: number) {}
|
||||
|
||||
intercept(context: ExecutionContext, next: CallHandler) {
|
||||
const ctx = context.switchToHttp();
|
||||
@@ -42,7 +42,7 @@ export class StatusInterceptor {
|
||||
|
||||
@Injectable()
|
||||
export class HeaderInterceptor {
|
||||
constructor(private headers: object) {}
|
||||
constructor(private readonly headers: object) {}
|
||||
|
||||
intercept(context: ExecutionContext, next: CallHandler) {
|
||||
const ctx = context.switchToHttp();
|
||||
@@ -72,9 +72,9 @@ describe('Interceptors', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
it(`should transform response (sync)`, async () => {
|
||||
app = (await createTestModule(
|
||||
new OverrideInterceptor(),
|
||||
)).createNestApplication();
|
||||
app = (
|
||||
await createTestModule(new OverrideInterceptor())
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
@@ -83,9 +83,9 @@ describe('Interceptors', () => {
|
||||
});
|
||||
|
||||
it(`should map response`, async () => {
|
||||
app = (await createTestModule(
|
||||
new TransformInterceptor(),
|
||||
)).createNestApplication();
|
||||
app = (
|
||||
await createTestModule(new TransformInterceptor())
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
@@ -94,9 +94,9 @@ describe('Interceptors', () => {
|
||||
});
|
||||
|
||||
it(`should map response (async)`, async () => {
|
||||
app = (await createTestModule(
|
||||
new TransformInterceptor(),
|
||||
)).createNestApplication();
|
||||
app = (
|
||||
await createTestModule(new TransformInterceptor())
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
@@ -105,9 +105,9 @@ describe('Interceptors', () => {
|
||||
});
|
||||
|
||||
it(`should map response (stream)`, async () => {
|
||||
app = (await createTestModule(
|
||||
new TransformInterceptor(),
|
||||
)).createNestApplication();
|
||||
app = (
|
||||
await createTestModule(new TransformInterceptor())
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
@@ -116,9 +116,9 @@ describe('Interceptors', () => {
|
||||
});
|
||||
|
||||
it(`should modify response status`, async () => {
|
||||
app = (await createTestModule(
|
||||
new StatusInterceptor(400),
|
||||
)).createNestApplication();
|
||||
app = (
|
||||
await createTestModule(new StatusInterceptor(400))
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
@@ -131,9 +131,9 @@ describe('Interceptors', () => {
|
||||
Authorization: 'jwt',
|
||||
};
|
||||
|
||||
app = (await createTestModule(
|
||||
new HeaderInterceptor(customHeaders),
|
||||
)).createNestApplication();
|
||||
app = (
|
||||
await createTestModule(new HeaderInterceptor(customHeaders))
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
return request(app.getHttpServer())
|
||||
|
||||
@@ -10,15 +10,14 @@ describe('Hello world (default adapter)', () => {
|
||||
beforeEach(async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
imports: [ApplicationModule],
|
||||
})
|
||||
.compile();
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
server = app.getHttpServer();
|
||||
await app.init();
|
||||
});
|
||||
|
||||
it(`should execute locally injected pipe`, () => {
|
||||
it(`host=example.com should execute locally injected pipe by HelloController`, () => {
|
||||
return request(server)
|
||||
.get('/hello/local-pipe/1')
|
||||
.expect(200)
|
||||
@@ -27,6 +26,29 @@ describe('Hello world (default adapter)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it(`host=host.example.com should execute locally injected pipe by HostController`, () => {
|
||||
return request(server)
|
||||
.get('/host/local-pipe/1')
|
||||
.set('Host', 'acme.example.com')
|
||||
.expect(200)
|
||||
.expect({
|
||||
id: '1',
|
||||
host: true,
|
||||
tenant: 'acme',
|
||||
});
|
||||
});
|
||||
|
||||
it(`should return 404 for mismatched host`, () => {
|
||||
return request(server)
|
||||
.get('/host/local-pipe/1')
|
||||
.expect(404)
|
||||
.expect({
|
||||
error: 'Not Found',
|
||||
message: 'Cannot GET /host/local-pipe/1',
|
||||
statusCode: 404,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await app.close();
|
||||
});
|
||||
|
||||
@@ -41,9 +41,11 @@ describe('Middleware (class)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = (await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()).createNestApplication();
|
||||
app = (
|
||||
await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
});
|
||||
|
||||
@@ -40,9 +40,11 @@ describe('Middleware (execution order)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = (await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()).createNestApplication();
|
||||
app = (
|
||||
await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
});
|
||||
|
||||
@@ -36,11 +36,11 @@ describe('Middleware (FastifyAdapter)', () => {
|
||||
let app: NestFastifyApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = (await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()).createNestApplication<NestFastifyApplication>(
|
||||
new FastifyAdapter(),
|
||||
);
|
||||
app = (
|
||||
await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()
|
||||
).createNestApplication<NestFastifyApplication>(new FastifyAdapter());
|
||||
|
||||
await app.init();
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ class TestController {
|
||||
}
|
||||
|
||||
@Get('tests/wildcard_nested')
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
wildcard_nested() {
|
||||
return RETURN_VALUE;
|
||||
}
|
||||
@@ -46,9 +47,11 @@ describe('Middleware', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = (await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()).createNestApplication();
|
||||
app = (
|
||||
await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()
|
||||
).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
});
|
||||
|
||||
277
integration/hello-world/package-lock.json
generated
277
integration/hello-world/package-lock.json
generated
@@ -5,59 +5,63 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.7.2.tgz",
|
||||
"integrity": "sha512-ASwS8tCSnHRVUFmERfnTKPLR3MLGsrDd+LYVOjwvXtNBPOJ2rBleZqCQrPh+UxGvygzBHH0Dn3Q+60br5kEvjQ==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.11.7.tgz",
|
||||
"integrity": "sha512-Rh3SYFAOLMlwZlWBsVNFo13Bt1NSoplOebs273w7ZRH8y3hTTsVcvJDKBAZ5a3RokEqYFZWjEXJpwRJ/7wzSNg==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.3"
|
||||
"axios": "0.19.2",
|
||||
"cli-color": "2.0.0",
|
||||
"tslib": "1.10.0",
|
||||
"uuid": "3.4.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.7.2.tgz",
|
||||
"integrity": "sha512-sXjuwlHaaiILK29/CLXS/iEeiD2Exzc+HdfPaOx95NstSON1CXuzn17J18c0w6j8Wlkt/fmPpmJQyq7HhU1g5A==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.11.7.tgz",
|
||||
"integrity": "sha512-91C6GPpMj/Zbnntxb9ANyBeFeZ3zIbYrUQgoYK6dHX38Fn/a0ptCuy7Rv9X8GGsTEt984+nhL18+IlglKHMNnw==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.7",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.3"
|
||||
"object-hash": "2.0.2",
|
||||
"path-to-regexp": "3.2.0",
|
||||
"tslib": "1.10.0",
|
||||
"uuid": "3.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"fast-safe-stringify": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
|
||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||
"path-to-regexp": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz",
|
||||
"integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.7.2.tgz",
|
||||
"integrity": "sha512-9k++Df8dvR6nk86b66YaETibVPSktnNb+jh+xAVKZPRzn8vLGcgThis00muX6SB+6gRSWJRRdBVHVyC9Z8BVmg==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.11.7.tgz",
|
||||
"integrity": "sha512-r9/OXhTjkpmLHO6jpCwBll/U9eAWVW9yhw4frwBy3bLofyGvimcUUMUUjrJI43cbzW5UGwrfZjZ2Da5YYg502Q==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
"optional": "0.1.4"
|
||||
"tslib": "1.10.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.7.2.tgz",
|
||||
"integrity": "sha512-tZzAgBMsxYBrxZ4tpOsBlnixdoWsptca6W5sUi71if4Bq0LjLF+ETH59Nl4t5eG0Jj9vNXUTRqH6/5bbaOoR0w==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.11.7.tgz",
|
||||
"integrity": "sha512-VuciM/LfkX3PQkG5ILDCjf/FQD6mykMuU9wqmreeeO+Tigkcirst9Di7l55aWWIYiwlOBP2VBscFi68Njwrc0w==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
"optional": "0.1.4",
|
||||
"tslib": "1.10.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.7.2.tgz",
|
||||
"integrity": "sha512-yT+c2V4BEY8Fw+4BSmxrBm94EJlijtO2SCGmPYcNMLwABoTtNOOorGSNHtzFXFveCqn8OBREHl1Q3B8yXQbaaw==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.11.7.tgz",
|
||||
"integrity": "sha512-ScE7F7j+cgGfYOb3M1pwQ4fQH/G6BaD9bzB+tOreQOVDJpF+3Zlxcue95vMYoh0LUQ6WXLj9dT8ucHBxF98ooQ==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
"iterare": "1.2.0",
|
||||
"tslib": "1.10.0"
|
||||
}
|
||||
},
|
||||
"@nuxtjs/opencollective": {
|
||||
@@ -71,9 +75,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "7.10.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.7.tgz",
|
||||
"integrity": "sha512-4I7+hXKyq7e1deuzX9udu0hPIYqSSkdKXtjow6fMnQ3OR9qkxIErGHbGY08YrfZJrCS1ajK8lOuzd0k3n2WM4A==",
|
||||
"version": "7.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.9.tgz",
|
||||
"integrity": "sha512-usSpgoUsRtO5xNV5YEPU8PPnHisFx8u0rokj1BPVn/hDF7zwUDzVLiuKZM38B7z8V2111Fj6kd4rGtQFUZpNOw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/validator": {
|
||||
@@ -116,9 +120,9 @@
|
||||
"integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA="
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz",
|
||||
"integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -153,12 +157,11 @@
|
||||
}
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
|
||||
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
|
||||
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
|
||||
"requires": {
|
||||
"follow-redirects": "1.5.10",
|
||||
"is-buffer": "^2.0.2"
|
||||
"follow-redirects": "1.5.10"
|
||||
}
|
||||
},
|
||||
"buffer-from": {
|
||||
@@ -183,26 +186,26 @@
|
||||
"integrity": "sha512-qsP+0xoavpOlJHuYsQJsN58HXSl8Jvveo+T37rEvCEeRfMWoytAyR0Ua/YsFgpM6AZYZ/og2PJwArwzJl1aXtQ=="
|
||||
},
|
||||
"class-validator": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.10.1.tgz",
|
||||
"integrity": "sha512-XC4drXqOzWUTmGExg7L3+n8V9u4HrnTFh3k8oFVH/B61O06ZyUZsZ3ONAC2EJ9nQl95nn8WOl3bo/n+u8Axm+w==",
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.11.0.tgz",
|
||||
"integrity": "sha512-niAmmSPFku9xsnpYYrddy8NZRrCX3yyoZ/rgPKOilE5BG0Ma1eVCIxpR4X0LasL/6BzbYzsutG+mSbAXlh4zNw==",
|
||||
"requires": {
|
||||
"@types/validator": "10.11.3",
|
||||
"google-libphonenumber": "^3.1.6",
|
||||
"validator": "11.1.0"
|
||||
"validator": "12.0.0"
|
||||
}
|
||||
},
|
||||
"cli-color": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.4.0.tgz",
|
||||
"integrity": "sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.0.tgz",
|
||||
"integrity": "sha512-a0VZ8LeraW0jTuCkuAGMNufareGHhyZU9z8OGsW0gXd1hZGi1SRuNRXdbGkraBBKnhyUhyebFWnRbp+dIn0f0A==",
|
||||
"requires": {
|
||||
"ansi-regex": "^2.1.1",
|
||||
"d": "1",
|
||||
"es5-ext": "^0.10.46",
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51",
|
||||
"es6-iterator": "^2.0.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"timers-ext": "^0.1.5"
|
||||
"timers-ext": "^0.1.7"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
@@ -234,9 +237,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
"version": "2.11.3",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.11.3.tgz",
|
||||
"integrity": "sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -268,9 +271,9 @@
|
||||
}
|
||||
},
|
||||
"deepmerge": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.0.0.tgz",
|
||||
"integrity": "sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww=="
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.1.1.tgz",
|
||||
"integrity": "sha512-+qO5WbNBKBaZez95TffdUDnGIo4+r5kmsX8aOb7PDHvXsTbghAmleuxjs6ytNaf5Eg4FGBXDS5vqO61TRi6BMg=="
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
@@ -279,19 +282,19 @@
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"version": "0.10.53",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
|
||||
"integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
"next-tick": "^1.0.0"
|
||||
"es6-symbol": "~3.1.3",
|
||||
"next-tick": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"es6-iterator": {
|
||||
@@ -305,12 +308,12 @@
|
||||
}
|
||||
},
|
||||
"es6-symbol": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.2.tgz",
|
||||
"integrity": "sha512-/ZypxQsArlv+KHpGvng52/Iz8by3EQPxhmbuz8yFG89N/caTFBSbcXONDw0aMjy827gQg26XAjP4uXFvnfINmQ==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||
"requires": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51"
|
||||
"ext": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"es6-weak-map": {
|
||||
@@ -338,6 +341,21 @@
|
||||
"es5-ext": "~0.10.14"
|
||||
}
|
||||
},
|
||||
"ext": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
|
||||
"integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
|
||||
"requires": {
|
||||
"type": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz",
|
||||
"integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
@@ -360,33 +378,33 @@
|
||||
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
|
||||
},
|
||||
"fast-json-stringify": {
|
||||
"version": "1.15.4",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-1.15.4.tgz",
|
||||
"integrity": "sha512-lsGTxL0OIGjGSUXgWUOdSgjCL/xMyMvMudfGN3D1zOLEv44fYZ1ZXmMyCON5XdpaiZN6nCXmU7GQg7fbXfPG4g==",
|
||||
"version": "1.15.5",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-1.15.5.tgz",
|
||||
"integrity": "sha512-isOtZqxaBElpIBG5kibeBDIPyMYCGuI271ujJvAiWE+HNMPCFNiJJLVoxfGwer0u6g9wjv6OWbVzSjBPfHAgmg==",
|
||||
"requires": {
|
||||
"ajv": "^6.8.1",
|
||||
"deepmerge": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"fast-redact": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-1.5.0.tgz",
|
||||
"integrity": "sha512-Afo61CgUjkzdvOKDHn08qnZ0kwck38AOGcMlvSGzvJbIab6soAP5rdoQayecGCDsD69AiF9vJBXyq31eoEO2tQ=="
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-2.0.0.tgz",
|
||||
"integrity": "sha512-zxpkULI9W9MNTK2sJ3BpPQrTEXFNESd2X6O1tXMFpK/XM0G5c5Rll2EVYZH2TqI3xRGK/VaJ+eEOt7pnENJpeA=="
|
||||
},
|
||||
"fast-safe-stringify": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz",
|
||||
"integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg=="
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
|
||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||
},
|
||||
"fastify": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.8.0.tgz",
|
||||
"integrity": "sha512-+HXe9xZzbj79680hlehEs0B1Z3e5RQT6CtPthseqgRJy2i7Wlro8EEdM7u7ewwL9XREjLWssCPlJiZ3G+t4qsw==",
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.10.0.tgz",
|
||||
"integrity": "sha512-ieWwtPZPpcurQlRBmWer6rSq/2WAKAI3yPkh2oBbQ98U5BnWjhcLXYYgBRTS1TDu2evwbXwnRVdLpILVC2O5XA==",
|
||||
"requires": {
|
||||
"abstract-logging": "^1.0.0",
|
||||
"ajv": "^6.10.2",
|
||||
"avvio": "^6.2.2",
|
||||
"fast-json-stringify": "^1.15.4",
|
||||
"fast-json-stringify": "^1.15.5",
|
||||
"find-my-way": "^2.0.0",
|
||||
"flatstr": "^1.0.12",
|
||||
"light-my-request": "^3.4.1",
|
||||
@@ -396,7 +414,7 @@
|
||||
"readable-stream": "^3.1.1",
|
||||
"rfdc": "^1.1.2",
|
||||
"secure-json-parse": "^1.0.0",
|
||||
"tiny-lru": "^6.0.1"
|
||||
"tiny-lru": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"fastq": {
|
||||
@@ -408,9 +426,9 @@
|
||||
}
|
||||
},
|
||||
"find-my-way": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.1.1.tgz",
|
||||
"integrity": "sha512-yznKDx1xELFkTrV2Ke9x3IOr9zn5isdFA2Af/NKjU8kmQQhtn3TmqrVZ6OiLO5pj1dAScxe4dAo92ieG4nGcoA==",
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.2.1.tgz",
|
||||
"integrity": "sha512-pzZA9/PlhDGG5PRzmd4vH4AbKW7FO68RE7q2I3NzjJHcVPukYbDA7bPdArg7ySKfS6pKki+qhrawFoN6aNZfjA==",
|
||||
"requires": {
|
||||
"fast-decode-uri-component": "^1.0.0",
|
||||
"safe-regex2": "^2.0.0",
|
||||
@@ -453,9 +471,9 @@
|
||||
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
||||
},
|
||||
"google-libphonenumber": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.5.tgz",
|
||||
"integrity": "sha512-Y0r7MFCI11UDLn0KaMPBEInhROyIOkWkQIyvWMFVF2I+h+sHE3vbl5a7FVe39td6u/w+nlKDdUMP9dMOZyv+2Q=="
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.6.tgz",
|
||||
"integrity": "sha512-6QCQAaKJlSd/1dUqvdQf7zzfb3uiZHsG8yhCfOdCVRfMuPZ/VDIEB47y5SYwjPQJPs7ebfW5jj6PeobB9JJ4JA=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
@@ -472,11 +490,6 @@
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
|
||||
"integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA=="
|
||||
},
|
||||
"is-buffer": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
|
||||
"integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw=="
|
||||
},
|
||||
"is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
|
||||
@@ -587,9 +600,9 @@
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"object-hash": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
|
||||
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA=="
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.0.2.tgz",
|
||||
"integrity": "sha512-b+2AKjAf6uQlxxv8ChHdM+VT4eeX+ZSwv+pk2xIXZWbo+yxn4/En1iC+GHe/OFYa9on0AhFF2PvuAcFHoiiHaA=="
|
||||
},
|
||||
"optional": {
|
||||
"version": "0.1.4",
|
||||
@@ -597,17 +610,17 @@
|
||||
"integrity": "sha512-gtvrrCfkE08wKcgXaVwQVgwEQ8vel2dc5DDBn9RLQZ3YtmtkBss6A2HY6BnJH4N/4Ku97Ri/SF8sNWE2225WJw=="
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.0.0.tgz",
|
||||
"integrity": "sha512-ZOtfhPttCrqp2M1PBBH4X13XlvnfhIwD7yCLx+GoGoXRPQyxGOTdQMpIzPSPKXAJT/JQrdfFrgdJOyAzvgpQ9A=="
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.1.0.tgz",
|
||||
"integrity": "sha512-PtHLisEvUOepjc+sStXxJ/pDV/s5UBTOKWJY2SOz3e6E/iN/jLknY9WL72kTwRrwXDUbZTEAtSnJbz2fF127DA=="
|
||||
},
|
||||
"pino": {
|
||||
"version": "5.13.2",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.2.tgz",
|
||||
"integrity": "sha512-WwOSCy36/gWhinsqWqAnuwIi2WtcH+jvoyeLm3bjUALIrzWIst0AovQjK4jVvSN2l64KFPfi3gd2fjsTovjdLQ==",
|
||||
"version": "5.13.4",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.4.tgz",
|
||||
"integrity": "sha512-heeg8m8FZY8Nl3nuuD+msJUmhamqoGl7JXoTExh9YpGajzz6LYbVByUqrjbf4sCEMYFsqdcqnTJWiSY660DraQ==",
|
||||
"requires": {
|
||||
"fast-redact": "^1.4.4",
|
||||
"fast-safe-stringify": "^2.0.6",
|
||||
"fast-redact": "^2.0.0",
|
||||
"fast-safe-stringify": "^2.0.7",
|
||||
"flatstr": "^1.0.9",
|
||||
"pino-std-serializers": "^2.3.0",
|
||||
"quick-format-unescaped": "^3.0.2",
|
||||
@@ -646,9 +659,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"quick-format-unescaped": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-3.0.2.tgz",
|
||||
"integrity": "sha512-FXTaCkwvpIlkdKeGDNgcq07SXWS383noQUuZjvdE1QcTt+eLuqof6/BDiEPqB59FWLie/l91+HtlJSw7iCViSA=="
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-3.0.3.tgz",
|
||||
"integrity": "sha512-dy1yjycmn9blucmJLXOfZDx1ikZJUi6E8bBZLnhPG5gBrVhHXx2xVyqqgKBubVNEXmx51dBACMHpoMQK/N/AXQ=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.4.0",
|
||||
@@ -681,9 +694,9 @@
|
||||
"integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -713,9 +726,9 @@
|
||||
"integrity": "sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg=="
|
||||
},
|
||||
"sonic-boom": {
|
||||
"version": "0.7.5",
|
||||
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-0.7.5.tgz",
|
||||
"integrity": "sha512-1pKrnAV6RfvntPnarY71tpthFTM3pWZWWQdghZY8ARjtDPGzG/inxqSuRwQY/7V1woUjfyxPb437zn4p5phgnQ==",
|
||||
"version": "0.7.6",
|
||||
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-0.7.6.tgz",
|
||||
"integrity": "sha512-k9E2QQ4zxuVRLDW+ZW6ISzJs3wlEorVdmM7ApDgor7wsGKSDG5YGHsGmgLY4XYh4DMlr/2ap2BWAE7yTFJtWnQ==",
|
||||
"requires": {
|
||||
"flatstr": "^1.0.12"
|
||||
}
|
||||
@@ -727,9 +740,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
|
||||
"integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -777,7 +790,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==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -829,21 +842,21 @@
|
||||
}
|
||||
},
|
||||
"tiny-lru": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-6.0.1.tgz",
|
||||
"integrity": "sha512-k/vdHz+bFALjmik0URLWBYNuO0hCABTL5dullbZBXvFDdlL8RrKaeLR6YuHfX+6ZXOLkHw+HpNLCUA7DtLMQmg=="
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-7.0.1.tgz",
|
||||
"integrity": "sha512-BImmnAPNkaN7XjrvmOr4JAT2U6ubLmxiD9iDBMMow3/026OZ+yiuWzM1F0TgECLfq1KO2YkXEIJ2h6sPjXv9XA=="
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"version": "8.6.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz",
|
||||
"integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^3.0.0"
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
@@ -857,9 +870,9 @@
|
||||
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz",
|
||||
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ=="
|
||||
},
|
||||
"uri-js": {
|
||||
"version": "4.2.2",
|
||||
@@ -875,14 +888,14 @@
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
||||
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-11.1.0.tgz",
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-12.0.0.tgz",
|
||||
"integrity": "sha512-r5zA1cQBEOgYlesRmSEwc9LkbfNLTtji+vWyaHzRZUxCTHdsX3bd+sdHfs5tGZ2W6ILGGsxWxCNwT/h3IY/3ng=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.7.2",
|
||||
"@nestjs/core": "6.7.2",
|
||||
"@nestjs/microservices": "6.7.2",
|
||||
"@nestjs/testing": "6.7.2",
|
||||
"@nestjs/websockets": "6.7.2",
|
||||
"@nestjs/common": "6.11.7",
|
||||
"@nestjs/core": "6.11.7",
|
||||
"@nestjs/microservices": "6.11.7",
|
||||
"@nestjs/testing": "6.11.7",
|
||||
"@nestjs/websockets": "6.11.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.1",
|
||||
"fastify": "2.8.0",
|
||||
"class-validator": "0.11.0",
|
||||
"fastify": "2.10.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
"rxjs": "6.5.4",
|
||||
"typescript": "3.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"@types/node": "7.10.9",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.4.1"
|
||||
"ts-node": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HelloModule } from './hello/hello.module';
|
||||
import { HostModule } from './host/host.module';
|
||||
|
||||
@Module({
|
||||
imports: [HelloModule],
|
||||
imports: [HelloModule, HostModule],
|
||||
})
|
||||
export class ApplicationModule {}
|
||||
|
||||
@@ -15,7 +15,7 @@ export class HelloController {
|
||||
|
||||
@Get('async')
|
||||
async asyncGreeting(): Promise<string> {
|
||||
return await this.helloService.greeting();
|
||||
return this.helloService.greeting();
|
||||
}
|
||||
|
||||
@Get('stream')
|
||||
|
||||
10
integration/hello-world/src/host/dto/test.dto.ts
Normal file
10
integration/hello-world/src/host/dto/test.dto.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';
|
||||
|
||||
export class TestDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
string: string;
|
||||
|
||||
@IsNumber()
|
||||
number: number;
|
||||
}
|
||||
37
integration/hello-world/src/host/host.controller.ts
Normal file
37
integration/hello-world/src/host/host.controller.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Controller, Get, Header, HostParam, Param } from '@nestjs/common';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { HostService } from './host.service';
|
||||
import { UserByIdPipe } from './users/user-by-id.pipe';
|
||||
|
||||
@Controller({
|
||||
path: 'host',
|
||||
host: ':tenant.example.com',
|
||||
})
|
||||
export class HostController {
|
||||
constructor(private readonly hostService: HostService) {}
|
||||
|
||||
@Get()
|
||||
@Header('Authorization', 'Bearer')
|
||||
greeting(@HostParam('tenant') tenant: string): string {
|
||||
return `${this.hostService.greeting()} tenant=${tenant}`;
|
||||
}
|
||||
|
||||
@Get('async')
|
||||
async asyncGreeting(@HostParam('tenant') tenant: string): Promise<string> {
|
||||
return `${await this.hostService.greeting()} tenant=${tenant}`;
|
||||
}
|
||||
|
||||
@Get('stream')
|
||||
streamGreeting(@HostParam('tenant') tenant: string): Observable<string> {
|
||||
return of(`${this.hostService.greeting()} tenant=${tenant}`);
|
||||
}
|
||||
|
||||
@Get('local-pipe/:id')
|
||||
localPipe(
|
||||
@Param('id', UserByIdPipe)
|
||||
user: any,
|
||||
@HostParam('tenant') tenant: string,
|
||||
): any {
|
||||
return { ...user, tenant };
|
||||
}
|
||||
}
|
||||
10
integration/hello-world/src/host/host.module.ts
Normal file
10
integration/hello-world/src/host/host.module.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HostController } from './host.controller';
|
||||
import { HostService } from './host.service';
|
||||
import { UsersService } from './users/users.service';
|
||||
|
||||
@Module({
|
||||
controllers: [HostController],
|
||||
providers: [HostService, UsersService],
|
||||
})
|
||||
export class HostModule {}
|
||||
8
integration/hello-world/src/host/host.service.ts
Normal file
8
integration/hello-world/src/host/host.service.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class HostService {
|
||||
greeting(): string {
|
||||
return 'Host Greeting!';
|
||||
}
|
||||
}
|
||||
11
integration/hello-world/src/host/users/user-by-id.pipe.ts
Normal file
11
integration/hello-world/src/host/users/user-by-id.pipe.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { PipeTransform, Injectable, ArgumentMetadata } from '@nestjs/common';
|
||||
import { UsersService } from './users.service';
|
||||
|
||||
@Injectable()
|
||||
export class UserByIdPipe implements PipeTransform<string> {
|
||||
constructor(private readonly usersService: UsersService) {}
|
||||
|
||||
transform(value: string, metadata: ArgumentMetadata) {
|
||||
return this.usersService.findById(value);
|
||||
}
|
||||
}
|
||||
8
integration/hello-world/src/host/users/users.service.ts
Normal file
8
integration/hello-world/src/host/users/users.service.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class UsersService {
|
||||
findById(id: string) {
|
||||
return { id, host: true };
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"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": []
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Injectable, BeforeApplicationShutdown } from '@nestjs/common';
|
||||
import { BeforeApplicationShutdown, Injectable } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import * as Sinon from 'sinon';
|
||||
@@ -19,7 +19,7 @@ describe('BeforeApplicationShutdown', () => {
|
||||
const instance = module.get(TestInjectable);
|
||||
expect(instance.beforeApplicationShutdown.called).to.be.true;
|
||||
});
|
||||
|
||||
/*
|
||||
it('should not stop the server once beforeApplicationShutdown has been called', async () => {
|
||||
let resolve;
|
||||
const promise = new Promise(r => (resolve = r));
|
||||
@@ -38,18 +38,16 @@ describe('BeforeApplicationShutdown', () => {
|
||||
|
||||
app.close();
|
||||
|
||||
expect(((module as any).dispose as Sinon.SinonSpy).called, 'dispose')
|
||||
.to.be.false;
|
||||
expect(((module as any).dispose as Sinon.SinonSpy).called, 'dispose').to.be
|
||||
.false;
|
||||
|
||||
resolve();
|
||||
|
||||
setTimeout(
|
||||
() =>
|
||||
expect(
|
||||
((module as any).dispose as Sinon.SinonSpy).called,
|
||||
'dispose',
|
||||
).to.be.true,
|
||||
expect(((module as any).dispose as Sinon.SinonSpy).called, 'dispose').to
|
||||
.be.true,
|
||||
0,
|
||||
);
|
||||
});
|
||||
});*/
|
||||
});
|
||||
|
||||
@@ -23,22 +23,22 @@ describe('OnApplicationBootstrap', () => {
|
||||
it('should not throw an error when onApplicationBootstrap is null', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onApplicationBootstrap: null } }
|
||||
{ provide: 'TEST', useValue: { onApplicationBootstrap: null } },
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
await app.init().then(obj => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
|
||||
it('should not throw an error when onApplicationBootstrap is undefined', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onApplicationBootstrap: undefined } }
|
||||
{ provide: 'TEST', useValue: { onApplicationBootstrap: undefined } },
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
await app.init().then(obj => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable, OnModuleDestroy } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import * as Sinon from 'sinon';
|
||||
import { Injectable, OnModuleDestroy } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
class TestInjectable implements OnModuleDestroy {
|
||||
@@ -22,23 +22,21 @@ describe('OnModuleDestroy', () => {
|
||||
|
||||
it('should not throw an error when onModuleDestroy is null', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onModuleDestroy: null } }
|
||||
],
|
||||
providers: [{ provide: 'TEST', useValue: { onModuleDestroy: null } }],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
await app.init().then(obj => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
|
||||
it('should not throw an error when onModuleDestroy is undefined', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onModuleDestroy: undefined } }
|
||||
{ provide: 'TEST', useValue: { onModuleDestroy: undefined } },
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
await app.init().then(obj => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,23 +22,19 @@ describe('OnModuleInit', () => {
|
||||
|
||||
it('should not throw an error when onModuleInit is null', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onModuleInit: null } }
|
||||
],
|
||||
providers: [{ provide: 'TEST', useValue: { onModuleInit: null } }],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
await app.init().then(obj => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
|
||||
it('should not throw an error when onModuleInit is undefined', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onModuleInit: undefined } }
|
||||
],
|
||||
providers: [{ provide: 'TEST', useValue: { onModuleInit: undefined } }],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
await app.init().then(obj => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
});
|
||||
|
||||
175
integration/hooks/package-lock.json
generated
175
integration/hooks/package-lock.json
generated
@@ -5,26 +5,28 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.7.2.tgz",
|
||||
"integrity": "sha512-ASwS8tCSnHRVUFmERfnTKPLR3MLGsrDd+LYVOjwvXtNBPOJ2rBleZqCQrPh+UxGvygzBHH0Dn3Q+60br5kEvjQ==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.11.7.tgz",
|
||||
"integrity": "sha512-Rh3SYFAOLMlwZlWBsVNFo13Bt1NSoplOebs273w7ZRH8y3hTTsVcvJDKBAZ5a3RokEqYFZWjEXJpwRJ/7wzSNg==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.3"
|
||||
"axios": "0.19.2",
|
||||
"cli-color": "2.0.0",
|
||||
"tslib": "1.10.0",
|
||||
"uuid": "3.4.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.7.2.tgz",
|
||||
"integrity": "sha512-sXjuwlHaaiILK29/CLXS/iEeiD2Exzc+HdfPaOx95NstSON1CXuzn17J18c0w6j8Wlkt/fmPpmJQyq7HhU1g5A==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.11.7.tgz",
|
||||
"integrity": "sha512-91C6GPpMj/Zbnntxb9ANyBeFeZ3zIbYrUQgoYK6dHX38Fn/a0ptCuy7Rv9X8GGsTEt984+nhL18+IlglKHMNnw==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.7",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.3"
|
||||
"object-hash": "2.0.2",
|
||||
"path-to-regexp": "3.2.0",
|
||||
"tslib": "1.10.0",
|
||||
"uuid": "3.4.0"
|
||||
}
|
||||
},
|
||||
"@nuxtjs/opencollective": {
|
||||
@@ -38,9 +40,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "7.10.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.7.tgz",
|
||||
"integrity": "sha512-4I7+hXKyq7e1deuzX9udu0hPIYqSSkdKXtjow6fMnQ3OR9qkxIErGHbGY08YrfZJrCS1ajK8lOuzd0k3n2WM4A==",
|
||||
"version": "7.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.9.tgz",
|
||||
"integrity": "sha512-usSpgoUsRtO5xNV5YEPU8PPnHisFx8u0rokj1BPVn/hDF7zwUDzVLiuKZM38B7z8V2111Fj6kd4rGtQFUZpNOw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/validator": {
|
||||
@@ -62,9 +64,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz",
|
||||
"integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -74,12 +76,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
|
||||
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
|
||||
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
|
||||
"requires": {
|
||||
"follow-redirects": "1.5.10",
|
||||
"is-buffer": "^2.0.2"
|
||||
"follow-redirects": "1.5.10"
|
||||
}
|
||||
},
|
||||
"buffer-from": {
|
||||
@@ -104,26 +105,26 @@
|
||||
"integrity": "sha512-qsP+0xoavpOlJHuYsQJsN58HXSl8Jvveo+T37rEvCEeRfMWoytAyR0Ua/YsFgpM6AZYZ/og2PJwArwzJl1aXtQ=="
|
||||
},
|
||||
"class-validator": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.10.1.tgz",
|
||||
"integrity": "sha512-XC4drXqOzWUTmGExg7L3+n8V9u4HrnTFh3k8oFVH/B61O06ZyUZsZ3ONAC2EJ9nQl95nn8WOl3bo/n+u8Axm+w==",
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.11.0.tgz",
|
||||
"integrity": "sha512-niAmmSPFku9xsnpYYrddy8NZRrCX3yyoZ/rgPKOilE5BG0Ma1eVCIxpR4X0LasL/6BzbYzsutG+mSbAXlh4zNw==",
|
||||
"requires": {
|
||||
"@types/validator": "10.11.3",
|
||||
"google-libphonenumber": "^3.1.6",
|
||||
"validator": "11.1.0"
|
||||
"validator": "12.0.0"
|
||||
}
|
||||
},
|
||||
"cli-color": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.4.0.tgz",
|
||||
"integrity": "sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.0.tgz",
|
||||
"integrity": "sha512-a0VZ8LeraW0jTuCkuAGMNufareGHhyZU9z8OGsW0gXd1hZGi1SRuNRXdbGkraBBKnhyUhyebFWnRbp+dIn0f0A==",
|
||||
"requires": {
|
||||
"ansi-regex": "^2.1.1",
|
||||
"d": "1",
|
||||
"es5-ext": "^0.10.46",
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51",
|
||||
"es6-iterator": "^2.0.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"timers-ext": "^0.1.5"
|
||||
"timers-ext": "^0.1.7"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
@@ -155,9 +156,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
"version": "2.11.3",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.11.3.tgz",
|
||||
"integrity": "sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -196,19 +197,19 @@
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"version": "0.10.53",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
|
||||
"integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
"next-tick": "^1.0.0"
|
||||
"es6-symbol": "~3.1.3",
|
||||
"next-tick": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"es6-iterator": {
|
||||
@@ -222,12 +223,12 @@
|
||||
}
|
||||
},
|
||||
"es6-symbol": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.2.tgz",
|
||||
"integrity": "sha512-/ZypxQsArlv+KHpGvng52/Iz8by3EQPxhmbuz8yFG89N/caTFBSbcXONDw0aMjy827gQg26XAjP4uXFvnfINmQ==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||
"requires": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51"
|
||||
"ext": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"es6-weak-map": {
|
||||
@@ -255,6 +256,21 @@
|
||||
"es5-ext": "~0.10.14"
|
||||
}
|
||||
},
|
||||
"ext": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
|
||||
"integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
|
||||
"requires": {
|
||||
"type": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz",
|
||||
"integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
@@ -307,9 +323,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"google-libphonenumber": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.5.tgz",
|
||||
"integrity": "sha512-Y0r7MFCI11UDLn0KaMPBEInhROyIOkWkQIyvWMFVF2I+h+sHE3vbl5a7FVe39td6u/w+nlKDdUMP9dMOZyv+2Q=="
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.6.tgz",
|
||||
"integrity": "sha512-6QCQAaKJlSd/1dUqvdQf7zzfb3uiZHsG8yhCfOdCVRfMuPZ/VDIEB47y5SYwjPQJPs7ebfW5jj6PeobB9JJ4JA=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
@@ -322,11 +338,6 @@
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||
"dev": true
|
||||
},
|
||||
"is-buffer": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
|
||||
"integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw=="
|
||||
},
|
||||
"is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
|
||||
@@ -410,14 +421,14 @@
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"object-hash": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
|
||||
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA=="
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.0.2.tgz",
|
||||
"integrity": "sha512-b+2AKjAf6uQlxxv8ChHdM+VT4eeX+ZSwv+pk2xIXZWbo+yxn4/En1iC+GHe/OFYa9on0AhFF2PvuAcFHoiiHaA=="
|
||||
},
|
||||
"optional": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/optional/-/optional-0.1.4.tgz",
|
||||
"integrity": "sha512-gtvrrCfkE08wKcgXaVwQVgwEQ8vel2dc5DDBn9RLQZ3YtmtkBss6A2HY6BnJH4N/4Ku97Ri/SF8sNWE2225WJw=="
|
||||
"path-to-regexp": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz",
|
||||
"integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
@@ -437,9 +448,9 @@
|
||||
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -457,9 +468,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
|
||||
"integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -544,16 +555,16 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"version": "8.6.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz",
|
||||
"integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^3.0.0"
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
@@ -567,9 +578,9 @@
|
||||
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz",
|
||||
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
@@ -578,14 +589,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
||||
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-11.1.0.tgz",
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-12.0.0.tgz",
|
||||
"integrity": "sha512-r5zA1cQBEOgYlesRmSEwc9LkbfNLTtji+vWyaHzRZUxCTHdsX3bd+sdHfs5tGZ2W6ILGGsxWxCNwT/h3IY/3ng=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.7.2",
|
||||
"@nestjs/core": "6.7.2",
|
||||
"@nestjs/common": "6.11.7",
|
||||
"@nestjs/core": "6.11.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.1",
|
||||
"class-validator": "0.11.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
"rxjs": "6.5.4",
|
||||
"typescript": "3.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"@types/node": "7.10.9",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.4.1"
|
||||
"ts-node": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import { Injectable, OnApplicationShutdown, BeforeApplicationShutdown, Module } from '@nestjs/common';
|
||||
import {
|
||||
BeforeApplicationShutdown,
|
||||
Injectable,
|
||||
Module,
|
||||
OnApplicationShutdown,
|
||||
} from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
const SIGNAL = process.argv[2];
|
||||
const SIGNAL_TO_LISTEN = process.argv[3];
|
||||
|
||||
@Injectable()
|
||||
class TestInjectable implements OnApplicationShutdown, BeforeApplicationShutdown {
|
||||
class TestInjectable
|
||||
implements OnApplicationShutdown, BeforeApplicationShutdown {
|
||||
beforeApplicationShutdown(signal: string) {
|
||||
console.log('beforeApplicationShutdown ' + signal);
|
||||
}
|
||||
@@ -17,7 +23,7 @@ class TestInjectable implements OnApplicationShutdown, BeforeApplicationShutdown
|
||||
@Module({
|
||||
providers: [TestInjectable],
|
||||
})
|
||||
class AppModule { }
|
||||
class AppModule {}
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule, { logger: true });
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"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": []
|
||||
}
|
||||
@@ -30,7 +30,9 @@ describe('Core Injectables', () => {
|
||||
});
|
||||
|
||||
it('should provide the current Module as provider', () => {
|
||||
const module = testingModule.get<CoreInjectablesModule>(CoreInjectablesModule);
|
||||
const module = testingModule.get<CoreInjectablesModule>(
|
||||
CoreInjectablesModule,
|
||||
);
|
||||
expect(module).to.not.be.undefined;
|
||||
expect(module.constructor.name).to.be.eq('CoreInjectablesModule');
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ import { expect } from 'chai';
|
||||
import { DependencyService } from '../src/properties/dependency.service';
|
||||
import { PropertiesModule } from '../src/properties/properties.module';
|
||||
import { PropertiesService } from '../src/properties/properties.service';
|
||||
import { UnknownDependenciesException } from '@nestjs/core/errors/exceptions/unknown-dependencies.exception';
|
||||
|
||||
describe('Injector', () => {
|
||||
it('should resolve property-based dependencies', async () => {
|
||||
@@ -14,5 +15,30 @@ describe('Injector', () => {
|
||||
|
||||
expect(app.get(PropertiesService).service).to.be.eql(dependency);
|
||||
expect(app.get(PropertiesService).token).to.be.true;
|
||||
expect(app.get(PropertiesService).symbolToken).to.be.true;
|
||||
});
|
||||
|
||||
it('should throw UnknownDependenciesException when dependency is not met', async () => {
|
||||
let exception;
|
||||
|
||||
try {
|
||||
const builder = Test.createTestingModule({
|
||||
providers: [
|
||||
DependencyService,
|
||||
PropertiesService,
|
||||
{
|
||||
provide: 'token',
|
||||
useValue: true,
|
||||
},
|
||||
// symbol token is missing here
|
||||
],
|
||||
});
|
||||
const app = await builder.compile();
|
||||
app.get(DependencyService);
|
||||
} catch (e) {
|
||||
exception = e;
|
||||
}
|
||||
|
||||
expect(exception).to.be.instanceOf(UnknownDependenciesException);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { createContextId } from '@nestjs/core';
|
||||
import { InvalidClassScopeException } from '@nestjs/core/errors/exceptions/invalid-class-scope.exception';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
@@ -16,8 +17,9 @@ describe('Scoped Instances', () => {
|
||||
});
|
||||
|
||||
it('should dynamically resolve transient provider', async () => {
|
||||
const transient1 = await testingModule.resolve(TransientService);
|
||||
const transient2 = await testingModule.resolve(TransientService);
|
||||
const contextId = createContextId();
|
||||
const transient1 = await testingModule.resolve(TransientService, contextId);
|
||||
const transient2 = await testingModule.resolve(TransientService, contextId);
|
||||
|
||||
expect(transient1).to.be.instanceOf(TransientService);
|
||||
expect(transient2).to.be.instanceOf(TransientService);
|
||||
|
||||
198
integration/injector/package-lock.json
generated
198
integration/injector/package-lock.json
generated
@@ -5,52 +5,56 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.7.2.tgz",
|
||||
"integrity": "sha512-ASwS8tCSnHRVUFmERfnTKPLR3MLGsrDd+LYVOjwvXtNBPOJ2rBleZqCQrPh+UxGvygzBHH0Dn3Q+60br5kEvjQ==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.11.7.tgz",
|
||||
"integrity": "sha512-Rh3SYFAOLMlwZlWBsVNFo13Bt1NSoplOebs273w7ZRH8y3hTTsVcvJDKBAZ5a3RokEqYFZWjEXJpwRJ/7wzSNg==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.3"
|
||||
"axios": "0.19.2",
|
||||
"cli-color": "2.0.0",
|
||||
"tslib": "1.10.0",
|
||||
"uuid": "3.4.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.7.2.tgz",
|
||||
"integrity": "sha512-sXjuwlHaaiILK29/CLXS/iEeiD2Exzc+HdfPaOx95NstSON1CXuzn17J18c0w6j8Wlkt/fmPpmJQyq7HhU1g5A==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.11.7.tgz",
|
||||
"integrity": "sha512-91C6GPpMj/Zbnntxb9ANyBeFeZ3zIbYrUQgoYK6dHX38Fn/a0ptCuy7Rv9X8GGsTEt984+nhL18+IlglKHMNnw==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.7",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.3"
|
||||
"object-hash": "2.0.2",
|
||||
"path-to-regexp": "3.2.0",
|
||||
"tslib": "1.10.0",
|
||||
"uuid": "3.4.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.7.2.tgz",
|
||||
"integrity": "sha512-9k++Df8dvR6nk86b66YaETibVPSktnNb+jh+xAVKZPRzn8vLGcgThis00muX6SB+6gRSWJRRdBVHVyC9Z8BVmg==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.11.7.tgz",
|
||||
"integrity": "sha512-r9/OXhTjkpmLHO6jpCwBll/U9eAWVW9yhw4frwBy3bLofyGvimcUUMUUjrJI43cbzW5UGwrfZjZ2Da5YYg502Q==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
"optional": "0.1.4"
|
||||
"tslib": "1.10.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.7.2.tgz",
|
||||
"integrity": "sha512-tZzAgBMsxYBrxZ4tpOsBlnixdoWsptca6W5sUi71if4Bq0LjLF+ETH59Nl4t5eG0Jj9vNXUTRqH6/5bbaOoR0w==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.11.7.tgz",
|
||||
"integrity": "sha512-VuciM/LfkX3PQkG5ILDCjf/FQD6mykMuU9wqmreeeO+Tigkcirst9Di7l55aWWIYiwlOBP2VBscFi68Njwrc0w==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
"optional": "0.1.4",
|
||||
"tslib": "1.10.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.7.2.tgz",
|
||||
"integrity": "sha512-yT+c2V4BEY8Fw+4BSmxrBm94EJlijtO2SCGmPYcNMLwABoTtNOOorGSNHtzFXFveCqn8OBREHl1Q3B8yXQbaaw==",
|
||||
"version": "6.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.11.7.tgz",
|
||||
"integrity": "sha512-ScE7F7j+cgGfYOb3M1pwQ4fQH/G6BaD9bzB+tOreQOVDJpF+3Zlxcue95vMYoh0LUQ6WXLj9dT8ucHBxF98ooQ==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
"iterare": "1.2.0",
|
||||
"tslib": "1.10.0"
|
||||
}
|
||||
},
|
||||
"@nuxtjs/opencollective": {
|
||||
@@ -64,9 +68,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "7.10.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.7.tgz",
|
||||
"integrity": "sha512-4I7+hXKyq7e1deuzX9udu0hPIYqSSkdKXtjow6fMnQ3OR9qkxIErGHbGY08YrfZJrCS1ajK8lOuzd0k3n2WM4A==",
|
||||
"version": "7.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.9.tgz",
|
||||
"integrity": "sha512-usSpgoUsRtO5xNV5YEPU8PPnHisFx8u0rokj1BPVn/hDF7zwUDzVLiuKZM38B7z8V2111Fj6kd4rGtQFUZpNOw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/validator": {
|
||||
@@ -88,9 +92,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz",
|
||||
"integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -100,12 +104,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
|
||||
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
|
||||
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
|
||||
"requires": {
|
||||
"follow-redirects": "1.5.10",
|
||||
"is-buffer": "^2.0.2"
|
||||
"follow-redirects": "1.5.10"
|
||||
}
|
||||
},
|
||||
"buffer-from": {
|
||||
@@ -130,26 +133,26 @@
|
||||
"integrity": "sha512-qsP+0xoavpOlJHuYsQJsN58HXSl8Jvveo+T37rEvCEeRfMWoytAyR0Ua/YsFgpM6AZYZ/og2PJwArwzJl1aXtQ=="
|
||||
},
|
||||
"class-validator": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.10.1.tgz",
|
||||
"integrity": "sha512-XC4drXqOzWUTmGExg7L3+n8V9u4HrnTFh3k8oFVH/B61O06ZyUZsZ3ONAC2EJ9nQl95nn8WOl3bo/n+u8Axm+w==",
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.11.0.tgz",
|
||||
"integrity": "sha512-niAmmSPFku9xsnpYYrddy8NZRrCX3yyoZ/rgPKOilE5BG0Ma1eVCIxpR4X0LasL/6BzbYzsutG+mSbAXlh4zNw==",
|
||||
"requires": {
|
||||
"@types/validator": "10.11.3",
|
||||
"google-libphonenumber": "^3.1.6",
|
||||
"validator": "11.1.0"
|
||||
"validator": "12.0.0"
|
||||
}
|
||||
},
|
||||
"cli-color": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.4.0.tgz",
|
||||
"integrity": "sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.0.tgz",
|
||||
"integrity": "sha512-a0VZ8LeraW0jTuCkuAGMNufareGHhyZU9z8OGsW0gXd1hZGi1SRuNRXdbGkraBBKnhyUhyebFWnRbp+dIn0f0A==",
|
||||
"requires": {
|
||||
"ansi-regex": "^2.1.1",
|
||||
"d": "1",
|
||||
"es5-ext": "^0.10.46",
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51",
|
||||
"es6-iterator": "^2.0.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"timers-ext": "^0.1.5"
|
||||
"timers-ext": "^0.1.7"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
@@ -181,9 +184,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
"version": "2.11.3",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.11.3.tgz",
|
||||
"integrity": "sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -222,19 +225,19 @@
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"version": "0.10.53",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
|
||||
"integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
"next-tick": "^1.0.0"
|
||||
"es6-symbol": "~3.1.3",
|
||||
"next-tick": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"es6-iterator": {
|
||||
@@ -248,12 +251,12 @@
|
||||
}
|
||||
},
|
||||
"es6-symbol": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.2.tgz",
|
||||
"integrity": "sha512-/ZypxQsArlv+KHpGvng52/Iz8by3EQPxhmbuz8yFG89N/caTFBSbcXONDw0aMjy827gQg26XAjP4uXFvnfINmQ==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||
"requires": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51"
|
||||
"ext": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"es6-weak-map": {
|
||||
@@ -281,6 +284,21 @@
|
||||
"es5-ext": "~0.10.14"
|
||||
}
|
||||
},
|
||||
"ext": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
|
||||
"integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
|
||||
"requires": {
|
||||
"type": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz",
|
||||
"integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
@@ -333,9 +351,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"google-libphonenumber": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.5.tgz",
|
||||
"integrity": "sha512-Y0r7MFCI11UDLn0KaMPBEInhROyIOkWkQIyvWMFVF2I+h+sHE3vbl5a7FVe39td6u/w+nlKDdUMP9dMOZyv+2Q=="
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.6.tgz",
|
||||
"integrity": "sha512-6QCQAaKJlSd/1dUqvdQf7zzfb3uiZHsG8yhCfOdCVRfMuPZ/VDIEB47y5SYwjPQJPs7ebfW5jj6PeobB9JJ4JA=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
@@ -348,11 +366,6 @@
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||
"dev": true
|
||||
},
|
||||
"is-buffer": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
|
||||
"integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw=="
|
||||
},
|
||||
"is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
|
||||
@@ -441,15 +454,20 @@
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"object-hash": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
|
||||
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA=="
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.0.2.tgz",
|
||||
"integrity": "sha512-b+2AKjAf6uQlxxv8ChHdM+VT4eeX+ZSwv+pk2xIXZWbo+yxn4/En1iC+GHe/OFYa9on0AhFF2PvuAcFHoiiHaA=="
|
||||
},
|
||||
"optional": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/optional/-/optional-0.1.4.tgz",
|
||||
"integrity": "sha512-gtvrrCfkE08wKcgXaVwQVgwEQ8vel2dc5DDBn9RLQZ3YtmtkBss6A2HY6BnJH4N/4Ku97Ri/SF8sNWE2225WJw=="
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz",
|
||||
"integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
@@ -468,9 +486,9 @@
|
||||
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -488,9 +506,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
|
||||
"integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -575,16 +593,16 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"version": "8.6.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz",
|
||||
"integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^3.0.0"
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
@@ -598,9 +616,9 @@
|
||||
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.2.tgz",
|
||||
"integrity": "sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
@@ -609,14 +627,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
||||
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-11.1.0.tgz",
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
"version": "12.0.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-12.0.0.tgz",
|
||||
"integrity": "sha512-r5zA1cQBEOgYlesRmSEwc9LkbfNLTtji+vWyaHzRZUxCTHdsX3bd+sdHfs5tGZ2W6ILGGsxWxCNwT/h3IY/3ng=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.7.2",
|
||||
"@nestjs/core": "6.7.2",
|
||||
"@nestjs/microservices": "6.7.2",
|
||||
"@nestjs/testing": "6.7.2",
|
||||
"@nestjs/websockets": "6.7.2",
|
||||
"@nestjs/common": "6.11.7",
|
||||
"@nestjs/core": "6.11.7",
|
||||
"@nestjs/microservices": "6.11.7",
|
||||
"@nestjs/testing": "6.11.7",
|
||||
"@nestjs/websockets": "6.11.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.1",
|
||||
"class-validator": "0.11.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
"rxjs": "6.5.4",
|
||||
"typescript": "3.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"@types/node": "7.10.9",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.4.1"
|
||||
"ts-node": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ export class CircularService {
|
||||
@Inject(forwardRef(() => InputService))
|
||||
public readonly service: InputService,
|
||||
) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@ export class CircularModule {
|
||||
static forRoot(): DynamicModule {
|
||||
const a = {
|
||||
module: CircularModule,
|
||||
providers: [
|
||||
InputService,
|
||||
],
|
||||
providers: [InputService],
|
||||
b: null,
|
||||
};
|
||||
a.b = a;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class InputService {
|
||||
}
|
||||
export class InputService {}
|
||||
|
||||
@@ -7,4 +7,4 @@ export class CircularService {
|
||||
@Inject(forwardRef(() => InputService))
|
||||
public readonly service: InputService,
|
||||
) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { DependencyService } from './dependency.service';
|
||||
import { PropertiesService } from './properties.service';
|
||||
import { PropertiesService, SYMBOL_TOKEN } from './properties.service';
|
||||
|
||||
@Module({
|
||||
providers: [
|
||||
@@ -10,6 +10,10 @@ import { PropertiesService } from './properties.service';
|
||||
provide: 'token',
|
||||
useValue: true,
|
||||
},
|
||||
{
|
||||
provide: SYMBOL_TOKEN,
|
||||
useValue: true,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class PropertiesModule {}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { DependencyService } from './dependency.service';
|
||||
|
||||
export const SYMBOL_TOKEN = Symbol('token');
|
||||
|
||||
@Injectable()
|
||||
export class PropertiesService {
|
||||
@Inject() service: DependencyService;
|
||||
@Inject('token') token: boolean;
|
||||
@Inject(SYMBOL_TOKEN) symbolToken: boolean;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@ import { Module } from '@nestjs/common';
|
||||
import { ScopedController } from './scoped.controller';
|
||||
import { ScopedService } from './scoped.service';
|
||||
import { TransientService } from './transient.service';
|
||||
import { Transient2Service } from './transient2.service';
|
||||
|
||||
@Module({
|
||||
controllers: [ScopedController],
|
||||
providers: [ScopedService, TransientService],
|
||||
providers: [ScopedService, TransientService, Transient2Service],
|
||||
})
|
||||
export class ScopedModule {}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Injectable, Scope } from '@nestjs/common';
|
||||
import { Transient2Service } from './transient2.service';
|
||||
|
||||
@Injectable({ scope: Scope.TRANSIENT })
|
||||
export class TransientService {}
|
||||
export class TransientService {
|
||||
constructor(private readonly svc: Transient2Service) {}
|
||||
}
|
||||
|
||||
4
integration/injector/src/scoped/transient2.service.ts
Normal file
4
integration/injector/src/scoped/transient2.service.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Injectable, Scope } from '@nestjs/common';
|
||||
|
||||
@Injectable({ scope: Scope.TRANSIENT })
|
||||
export class Transient2Service {}
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"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": []
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user