mirror of
https://github.com/nestjs/nest.git
synced 2026-02-23 15:52:50 +00:00
Compare commits
412 Commits
BrunnerLiv
...
v6.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35c79bd491 | ||
|
|
35635be02e | ||
|
|
d936627214 | ||
|
|
f12bae62a0 | ||
|
|
c40f1ff767 | ||
|
|
2b94f16d41 | ||
|
|
6fc41cab72 | ||
|
|
cf389312ce | ||
|
|
0bb86b386b | ||
|
|
0584093419 | ||
|
|
3254a3afa8 | ||
|
|
dc8d362e36 | ||
|
|
ee89e12e03 | ||
|
|
9b391c836f | ||
|
|
c52d494e3a | ||
|
|
a395ca02a3 | ||
|
|
4d374e12ea | ||
|
|
3d72259e8f | ||
|
|
3e173a2d7a | ||
|
|
f2f63aa0d5 | ||
|
|
38d1cfd757 | ||
|
|
d2cca0cffe | ||
|
|
efb7de2f3e | ||
|
|
8e7fe10c66 | ||
|
|
0789aad977 | ||
|
|
248271397b | ||
|
|
cbf263a17f | ||
|
|
18fe2f1d2c | ||
|
|
17514942e7 | ||
|
|
741eb75cb3 | ||
|
|
a39bf86d83 | ||
|
|
62c1d4d673 | ||
|
|
140904025d | ||
|
|
59195609bc | ||
|
|
8ff06ff38a | ||
|
|
4ce61867c4 | ||
|
|
810ba2a484 | ||
|
|
71ade30129 | ||
|
|
2dce56fe9d | ||
|
|
a6b47321de | ||
|
|
7d68f8c690 | ||
|
|
a6e9a13c7c | ||
|
|
b4baa995e4 | ||
|
|
924503535a | ||
|
|
d035a725cf | ||
|
|
96a051c2cc | ||
|
|
cee1a23878 | ||
|
|
d4a68a61cf | ||
|
|
d3df303781 | ||
|
|
8df62fa49b | ||
|
|
de85a539d1 | ||
|
|
dc87cd92ab | ||
|
|
99074a8d9d | ||
|
|
e5c32f21d1 | ||
|
|
ae207ca6c9 | ||
|
|
c5a641d3ee | ||
|
|
0f6920894f | ||
|
|
635f332314 | ||
|
|
b49f3ce82c | ||
|
|
18e3445934 | ||
|
|
edc7bd0c6c | ||
|
|
f3a352c760 | ||
|
|
75636abf2a | ||
|
|
f9fb143d28 | ||
|
|
83c0d6df67 | ||
|
|
7ec42164cc | ||
|
|
f397af3fa7 | ||
|
|
feefeec083 | ||
|
|
b5f932db07 | ||
|
|
16a80d2ffd | ||
|
|
43cff1603b | ||
|
|
0b2e5652ed | ||
|
|
32651fa06a | ||
|
|
af88637435 | ||
|
|
b4dd1829ab | ||
|
|
7d8e668ff6 | ||
|
|
f63028026d | ||
|
|
84997f0c3f | ||
|
|
70c3f2e476 | ||
|
|
fdfc399184 | ||
|
|
155f917195 | ||
|
|
886220d9f8 | ||
|
|
73ff3d18ef | ||
|
|
733560d873 | ||
|
|
73c1cf34c1 | ||
|
|
d3bea8a222 | ||
|
|
7bb3b01f39 | ||
|
|
a8b98419f5 | ||
|
|
4c9b334c2c | ||
|
|
d14f2de4fb | ||
|
|
1e3594b050 | ||
|
|
6cd3968b20 | ||
|
|
25e3a7c808 | ||
|
|
e82c8a7804 | ||
|
|
1b79e146a7 | ||
|
|
8834c5f3f4 | ||
|
|
80622253be | ||
|
|
cee461096d | ||
|
|
dc633a2c3b | ||
|
|
5ff3754b4f | ||
|
|
a7993df60d | ||
|
|
29745813e6 | ||
|
|
5d0da3e38d | ||
|
|
27b9629bb0 | ||
|
|
5190adcc0a | ||
|
|
c39d4fc798 | ||
|
|
22f0390047 | ||
|
|
f6c37bbb9c | ||
|
|
cb79818989 | ||
|
|
15df360f8e | ||
|
|
cb36a98607 | ||
|
|
52dee78f13 | ||
|
|
3df7d92d06 | ||
|
|
c1c8bc33e0 | ||
|
|
fbb894a10a | ||
|
|
7db42a1a2c | ||
|
|
77297cabea | ||
|
|
afcff76e4e | ||
|
|
450d5f7537 | ||
|
|
6a37b6900e | ||
|
|
cc3809be46 | ||
|
|
f2a2710746 | ||
|
|
5ba501330b | ||
|
|
fb6dc8ad3b | ||
|
|
4399e26d7a | ||
|
|
b754a5feef | ||
|
|
ece9a6d285 | ||
|
|
be2531907a | ||
|
|
c9cb147b6f | ||
|
|
ec735b4a49 | ||
|
|
8ea9f8ae94 | ||
|
|
555a9691cd | ||
|
|
88c524611f | ||
|
|
772e8e82b9 | ||
|
|
432dc3bad5 | ||
|
|
d4bb43009b | ||
|
|
bacad91d00 | ||
|
|
7f9e110c60 | ||
|
|
28ffffa5e4 | ||
|
|
fbe80927b3 | ||
|
|
3086df5a50 | ||
|
|
8a6476a008 | ||
|
|
8cac746b2c | ||
|
|
f8088a0119 | ||
|
|
d36d2f5e2d | ||
|
|
6b7e5c2918 | ||
|
|
a8160cfa38 | ||
|
|
3bd6d4de9b | ||
|
|
77fb3bae6b | ||
|
|
d77cdef120 | ||
|
|
9af2f6eb0f | ||
|
|
c575f9dfd7 | ||
|
|
af0d322fcf | ||
|
|
935399f146 | ||
|
|
d469f1823b | ||
|
|
12368ffca7 | ||
|
|
ce912dac83 | ||
|
|
0094b29283 | ||
|
|
580eaab106 | ||
|
|
b9d6508ead | ||
|
|
efeb072797 | ||
|
|
64907e5879 | ||
|
|
915fa708f0 | ||
|
|
565a5a8a11 | ||
|
|
d357f1edfe | ||
|
|
3148e0f866 | ||
|
|
5f3eeff77a | ||
|
|
17d29a952c | ||
|
|
2bbff5432e | ||
|
|
d77936b7bd | ||
|
|
f48d4d422d | ||
|
|
9874b55b27 | ||
|
|
74fb7917ce | ||
|
|
f9ec473f64 | ||
|
|
ad2fecfef8 | ||
|
|
1e9930aa6c | ||
|
|
7c13c100e2 | ||
|
|
63ac6c098f | ||
|
|
a7c24a168e | ||
|
|
f690baf387 | ||
|
|
908438c98f | ||
|
|
4cf0e7bfab | ||
|
|
707ff6e512 | ||
|
|
37488d4d1e | ||
|
|
db61bc1729 | ||
|
|
c0fc683b7c | ||
|
|
6d90053f99 | ||
|
|
84acc114cf | ||
|
|
69dcf81f54 | ||
|
|
de4a990aae | ||
|
|
af54516b99 | ||
|
|
3c59864847 | ||
|
|
741f55046f | ||
|
|
1cf7610e9b | ||
|
|
bbb8000831 | ||
|
|
ade87e1284 | ||
|
|
f0d0ded2d7 | ||
|
|
02c8b5b2b9 | ||
|
|
e062a1b960 | ||
|
|
f1ab1f1ab0 | ||
|
|
a023c5871e | ||
|
|
4cea99e16f | ||
|
|
11625038e8 | ||
|
|
df90e0dc62 | ||
|
|
4632ba60cf | ||
|
|
f791b3e6b1 | ||
|
|
1a0102b007 | ||
|
|
7516de13a8 | ||
|
|
2cdebc888d | ||
|
|
557f585a00 | ||
|
|
892df6c433 | ||
|
|
83e846633b | ||
|
|
709625e273 | ||
|
|
cb4eb3d7ad | ||
|
|
1490a8a8b3 | ||
|
|
1b166131d7 | ||
|
|
37e41d7afe | ||
|
|
40234488d6 | ||
|
|
781bf4d283 | ||
|
|
c80834894a | ||
|
|
16ae1407e1 | ||
|
|
2e05368b2e | ||
|
|
a68ae579d4 | ||
|
|
aa9dfbb7ba | ||
|
|
8278746279 | ||
|
|
60eae53f98 | ||
|
|
77298e804a | ||
|
|
9a53587afa | ||
|
|
7cfffb9a95 | ||
|
|
0e2a4e7e84 | ||
|
|
a1b839e211 | ||
|
|
461959e176 | ||
|
|
e39b6468f0 | ||
|
|
25174cbef4 | ||
|
|
8d9b996b2f | ||
|
|
27c1c0881e | ||
|
|
d01a798d7b | ||
|
|
b8fbda24bd | ||
|
|
464c2bbef0 | ||
|
|
a9aaf86099 | ||
|
|
85f3897ae1 | ||
|
|
bed7ef1593 | ||
|
|
10c9d66cc4 | ||
|
|
6c035060a1 | ||
|
|
5ab5ed8736 | ||
|
|
1682181b78 | ||
|
|
16fdcd3a4f | ||
|
|
47ee1d68d5 | ||
|
|
acff437542 | ||
|
|
48fc6473bd | ||
|
|
09c84e2086 | ||
|
|
0a7f37d90b | ||
|
|
7f8aa92c0a | ||
|
|
6ec98b8411 | ||
|
|
418d4e3a79 | ||
|
|
a9caead0bc | ||
|
|
0bd9a8c3d4 | ||
|
|
9885309cd5 | ||
|
|
bba86dcac2 | ||
|
|
51bde528c0 | ||
|
|
3c340b8a41 | ||
|
|
64bc85ac28 | ||
|
|
1ff60ee0b6 | ||
|
|
e974283ec8 | ||
|
|
84d7178a59 | ||
|
|
844a69ee6a | ||
|
|
b4c190b912 | ||
|
|
13cdc6d23b | ||
|
|
e0fd3b8f3a | ||
|
|
ef264f1496 | ||
|
|
9d4d2abf46 | ||
|
|
036bc562ea | ||
|
|
43db50c500 | ||
|
|
5445997734 | ||
|
|
8b89187515 | ||
|
|
7af66c56fb | ||
|
|
8da95030fe | ||
|
|
63644df773 | ||
|
|
12753dafb4 | ||
|
|
de26bd490b | ||
|
|
b84246c641 | ||
|
|
458e2ccd04 | ||
|
|
a814974d6d | ||
|
|
e7a049823d | ||
|
|
a651429697 | ||
|
|
6b56bdf216 | ||
|
|
47a1434b8a | ||
|
|
ab43b862cc | ||
|
|
4f16736351 | ||
|
|
0ef817b9af | ||
|
|
b2135b43fb | ||
|
|
901191a9dd | ||
|
|
781d43d8ec | ||
|
|
a6940be500 | ||
|
|
44e62b3e7a | ||
|
|
8c9f6d75cf | ||
|
|
8d58d70e1a | ||
|
|
6a8ffcabfa | ||
|
|
ce7eecb745 | ||
|
|
aebf29e657 | ||
|
|
69e689ac7a | ||
|
|
6652b55b20 | ||
|
|
5ed092a526 | ||
|
|
945a3d7a8b | ||
|
|
1e3c007e44 | ||
|
|
34f4a84534 | ||
|
|
311265fe81 | ||
|
|
3f496afc6a | ||
|
|
e913ccf6de | ||
|
|
7d34529ece | ||
|
|
e38999e6a9 | ||
|
|
a3c47d6280 | ||
|
|
6e686bc64b | ||
|
|
1711527d4f | ||
|
|
1b96a8de7f | ||
|
|
648faecbcd | ||
|
|
86fd379ebb | ||
|
|
e23138a83e | ||
|
|
9803e4e20e | ||
|
|
36db11c989 | ||
|
|
8bccfcab4e | ||
|
|
d521792c34 | ||
|
|
98a3630819 | ||
|
|
e9d293f43d | ||
|
|
e25d97412f | ||
|
|
67a9b2830f | ||
|
|
5fdfd79eb3 | ||
|
|
362359f188 | ||
|
|
965521c0c0 | ||
|
|
b8eb8f6f62 | ||
|
|
4a73b92bec | ||
|
|
6c8a034784 | ||
|
|
58f93edcb4 | ||
|
|
cffe8f919f | ||
|
|
be593afdb7 | ||
|
|
6b683eefbb | ||
|
|
d96b8ebbc9 | ||
|
|
be239b598b | ||
|
|
dcbeb59596 | ||
|
|
e2ac748458 | ||
|
|
ebefabdbda | ||
|
|
836698317c | ||
|
|
32f04ec382 | ||
|
|
4fc64486c6 | ||
|
|
f25eadf86d | ||
|
|
710d00e369 | ||
|
|
3ed6d3bffa | ||
|
|
e50203277b | ||
|
|
d3ed627199 | ||
|
|
00b1122591 | ||
|
|
e91b711456 | ||
|
|
106cdccefd | ||
|
|
9c83b26486 | ||
|
|
a165ddbccf | ||
|
|
dc020161b3 | ||
|
|
7cf4325472 | ||
|
|
aa2e8f9ae9 | ||
|
|
f8a33ea09c | ||
|
|
8c6c707b2c | ||
|
|
28ca9ba5d1 | ||
|
|
f9a574d2a4 | ||
|
|
3273f9f784 | ||
|
|
b5d8965c5e | ||
|
|
f4d3c03d6b | ||
|
|
f906ec8625 | ||
|
|
9c711bf221 | ||
|
|
ad44931eb3 | ||
|
|
84961d4079 | ||
|
|
cd9cb824a9 | ||
|
|
f2d3420ba8 | ||
|
|
581a1dff17 | ||
|
|
4bba628ae9 | ||
|
|
4480a7c3a1 | ||
|
|
c376018dc9 | ||
|
|
9d394f5668 | ||
|
|
63e5d6b806 | ||
|
|
59bdc2e4d8 | ||
|
|
05fc85dae5 | ||
|
|
1493c011ae | ||
|
|
3e5a30d116 | ||
|
|
32e07c3ede | ||
|
|
52a736d95d | ||
|
|
c70f3fe7f0 | ||
|
|
9dd8e46f10 | ||
|
|
08e583d029 | ||
|
|
cc5ea08c47 | ||
|
|
2c582c88d1 | ||
|
|
4cc0b83cb6 | ||
|
|
41c8b39ca5 | ||
|
|
c5f3dbf8b2 | ||
|
|
20636aa43f | ||
|
|
c6123e790f | ||
|
|
151e2025bb | ||
|
|
f1271b6f1e | ||
|
|
7d9c0a1c0d | ||
|
|
b295ea1850 | ||
|
|
27a26420ac | ||
|
|
abb3549f28 | ||
|
|
b9ce9b8d5f | ||
|
|
4fc5c893b8 | ||
|
|
bdb0ede50d | ||
|
|
547f6e9079 | ||
|
|
16dbe21d40 | ||
|
|
2b5f0e2ba2 | ||
|
|
fcf5042d32 | ||
|
|
13ac2a95f1 | ||
|
|
6aa4bfd873 | ||
|
|
2c032adf91 | ||
|
|
4b034af203 | ||
|
|
110a34b79f | ||
|
|
1ee760d18b | ||
|
|
b5ed5dd166 |
178
.circleci/config.yml
Normal file
178
.circleci/config.yml
Normal file
@@ -0,0 +1,178 @@
|
||||
version: 2
|
||||
|
||||
aliases:
|
||||
- &restore-cache
|
||||
restore_cache:
|
||||
key: dependency-cache-{{ checksum "package.json" }}
|
||||
- &install-deps
|
||||
run:
|
||||
name: Install dependencies
|
||||
command: npm ci
|
||||
- &build-packages
|
||||
run:
|
||||
name: Build
|
||||
command: npm run build
|
||||
- &run-unit-tests
|
||||
run:
|
||||
name: Test
|
||||
command: npm run test
|
||||
|
||||
unit-tests-template: &unit-tests-template
|
||||
working_directory: ~/nest
|
||||
steps:
|
||||
- checkout
|
||||
- *restore-cache
|
||||
- *install-deps
|
||||
- *build-packages
|
||||
- *run-unit-tests
|
||||
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/nest
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Update NPM version
|
||||
command: 'sudo npm install -g npm@latest'
|
||||
- restore_cache:
|
||||
key: dependency-cache-{{ checksum "package.json" }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: npm ci
|
||||
- save_cache:
|
||||
key: dependency-cache-{{ checksum "package.json" }}
|
||||
paths:
|
||||
- ./node_modules
|
||||
- run:
|
||||
name: Build
|
||||
command: npm run build
|
||||
|
||||
test_node_12:
|
||||
working_directory: ~/nest
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
steps:
|
||||
- checkout
|
||||
- *restore-cache
|
||||
- *install-deps
|
||||
- *build-packages
|
||||
- *run-unit-tests
|
||||
- run:
|
||||
name: Collect coverage
|
||||
command: npm run coverage
|
||||
- store_artifacts:
|
||||
path: coverage
|
||||
|
||||
test_node_10:
|
||||
<<: *unit-tests-template
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
|
||||
test_node_8:
|
||||
<<: *unit-tests-template
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
|
||||
lint:
|
||||
working_directory: ~/nest
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
steps:
|
||||
- checkout
|
||||
- *restore-cache
|
||||
- *install-deps
|
||||
- run:
|
||||
name: Lint
|
||||
command: npm run lint
|
||||
|
||||
integration_tests:
|
||||
working_directory: ~/nest
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Prepare nvm
|
||||
command: |
|
||||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
|
||||
- run:
|
||||
name: Upgrade Node.js
|
||||
command: |
|
||||
nvm install v12
|
||||
node -v
|
||||
nvm alias default v12
|
||||
- run:
|
||||
name: Install Docker Compose
|
||||
command: |
|
||||
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
|
||||
chmod +x ~/docker-compose
|
||||
sudo mv ~/docker-compose /usr/local/bin/docker-compose
|
||||
- *install-deps
|
||||
- run:
|
||||
name: Prepare tests
|
||||
command: |
|
||||
bash ./scripts/prepare.sh
|
||||
sleep 10
|
||||
- run:
|
||||
name: List containers
|
||||
command: docker ps
|
||||
- run:
|
||||
name: Integration tests
|
||||
command: npm run integration-test
|
||||
|
||||
codechecks_benchmarks:
|
||||
working_directory: ~/nest
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
steps:
|
||||
- checkout
|
||||
- *restore-cache
|
||||
- *install-deps
|
||||
- *build-packages
|
||||
- run:
|
||||
name: Install native wrk
|
||||
command: .circleci/install-wrk.sh
|
||||
- run:
|
||||
name: Run codechecks with benchmarks
|
||||
command: yarn codechecks:benchmarks
|
||||
|
||||
samples:
|
||||
working_directory: ~/nest
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
steps:
|
||||
- checkout
|
||||
- *restore-cache
|
||||
- *install-deps
|
||||
- run:
|
||||
name: Build all samples
|
||||
command: npm run build:samples
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build-and-test:
|
||||
jobs:
|
||||
- build
|
||||
- test_node_12:
|
||||
requires:
|
||||
- build
|
||||
- test_node_10:
|
||||
requires:
|
||||
- build
|
||||
- test_node_8:
|
||||
requires:
|
||||
- build
|
||||
- lint:
|
||||
requires:
|
||||
- build
|
||||
- integration_tests:
|
||||
requires:
|
||||
- build
|
||||
- samples:
|
||||
requires:
|
||||
- build
|
||||
- codechecks_benchmarks:
|
||||
requires:
|
||||
- build
|
||||
13
.circleci/install-wrk.sh
Executable file
13
.circleci/install-wrk.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# based on https://medium.com/@felipedutratine/intelligent-benchmark-with-wrk-163986c1587f
|
||||
|
||||
cd /tmp/
|
||||
sudo apt-get install build-essential libssl-dev git -y
|
||||
git clone https://github.com/wg/wrk.git wrk
|
||||
cd wrk
|
||||
sudo make
|
||||
# move the executable to somewhere in your PATH, ex:
|
||||
sudo cp wrk /usr/local/bin
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ node_modules/
|
||||
/.idea
|
||||
/.awcache
|
||||
/.vscode
|
||||
*.code-workspace
|
||||
|
||||
# bundle
|
||||
packages/**/*.d.ts
|
||||
|
||||
56
.travis.yml
56
.travis.yml
@@ -1,56 +0,0 @@
|
||||
language: node_js
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- "node_modules"
|
||||
|
||||
git:
|
||||
depth: 5
|
||||
|
||||
before_install:
|
||||
- npm i -g npm@latest
|
||||
|
||||
install:
|
||||
- npm ci
|
||||
- npm run build:dev
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- state: "Test"
|
||||
name: "Unit Test Node v12"
|
||||
script: npm test
|
||||
node_js: 12
|
||||
after_success: npm run coverage
|
||||
|
||||
- state: "Test"
|
||||
name: "Unit Test Node v10"
|
||||
script: npm test
|
||||
node_js: 10
|
||||
|
||||
- state: "Test"
|
||||
name: "Unit Test Node v8"
|
||||
script: npm test
|
||||
node_js: 8
|
||||
|
||||
- state: "Test"
|
||||
name: "Integration Test"
|
||||
install: skip
|
||||
before_install: skip
|
||||
before_script: skip
|
||||
addons: skip
|
||||
script:
|
||||
sudo service mysql stop &&
|
||||
bash ./scripts/prepare.sh &&
|
||||
npm run integration-test
|
||||
node_js: 12
|
||||
|
||||
- stage: "Test"
|
||||
name: "Lint"
|
||||
script: npm run lint
|
||||
node_js: 12
|
||||
|
||||
- stage: "Test"
|
||||
name: "Build samples"
|
||||
script: npm run build:samples
|
||||
node_js: 12
|
||||
|
||||
105
CONTRIBUTING.md
105
CONTRIBUTING.md
@@ -4,13 +4,14 @@ We would love for you to contribute to Nest and help make it even better than it
|
||||
today! As a contributor, here are the guidelines we would like you to follow:
|
||||
|
||||
<!--* [Code of Conduct](#coc)-->
|
||||
* [Question or Problem?](#question)
|
||||
* [Issues and Bugs](#issue)
|
||||
* [Feature Requests](#feature)
|
||||
* [Submission Guidelines](#submit)
|
||||
* [Development Setup](#development)
|
||||
* [Coding Rules](#rules)
|
||||
* [Commit Message Guidelines](#commit)
|
||||
|
||||
- [Question or Problem?](#question)
|
||||
- [Issues and Bugs](#issue)
|
||||
- [Feature Requests](#feature)
|
||||
- [Submission Guidelines](#submit)
|
||||
- [Development Setup](#development)
|
||||
- [Coding Rules](#rules)
|
||||
- [Commit Message Guidelines](#commit)
|
||||
<!-- - [Signing the CLA](#cla) -->
|
||||
|
||||
<!-- ## <a name="coc"></a> Code of Conduct
|
||||
@@ -24,8 +25,8 @@ Stack Overflow is a much better place to ask questions since:
|
||||
|
||||
<!-- - there are thousands of people willing to help on Stack Overflow [maybe one day] -->
|
||||
|
||||
* questions and answers stay available for public viewing so your question / answer might help someone else
|
||||
* Stack Overflow's voting system assures that the best answers are prominently visible.
|
||||
- questions and answers stay available for public viewing so your question / answer might help someone else
|
||||
- Stack Overflow's voting system assures that the best answers are prominently visible.
|
||||
|
||||
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
|
||||
|
||||
@@ -44,10 +45,10 @@ Repository. If you would like to _implement_ a new feature, please submit an iss
|
||||
a proposal for your work first, to be sure that we can use it.
|
||||
Please consider what kind of change it is:
|
||||
|
||||
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
|
||||
- For a **Major Feature**, first open an issue and outline your proposal so that it can be
|
||||
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
|
||||
and help you to craft the change so that it is successfully accepted into the project. For your issue name, please prefix your proposal with `[discussion]`, for example "[discussion]: your feature idea".
|
||||
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
|
||||
- **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
|
||||
|
||||
## <a name="submit"></a> Submission Guidelines
|
||||
|
||||
@@ -57,9 +58,9 @@ Before you submit an issue, please search the issue tracker, maybe an issue for
|
||||
|
||||
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using a repository or [Gist](https://gist.github.com/). Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like:
|
||||
|
||||
* version of NestJS used
|
||||
* 3rd-party libraries and their versions
|
||||
* and most importantly - a use-case that fails
|
||||
- version of NestJS used
|
||||
- 3rd-party libraries and their versions
|
||||
- and most importantly - a use-case that fails
|
||||
|
||||
<!--
|
||||
// TODO we need to create a playground, similar to plunkr
|
||||
@@ -114,11 +115,11 @@ We cannot accept code without this.
|
||||
|
||||
1. In GitHub, send a pull request to `nestjs:master`.
|
||||
|
||||
* If we suggest changes then:
|
||||
- If we suggest changes then:
|
||||
|
||||
* Make the required updates.
|
||||
* Re-run the Nest test suites to ensure tests are still passing.
|
||||
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
||||
- Make the required updates.
|
||||
- Re-run the Nest test suites to ensure tests are still passing.
|
||||
- Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
||||
|
||||
```shell
|
||||
git rebase master -i
|
||||
@@ -132,25 +133,25 @@ That's it! Thank you for your contribution!
|
||||
After your pull request is merged, you can safely delete your branch and pull the changes
|
||||
from the main (upstream) repository:
|
||||
|
||||
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||
|
||||
```shell
|
||||
git push origin --delete my-fix-branch
|
||||
```
|
||||
|
||||
* Check out the master branch:
|
||||
- Check out the master branch:
|
||||
|
||||
```shell
|
||||
git checkout master -f
|
||||
```
|
||||
|
||||
* Delete the local branch:
|
||||
- Delete the local branch:
|
||||
|
||||
```shell
|
||||
git branch -D my-fix-branch
|
||||
```
|
||||
|
||||
* Update your master with the latest upstream version:
|
||||
- Update your master with the latest upstream version:
|
||||
|
||||
```shell
|
||||
git pull --ff upstream master
|
||||
@@ -177,13 +178,8 @@ That will compile fresh packages and afterward, move them to all `sample` direct
|
||||
### <a name="common-scripts"></a>Commonly used NPM scripts
|
||||
|
||||
```bash
|
||||
# build all packages and put them near to their source .ts files
|
||||
$ npm run build
|
||||
|
||||
# build all packages and move to "sample" and "integration" directories
|
||||
# if cross-packages breaking changes were performed you may face irrelevant errors
|
||||
# in order to verify the build, you can run this command again then
|
||||
$ npm run build:dev
|
||||
$ npm run build
|
||||
|
||||
# run the full unit tests suite
|
||||
$ npm run test
|
||||
@@ -194,6 +190,9 @@ $ sh scripts/run-integration.sh
|
||||
|
||||
# run linter
|
||||
$ npm run lint
|
||||
|
||||
# build all packages and put them near to their source .ts files
|
||||
$ npm run build:prod
|
||||
```
|
||||
|
||||
## <a name="rules"></a> Coding Rules
|
||||
@@ -204,8 +203,8 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
|
||||
// We're working on auto-documentation.
|
||||
* All public API methods **must be documented**. (Details TBC). -->
|
||||
|
||||
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
|
||||
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
|
||||
- All features or bug fixes **must be tested** by one or more specs (unit-tests).
|
||||
- We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
|
||||
**100 characters**. An automated formatter is available (`npm run format`).
|
||||
|
||||
## <a name="commit"></a> Commit Message Guidelines
|
||||
@@ -249,15 +248,15 @@ If the commit reverts a previous commit, it should begin with `revert:`, followe
|
||||
|
||||
Must be one of the following:
|
||||
|
||||
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||
* **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
|
||||
* **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)
|
||||
* **test**: Adding missing tests or correcting existing tests
|
||||
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||
- **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
|
||||
- **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)
|
||||
- **test**: Adding missing tests or correcting existing tests
|
||||
|
||||
### Scope
|
||||
|
||||
@@ -265,28 +264,28 @@ The scope should be the name of the npm package affected (as perceived by person
|
||||
|
||||
The following is the list of supported scopes:
|
||||
|
||||
* **common**
|
||||
* **core**
|
||||
* **sample**
|
||||
* **microservices**
|
||||
* **testing**
|
||||
* **websockets**
|
||||
- **common**
|
||||
- **core**
|
||||
- **sample**
|
||||
- **microservices**
|
||||
- **testing**
|
||||
- **websockets**
|
||||
|
||||
There are currently a few exceptions to the "use package name" rule:
|
||||
|
||||
* **packaging**: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc.
|
||||
* **changelog**: used for updating the release notes in CHANGELOG.md
|
||||
* **sample/#**: for the example apps directory, replacing # with the example app number
|
||||
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)
|
||||
<!-- * **aio**: used for docs-app (angular.io) related changes within the /aio directory of the repo -->
|
||||
- **packaging**: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc.
|
||||
- **changelog**: used for updating the release notes in CHANGELOG.md
|
||||
- **sample/#**: for the example apps directory, replacing # with the example app number
|
||||
- none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)
|
||||
<!-- * **aio**: used for docs-app (angular.io) related changes within the /aio directory of the repo -->
|
||||
|
||||
### Subject
|
||||
|
||||
The subject contains succinct description of the change:
|
||||
|
||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
* don't capitalize first letter
|
||||
* no dot (.) at the end
|
||||
- use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
- don't capitalize first letter
|
||||
- no dot (.) at the end
|
||||
|
||||
### Body
|
||||
|
||||
|
||||
14
Readme.md
14
Readme.md
@@ -2,18 +2,15 @@
|
||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
|
||||
</p>
|
||||
|
||||
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/nestjs/nest
|
||||
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
|
||||
[linux-url]: https://travis-ci.org/nestjs/nest
|
||||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
||||
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
||||
|
||||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
||||
<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://travis-ci.org/nestjs/nest" target="_blank"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
|
||||
<a href="https://travis-ci.org/nestjs/nest" target="_blank"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></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>
|
||||
@@ -42,7 +39,7 @@ Nest is a framework for building efficient, scalable <a href="http://nodejs.org"
|
||||
|
||||
## Consulting
|
||||
|
||||
With official support, you can get expert help straight from Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://docs.nestjs.com/enterprise).
|
||||
With official support, you can get expert help straight from Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://enterprise.nestjs.com).
|
||||
|
||||
## Support
|
||||
|
||||
@@ -71,7 +68,8 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
<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://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>
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo 'Library:' $1
|
||||
node $1 &
|
||||
pid=$!
|
||||
|
||||
sleep 2
|
||||
|
||||
wrk 'http://localhost:3000' \
|
||||
-d 10 \
|
||||
-c 1024 \
|
||||
-t 8
|
||||
|
||||
kill $pid
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
: > all_output.txt
|
||||
|
||||
lib=(express fastify nest nest-fastify)
|
||||
for item in ${lib[*]}
|
||||
do
|
||||
echo '-----------------------' >> all_output.txt
|
||||
echo $item >> all_output.txt
|
||||
echo '-----------------------' >> all_output.txt
|
||||
|
||||
node $item &
|
||||
pid=$!
|
||||
|
||||
sleep 2
|
||||
|
||||
wrk 'http://localhost:3000' \
|
||||
-d 10 \
|
||||
-c 1024 \
|
||||
-t 8 >> all_output.txt
|
||||
|
||||
kill $pid
|
||||
done
|
||||
@@ -31,15 +31,42 @@ services:
|
||||
- "3306:3306"
|
||||
restart: always
|
||||
mongodb:
|
||||
container_name: test-mongodb
|
||||
image: mongo:latest
|
||||
environment:
|
||||
- MONGODB_DATABASE="test"
|
||||
ports:
|
||||
- 27017:27017
|
||||
rabbit:
|
||||
container_name: test-rabbit
|
||||
hostname: rabbit
|
||||
image: "rabbitmq:management"
|
||||
ports:
|
||||
- "15672:15672"
|
||||
- "5672:5672"
|
||||
tty: true
|
||||
zookeeper:
|
||||
container_name: test-zookeeper
|
||||
hostname: zookeeper
|
||||
image: confluentinc/cp-zookeeper:5.3.1
|
||||
ports:
|
||||
- "2181:2181"
|
||||
environment:
|
||||
ZOOKEEPER_CLIENT_PORT: 2181
|
||||
ZOOKEEPER_TICK_TIME: 2000
|
||||
kafka:
|
||||
container_name: test-kafka
|
||||
hostname: kafka
|
||||
image: confluentinc/cp-kafka:5.3.1
|
||||
depends_on:
|
||||
- zookeeper
|
||||
ports:
|
||||
- "29092:29092"
|
||||
- "9092:9092"
|
||||
environment:
|
||||
KAFKA_BROKER_ID: 1
|
||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
||||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
|
||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
|
||||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
||||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
|
||||
|
||||
922
integration/graphql/package-lock.json
generated
922
integration/graphql/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,21 +9,21 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/graphql": "6.4.2",
|
||||
"apollo-server-express": "2.8.1",
|
||||
"graphql": "14.5.0",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/graphql": "6.5.1",
|
||||
"apollo-server-express": "2.9.3",
|
||||
"graphql": "14.5.6",
|
||||
"graphql-tools": "4.0.5",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"rxjs": "6.5.3",
|
||||
"subscriptions-transport-ws": "0.9.16",
|
||||
"typescript": "3.5.3",
|
||||
"typescript": "3.6.3",
|
||||
"ws": "7.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.19.0"
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0"
|
||||
}
|
||||
}
|
||||
|
||||
59
integration/hello-world/e2e/middleware-execute-order.spec.ts
Normal file
59
integration/hello-world/e2e/middleware-execute-order.spec.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { INestApplication, MiddlewareConsumer, Module } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
|
||||
const RETURN_VALUE_A = 'test_A';
|
||||
const RETURN_VALUE_B = 'test_B';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
})
|
||||
class ModuleA {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer
|
||||
.apply((req, res, next) => {
|
||||
res.send(RETURN_VALUE_A);
|
||||
})
|
||||
.forRoutes('hello');
|
||||
}
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ModuleA],
|
||||
})
|
||||
class ModuleB {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer
|
||||
.apply((req, res, next) => {
|
||||
res.send(RETURN_VALUE_B);
|
||||
})
|
||||
.forRoutes('hello');
|
||||
}
|
||||
}
|
||||
|
||||
@Module({
|
||||
imports: [ModuleB],
|
||||
})
|
||||
class TestModule {}
|
||||
|
||||
describe('Middleware (execution order)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = (await Test.createTestingModule({
|
||||
imports: [TestModule],
|
||||
}).compile()).createNestApplication();
|
||||
|
||||
await app.init();
|
||||
});
|
||||
|
||||
it(`should execute middleware in topological order`, () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/hello')
|
||||
.expect(200, RETURN_VALUE_B);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await app.close();
|
||||
});
|
||||
});
|
||||
148
integration/hello-world/package-lock.json
generated
148
integration/hello-world/package-lock.json
generated
@@ -5,32 +5,32 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.5.3.tgz",
|
||||
"integrity": "sha512-T9zZf61myahenI4c0qhcYnhnx49L+zL9+8W6fc+LPTarbt1HJDu6iyj6fh2BzewakwNLJRyGMJ9YCYlXhFuvlA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.6.7.tgz",
|
||||
"integrity": "sha512-YhjJEB326Ms5Q6D9xC6uQc65gS3CM61xPvyWospnwGUz7o5RVie0BT33Ja4CQ33OIRvqEVqn5Fi2BcQmNZiYxg==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
@@ -38,17 +38,17 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.5.3.tgz",
|
||||
"integrity": "sha512-W8tPhkNVhmX+jaDu4R7WUOtIl0PK3ZDso434rEm/b1+S6ZRgAKwNVHWM/rwIuTi5+erPTEULtTsZgrXFrzC1sA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.6.7.tgz",
|
||||
"integrity": "sha512-SKP1aTnTKTKbzL7QqiVmQC3EEZH7javf67GZMuFkIJ5hVCEuc6FEdfV9iyCGH6hC/68ArCa8U8jbxt9+CbyPew==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.5.3.tgz",
|
||||
"integrity": "sha512-YrCvmLHTW0OBusTiUOPrG0PNrw/3Gatty/bh3ro5cEoiovcaJxGSMsTC+JSVXqPwRJjEtoHMCr5Qje2rAepIzQ==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.6.7.tgz",
|
||||
"integrity": "sha512-wq6sp0Vw3CAU/h+aXhDm6AZBA/vxIB55Nc114R5RNTIDFU7NuTLTnKLcTvWDatDu5tcwtOAKqx4GXWyTytmQ8w==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
}
|
||||
@@ -109,9 +109,9 @@
|
||||
"integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA="
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -121,9 +121,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"avvio": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/avvio/-/avvio-6.2.1.tgz",
|
||||
"integrity": "sha512-k+gTocL3yShwN1PtKEsSj7eFiApcZ4JZLAu/ecyzEb8jyx+Kmxb+7SXUsodB47g7fqhs/zkfsCdqq72a1ok5Ew==",
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/avvio/-/avvio-6.2.2.tgz",
|
||||
"integrity": "sha512-7+yznbJOMoHQ8Z8VH+1meyRjtxUW8za6gqnHBl8DqlX5qPtaclNIgWrKrTLuIbfn2+1/EGkcr+rQXI8DYVU4RA==",
|
||||
"requires": {
|
||||
"archy": "^1.0.0",
|
||||
"debug": "^4.0.0",
|
||||
@@ -227,9 +227,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -278,9 +278,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -372,19 +372,19 @@
|
||||
"integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg=="
|
||||
},
|
||||
"fastify": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.7.1.tgz",
|
||||
"integrity": "sha512-ScKPXD84lkdCgz7q0zjyBr1aLxKbXRt9HYL3XIt/L8ZD2f3fAcsLEyQ2/rHxLUzLGjPlEjIvprWUL3RZvlLRLw==",
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.8.0.tgz",
|
||||
"integrity": "sha512-+HXe9xZzbj79680hlehEs0B1Z3e5RQT6CtPthseqgRJy2i7Wlro8EEdM7u7ewwL9XREjLWssCPlJiZ3G+t4qsw==",
|
||||
"requires": {
|
||||
"abstract-logging": "^1.0.0",
|
||||
"ajv": "^6.10.2",
|
||||
"avvio": "^6.1.1",
|
||||
"fast-json-stringify": "^1.15.0",
|
||||
"avvio": "^6.2.2",
|
||||
"fast-json-stringify": "^1.15.4",
|
||||
"find-my-way": "^2.0.0",
|
||||
"flatstr": "^1.0.12",
|
||||
"light-my-request": "^3.4.1",
|
||||
"middie": "^4.0.1",
|
||||
"pino": "^5.13.1",
|
||||
"pino": "^5.13.2",
|
||||
"proxy-addr": "^2.0.4",
|
||||
"readable-stream": "^3.1.1",
|
||||
"rfdc": "^1.1.2",
|
||||
@@ -401,9 +401,9 @@
|
||||
}
|
||||
},
|
||||
"find-my-way": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.1.0.tgz",
|
||||
"integrity": "sha512-Hdx6ctcrzkZH5y9EREHtXryXAgc5Bc8z5Cvoa61y9kaoYj2KU4yXD6h8b6u0NUkYPVmQQeRdf0AtG1kQxQ+ukQ==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.1.1.tgz",
|
||||
"integrity": "sha512-yznKDx1xELFkTrV2Ke9x3IOr9zn5isdFA2Af/NKjU8kmQQhtn3TmqrVZ6OiLO5pj1dAScxe4dAo92ieG4nGcoA==",
|
||||
"requires": {
|
||||
"fast-decode-uri-component": "^1.0.0",
|
||||
"safe-regex2": "^2.0.0",
|
||||
@@ -595,9 +595,9 @@
|
||||
"integrity": "sha512-ZOtfhPttCrqp2M1PBBH4X13XlvnfhIwD7yCLx+GoGoXRPQyxGOTdQMpIzPSPKXAJT/JQrdfFrgdJOyAzvgpQ9A=="
|
||||
},
|
||||
"pino": {
|
||||
"version": "5.13.1",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.1.tgz",
|
||||
"integrity": "sha512-IxusG28L0g50uuf21kZELypdFOeNrJ/kRhktdi7LtdZQWCxLliMxG5iOrGUQ/ng7MiJ4XqXi/hfyXwZeKc1MxA==",
|
||||
"version": "5.13.2",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.2.tgz",
|
||||
"integrity": "sha512-WwOSCy36/gWhinsqWqAnuwIi2WtcH+jvoyeLm3bjUALIrzWIst0AovQjK4jVvSN2l64KFPfi3gd2fjsTovjdLQ==",
|
||||
"requires": {
|
||||
"fast-redact": "^1.4.4",
|
||||
"fast-safe-stringify": "^2.0.6",
|
||||
@@ -674,9 +674,9 @@
|
||||
"integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -684,7 +684,8 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"safe-regex2": {
|
||||
"version": "2.0.0",
|
||||
@@ -719,9 +720,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -729,11 +730,18 @@
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz",
|
||||
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
"safe-buffer": "~5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"superagent": {
|
||||
@@ -819,9 +827,9 @@
|
||||
"integrity": "sha512-k/vdHz+bFALjmik0URLWBYNuO0hCABTL5dullbZBXvFDdlL8RrKaeLR6YuHfX+6ZXOLkHw+HpNLCUA7DtLMQmg=="
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -832,19 +840,19 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"uri-js": {
|
||||
"version": "4.2.2",
|
||||
@@ -860,9 +868,9 @@
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
@@ -870,9 +878,9 @@
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/microservices": "6.5.3",
|
||||
"@nestjs/testing": "6.5.3",
|
||||
"@nestjs/websockets": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/microservices": "6.6.7",
|
||||
"@nestjs/testing": "6.6.7",
|
||||
"@nestjs/websockets": "6.6.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"fastify": "2.7.1",
|
||||
"fastify": "2.8.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0"
|
||||
"ts-node": "8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
55
integration/hooks/e2e/before-app-shutdown.spec.ts
Normal file
55
integration/hooks/e2e/before-app-shutdown.spec.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Injectable, BeforeApplicationShutdown } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
@Injectable()
|
||||
class TestInjectable implements BeforeApplicationShutdown {
|
||||
beforeApplicationShutdown = Sinon.spy();
|
||||
}
|
||||
|
||||
describe('BeforeApplicationShutdown', () => {
|
||||
it('should call `beforeApplicationShutdown` when application closes', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [TestInjectable],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.close();
|
||||
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));
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{
|
||||
provide: 'Test',
|
||||
useValue: {
|
||||
beforeApplicationShutdown: () => promise,
|
||||
},
|
||||
},
|
||||
],
|
||||
}).compile();
|
||||
Sinon.stub(module, 'dispose' as any);
|
||||
const app = module.createNestApplication();
|
||||
|
||||
app.close();
|
||||
|
||||
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,
|
||||
0,
|
||||
);
|
||||
});
|
||||
});
|
||||
54
integration/hooks/e2e/enable-shutdown-hook.spec.ts
Normal file
54
integration/hooks/e2e/enable-shutdown-hook.spec.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { expect } from 'chai';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { join } from 'path';
|
||||
|
||||
describe('enableShutdownHooks', () => {
|
||||
it('should call the correct hooks if any shutdown signal gets invoked', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/enable-shutdown-hooks-main.ts'),
|
||||
'SIGHUP',
|
||||
]);
|
||||
const calls = result.stdout
|
||||
.toString()
|
||||
.split('\n')
|
||||
.map((call: string) => call.trim());
|
||||
expect(calls[0]).to.equal('beforeApplicationShutdown SIGHUP');
|
||||
expect(calls[1]).to.equal('onApplicationShutdown SIGHUP');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
|
||||
it('should call the correct hooks if a specific shutdown signal gets invoked', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/enable-shutdown-hooks-main.ts'),
|
||||
'SIGINT',
|
||||
'SIGINT',
|
||||
]);
|
||||
const calls = result.stdout
|
||||
.toString()
|
||||
.split('\n')
|
||||
.map((call: string) => call.trim());
|
||||
expect(calls[0]).to.equal('beforeApplicationShutdown SIGINT');
|
||||
expect(calls[1]).to.equal('onApplicationShutdown SIGINT');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
|
||||
it('should ignore system signals which are not specified', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/enable-shutdown-hooks-main.ts'),
|
||||
'SIGINT',
|
||||
'SIGHUP',
|
||||
]);
|
||||
expect(result.stdout.toString().trim()).to.be.eq('');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
|
||||
it('should ignore system signals if "enableShutdownHooks" was not called', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/enable-shutdown-hooks-main.ts'),
|
||||
'SIGINT',
|
||||
'NONE',
|
||||
]);
|
||||
expect(result.stdout.toString().trim()).to.be.eq('');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
});
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import * as Sinon from 'sinon';
|
||||
import {
|
||||
Injectable,
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
OnApplicationShutdown,
|
||||
OnModuleDestroy,
|
||||
OnModuleInit,
|
||||
BeforeApplicationShutdown,
|
||||
} from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
@@ -15,8 +15,10 @@ class TestInjectable
|
||||
OnApplicationBootstrap,
|
||||
OnModuleInit,
|
||||
OnModuleDestroy,
|
||||
OnApplicationShutdown {
|
||||
OnApplicationShutdown,
|
||||
BeforeApplicationShutdown {
|
||||
onApplicationBootstrap = Sinon.spy();
|
||||
beforeApplicationShutdown = Sinon.spy();
|
||||
onApplicationShutdown = Sinon.spy();
|
||||
onModuleDestroy = Sinon.spy();
|
||||
onModuleInit = Sinon.spy();
|
||||
@@ -37,6 +39,7 @@ describe('Lifecycle Hook Order', () => {
|
||||
instance.onModuleInit,
|
||||
instance.onApplicationBootstrap,
|
||||
instance.onModuleDestroy,
|
||||
instance.beforeApplicationShutdown,
|
||||
instance.onApplicationShutdown,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -19,4 +19,26 @@ describe('OnApplicationBootstrap', () => {
|
||||
const instance = module.get(TestInjectable);
|
||||
expect(instance.onApplicationBootstrap.called).to.be.true;
|
||||
});
|
||||
|
||||
it('should not throw an error when onApplicationBootstrap is null', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onApplicationBootstrap: null } }
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
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 } }
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Injectable, OnApplicationShutdown } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { join } from 'path';
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
@Injectable()
|
||||
@@ -21,43 +19,4 @@ describe('OnApplicationShutdown', () => {
|
||||
const instance = module.get(TestInjectable);
|
||||
expect(instance.onApplicationShutdown.called).to.be.true;
|
||||
});
|
||||
|
||||
it('should call onApplicationShutdown if any shutdown signal gets invoked', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/main.ts'),
|
||||
'SIGHUP',
|
||||
]);
|
||||
expect(result.stdout.toString().trim() === 'Signal SIGHUP').to.be.true;
|
||||
done();
|
||||
}).timeout(5000);
|
||||
|
||||
it('should call onApplicationShutdown if a specific shutdown signal gets invoked', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/main.ts'),
|
||||
'SIGINT',
|
||||
'SIGINT',
|
||||
]);
|
||||
expect(result.stdout.toString().trim()).to.be.eq('Signal SIGINT');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
|
||||
it('should ignore system signals which are not specified', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/main.ts'),
|
||||
'SIGINT',
|
||||
'SIGHUP',
|
||||
]);
|
||||
expect(result.stdout.toString().trim()).to.be.eq('');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
|
||||
it('should ignore system signals if "enableShutdownHooks" was not called', done => {
|
||||
const result = spawnSync('ts-node', [
|
||||
join(__dirname, '../src/main.ts'),
|
||||
'SIGINT',
|
||||
'NONE',
|
||||
]);
|
||||
expect(result.stdout.toString().trim()).to.be.eq('');
|
||||
done();
|
||||
}).timeout(5000);
|
||||
});
|
||||
|
||||
@@ -19,4 +19,26 @@ describe('OnModuleDestroy', () => {
|
||||
const instance = module.get(TestInjectable);
|
||||
expect(instance.onModuleDestroy.called).to.be.true;
|
||||
});
|
||||
|
||||
it('should not throw an error when onModuleDestroy is null', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onModuleDestroy: null } }
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
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 } }
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,4 +19,26 @@ describe('OnModuleInit', () => {
|
||||
const instance = module.get(TestInjectable);
|
||||
expect(instance.onModuleInit.called).to.be.true;
|
||||
});
|
||||
|
||||
it('should not throw an error when onModuleInit is null', async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
providers: [
|
||||
{ provide: 'TEST', useValue: { onModuleInit: null } }
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
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 } }
|
||||
],
|
||||
}).compile();
|
||||
|
||||
const app = module.createNestApplication();
|
||||
await app.init().then((obj) => expect(obj).to.not.be.undefined);
|
||||
});
|
||||
});
|
||||
|
||||
82
integration/hooks/package-lock.json
generated
82
integration/hooks/package-lock.json
generated
@@ -5,26 +5,26 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nuxtjs/opencollective": {
|
||||
@@ -62,9 +62,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -155,9 +155,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -202,9 +202,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -437,9 +437,9 @@
|
||||
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -457,9 +457,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -544,9 +544,9 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -557,19 +557,19 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
@@ -578,9 +578,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
@@ -588,9 +588,9 @@
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0"
|
||||
"ts-node": "8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import { Injectable, OnApplicationShutdown, Module } from '@nestjs/common';
|
||||
import { Injectable, OnApplicationShutdown, BeforeApplicationShutdown, Module } 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 {
|
||||
class TestInjectable implements OnApplicationShutdown, BeforeApplicationShutdown {
|
||||
beforeApplicationShutdown(signal: string) {
|
||||
console.log('beforeApplicationShutdown ' + signal);
|
||||
}
|
||||
|
||||
onApplicationShutdown(signal: string) {
|
||||
console.log('Signal ' + signal);
|
||||
console.log('onApplicationShutdown ' + signal);
|
||||
}
|
||||
}
|
||||
|
||||
54
integration/injector/e2e/scoped-instances.spec.ts
Normal file
54
integration/injector/e2e/scoped-instances.spec.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { InvalidClassScopeException } from '@nestjs/core/errors/exceptions/invalid-class-scope.exception';
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { ScopedController } from '../src/scoped/scoped.controller';
|
||||
import { ScopedModule } from '../src/scoped/scoped.module';
|
||||
import { ScopedService } from '../src/scoped/scoped.service';
|
||||
import { TransientService } from '../src/scoped/transient.service';
|
||||
|
||||
describe('Scoped Instances', () => {
|
||||
let testingModule: TestingModule;
|
||||
|
||||
beforeEach(async () => {
|
||||
testingModule = await Test.createTestingModule({
|
||||
imports: [ScopedModule],
|
||||
}).compile();
|
||||
});
|
||||
|
||||
it('should dynamically resolve transient provider', async () => {
|
||||
const transient1 = await testingModule.resolve(TransientService);
|
||||
const transient2 = await testingModule.resolve(TransientService);
|
||||
|
||||
expect(transient1).to.be.instanceOf(TransientService);
|
||||
expect(transient2).to.be.instanceOf(TransientService);
|
||||
expect(transient1).to.be.equal(transient2);
|
||||
});
|
||||
|
||||
it('should dynamically resolve request-scoped provider', async () => {
|
||||
const request1 = await testingModule.resolve(ScopedService);
|
||||
const request2 = await testingModule.resolve(ScopedService);
|
||||
const request3 = await testingModule.resolve(ScopedService, { id: 1 });
|
||||
|
||||
expect(request1).to.be.instanceOf(ScopedService);
|
||||
expect(request2).to.be.instanceOf(ScopedService);
|
||||
expect(request3).to.not.be.equal(request2);
|
||||
});
|
||||
|
||||
it('should dynamically resolve request-scoped controller', async () => {
|
||||
const request1 = await testingModule.resolve(ScopedController);
|
||||
const request2 = await testingModule.resolve(ScopedController);
|
||||
const request3 = await testingModule.resolve(ScopedController, { id: 1 });
|
||||
|
||||
expect(request1).to.be.instanceOf(ScopedController);
|
||||
expect(request2).to.be.instanceOf(ScopedController);
|
||||
expect(request3).to.not.be.equal(request2);
|
||||
});
|
||||
|
||||
it('should throw an exception when "get()" method is used', async () => {
|
||||
try {
|
||||
testingModule.get(ScopedController);
|
||||
} catch (err) {
|
||||
expect(err).to.be.instanceOf(InvalidClassScopeException);
|
||||
}
|
||||
});
|
||||
});
|
||||
100
integration/injector/package-lock.json
generated
100
integration/injector/package-lock.json
generated
@@ -5,32 +5,32 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.5.3.tgz",
|
||||
"integrity": "sha512-T9zZf61myahenI4c0qhcYnhnx49L+zL9+8W6fc+LPTarbt1HJDu6iyj6fh2BzewakwNLJRyGMJ9YCYlXhFuvlA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.6.7.tgz",
|
||||
"integrity": "sha512-YhjJEB326Ms5Q6D9xC6uQc65gS3CM61xPvyWospnwGUz7o5RVie0BT33Ja4CQ33OIRvqEVqn5Fi2BcQmNZiYxg==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
@@ -38,17 +38,17 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.5.3.tgz",
|
||||
"integrity": "sha512-W8tPhkNVhmX+jaDu4R7WUOtIl0PK3ZDso434rEm/b1+S6ZRgAKwNVHWM/rwIuTi5+erPTEULtTsZgrXFrzC1sA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.6.7.tgz",
|
||||
"integrity": "sha512-SKP1aTnTKTKbzL7QqiVmQC3EEZH7javf67GZMuFkIJ5hVCEuc6FEdfV9iyCGH6hC/68ArCa8U8jbxt9+CbyPew==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.5.3.tgz",
|
||||
"integrity": "sha512-YrCvmLHTW0OBusTiUOPrG0PNrw/3Gatty/bh3ro5cEoiovcaJxGSMsTC+JSVXqPwRJjEtoHMCr5Qje2rAepIzQ==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.6.7.tgz",
|
||||
"integrity": "sha512-wq6sp0Vw3CAU/h+aXhDm6AZBA/vxIB55Nc114R5RNTIDFU7NuTLTnKLcTvWDatDu5tcwtOAKqx4GXWyTytmQ8w==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
}
|
||||
@@ -88,9 +88,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -181,9 +181,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -228,9 +228,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -468,9 +468,9 @@
|
||||
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -488,9 +488,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -575,9 +575,9 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -588,19 +588,19 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
@@ -609,9 +609,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
@@ -619,9 +619,9 @@
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/microservices": "6.5.3",
|
||||
"@nestjs/testing": "6.5.3",
|
||||
"@nestjs/websockets": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/microservices": "6.6.7",
|
||||
"@nestjs/testing": "6.6.7",
|
||||
"@nestjs/websockets": "6.6.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0"
|
||||
"ts-node": "8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
7
integration/injector/src/scoped/scoped.controller.ts
Normal file
7
integration/injector/src/scoped/scoped.controller.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Controller, Scope } from '@nestjs/common';
|
||||
|
||||
@Controller({
|
||||
path: 'test',
|
||||
scope: Scope.REQUEST,
|
||||
})
|
||||
export class ScopedController {}
|
||||
10
integration/injector/src/scoped/scoped.module.ts
Normal file
10
integration/injector/src/scoped/scoped.module.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ScopedController } from './scoped.controller';
|
||||
import { ScopedService } from './scoped.service';
|
||||
import { TransientService } from './transient.service';
|
||||
|
||||
@Module({
|
||||
controllers: [ScopedController],
|
||||
providers: [ScopedService, TransientService],
|
||||
})
|
||||
export class ScopedModule {}
|
||||
4
integration/injector/src/scoped/scoped.service.ts
Normal file
4
integration/injector/src/scoped/scoped.service.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Injectable, Scope } from '@nestjs/common';
|
||||
|
||||
@Injectable({ scope: Scope.REQUEST })
|
||||
export class ScopedService {}
|
||||
4
integration/injector/src/scoped/transient.service.ts
Normal file
4
integration/injector/src/scoped/transient.service.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Injectable, Scope } from '@nestjs/common';
|
||||
|
||||
@Injectable({ scope: Scope.TRANSIENT })
|
||||
export class TransientService {}
|
||||
@@ -18,9 +18,15 @@ describe('MQTT transport', () => {
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.MQTT,
|
||||
options: {
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
});
|
||||
app.connectMicroservice({
|
||||
transport: Transport.MQTT,
|
||||
options: {
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
|
||||
@@ -18,9 +18,15 @@ describe('NATS transport', () => {
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.NATS,
|
||||
options: {
|
||||
url: 'nats://0.0.0.0:4222',
|
||||
},
|
||||
});
|
||||
app.connectMicroservice({
|
||||
transport: Transport.NATS,
|
||||
options: {
|
||||
url: 'nats://0.0.0.0:4222',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
|
||||
@@ -18,9 +18,15 @@ describe('REDIS transport', () => {
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.REDIS,
|
||||
options: {
|
||||
url: 'redis://0.0.0.0:6379',
|
||||
},
|
||||
});
|
||||
app.connectMicroservice({
|
||||
transport: Transport.REDIS,
|
||||
options: {
|
||||
url: 'redis://0.0.0.0:6379',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
|
||||
140
integration/microservices/e2e/sum-kafka.spec.ts
Normal file
140
integration/microservices/e2e/sum-kafka.spec.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Transport } from '@nestjs/microservices';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import * as request from 'supertest';
|
||||
import { BusinessDto } from '../src/kafka/dtos/business.dto';
|
||||
import { UserDto } from '../src/kafka/dtos/user.dto';
|
||||
import { UserEntity } from '../src/kafka/entities/user.entity';
|
||||
import { KafkaController } from '../src/kafka/kafka.controller';
|
||||
import { KafkaMessagesController } from '../src/kafka/kafka.messages.controller';
|
||||
|
||||
describe('Kafka transport', () => {
|
||||
let server;
|
||||
let app: INestApplication;
|
||||
|
||||
it(`Start Kafka app`, async () => {
|
||||
const module = await Test.createTestingModule({
|
||||
controllers: [KafkaController, KafkaMessagesController],
|
||||
}).compile();
|
||||
|
||||
app = module.createNestApplication();
|
||||
server = app.getHttpAdapter().getInstance();
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.KAFKA,
|
||||
options: {
|
||||
client: {
|
||||
brokers: ['localhost:9092'],
|
||||
},
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
}).timeout(30000);
|
||||
|
||||
it(`/POST (sync sum kafka message)`, () => {
|
||||
return request(server)
|
||||
.post('/mathSumSyncKafkaMessage')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200)
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (sync sum kafka(ish) message without key and only the value)`, () => {
|
||||
return request(server)
|
||||
.post('/mathSumSyncWithoutKey')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200)
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (sync sum plain object)`, () => {
|
||||
return request(server)
|
||||
.post('/mathSumSyncPlainObject')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200)
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (sync sum array)`, () => {
|
||||
return request(server)
|
||||
.post('/mathSumSyncArray')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200)
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (sync sum string)`, () => {
|
||||
return request(server)
|
||||
.post('/mathSumSyncString')
|
||||
.send([1, 2, 3, 4, 5])
|
||||
.expect(200)
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (sync sum number)`, () => {
|
||||
return request(server)
|
||||
.post('/mathSumSyncNumber')
|
||||
.send([12345])
|
||||
.expect(200)
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
it(`/POST (async event notification)`, done => {
|
||||
request(server)
|
||||
.post('/notify')
|
||||
.send()
|
||||
.end(() => {
|
||||
setTimeout(() => {
|
||||
expect(KafkaController.IS_NOTIFIED).to.be.true;
|
||||
done();
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
const userDto: UserDto = {
|
||||
email: 'enriquebenavidesm@gmail.com',
|
||||
name: 'Ben',
|
||||
phone: '1112223331',
|
||||
years: 33,
|
||||
};
|
||||
const newUser: UserEntity = new UserEntity(userDto);
|
||||
const businessDto: BusinessDto = {
|
||||
name: 'Example',
|
||||
phone: '2233441122',
|
||||
user: newUser,
|
||||
};
|
||||
it(`/POST (sync command create user)`, () => {
|
||||
return request(server)
|
||||
.post('/user')
|
||||
.send(userDto)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it(`/POST (sync command create business`, () => {
|
||||
return request(server)
|
||||
.post('/business')
|
||||
.send(businessDto)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
it(`/POST (sync command create user) Concurrency Test`, async () => {
|
||||
const promises = [];
|
||||
for (let concurrencyKey = 0; concurrencyKey < 100; concurrencyKey++) {
|
||||
const innerUserDto = JSON.parse(JSON.stringify(userDto));
|
||||
innerUserDto.name += `+${concurrencyKey}`;
|
||||
promises.push(
|
||||
request(server)
|
||||
.post('/user')
|
||||
.send(userDto)
|
||||
.expect(200),
|
||||
);
|
||||
}
|
||||
await Promise.all(promises);
|
||||
});
|
||||
|
||||
after(`Stopping Kafka app`, async () => {
|
||||
await app.close();
|
||||
});
|
||||
}).timeout(30000);
|
||||
@@ -19,6 +19,9 @@ describe('MQTT transport', () => {
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.MQTT,
|
||||
options: {
|
||||
url: 'mqtt://0.0.0.0:1883',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
@@ -46,6 +49,8 @@ describe('MQTT transport', () => {
|
||||
.expect(200, '15');
|
||||
});
|
||||
|
||||
/**
|
||||
* Figure out race conditions here (flaky tests)
|
||||
it(`/POST (concurrent)`, function() {
|
||||
this.retries(10);
|
||||
return request(server)
|
||||
@@ -63,7 +68,7 @@ describe('MQTT transport', () => {
|
||||
Array.from({ length: 10 }, (v, k) => k + 91),
|
||||
])
|
||||
.expect(200, 'true');
|
||||
}).timeout(5000);
|
||||
}).timeout(5000); */
|
||||
|
||||
it(`/POST (streaming)`, () => {
|
||||
return request(server)
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('NATS transport', () => {
|
||||
app.connectMicroservice({
|
||||
transport: Transport.NATS,
|
||||
options: {
|
||||
url: 'nats://localhost:4222',
|
||||
url: 'nats://0.0.0.0:4222',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
|
||||
@@ -19,6 +19,9 @@ describe('REDIS transport', () => {
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.REDIS,
|
||||
options: {
|
||||
url: 'redis://0.0.0.0:6379',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('RabbitMQ transport', () => {
|
||||
app.connectMicroservice({
|
||||
transport: Transport.RMQ,
|
||||
options: {
|
||||
urls: [`amqp://localhost:5672`],
|
||||
urls: [`amqp://0.0.0.0:5672`],
|
||||
queue: 'test',
|
||||
queueOptions: { durable: false },
|
||||
socketOptions: { noDelay: true },
|
||||
|
||||
@@ -20,6 +20,9 @@ describe('RPC transport', () => {
|
||||
|
||||
app.connectMicroservice({
|
||||
transport: Transport.TCP,
|
||||
options: {
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
await app.init();
|
||||
|
||||
106
integration/microservices/package-lock.json
generated
106
integration/microservices/package-lock.json
generated
@@ -5,32 +5,32 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.5.3.tgz",
|
||||
"integrity": "sha512-T9zZf61myahenI4c0qhcYnhnx49L+zL9+8W6fc+LPTarbt1HJDu6iyj6fh2BzewakwNLJRyGMJ9YCYlXhFuvlA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.6.7.tgz",
|
||||
"integrity": "sha512-YhjJEB326Ms5Q6D9xC6uQc65gS3CM61xPvyWospnwGUz7o5RVie0BT33Ja4CQ33OIRvqEVqn5Fi2BcQmNZiYxg==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
@@ -38,9 +38,9 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/platform-express": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-6.5.3.tgz",
|
||||
"integrity": "sha512-c5n4XUbDDmF6MfBGYWM1jtsIDpVsOfOQtf3S0w3IeJNqm7dnmVAvO2Jk+RsYpt50tN4NAXntM3YTuTDqMb9uiA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-6.6.7.tgz",
|
||||
"integrity": "sha512-cflh5DqKF3ofhs2wWKij4JJ25fxJB0/04jLzX2WZDssU8FFPzlLg/mU+VoJqar6VT9taZl/Q6LnRGSjiRnXhUw==",
|
||||
"requires": {
|
||||
"body-parser": "1.19.0",
|
||||
"cors": "2.8.5",
|
||||
@@ -49,17 +49,17 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.5.3.tgz",
|
||||
"integrity": "sha512-W8tPhkNVhmX+jaDu4R7WUOtIl0PK3ZDso434rEm/b1+S6ZRgAKwNVHWM/rwIuTi5+erPTEULtTsZgrXFrzC1sA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.6.7.tgz",
|
||||
"integrity": "sha512-SKP1aTnTKTKbzL7QqiVmQC3EEZH7javf67GZMuFkIJ5hVCEuc6FEdfV9iyCGH6hC/68ArCa8U8jbxt9+CbyPew==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.5.3.tgz",
|
||||
"integrity": "sha512-YrCvmLHTW0OBusTiUOPrG0PNrw/3Gatty/bh3ro5cEoiovcaJxGSMsTC+JSVXqPwRJjEtoHMCr5Qje2rAepIzQ==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.6.7.tgz",
|
||||
"integrity": "sha512-wq6sp0Vw3CAU/h+aXhDm6AZBA/vxIB55Nc114R5RNTIDFU7NuTLTnKLcTvWDatDu5tcwtOAKqx4GXWyTytmQ8w==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
}
|
||||
@@ -136,9 +136,9 @@
|
||||
"integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY="
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"array-flatten": {
|
||||
@@ -324,9 +324,9 @@
|
||||
}
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"content-disposition": {
|
||||
"version": "0.5.3",
|
||||
@@ -431,9 +431,9 @@
|
||||
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -910,9 +910,9 @@
|
||||
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -992,9 +992,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -1099,9 +1099,9 @@
|
||||
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -1112,14 +1112,14 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"type-is": {
|
||||
"version": "1.6.18",
|
||||
@@ -1151,9 +1151,9 @@
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"unpipe": {
|
||||
"version": "1.0.0",
|
||||
@@ -1171,9 +1171,9 @@
|
||||
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
@@ -1191,9 +1191,9 @@
|
||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/microservices": "6.5.3",
|
||||
"@nestjs/platform-express": "6.5.3",
|
||||
"@nestjs/testing": "6.5.3",
|
||||
"@nestjs/websockets": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/microservices": "6.6.7",
|
||||
"@nestjs/platform-express": "6.6.7",
|
||||
"@nestjs/testing": "6.6.7",
|
||||
"@nestjs/websockets": "6.6.7",
|
||||
"amqp-connection-manager": "3.0.0",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0"
|
||||
"ts-node": "8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
7
integration/microservices/src/kafka/dtos/business.dto.ts
Normal file
7
integration/microservices/src/kafka/dtos/business.dto.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { UserEntity } from '../entities/user.entity';
|
||||
|
||||
export class BusinessDto {
|
||||
name: string;
|
||||
phone: string;
|
||||
user: UserEntity;
|
||||
}
|
||||
6
integration/microservices/src/kafka/dtos/user.dto.ts
Normal file
6
integration/microservices/src/kafka/dtos/user.dto.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export class UserDto {
|
||||
name: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
years: number;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { UserEntity } from './user.entity';
|
||||
import { BusinessDto } from '../dtos/business.dto';
|
||||
|
||||
export class BusinessEntity {
|
||||
constructor(business: BusinessDto) {
|
||||
this.id = Math.random() * 99999999;
|
||||
this.name = business.name;
|
||||
this.phone = business.phone;
|
||||
this.createdBy = {
|
||||
id: business.user.id,
|
||||
};
|
||||
this.created = new Date();
|
||||
}
|
||||
id: number;
|
||||
name: string;
|
||||
phone: string;
|
||||
createdBy: Partial<UserEntity>;
|
||||
created: Date;
|
||||
}
|
||||
18
integration/microservices/src/kafka/entities/user.entity.ts
Normal file
18
integration/microservices/src/kafka/entities/user.entity.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { UserDto } from '../dtos/user.dto';
|
||||
|
||||
export class UserEntity {
|
||||
constructor(user: UserDto) {
|
||||
this.id = Math.random() * 99999999;
|
||||
this.name = user.name;
|
||||
this.email = user.email;
|
||||
this.phone = user.phone;
|
||||
this.years = user.years;
|
||||
this.created = new Date();
|
||||
}
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
years: number;
|
||||
created: Date;
|
||||
}
|
||||
152
integration/microservices/src/kafka/kafka.controller.ts
Normal file
152
integration/microservices/src/kafka/kafka.controller.ts
Normal file
@@ -0,0 +1,152 @@
|
||||
import { Body, Controller, HttpCode, OnModuleInit, Post } from '@nestjs/common';
|
||||
import { Logger } from '@nestjs/common/services/logger.service';
|
||||
import { Client, ClientKafka, Transport } from '@nestjs/microservices';
|
||||
import { Observable } from 'rxjs';
|
||||
import { BusinessDto } from './dtos/business.dto';
|
||||
import { UserDto } from './dtos/user.dto';
|
||||
|
||||
@Controller()
|
||||
export class KafkaController implements OnModuleInit {
|
||||
protected readonly logger = new Logger(KafkaController.name);
|
||||
static IS_NOTIFIED = false;
|
||||
static MATH_SUM = 0;
|
||||
|
||||
@Client({
|
||||
transport: Transport.KAFKA,
|
||||
options: {
|
||||
client: {
|
||||
brokers: ['localhost:9092'],
|
||||
},
|
||||
},
|
||||
})
|
||||
private readonly client: ClientKafka;
|
||||
|
||||
onModuleInit() {
|
||||
const requestPatterns = [
|
||||
'math.sum.sync.kafka.message',
|
||||
'math.sum.sync.without.key',
|
||||
'math.sum.sync.plain.object',
|
||||
'math.sum.sync.array',
|
||||
'math.sum.sync.string',
|
||||
'math.sum.sync.number',
|
||||
'user.create',
|
||||
'business.create',
|
||||
];
|
||||
|
||||
requestPatterns.forEach(pattern => {
|
||||
this.client.subscribeToResponseOf(pattern);
|
||||
});
|
||||
}
|
||||
|
||||
// sync send kafka message
|
||||
@Post('mathSumSyncKafkaMessage')
|
||||
@HttpCode(200)
|
||||
async mathSumSyncKafkaMessage(
|
||||
@Body() data: number[],
|
||||
): Promise<Observable<any>> {
|
||||
const result = await this.client
|
||||
.send('math.sum.sync.kafka.message', {
|
||||
key: '1',
|
||||
value: {
|
||||
numbers: data,
|
||||
},
|
||||
})
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
// sync send kafka(ish) message without key and only the value
|
||||
@Post('mathSumSyncWithoutKey')
|
||||
@HttpCode(200)
|
||||
async mathSumSyncWithoutKey(
|
||||
@Body() data: number[],
|
||||
): Promise<Observable<any>> {
|
||||
const result = await this.client
|
||||
.send('math.sum.sync.without.key', {
|
||||
value: {
|
||||
numbers: data,
|
||||
},
|
||||
})
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
// sync send message without key or value
|
||||
@Post('mathSumSyncPlainObject')
|
||||
@HttpCode(200)
|
||||
async mathSumSyncPlainObject(
|
||||
@Body() data: number[],
|
||||
): Promise<Observable<any>> {
|
||||
const result = await this.client
|
||||
.send('math.sum.sync.plain.object', {
|
||||
numbers: data,
|
||||
})
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
// sync send message without key or value
|
||||
@Post('mathSumSyncArray')
|
||||
@HttpCode(200)
|
||||
async mathSumSyncArray(@Body() data: number[]): Promise<Observable<any>> {
|
||||
const result = await this.client
|
||||
.send('math.sum.sync.array', data)
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Post('mathSumSyncString')
|
||||
@HttpCode(200)
|
||||
async mathSumSyncString(@Body() data: number[]): Promise<Observable<any>> {
|
||||
// this.logger.error(util.format('mathSumSyncString() data: %o', data));
|
||||
const result = await this.client
|
||||
.send('math.sum.sync.string', data.toString())
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Post('mathSumSyncNumber')
|
||||
@HttpCode(200)
|
||||
async mathSumSyncNumber(@Body() data: number[]): Promise<Observable<any>> {
|
||||
const result = await this.client
|
||||
.send('math.sum.sync.number', data[0])
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
// async notify
|
||||
@Post('notify')
|
||||
async sendNotification(): Promise<any> {
|
||||
return this.client.emit('notify', { notify: true });
|
||||
}
|
||||
|
||||
// Complex data to send.
|
||||
@Post('/user')
|
||||
@HttpCode(200)
|
||||
async createUser(@Body() user: UserDto): Promise<Observable<any>> {
|
||||
const result = await this.client
|
||||
.send('user.create', {
|
||||
key: '1',
|
||||
value: {
|
||||
user,
|
||||
},
|
||||
})
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Complex data to send.
|
||||
@Post('/business')
|
||||
@HttpCode(200)
|
||||
async createBusiness(@Body() business: BusinessDto) {
|
||||
const result = await this.client
|
||||
.send('business.create', {
|
||||
key: '1',
|
||||
value: {
|
||||
business,
|
||||
},
|
||||
})
|
||||
.toPromise();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
import { Logger } from '@nestjs/common/services/logger.service';
|
||||
import { EventPattern, MessagePattern } from '@nestjs/microservices';
|
||||
import { BusinessDto } from './dtos/business.dto';
|
||||
import { UserDto } from './dtos/user.dto';
|
||||
import { BusinessEntity } from './entities/business.entity';
|
||||
import { UserEntity } from './entities/user.entity';
|
||||
import { KafkaController } from './kafka.controller';
|
||||
|
||||
@Controller()
|
||||
export class KafkaMessagesController {
|
||||
protected readonly logger = new Logger(KafkaMessagesController.name);
|
||||
static IS_NOTIFIED = false;
|
||||
|
||||
@MessagePattern('math.sum.sync.kafka.message')
|
||||
mathSumSyncKafkaMessage(data: any) {
|
||||
return (data.value.numbers || []).reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
@MessagePattern('math.sum.sync.without.key')
|
||||
mathSumSyncWithoutKey(data: any) {
|
||||
return (data.value.numbers || []).reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
@MessagePattern('math.sum.sync.plain.object')
|
||||
mathSumSyncPlainObject(data: any) {
|
||||
return (data.value.numbers || []).reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
@MessagePattern('math.sum.sync.array')
|
||||
mathSumSyncArray(data: any) {
|
||||
return (data.value || []).reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
@MessagePattern('math.sum.sync.string')
|
||||
mathSumSyncString(data: any) {
|
||||
// this.logger.error(util.format('mathSumSyncString() data: %o', data));
|
||||
return (data.value.split(',') || [])
|
||||
.map(i => {
|
||||
return parseFloat(i);
|
||||
})
|
||||
.reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
@MessagePattern('math.sum.sync.number')
|
||||
mathSumSyncNumber(data: any) {
|
||||
// this.logger.error(util.format('mathSumSyncNumber() data: %o', data));
|
||||
return (data.value.toString().split('') || [])
|
||||
.map(i => {
|
||||
return parseFloat(i);
|
||||
})
|
||||
.reduce((a, b) => a + b);
|
||||
}
|
||||
|
||||
@EventPattern('notify')
|
||||
eventHandler(data: any) {
|
||||
KafkaController.IS_NOTIFIED = data.value.notify;
|
||||
}
|
||||
|
||||
// Complex data to send.
|
||||
@MessagePattern('user.create')
|
||||
async createUser(params: { value: { user: UserDto } }) {
|
||||
return new UserEntity(params.value.user);
|
||||
}
|
||||
|
||||
@MessagePattern('business.create')
|
||||
async createBusiness(params: { value: { business: BusinessDto } }) {
|
||||
return new BusinessEntity(params.value.business);
|
||||
}
|
||||
}
|
||||
169
integration/mongoose/package-lock.json
generated
169
integration/mongoose/package-lock.json
generated
@@ -25,26 +25,26 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/mongoose": {
|
||||
@@ -72,9 +72,9 @@
|
||||
}
|
||||
},
|
||||
"@types/mongodb": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.0.tgz",
|
||||
"integrity": "sha512-YMrve0uBOqFDEiezQk3AfWV73g871/rQTAEb8Y2CSlbySnV/2OyerI1DAOUUJQaIqGEWWaYF6GMPO6wTErLUuw==",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.1.tgz",
|
||||
"integrity": "sha512-Va7o1fN3zeabmIJSQ6yuAWkqPvrT38HSTIi4YbVOb2UL7FJ4diXrWt+OUuuEFWAVPtF9VZV5h+7LDYdzgXWgQA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/bson": "*",
|
||||
@@ -82,9 +82,9 @@
|
||||
}
|
||||
},
|
||||
"@types/mongoose": {
|
||||
"version": "5.5.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.13.tgz",
|
||||
"integrity": "sha512-k7Kxk5gugsZhkl7euWH1p6lmIdh9W8AsQgX0cO7kaihBie/P3ywU8LFMqo9ey6frdHBlGVaNICTeFZ/pZ6s5Lg==",
|
||||
"version": "5.5.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.17.tgz",
|
||||
"integrity": "sha512-Nv7Fmun31np7YpNw9s2Aib+bqErDeO2QQZgtl4zUJSwY4Fyp+UDYV/nWANEbKMFU0fkQ3aNbnkODziL1YtSdbg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/mongodb": "*",
|
||||
@@ -111,9 +111,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
@@ -229,9 +229,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"d": {
|
||||
"version": "1.0.1",
|
||||
@@ -258,15 +258,15 @@
|
||||
}
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
|
||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -415,9 +415,9 @@
|
||||
}
|
||||
},
|
||||
"kareem": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz",
|
||||
"integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg=="
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz",
|
||||
"integrity": "sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw=="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
@@ -453,12 +453,6 @@
|
||||
"timers-ext": "^0.1.5"
|
||||
}
|
||||
},
|
||||
"memory-pager": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
|
||||
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
|
||||
"optional": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
@@ -484,35 +478,24 @@
|
||||
}
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.2.7.tgz",
|
||||
"integrity": "sha512-2YdWrdf1PJgxcCrT1tWoL6nHuk6hCxhddAAaEh8QJL231ci4+P9FLyqopbTm2Z2sAU6mhCri+wd9r1hOcHdoMw==",
|
||||
"requires": {
|
||||
"mongodb-core": "3.2.7",
|
||||
"safe-buffer": "^5.1.2"
|
||||
}
|
||||
},
|
||||
"mongodb-core": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.2.7.tgz",
|
||||
"integrity": "sha512-WypKdLxFNPOH/Jy6i9z47IjG2wIldA54iDZBmHMINcgKOUcWJh8og+Wix76oGd7EyYkHJKssQ2FAOw5Su/n4XQ==",
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.3.2.tgz",
|
||||
"integrity": "sha512-fqJt3iywelk4yKu/lfwQg163Bjpo5zDKhXiohycvon4iQHbrfflSAz9AIlRE6496Pm/dQKQK5bMigdVo2s6gBg==",
|
||||
"requires": {
|
||||
"bson": "^1.1.1",
|
||||
"require_optional": "^1.0.1",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"saslprep": "^1.0.0"
|
||||
"safe-buffer": "^5.1.2"
|
||||
}
|
||||
},
|
||||
"mongoose": {
|
||||
"version": "5.6.10",
|
||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.10.tgz",
|
||||
"integrity": "sha512-lxWvF4Vl2118K2nZTj+QAEEmNBCbmUAcmF/roe8d+68Np4RXKEQvmpqm1c3aIlE9AVMp//eKB8IfXr38ZHe0Zw==",
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.1.tgz",
|
||||
"integrity": "sha512-TJeZHb5h8UGH++ctngh2shgZuZmR9o0D8elxfkWzIpKB6QAFsJPmALtDuD6RYZTS33+CifhDdAMGqs3OpJ3cyQ==",
|
||||
"requires": {
|
||||
"async": "2.6.2",
|
||||
"bson": "~1.1.1",
|
||||
"kareem": "2.3.0",
|
||||
"mongodb": "3.2.7",
|
||||
"mongodb-core": "3.2.7",
|
||||
"kareem": "2.3.1",
|
||||
"mongodb": "3.3.2",
|
||||
"mongoose-legacy-pluralize": "1.0.2",
|
||||
"mpath": "0.6.0",
|
||||
"mquery": "3.2.1",
|
||||
@@ -625,9 +608,9 @@
|
||||
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -637,15 +620,6 @@
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"saslprep": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
|
||||
"integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"sparse-bitfield": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||
@@ -668,24 +642,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"sparse-bitfield": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
|
||||
"integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"memory-pager": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
@@ -710,9 +675,9 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -720,14 +685,6 @@
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"diff": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
@@ -736,16 +693,16 @@
|
||||
"integrity": "sha512-avfPS28HmGLLc2o4elcc2EIq2FcH++Yo5YxpBZi9Yw93BCTGFthI4HPE4Rpep6vSYQaK8e69PelM44tPj+RaQg=="
|
||||
},
|
||||
"tslint": {
|
||||
"version": "5.19.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz",
|
||||
"integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==",
|
||||
"version": "5.20.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.0.tgz",
|
||||
"integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"builtin-modules": "^1.1.1",
|
||||
"chalk": "^2.3.0",
|
||||
"commander": "^2.12.1",
|
||||
"diff": "^3.2.0",
|
||||
"diff": "^4.0.1",
|
||||
"glob": "^7.1.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"minimatch": "^3.0.4",
|
||||
@@ -766,19 +723,19 @@
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
@@ -787,9 +744,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/mongoose": "6.1.2",
|
||||
"mongoose": "5.6.10",
|
||||
"mongoose": "5.7.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mongoose": "5.5.13",
|
||||
"@types/mongoose": "5.5.17",
|
||||
"@types/node": "7.10.7",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.19.0"
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0"
|
||||
}
|
||||
}
|
||||
|
||||
148
integration/scopes/package-lock.json
generated
148
integration/scopes/package-lock.json
generated
@@ -5,32 +5,32 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.5.3.tgz",
|
||||
"integrity": "sha512-T9zZf61myahenI4c0qhcYnhnx49L+zL9+8W6fc+LPTarbt1HJDu6iyj6fh2BzewakwNLJRyGMJ9YCYlXhFuvlA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.6.7.tgz",
|
||||
"integrity": "sha512-YhjJEB326Ms5Q6D9xC6uQc65gS3CM61xPvyWospnwGUz7o5RVie0BT33Ja4CQ33OIRvqEVqn5Fi2BcQmNZiYxg==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
@@ -38,17 +38,17 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.5.3.tgz",
|
||||
"integrity": "sha512-W8tPhkNVhmX+jaDu4R7WUOtIl0PK3ZDso434rEm/b1+S6ZRgAKwNVHWM/rwIuTi5+erPTEULtTsZgrXFrzC1sA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.6.7.tgz",
|
||||
"integrity": "sha512-SKP1aTnTKTKbzL7QqiVmQC3EEZH7javf67GZMuFkIJ5hVCEuc6FEdfV9iyCGH6hC/68ArCa8U8jbxt9+CbyPew==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.5.3.tgz",
|
||||
"integrity": "sha512-YrCvmLHTW0OBusTiUOPrG0PNrw/3Gatty/bh3ro5cEoiovcaJxGSMsTC+JSVXqPwRJjEtoHMCr5Qje2rAepIzQ==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.6.7.tgz",
|
||||
"integrity": "sha512-wq6sp0Vw3CAU/h+aXhDm6AZBA/vxIB55Nc114R5RNTIDFU7NuTLTnKLcTvWDatDu5tcwtOAKqx4GXWyTytmQ8w==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
}
|
||||
@@ -109,9 +109,9 @@
|
||||
"integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA="
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -121,9 +121,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"avvio": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/avvio/-/avvio-6.2.1.tgz",
|
||||
"integrity": "sha512-k+gTocL3yShwN1PtKEsSj7eFiApcZ4JZLAu/ecyzEb8jyx+Kmxb+7SXUsodB47g7fqhs/zkfsCdqq72a1ok5Ew==",
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/avvio/-/avvio-6.2.2.tgz",
|
||||
"integrity": "sha512-7+yznbJOMoHQ8Z8VH+1meyRjtxUW8za6gqnHBl8DqlX5qPtaclNIgWrKrTLuIbfn2+1/EGkcr+rQXI8DYVU4RA==",
|
||||
"requires": {
|
||||
"archy": "^1.0.0",
|
||||
"debug": "^4.0.0",
|
||||
@@ -227,9 +227,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -278,9 +278,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -372,19 +372,19 @@
|
||||
"integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg=="
|
||||
},
|
||||
"fastify": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.7.1.tgz",
|
||||
"integrity": "sha512-ScKPXD84lkdCgz7q0zjyBr1aLxKbXRt9HYL3XIt/L8ZD2f3fAcsLEyQ2/rHxLUzLGjPlEjIvprWUL3RZvlLRLw==",
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/fastify/-/fastify-2.8.0.tgz",
|
||||
"integrity": "sha512-+HXe9xZzbj79680hlehEs0B1Z3e5RQT6CtPthseqgRJy2i7Wlro8EEdM7u7ewwL9XREjLWssCPlJiZ3G+t4qsw==",
|
||||
"requires": {
|
||||
"abstract-logging": "^1.0.0",
|
||||
"ajv": "^6.10.2",
|
||||
"avvio": "^6.1.1",
|
||||
"fast-json-stringify": "^1.15.0",
|
||||
"avvio": "^6.2.2",
|
||||
"fast-json-stringify": "^1.15.4",
|
||||
"find-my-way": "^2.0.0",
|
||||
"flatstr": "^1.0.12",
|
||||
"light-my-request": "^3.4.1",
|
||||
"middie": "^4.0.1",
|
||||
"pino": "^5.13.1",
|
||||
"pino": "^5.13.2",
|
||||
"proxy-addr": "^2.0.4",
|
||||
"readable-stream": "^3.1.1",
|
||||
"rfdc": "^1.1.2",
|
||||
@@ -401,9 +401,9 @@
|
||||
}
|
||||
},
|
||||
"find-my-way": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.1.0.tgz",
|
||||
"integrity": "sha512-Hdx6ctcrzkZH5y9EREHtXryXAgc5Bc8z5Cvoa61y9kaoYj2KU4yXD6h8b6u0NUkYPVmQQeRdf0AtG1kQxQ+ukQ==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-2.1.1.tgz",
|
||||
"integrity": "sha512-yznKDx1xELFkTrV2Ke9x3IOr9zn5isdFA2Af/NKjU8kmQQhtn3TmqrVZ6OiLO5pj1dAScxe4dAo92ieG4nGcoA==",
|
||||
"requires": {
|
||||
"fast-decode-uri-component": "^1.0.0",
|
||||
"safe-regex2": "^2.0.0",
|
||||
@@ -595,9 +595,9 @@
|
||||
"integrity": "sha512-ZOtfhPttCrqp2M1PBBH4X13XlvnfhIwD7yCLx+GoGoXRPQyxGOTdQMpIzPSPKXAJT/JQrdfFrgdJOyAzvgpQ9A=="
|
||||
},
|
||||
"pino": {
|
||||
"version": "5.13.1",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.1.tgz",
|
||||
"integrity": "sha512-IxusG28L0g50uuf21kZELypdFOeNrJ/kRhktdi7LtdZQWCxLliMxG5iOrGUQ/ng7MiJ4XqXi/hfyXwZeKc1MxA==",
|
||||
"version": "5.13.2",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.2.tgz",
|
||||
"integrity": "sha512-WwOSCy36/gWhinsqWqAnuwIi2WtcH+jvoyeLm3bjUALIrzWIst0AovQjK4jVvSN2l64KFPfi3gd2fjsTovjdLQ==",
|
||||
"requires": {
|
||||
"fast-redact": "^1.4.4",
|
||||
"fast-safe-stringify": "^2.0.6",
|
||||
@@ -674,9 +674,9 @@
|
||||
"integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -684,7 +684,8 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
},
|
||||
"safe-regex2": {
|
||||
"version": "2.0.0",
|
||||
@@ -719,9 +720,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -729,11 +730,18 @@
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz",
|
||||
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
"safe-buffer": "~5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"superagent": {
|
||||
@@ -819,9 +827,9 @@
|
||||
"integrity": "sha512-k/vdHz+bFALjmik0URLWBYNuO0hCABTL5dullbZBXvFDdlL8RrKaeLR6YuHfX+6ZXOLkHw+HpNLCUA7DtLMQmg=="
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -832,19 +840,19 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"uri-js": {
|
||||
"version": "4.2.2",
|
||||
@@ -860,9 +868,9 @@
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
@@ -870,9 +878,9 @@
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/microservices": "6.5.3",
|
||||
"@nestjs/testing": "6.5.3",
|
||||
"@nestjs/websockets": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/microservices": "6.6.7",
|
||||
"@nestjs/testing": "6.6.7",
|
||||
"@nestjs/websockets": "6.6.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"fastify": "2.7.1",
|
||||
"fastify": "2.8.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0"
|
||||
"ts-node": "8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
847
integration/typegraphql/package-lock.json
generated
847
integration/typegraphql/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,24 +9,24 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/graphql": "6.4.2",
|
||||
"apollo-server-express": "2.8.1",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/graphql": "6.5.1",
|
||||
"apollo-server-express": "2.9.3",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"graphql": "14.5.0",
|
||||
"graphql": "14.5.6",
|
||||
"graphql-tools": "4.0.5",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"rxjs": "6.5.3",
|
||||
"subscriptions-transport-ws": "0.9.16",
|
||||
"type-graphql": "0.17.5",
|
||||
"typescript": "3.5.3",
|
||||
"typescript": "3.6.3",
|
||||
"ws": "7.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.19.0"
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0"
|
||||
}
|
||||
}
|
||||
|
||||
469
integration/typeorm/package-lock.json
generated
469
integration/typeorm/package-lock.json
generated
@@ -25,26 +25,40 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"uuid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"uuid": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@nestjs/typeorm": {
|
||||
@@ -107,9 +121,9 @@
|
||||
"integrity": "sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA=="
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
@@ -135,9 +149,9 @@
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
|
||||
"integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw=="
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
|
||||
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="
|
||||
},
|
||||
"bignumber.js": {
|
||||
"version": "7.2.1",
|
||||
@@ -154,9 +168,9 @@
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==",
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz",
|
||||
"integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==",
|
||||
"requires": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4"
|
||||
@@ -256,27 +270,15 @@
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
|
||||
"requires": {
|
||||
"nice-try": "^1.0.4",
|
||||
"path-key": "^2.0.1",
|
||||
"semver": "^5.5.0",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
},
|
||||
"d": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
||||
@@ -299,10 +301,18 @@
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||
},
|
||||
"define-properties": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
|
||||
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
|
||||
"requires": {
|
||||
"object-keys": "^1.0.12"
|
||||
}
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
|
||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"dev": true
|
||||
},
|
||||
"dotenv": {
|
||||
@@ -315,18 +325,37 @@
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
||||
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA=="
|
||||
},
|
||||
"end-of-stream": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
|
||||
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
|
||||
"es-abstract": {
|
||||
"version": "1.14.2",
|
||||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.2.tgz",
|
||||
"integrity": "sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==",
|
||||
"requires": {
|
||||
"once": "^1.4.0"
|
||||
"es-to-primitive": "^1.2.0",
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-symbols": "^1.0.0",
|
||||
"is-callable": "^1.1.4",
|
||||
"is-regex": "^1.0.4",
|
||||
"object-inspect": "^1.6.0",
|
||||
"object-keys": "^1.1.1",
|
||||
"string.prototype.trimleft": "^2.0.0",
|
||||
"string.prototype.trimright": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"es-to-primitive": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz",
|
||||
"integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==",
|
||||
"requires": {
|
||||
"is-callable": "^1.1.4",
|
||||
"is-date-object": "^1.0.1",
|
||||
"is-symbol": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -388,29 +417,15 @@
|
||||
"es5-ext": "~0.10.14"
|
||||
}
|
||||
},
|
||||
"execa": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
|
||||
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
|
||||
"requires": {
|
||||
"cross-spawn": "^6.0.0",
|
||||
"get-stream": "^4.0.0",
|
||||
"is-stream": "^1.1.0",
|
||||
"npm-run-path": "^2.0.0",
|
||||
"p-finally": "^1.0.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"strip-eof": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"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=="
|
||||
},
|
||||
"figlet": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/figlet/-/figlet-1.2.3.tgz",
|
||||
"integrity": "sha512-+F5zdvZ66j77b8x2KCPvWUHC0UCKUMWrewxmewgPlagp3wmDpcrHMbyv/ygq/6xoxBPGQA+UJU3SMoBzKoROQQ=="
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/figlet/-/figlet-1.2.4.tgz",
|
||||
"integrity": "sha512-mv8YA9RruB4C5QawPaD29rEVx3N97ZTyNrE4DAfbhuo6tpcMdKnPVo8MlyT3RP5uPcg5M14bEJBq7kjFf4kAWg=="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "3.0.0",
|
||||
@@ -448,19 +463,16 @@
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
||||
},
|
||||
"get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"requires": {
|
||||
"pump": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
||||
@@ -474,6 +486,14 @@
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"requires": {
|
||||
"function-bind": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"has-ansi": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
|
||||
@@ -494,10 +514,15 @@
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
|
||||
},
|
||||
"has-symbols": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
|
||||
"integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q="
|
||||
},
|
||||
"highlight.js": {
|
||||
"version": "9.15.8",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.8.tgz",
|
||||
"integrity": "sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA=="
|
||||
"version": "9.15.10",
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.10.tgz",
|
||||
"integrity": "sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw=="
|
||||
},
|
||||
"ieee754": {
|
||||
"version": "1.1.13",
|
||||
@@ -518,16 +543,21 @@
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
|
||||
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA=="
|
||||
},
|
||||
"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-callable": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
|
||||
"integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA=="
|
||||
},
|
||||
"is-date-object": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
|
||||
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
@@ -538,21 +568,27 @@
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
|
||||
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||
"is-regex": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
|
||||
"integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
|
||||
"requires": {
|
||||
"has": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"is-symbol": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
|
||||
"integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
|
||||
"requires": {
|
||||
"has-symbols": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||
},
|
||||
"iterare": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.0.tgz",
|
||||
@@ -573,14 +609,6 @@
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"lcid": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
|
||||
"integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
|
||||
"requires": {
|
||||
"invert-kv": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||
@@ -604,24 +632,6 @@
|
||||
"integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==",
|
||||
"dev": true
|
||||
},
|
||||
"map-age-cleaner": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
|
||||
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
|
||||
"requires": {
|
||||
"p-defer": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"mem": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
|
||||
"integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
|
||||
"requires": {
|
||||
"map-age-cleaner": "^0.1.1",
|
||||
"mimic-fn": "^2.0.0",
|
||||
"p-is-promise": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"memoizee": {
|
||||
"version": "0.4.14",
|
||||
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz",
|
||||
@@ -637,11 +647,6 @@
|
||||
"timers-ext": "^0.1.5"
|
||||
}
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
@@ -664,9 +669,9 @@
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"mysql": {
|
||||
"version": "2.17.1",
|
||||
@@ -694,24 +699,11 @@
|
||||
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
|
||||
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
|
||||
},
|
||||
"nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||
"requires": {
|
||||
"path-key": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
@@ -722,6 +714,25 @@
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
|
||||
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA=="
|
||||
},
|
||||
"object-inspect": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz",
|
||||
"integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ=="
|
||||
},
|
||||
"object-keys": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
||||
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
|
||||
},
|
||||
"object.getownpropertydescriptors": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
|
||||
"integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
|
||||
"requires": {
|
||||
"define-properties": "^1.1.2",
|
||||
"es-abstract": "^1.5.1"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
@@ -735,35 +746,10 @@
|
||||
"resolved": "https://registry.npmjs.org/optional/-/optional-0.1.4.tgz",
|
||||
"integrity": "sha512-gtvrrCfkE08wKcgXaVwQVgwEQ8vel2dc5DDBn9RLQZ3YtmtkBss6A2HY6BnJH4N/4Ku97Ri/SF8sNWE2225WJw=="
|
||||
},
|
||||
"os-locale": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
|
||||
"integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
|
||||
"requires": {
|
||||
"execa": "^1.0.0",
|
||||
"lcid": "^2.0.0",
|
||||
"mem": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"p-defer": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
|
||||
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww="
|
||||
},
|
||||
"p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
|
||||
},
|
||||
"p-is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
|
||||
"integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg=="
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
|
||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
|
||||
"integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
}
|
||||
@@ -801,11 +787,6 @@
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
|
||||
},
|
||||
"path-parse": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
||||
@@ -817,15 +798,6 @@
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
"requires": {
|
||||
"end-of-stream": "^1.1.0",
|
||||
"once": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.6",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||
@@ -865,9 +837,9 @@
|
||||
}
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -885,31 +857,14 @@
|
||||
"semver": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
|
||||
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
|
||||
"dev": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||
"requires": {
|
||||
"shebang-regex": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
@@ -917,9 +872,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -946,6 +901,24 @@
|
||||
"strip-ansi": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"string.prototype.trimleft": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz",
|
||||
"integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==",
|
||||
"requires": {
|
||||
"define-properties": "^1.1.3",
|
||||
"function-bind": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"string.prototype.trimright": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz",
|
||||
"integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==",
|
||||
"requires": {
|
||||
"define-properties": "^1.1.3",
|
||||
"function-bind": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
@@ -962,11 +935,6 @@
|
||||
"ansi-regex": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz",
|
||||
@@ -1001,9 +969,9 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -1011,14 +979,6 @@
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"diff": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
@@ -1027,16 +987,16 @@
|
||||
"integrity": "sha512-avfPS28HmGLLc2o4elcc2EIq2FcH++Yo5YxpBZi9Yw93BCTGFthI4HPE4Rpep6vSYQaK8e69PelM44tPj+RaQg=="
|
||||
},
|
||||
"tslint": {
|
||||
"version": "5.19.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz",
|
||||
"integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==",
|
||||
"version": "5.20.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.0.tgz",
|
||||
"integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"builtin-modules": "^1.1.1",
|
||||
"chalk": "^2.3.0",
|
||||
"commander": "^2.12.1",
|
||||
"diff": "^3.2.0",
|
||||
"diff": "^4.0.1",
|
||||
"glob": "^7.1.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"minimatch": "^3.0.4",
|
||||
@@ -1057,14 +1017,14 @@
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typeorm": {
|
||||
"version": "0.2.18",
|
||||
"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.2.18.tgz",
|
||||
"integrity": "sha512-S553GwtG5ab268+VmaLCN7gKDqFPIzUw0eGMTobJ9yr0Np62Ojfx8j1Oa9bIeh5p7Pz1/kmGabAHoP1MYK05pA==",
|
||||
"version": "0.2.19",
|
||||
"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.2.19.tgz",
|
||||
"integrity": "sha512-xKVx/W41zckQ7v8WYcpRhSKpjXDKG/Jgjy0RWvYelR8ZnfyblNRL12jF4P8tIhwXv6l5t01s7HEc9lR+zb6Gtg==",
|
||||
"requires": {
|
||||
"app-root-path": "^2.0.1",
|
||||
"buffer": "^5.1.0",
|
||||
@@ -1095,28 +1055,29 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"util.promisify": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
|
||||
"integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
|
||||
"requires": {
|
||||
"define-properties": "^1.1.2",
|
||||
"object.getownpropertydescriptors": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
@@ -1138,18 +1099,19 @@
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"xml2js": {
|
||||
"version": "0.4.19",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
|
||||
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
|
||||
"version": "0.4.22",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.22.tgz",
|
||||
"integrity": "sha512-MWTbxAQqclRSTnehWWe5nMKzI3VmJ8ltiJEco8akcC6j3miOhjjfzKum5sId+CWhfxdOs/1xauYr8/ZDBtQiRw==",
|
||||
"requires": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~9.0.1"
|
||||
"util.promisify": "~1.0.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
}
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "9.0.7",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
||||
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
|
||||
},
|
||||
"y18n": {
|
||||
"version": "4.0.0",
|
||||
@@ -1204,36 +1166,35 @@
|
||||
}
|
||||
},
|
||||
"yargs": {
|
||||
"version": "13.2.4",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz",
|
||||
"integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==",
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
|
||||
"integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
|
||||
"requires": {
|
||||
"cliui": "^5.0.0",
|
||||
"find-up": "^3.0.0",
|
||||
"get-caller-file": "^2.0.1",
|
||||
"os-locale": "^3.1.0",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^2.0.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^3.0.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^4.0.0",
|
||||
"yargs-parser": "^13.1.0"
|
||||
"yargs-parser": "^13.1.1"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "13.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.0.tgz",
|
||||
"integrity": "sha512-Yq+32PrijHRri0vVKQEm+ys8mbqWjLiwQkMFNXEENutzLPP0bE4Lcd4iA3OQY5HF+GD3xXxf0MEHb8E4/SA3AA==",
|
||||
"version": "13.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
|
||||
"integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
|
||||
"requires": {
|
||||
"camelcase": "^5.0.0",
|
||||
"decamelize": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/typeorm": "6.1.3",
|
||||
"mysql": "2.17.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typeorm": "0.2.18",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typeorm": "0.2.19",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.19.0"
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0"
|
||||
}
|
||||
}
|
||||
|
||||
100
integration/websockets/package-lock.json
generated
100
integration/websockets/package-lock.json
generated
@@ -5,32 +5,32 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.5.3.tgz",
|
||||
"integrity": "sha512-8d39grIMrUYGKM46BFWxB6csQFCu1S2aK7azPivg7gTRVSbvR84cVd6tgRVM0LwFpqQrtn3Q6G6Pa8FSk7Kh1w==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-6.6.7.tgz",
|
||||
"integrity": "sha512-F/jZ8YKJXqZj5qaDSmIauSBv/zybX85reAjuJMgBGj+gv/8FlQGvsvA0/8HPdjqDAQ2xIi4hRfe+CjZyDnxzvQ==",
|
||||
"requires": {
|
||||
"axios": "0.19.0",
|
||||
"cli-color": "1.4.0",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.5.3.tgz",
|
||||
"integrity": "sha512-ZhYfH49sVmUUw02qsaGozCFOOehlEABakYzRShyDDq30/2+ek3KpE0DfvA9tXlzX2KVrac2qDTBxMOPoJ+zY+g==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-6.6.7.tgz",
|
||||
"integrity": "sha512-SH3ZiG8+LruM3N1Csp87HocBmfn/BASwHAUkQdQxsNIBJanbOEjIc1HiPxXv0RXZMrXDM2Wt483VxZUtLsetLQ==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"iterare": "1.2.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"uuid": "3.3.2"
|
||||
"uuid": "3.3.3"
|
||||
}
|
||||
},
|
||||
"@nestjs/microservices": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.5.3.tgz",
|
||||
"integrity": "sha512-T9zZf61myahenI4c0qhcYnhnx49L+zL9+8W6fc+LPTarbt1HJDu6iyj6fh2BzewakwNLJRyGMJ9YCYlXhFuvlA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/microservices/-/microservices-6.6.7.tgz",
|
||||
"integrity": "sha512-YhjJEB326Ms5Q6D9xC6uQc65gS3CM61xPvyWospnwGUz7o5RVie0BT33Ja4CQ33OIRvqEVqn5Fi2BcQmNZiYxg==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0",
|
||||
"json-socket": "0.3.0",
|
||||
@@ -38,17 +38,17 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.5.3.tgz",
|
||||
"integrity": "sha512-W8tPhkNVhmX+jaDu4R7WUOtIl0PK3ZDso434rEm/b1+S6ZRgAKwNVHWM/rwIuTi5+erPTEULtTsZgrXFrzC1sA==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-6.6.7.tgz",
|
||||
"integrity": "sha512-SKP1aTnTKTKbzL7QqiVmQC3EEZH7javf67GZMuFkIJ5hVCEuc6FEdfV9iyCGH6hC/68ArCa8U8jbxt9+CbyPew==",
|
||||
"requires": {
|
||||
"optional": "0.1.4"
|
||||
}
|
||||
},
|
||||
"@nestjs/websockets": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.5.3.tgz",
|
||||
"integrity": "sha512-YrCvmLHTW0OBusTiUOPrG0PNrw/3Gatty/bh3ro5cEoiovcaJxGSMsTC+JSVXqPwRJjEtoHMCr5Qje2rAepIzQ==",
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-6.6.7.tgz",
|
||||
"integrity": "sha512-wq6sp0Vw3CAU/h+aXhDm6AZBA/vxIB55Nc114R5RNTIDFU7NuTLTnKLcTvWDatDu5tcwtOAKqx4GXWyTytmQ8w==",
|
||||
"requires": {
|
||||
"iterare": "1.2.0"
|
||||
}
|
||||
@@ -88,9 +88,9 @@
|
||||
}
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz",
|
||||
"integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==",
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.1.tgz",
|
||||
"integrity": "sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
@@ -181,9 +181,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.9.0.tgz",
|
||||
"integrity": "sha512-34Iue+LRcWbndFIfZc5boNizWlsrRjqIBJZTe591vImgbnq7nx2EzlrLtANj9TH2Fxm7puFJBJAOk5BhvZOddQ=="
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.10.1.tgz",
|
||||
"integrity": "sha512-4sxpH6SGFYLADfUip4vuY65f/gEogrzJoniVhNUYkJHtng0l8ZjnDCqxxrSVRHOHwKxsy8Vm5ONZh1wOR3/l/w=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
@@ -228,9 +228,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.50",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz",
|
||||
"integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==",
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
@@ -468,9 +468,9 @@
|
||||
"integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
|
||||
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
@@ -488,9 +488,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
@@ -575,9 +575,9 @@
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.4.1.tgz",
|
||||
"integrity": "sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
@@ -588,19 +588,19 @@
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
|
||||
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
|
||||
},
|
||||
"type": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
|
||||
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.0.3.tgz",
|
||||
"integrity": "sha512-51IMtNfVcee8+9GJvj0spSuFcZHe9vSib6Xtgsny1Km9ugyz2mbS08I3rsUIRYgJohFRFU1160sgRodYz378Hg=="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g=="
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw=="
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
@@ -609,9 +609,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
|
||||
},
|
||||
"validator": {
|
||||
"version": "11.1.0",
|
||||
@@ -619,9 +619,9 @@
|
||||
"integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg=="
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz",
|
||||
"integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
"start": "ts-node src/main"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "6.5.3",
|
||||
"@nestjs/core": "6.5.3",
|
||||
"@nestjs/microservices": "6.5.3",
|
||||
"@nestjs/testing": "6.5.3",
|
||||
"@nestjs/websockets": "6.5.3",
|
||||
"@nestjs/common": "6.6.7",
|
||||
"@nestjs/core": "6.6.7",
|
||||
"@nestjs/microservices": "6.6.7",
|
||||
"@nestjs/testing": "6.6.7",
|
||||
"@nestjs/websockets": "6.6.7",
|
||||
"class-transformer": "0.2.3",
|
||||
"class-validator": "0.10.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"typescript": "3.5.3"
|
||||
"rxjs": "6.5.3",
|
||||
"typescript": "3.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.10.7",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0"
|
||||
"ts-node": "8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "6.5.3"
|
||||
"version": "6.7.1"
|
||||
}
|
||||
|
||||
1043
package-lock.json
generated
1043
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
71
package.json
71
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nestjs/core",
|
||||
"version": "6.5.3",
|
||||
"version": "6.7.0",
|
||||
"description": "Modern, fast, powerful node.js web framework",
|
||||
"scripts": {
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
@@ -9,17 +9,20 @@
|
||||
"lint": "tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
|
||||
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
|
||||
"clean": "gulp clean:bundle",
|
||||
"build": "npm run clean && gulp build",
|
||||
"prebuild:dev": "rm -rf node_modules/@nestjs",
|
||||
"build:dev": "gulp build --dist node_modules/@nestjs && gulp move",
|
||||
"build:samples": "gulp install:samples && npm run build:dev && gulp build:samples",
|
||||
"prebuild": "rm -rf node_modules/@nestjs",
|
||||
"build": "gulp build --dist node_modules/@nestjs",
|
||||
"postbuild": "gulp move",
|
||||
"prebuild:prod": "npm run clean",
|
||||
"build:prod": "gulp build",
|
||||
"build:samples": "gulp install:samples && npm run build && gulp build:samples",
|
||||
"postinstall": "opencollective",
|
||||
"prerelease": "gulp copy-misc && gulp build --dist node_modules/@nestjs",
|
||||
"publish": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --access public --exact -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:rc": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=rc --access public -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:next": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=next --access public --skip-git -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:beta": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --npm-tag=beta --access public -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:test": "npm run prerelease && npm run build && ./node_modules/.bin/lerna publish --force-publish --access public --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
|
||||
"publish": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --access public --exact -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:rc": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=rc --access public -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:next": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=next --access public --skip-git -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:beta": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --npm-tag=beta --access public -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:test": "npm run prerelease && npm run build:prod && ./node_modules/.bin/lerna publish --force-publish --access public --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\"",
|
||||
"codechecks:benchmarks": "codechecks ./tools/benchmarks/check-benchmarks.ts"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.9.0"
|
||||
@@ -31,7 +34,7 @@
|
||||
"author": "Kamil Mysliwiec",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@grpc/proto-loader": "0.5.1",
|
||||
"@grpc/proto-loader": "0.5.2",
|
||||
"@nestjs/common": "6.1.1",
|
||||
"@nestjs/core": "6.1.1",
|
||||
"@nestjs/microservices": "6.1.1",
|
||||
@@ -40,7 +43,7 @@
|
||||
"@nuxtjs/opencollective": "0.2.2",
|
||||
"amqp-connection-manager": "3.0.0",
|
||||
"amqplib": "0.5.5",
|
||||
"apollo-server-express": "2.8.1",
|
||||
"apollo-server-express": "2.9.3",
|
||||
"axios": "0.19.0",
|
||||
"cache-manager": "2.10.0",
|
||||
"class-transformer": "0.2.3",
|
||||
@@ -48,46 +51,49 @@
|
||||
"cli-color": "1.4.0",
|
||||
"connect": "3.7.0",
|
||||
"cors": "2.8.5",
|
||||
"engine.io-client": "3.3.2",
|
||||
"engine.io-client": "3.4.0",
|
||||
"express": "4.17.1",
|
||||
"fast-json-stringify": "1.15.4",
|
||||
"fast-safe-stringify": "2.0.6",
|
||||
"fastify": "2.7.1",
|
||||
"fast-safe-stringify": "2.0.7",
|
||||
"fastify": "2.8.0",
|
||||
"fastify-cors": "2.1.3",
|
||||
"fastify-formbody": "3.1.0",
|
||||
"fastify-multipart": "1.0.2",
|
||||
"graphql": "14.5.0",
|
||||
"graphql": "14.5.6",
|
||||
"grpc": "1.23.3",
|
||||
"http2": "3.3.7",
|
||||
"iterare": "1.2.0",
|
||||
"merge-graphql-schemas": "1.7.0",
|
||||
"kafkajs": "1.10.0",
|
||||
"merge-graphql-schemas": "1.6.1",
|
||||
"mqtt": "3.0.0",
|
||||
"multer": "1.4.2",
|
||||
"nats": "1.3.0",
|
||||
"object-hash": "1.3.1",
|
||||
"optional": "0.1.4",
|
||||
"path-to-regexp": "3.0.0",
|
||||
"path-to-regexp": "3.1.0",
|
||||
"pump": "3.0.0",
|
||||
"redis": "2.8.0",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "6.5.2",
|
||||
"rxjs-compat": "6.5.2",
|
||||
"rxjs": "6.5.3",
|
||||
"rxjs-compat": "6.5.3",
|
||||
"socket.io": "2.2.0",
|
||||
"ts-morph": "3.1.3",
|
||||
"ts-morph": "4.0.1",
|
||||
"uuid": "3.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codechecks/client": "0.1.9",
|
||||
"@types/amqplib": "0.5.13",
|
||||
"@types/cache-manager": "1.2.8",
|
||||
"@types/chai": "4.2.0",
|
||||
"@types/cache-manager": "2.10.0",
|
||||
"@types/chai": "4.2.2",
|
||||
"@types/bytes": "3.0.0",
|
||||
"@types/chai-as-promised": "7.1.2",
|
||||
"@types/cors": "2.8.6",
|
||||
"@types/express": "4.17.1",
|
||||
"@types/fastify-cors": "2.1.0",
|
||||
"@types/gulp": "4.0.6",
|
||||
"@types/kafka-node": "2.0.8",
|
||||
"@types/kafka-node": "2.0.9",
|
||||
"@types/mocha": "5.2.7",
|
||||
"@types/node": "10.14.16",
|
||||
"@types/node": "10.14.18",
|
||||
"@types/redis": "2.8.13",
|
||||
"@types/reflect-metadata": "0.0.5",
|
||||
"@types/sinon": "7.0.13",
|
||||
@@ -96,6 +102,7 @@
|
||||
"artillery": "1.6.0-28",
|
||||
"awesome-typescript-loader": "5.2.1",
|
||||
"body-parser": "1.19.0",
|
||||
"bytes": "3.1.0",
|
||||
"chai": "4.2.0",
|
||||
"chai-as-promised": "7.1.1",
|
||||
"clang-format": "1.2.4",
|
||||
@@ -117,18 +124,20 @@
|
||||
"imports-loader": "0.8.0",
|
||||
"json-loader": "0.5.7",
|
||||
"lerna": "2.11.0",
|
||||
"lint-staged": "9.2.3",
|
||||
"lint-staged": "9.2.5",
|
||||
"markdown-table": "1.1.3",
|
||||
"mocha": "3.5.3",
|
||||
"nodemon": "1.19.1",
|
||||
"nodemon": "1.19.2",
|
||||
"nyc": "14.1.1",
|
||||
"prettier": "1.18.2",
|
||||
"sinon": "7.4.1",
|
||||
"sinon": "7.4.2",
|
||||
"sinon-chai": "3.3.0",
|
||||
"socket.io-client": "2.2.0",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "8.3.0",
|
||||
"tslint": "5.19.0",
|
||||
"typescript": "3.5.3"
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "5.20.0",
|
||||
"typescript": "3.6.3",
|
||||
"wrk": "1.2.0"
|
||||
},
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2017-2019 Kamil Myśliwiec <http://kamilmysliwiec.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
1
packages/common/PACKAGE.md
Normal file
1
packages/common/PACKAGE.md
Normal file
@@ -0,0 +1 @@
|
||||
The common package comes with decorators such as `@Controller()`, `@Injectable()` and so on.
|
||||
@@ -2,18 +2,15 @@
|
||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
|
||||
</p>
|
||||
|
||||
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
|
||||
[travis-url]: https://travis-ci.org/nestjs/nest
|
||||
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
|
||||
[linux-url]: https://travis-ci.org/nestjs/nest
|
||||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
|
||||
[circleci-url]: https://circleci.com/gh/nestjs/nest
|
||||
|
||||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
|
||||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
|
||||
<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://travis-ci.org/nestjs/nest" target="_blank"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
|
||||
<a href="https://travis-ci.org/nestjs/nest" target="_blank"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></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>
|
||||
@@ -42,7 +39,7 @@ Nest is a framework for building efficient, scalable <a href="http://nodejs.org"
|
||||
|
||||
## Consulting
|
||||
|
||||
With official support, you can get expert help straight from Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://docs.nestjs.com/enterprise).
|
||||
With official support, you can get expert help straight from Nest core team. We provide dedicated technical support, migration strategies, advice on best practices (and design decisions), PR reviews, and team augmentation. Read more about [support here](https://enterprise.nestjs.com).
|
||||
|
||||
## Support
|
||||
|
||||
@@ -60,25 +57,24 @@ 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="125" valign="middle" /> </a> <a href="https://blueanchor.io/" target="_blank"><img src="https://nestjs.com/img/blueanchor.png" width="180" valign="middle" /></a>
|
||||
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="130" valign="middle" /></a>
|
||||
<a href="https://scal.io" target="_blank"><img src="https://nestjs.com/img/scalio-logo.svg" width="100" valign="middle" /></a> <a href="http://angularity.io" target="_blank"><img src="http://angularity.io/media/logo.svg" height="26" 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="30" valign="middle" /></a>
|
||||
|
||||
<a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" height="36" valign="middle" /></a> <a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" height="24" valign="middle" /></a> <a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" height="28" valign="middle" /></a> <a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" height="20" valign="middle" /></a> <a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" height="30" valign="middle" /></a>
|
||||
<a href="https://ever.co/" target="_blank"><img src="https://nestjs.com/img/ever-logo.png" height="20" valign="middle" /></a>
|
||||
<a href="https://buddy.works/" target="_blank"><img src="https://nestjs.com/img/buddy-logo.svg" height="35" valign="middle" /></a>
|
||||
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" height="31" valign="middle" /></a>
|
||||
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" height="28" valign="middle" /></a> <a href="https://yakaz.com/" target="_blank"><img src="https://nestjs.com/img/yakaz.png" width="80" valign="middle" /></a>
|
||||
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="120" valign="middle" /></a>
|
||||
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="90" valign="middle" /></a>
|
||||
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="145" valign="middle" /></a>
|
||||
<a href="http://xtremis.com/" target="_blank"><img src="https://nestjs.com/img/logo-xtremis.svg" width="145" valign="middle" /></a>
|
||||
|
||||
<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://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://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>
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
<a href="https://opencollective.com/nest" target="_blank"><img src="https://opencollective.com/nest/backers.svg?width=1600"></a>
|
||||
<a href="https://opencollective.com/nest" target="_blank"><img src="https://opencollective.com/nest/backers.svg?width=1000"></a>
|
||||
|
||||
## Stay in touch
|
||||
|
||||
|
||||
22
packages/common/cache/cache.module.ts
vendored
22
packages/common/cache/cache.module.ts
vendored
@@ -8,11 +8,25 @@ import {
|
||||
CacheOptionsFactory,
|
||||
} from './interfaces/cache-module.interface';
|
||||
|
||||
/**
|
||||
* Module that provides Nest cache-manager.
|
||||
*
|
||||
* @see [Caching](https://docs.nestjs.com/techniques/caching)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
@Module({
|
||||
providers: [createCacheManager()],
|
||||
exports: [CACHE_MANAGER],
|
||||
})
|
||||
export class CacheModule {
|
||||
/**
|
||||
* Configure the cache manager statically.
|
||||
*
|
||||
* @param options options to configure the cache manager
|
||||
*
|
||||
* @see [Customize caching](https://docs.nestjs.com/techniques/caching#customize-caching)
|
||||
*/
|
||||
static register(options: CacheModuleOptions = {}): DynamicModule {
|
||||
return {
|
||||
module: CacheModule,
|
||||
@@ -20,6 +34,14 @@ export class CacheModule {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the cache manager dynamically.
|
||||
*
|
||||
* @param options method for dynamically supplying cache manager configuration
|
||||
* options
|
||||
*
|
||||
* @see [Async configuration](https://docs.nestjs.com/techniques/caching#async-configuration)
|
||||
*/
|
||||
static registerAsync(options: CacheModuleAsyncOptions): DynamicModule {
|
||||
return {
|
||||
module: CacheModule,
|
||||
|
||||
5
packages/common/cache/cache.providers.ts
vendored
5
packages/common/cache/cache.providers.ts
vendored
@@ -4,6 +4,11 @@ import { CACHE_MANAGER, CACHE_MODULE_OPTIONS } from './cache.constants';
|
||||
import { defaultCacheOptions } from './default-options';
|
||||
import { CacheManagerOptions } from './interfaces/cache-manager.interface';
|
||||
|
||||
/**
|
||||
* Creates a CacheManager Provider.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function createCacheManager(): Provider {
|
||||
return {
|
||||
provide: CACHE_MANAGER,
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
import { SetMetadata } from '../../decorators';
|
||||
import { CACHE_KEY_METADATA } from '../cache.constants';
|
||||
|
||||
/**
|
||||
* Decorator that sets the caching key used to store/retrieve cached items for
|
||||
* Web sockets or Microservice based apps.
|
||||
*
|
||||
* For example:
|
||||
* `@CacheKey('events')`
|
||||
*
|
||||
* @param key string naming the field to be used as a cache key
|
||||
*
|
||||
* @see [Caching](https://docs.nestjs.com/techniques/caching)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const CacheKey = (key: string) => SetMetadata(CACHE_KEY_METADATA, key);
|
||||
|
||||
@@ -2,19 +2,70 @@ export interface LiteralObject {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface defining a cache store. Implement this interface to create a custom
|
||||
* cache store.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface CacheStore {
|
||||
/**
|
||||
* Create a key/value pair in the cache.
|
||||
*
|
||||
* @param key cache key
|
||||
* @param value cache value
|
||||
*/
|
||||
set<T>(key: string, value: T): Promise<void> | void;
|
||||
get<T>(key: string): Promise<void> | void;
|
||||
/**
|
||||
* Retrieve a key/value pair from the cache.
|
||||
*
|
||||
* @param key cache key
|
||||
*/
|
||||
get<T>(key: string): Promise<T | undefined> | T | undefined;
|
||||
/**
|
||||
* Destroy a key/value pair from the cache.
|
||||
*
|
||||
* @param key cache key
|
||||
*/
|
||||
del(key: string): void | Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface defining a factory to create a cache store.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface CacheStoreFactory {
|
||||
/**
|
||||
* Return a configured cache store.
|
||||
*
|
||||
* @param args Cache manager options received from `CacheModule.register()`
|
||||
* or `CacheModule.registerAcync()`
|
||||
*/
|
||||
create(args: LiteralObject): CacheStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface defining Cache Manager configuration options.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface CacheManagerOptions {
|
||||
/**
|
||||
* Cache storage manager. Default is `'memory'` (in-memory store). See
|
||||
* [Different stores](https://docs.nestjs.com/techniques/caching#different-stores)
|
||||
* for more info.
|
||||
*/
|
||||
store?: string | CacheStoreFactory;
|
||||
/**
|
||||
* Time to live - amount of time in seconds that a response is cached before it
|
||||
* is deleted. Subsequent request will call through the route handler and refresh
|
||||
* the cache. Defaults to 5 seconds.
|
||||
*/
|
||||
ttl?: number;
|
||||
/**
|
||||
* Maximum number of responses to store in the cache. Defaults to 100.
|
||||
*/
|
||||
max?: number;
|
||||
isCacheableValue?: (value: any) => boolean;
|
||||
}
|
||||
|
||||
@@ -5,17 +5,47 @@ export interface CacheModuleOptions extends CacheManagerOptions {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface describing a `CacheOptionsFactory`. Providers supplying configuration
|
||||
* options for the Cache module must implement this interface.
|
||||
*
|
||||
* @see [Async configuration](https://docs.nestjs.com/techniques/caching#async-configuration)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface CacheOptionsFactory {
|
||||
createCacheOptions(): Promise<CacheModuleOptions> | CacheModuleOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for dynamically configuring the Cache module.
|
||||
*
|
||||
* @see [Async configuration](https://docs.nestjs.com/techniques/caching#async-configuration)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface CacheModuleAsyncOptions
|
||||
extends Pick<ModuleMetadata, 'imports'> {
|
||||
/**
|
||||
* Injection token resolving to an existing provider. The provider must implement
|
||||
* the `CacheOptionsFactory` interface.
|
||||
*/
|
||||
useExisting?: Type<CacheOptionsFactory>;
|
||||
/**
|
||||
* Injection token resolving to a class that will be instantiated as a provider.
|
||||
* The class must implement the `CacheOptionsFactory` interface.
|
||||
*/
|
||||
useClass?: Type<CacheOptionsFactory>;
|
||||
/**
|
||||
* Function returning options (or a Promise resolving to options) to configure the
|
||||
* cache module.
|
||||
*/
|
||||
useFactory?: (
|
||||
...args: any[]
|
||||
) => Promise<CacheModuleOptions> | CacheModuleOptions;
|
||||
/**
|
||||
* Dependencies that a Factory may inject.
|
||||
*/
|
||||
inject?: any[];
|
||||
extraProviders?: Provider[];
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
/**
|
||||
* Binds parameter decorators to the method
|
||||
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
|
||||
* @param {} ...decorators
|
||||
* Decorator that binds *parameter decorators* to the method that follows.
|
||||
*
|
||||
* Useful when the language doesn't provide a 'Parameter Decorator' feature
|
||||
* (i.e., vanilla JavaScript).
|
||||
*
|
||||
* @param decorators one or more parameter decorators (e.g., `Req()`)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Bind(...decorators: any[]): MethodDecorator {
|
||||
return <T>(
|
||||
|
||||
@@ -2,8 +2,21 @@ import { FILTER_CATCH_EXCEPTIONS } from '../../constants';
|
||||
import { Type } from '../../interfaces';
|
||||
|
||||
/**
|
||||
* Defines an exception filter. Takes set of exception types as arguments which have to be caught by this filter.
|
||||
* The class should implement the `ExceptionFilter` interface.
|
||||
* Decorator that marks a class as a Nest exception filter. An exception filter
|
||||
* handles exceptions thrown by or not handled by your application code.
|
||||
*
|
||||
* The decorated class must implement the `ExceptionFilter` interface.
|
||||
*
|
||||
* @param exceptions one or more exception *types* specifying
|
||||
* the exceptions to be caught and handled by this filter.
|
||||
*
|
||||
* @see [Exception Filters](https://docs.nestjs.com/exception-filters)
|
||||
*
|
||||
* @usageNotes
|
||||
* Exception filters are applied using the `@UseFilters()` decorator, or (globally)
|
||||
* with `app.useGlobalFilters()`.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Catch(...exceptions: Type<any>[]): ClassDecorator {
|
||||
return (target: object) => {
|
||||
|
||||
@@ -2,17 +2,127 @@ import { PATH_METADATA, SCOPE_OPTIONS_METADATA } from '../../constants';
|
||||
import { isString, isUndefined } from '../../utils/shared.utils';
|
||||
import { ScopeOptions } from './../../interfaces/scope-options.interface';
|
||||
|
||||
/**
|
||||
* Interface defining options that can be passed to `@Controller()` decorator
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface ControllerOptions extends ScopeOptions {
|
||||
/**
|
||||
* Specifies an optional `route path prefix`. The prefix is pre-pended to the
|
||||
* path specified in any request decorator in the class.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*/
|
||||
path?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the controller. Controller can inject dependencies through constructor.
|
||||
* Those dependencies have to belong to the same module.
|
||||
* Decorator that marks a class as a Nest controller that can receive inbound
|
||||
* requests and produce responses.
|
||||
*
|
||||
* An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses.
|
||||
* It defines a class that provides the context for one or more related route
|
||||
* handlers that correspond to HTTP request methods and associated routes
|
||||
* for example `GET /api/profile`, `POST /user/resume`.
|
||||
*
|
||||
* A Microservice Controller responds to requests as well as events, running over
|
||||
* a variety of transports [(read more here)](https://docs.nestjs.com/microservices/basics).
|
||||
* It defines a class that provides a context for one or more message or event
|
||||
* handlers.
|
||||
*
|
||||
* @see [Controllers](https://docs.nestjs.com/controllers)
|
||||
* @see [Microservices](https://docs.nestjs.com/microservices/basics#request-response)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Controller(): ClassDecorator;
|
||||
|
||||
/**
|
||||
* Decorator that marks a class as a Nest controller that can receive inbound
|
||||
* requests and produce responses.
|
||||
*
|
||||
* An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses.
|
||||
* It defines a class that provides the context for one or more related route
|
||||
* handlers that correspond to HTTP request methods and associated routes
|
||||
* for example `GET /api/profile`, `POST /user/resume`.
|
||||
*
|
||||
* A Microservice Controller responds to requests as well as events, running over
|
||||
* a variety of transports [(read more here)](https://docs.nestjs.com/microservices/basics).
|
||||
* It defines a class that provides a context for one or more message or event
|
||||
* handlers.
|
||||
*
|
||||
* @param {string} prefix string that defines a `route path prefix`. The prefix
|
||||
* is pre-pended to the path specified in any request decorator in the class.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
* @see [Controllers](https://docs.nestjs.com/controllers)
|
||||
* @see [Microservices](https://docs.nestjs.com/microservices/basics#request-response)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Controller(prefix: string): ClassDecorator;
|
||||
|
||||
/**
|
||||
* Decorator that marks a class as a Nest controller that can receive inbound
|
||||
* requests and produce responses.
|
||||
*
|
||||
* An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses.
|
||||
* It defines a class that provides the context for one or more related route
|
||||
* handlers that correspond to HTTP request methods and associated routes
|
||||
* for example `GET /api/profile`, `POST /user/resume`.
|
||||
*
|
||||
* A Microservice Controller responds to requests as well as events, running over
|
||||
* a variety of transports [(read more here)](https://docs.nestjs.com/microservices/basics).
|
||||
* It defines a class that provides a context for one or more message or event
|
||||
* handlers.
|
||||
*
|
||||
* @param {object} options configuration object specifying:
|
||||
*
|
||||
* - `scope` - symbol that determines the lifetime of a Controller instance.
|
||||
* [See Scope](https://docs.nestjs.com/fundamentals/injection-scopes#usage) for
|
||||
* more details.
|
||||
* - `prefix` - string that defines a `route path prefix`. The prefix
|
||||
* is pre-pended to the path specified in any request decorator in the class.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
* @see [Controllers](https://docs.nestjs.com/controllers)
|
||||
* @see [Microservices](https://docs.nestjs.com/microservices/basics#request-response)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Controller(options: ControllerOptions): ClassDecorator;
|
||||
|
||||
/**
|
||||
* Decorator that marks a class as a Nest controller that can receive inbound
|
||||
* requests and produce responses.
|
||||
*
|
||||
* An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses.
|
||||
* It defines a class that provides the context for one or more related route
|
||||
* handlers that correspond to HTTP request methods and associated routes
|
||||
* for example `GET /api/profile`, `POST /user/resume`
|
||||
*
|
||||
* A Microservice Controller responds to requests as well as events, running over
|
||||
* a variety of transports [(read more here)](https://docs.nestjs.com/microservices/basics).
|
||||
* It defines a class that provides a context for one or more message or event
|
||||
* handlers.
|
||||
*
|
||||
* @param prefixOrOptions a `route path prefix` or a `ControllerOptions` object.
|
||||
* A `route path prefix` is pre-pended to the path specified in any request decorator
|
||||
* in the class. `ControllerOptions` is an options configuration object specifying:
|
||||
* - `scope` - symbol that determines the lifetime of a Controller instance.
|
||||
* [See Scope](https://docs.nestjs.com/fundamentals/injection-scopes#usage) for
|
||||
* more details.
|
||||
* - `prefix` - string that defines a `route path prefix`. The prefix
|
||||
* is pre-pended to the path specified in any request decorator in the class.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
* @see [Controllers](https://docs.nestjs.com/controllers)
|
||||
* @see [Microservices](https://docs.nestjs.com/microservices/basics#request-response)
|
||||
* @see [Scope](https://docs.nestjs.com/fundamentals/injection-scopes#usage)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Controller(
|
||||
prefixOrOptions?: string | ControllerOptions,
|
||||
): ClassDecorator {
|
||||
@@ -20,8 +130,8 @@ export function Controller(
|
||||
const [path, scopeOptions] = isUndefined(prefixOrOptions)
|
||||
? [defaultPath, undefined]
|
||||
: isString(prefixOrOptions)
|
||||
? [prefixOrOptions, undefined]
|
||||
: [prefixOrOptions.path || defaultPath, { scope: prefixOrOptions.scope }];
|
||||
? [prefixOrOptions, undefined]
|
||||
: [prefixOrOptions.path || defaultPath, { scope: prefixOrOptions.scope }];
|
||||
|
||||
return (target: object) => {
|
||||
Reflect.defineMetadata(PATH_METADATA, path, target);
|
||||
|
||||
@@ -34,14 +34,26 @@ const defineFiltersMetadata = (...filters: (Function | ExceptionFilter)[]) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* Bounds exception filters to the chosen context.
|
||||
* When the `@UseFilters()` is used on the controller level:
|
||||
* - Exception Filter will be set up to every handler (every method)
|
||||
* Decorator that binds exception filters to the scope of the controller or
|
||||
* method, depending on its context.
|
||||
*
|
||||
* When the `@UseFilters()` is used on the handle level:
|
||||
* - Exception Filter will be set up only to the specified method
|
||||
* When `@UseFilters` is used at the controller level, the filter will be
|
||||
* applied to every handler (method) in the controller.
|
||||
*
|
||||
* @param {ExceptionFilter[]} ...filters
|
||||
* When `@UseFilters` is used at the individual handler level, the filter
|
||||
* will apply only to that specific method.
|
||||
*
|
||||
* @param filters exception filter instance or class, or a list of exception
|
||||
* filter instances or classes.
|
||||
*
|
||||
* @see [Exception filters](https://docs.nestjs.com/exception-filters)
|
||||
*
|
||||
* @usageNotes
|
||||
* Exception filters can also be set up globally for all controllers and routes
|
||||
* using `app.useGlobalFilters()`. [See here for details](https://docs.nestjs.com/exception-filters#binding-filters)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
|
||||
export const UseFilters = (...filters: (ExceptionFilter | Function)[]) =>
|
||||
defineFiltersMetadata(...filters);
|
||||
|
||||
@@ -5,8 +5,33 @@ import {
|
||||
import { isFunction, isUndefined } from '../../utils/shared.utils';
|
||||
|
||||
/**
|
||||
* Injects provider which has to be available in the current injector (module) scope.
|
||||
* Providers are recognized by either types or tokens.
|
||||
* Decorator that marks a constructor parameter as a target for
|
||||
* [Dependency Injection (DI)](https://docs.nestjs.com/providers#dependency-injection).
|
||||
*
|
||||
* Any injected provider must be visible within the module scope (loosely
|
||||
* speaking, the containing module) of the class it is being injected into. This
|
||||
* can be done by:
|
||||
*
|
||||
* - defining the provider in the same module scope
|
||||
* - exporting the provider from one module scope and importing that module into the
|
||||
* module scope of the class being injected into
|
||||
* - exporting the provider from a module that is marked as global using the
|
||||
* `@Global()` decorator
|
||||
*
|
||||
* #### Injection tokens
|
||||
* Can be *types* (class names), *strings* or *symbols*. This depends on how the
|
||||
* provider with which it is associated was defined. Providers defined with the
|
||||
* `@Injectable()` decorator use the class name. Custom Providers may use strings
|
||||
* or symbols as the injection token.
|
||||
*
|
||||
* @param token lookup key for the provider to be injected (assigned to the constructor
|
||||
* parameter).
|
||||
*
|
||||
* @see [Providers](https://docs.nestjs.com/providers)
|
||||
* @see [Custom Providers](https://docs.nestjs.com/fundamentals/custom-providers)
|
||||
* @see [Injection Scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Inject<T = any>(token?: T) {
|
||||
return (target: Object, key: string | symbol, index?: number) => {
|
||||
|
||||
@@ -3,11 +3,42 @@ import { ScopeOptions } from '../../interfaces/scope-options.interface';
|
||||
import { SCOPE_OPTIONS_METADATA } from './../../constants';
|
||||
import { Type } from './../../interfaces/type.interface';
|
||||
|
||||
/**
|
||||
* Defines the injection scope.
|
||||
*
|
||||
* @see [Injection Scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface InjectableOptions extends ScopeOptions {}
|
||||
|
||||
/**
|
||||
* Defines the injectable class. This class can inject dependencies through constructor.
|
||||
* Those dependencies have to belong to the same module.
|
||||
* Decorator that marks a class as a [provider](https://docs.nestjs.com/providers).
|
||||
* Providers can be injected into other classes via constructor parameter injection
|
||||
* using Nest's built-in [Dependency Injection (DI)](https://docs.nestjs.com/providers#dependency-injection)
|
||||
* system.
|
||||
*
|
||||
* When injecting a provider, it must be visible within the module scope (loosely
|
||||
* speaking, the containing module) of the class it is being injected into. This
|
||||
* can be done by:
|
||||
*
|
||||
* - defining the provider in the same module scope
|
||||
* - exporting the provider from one module scope and importing that module into the
|
||||
* module scope of the class being injected into
|
||||
* - exporting the provider from a module that is marked as global using the
|
||||
* `@Global()` decorator
|
||||
*
|
||||
* Providers can also be defined in a more explicit and imperative form using
|
||||
* various [custom provider](https://docs.nestjs.com/fundamentals/custom-providers) techniques that expose
|
||||
* more capabilities of the DI system.
|
||||
*
|
||||
* @param options options specifying scope of injectable
|
||||
*
|
||||
* @see [Providers](https://docs.nestjs.com/providers)
|
||||
* @see [Custom Providers](https://docs.nestjs.com/fundamentals/custom-providers)
|
||||
* @see [Injection Scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Injectable(options?: InjectableOptions): ClassDecorator {
|
||||
return (target: object) => {
|
||||
|
||||
@@ -5,7 +5,17 @@ import {
|
||||
import { isUndefined } from '../../utils/shared.utils';
|
||||
|
||||
/**
|
||||
* Sets dependency as an optional one.
|
||||
* Parameter decorator for an injected dependency marking the
|
||||
* dependency as optional.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* constructor(@Optional() @Inject('HTTP_OPTIONS')private readonly httpClient: T) {}
|
||||
* ```
|
||||
*
|
||||
* @see [Optional providers](https://docs.nestjs.com/providers#optional-providers)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Optional() {
|
||||
return (target: Object, key: string | symbol, index?: number) => {
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
import { Logger } from './../../services/logger.service';
|
||||
|
||||
/**
|
||||
* Assigns the metadata to the class/function under specified `key`.
|
||||
* This metadata can be reflected using `Reflector` class.
|
||||
* Decorator that assigns metadata to the class/function using the
|
||||
* specified `key`.
|
||||
*
|
||||
* Requires two parameters:
|
||||
* - `key` - a value defining the key under which the metadata is stored
|
||||
* - `value[]` - array of metadata values to be associated with `key`
|
||||
*
|
||||
* This metadata can be reflected using the `Reflector` class.
|
||||
*
|
||||
* Example: `@SetMetadata('roles', ['admin'])`
|
||||
*
|
||||
* @see [Reflection](https://docs.nestjs.com/guards#reflection)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const SetMetadata = <K = any, V = any>(
|
||||
metadataKey: K,
|
||||
|
||||
@@ -5,14 +5,25 @@ import { isFunction } from '../../utils/shared.utils';
|
||||
import { validateEach } from '../../utils/validate-each.util';
|
||||
|
||||
/**
|
||||
* Binds guards to the particular context.
|
||||
* When the `@UseGuards()` is used on the controller level:
|
||||
* - Guard will be register to each handler (every method)
|
||||
* Decorator that binds guards to the scope of the controller or method,
|
||||
* depending on its context.
|
||||
*
|
||||
* When the `@UseGuards()` is used on the handler level:
|
||||
* - Guard will be registered only to the specified method
|
||||
* When `@UseGuards` is used at the controller level, the guard will be
|
||||
* applied to every handler (method) in the controller.
|
||||
*
|
||||
* @param {} ...guards
|
||||
* When `@UseGuards` is used at the individual handler level, the guard
|
||||
* will apply only to that specific method.
|
||||
*
|
||||
* @param guards a single guard instance or class, or a list of guard instances
|
||||
* or classes.
|
||||
*
|
||||
* @see [Guards](https://docs.nestjs.com/guards)
|
||||
*
|
||||
* @usageNotes
|
||||
* Guards can also be set up globally for all controllers and routes
|
||||
* using `app.useGlobalGuards()`. [See here for details](https://docs.nestjs.com/guards#binding-guards)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function UseGuards(...guards: (CanActivate | Function)[]) {
|
||||
return (target: any, key?: string, descriptor?: any) => {
|
||||
|
||||
@@ -5,14 +5,25 @@ import { isFunction } from '../../utils/shared.utils';
|
||||
import { validateEach } from '../../utils/validate-each.util';
|
||||
|
||||
/**
|
||||
* Binds interceptors to the particular context.
|
||||
* When the `@UseInterceptors()` is used on the controller level:
|
||||
* - Interceptor will be register to each handler (every method)
|
||||
* Decorator that binds interceptors to the scope of the controller or method,
|
||||
* depending on its context.
|
||||
*
|
||||
* When the `@UseInterceptors()` is used on the handle level:
|
||||
* - Interceptor will be registered only to the specified method
|
||||
* When `@UseInterceptors` is used at the controller level, the interceptor will
|
||||
* be applied to every handler (method) in the controller.
|
||||
*
|
||||
* @param {} ...interceptors
|
||||
* When `@UseInterceptors` is used at the individual handler level, the interceptor
|
||||
* will apply only to that specific method.
|
||||
*
|
||||
* @param interceptors a single interceptor instance or class, or a list of
|
||||
* interceptor instances or classes.
|
||||
*
|
||||
* @see [Interceptors](https://docs.nestjs.com/interceptors)
|
||||
*
|
||||
* @usageNotes
|
||||
* Interceptors can also be set up globally for all controllers and routes
|
||||
* using `app.useGlobalInterceptors()`. [See here for details](https://docs.nestjs.com/interceptors#binding-interceptors)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function UseInterceptors(
|
||||
...interceptors: (NestInterceptor | Function)[]
|
||||
|
||||
@@ -5,15 +5,27 @@ import { isFunction } from '../../utils/shared.utils';
|
||||
import { validateEach } from '../../utils/validate-each.util';
|
||||
|
||||
/**
|
||||
* Binds pipes to the particular context.
|
||||
* When the `@UsePipes()` is used on the controller level:
|
||||
* - Pipe will be register to each handler (every method)
|
||||
* Decorator that binds pipes to the scope of the controller or method,
|
||||
* depending on its context.
|
||||
*
|
||||
* When the `@UsePipes()` is used on the handle level:
|
||||
* - Pipe will be registered only to the specified method
|
||||
* When `@UsePipes` is used at the controller level, the pipe will be
|
||||
* applied to every handler (method) in the controller.
|
||||
*
|
||||
* @param {PipeTransform[]} ...pipes
|
||||
* When `@UsePipes` is used at the individual handler level, the pipe
|
||||
* will apply only to that specific method.
|
||||
*
|
||||
* @param pipes a single pipe instance or class, or a list of pipe instances or
|
||||
* classes.
|
||||
*
|
||||
* @see [Pipes](https://docs.nestjs.com/pipes)
|
||||
*
|
||||
* @usageNotes
|
||||
* Pipes can also be set up globally for all controllers and routes
|
||||
* using `app.useGlobalPipes()`. [See here for details](https://docs.nestjs.com/pipes#class-validator)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
|
||||
export function UsePipes(...pipes: (PipeTransform | Function)[]) {
|
||||
return (target: any, key?: string, descriptor?: any) => {
|
||||
const isPipeValid = <T extends Function | Record<string, any>>(pipe: T) =>
|
||||
|
||||
@@ -30,6 +30,7 @@ export type ParamDecoratorEnhancer = ParameterDecorator;
|
||||
|
||||
/**
|
||||
* Defines HTTP route param decorator
|
||||
*
|
||||
* @param factory
|
||||
*/
|
||||
export function createParamDecorator(
|
||||
@@ -48,7 +49,9 @@ export function createParamDecorator(
|
||||
|
||||
const isPipe = (pipe: any) =>
|
||||
pipe &&
|
||||
((isFunction(pipe) && pipe.prototype && isFunction(pipe.prototype.transform)) ||
|
||||
((isFunction(pipe) &&
|
||||
pipe.prototype &&
|
||||
isFunction(pipe.prototype.transform)) ||
|
||||
isFunction(pipe.transform));
|
||||
|
||||
const hasParamData = isNil(data) || !isPipe(data);
|
||||
|
||||
@@ -2,7 +2,17 @@ import { HEADERS_METADATA } from '../../constants';
|
||||
import { extendArrayMetadata } from '../../utils/extend-metadata.util';
|
||||
|
||||
/**
|
||||
* Sets a response header.
|
||||
* Request method Decorator. Sets a response header.
|
||||
*
|
||||
* For example:
|
||||
* `@Header('Cache-Control', 'none')`
|
||||
*
|
||||
* @param name string to be used for header name
|
||||
* @param value string to be used for header value
|
||||
*
|
||||
* @see [Headers](https://docs.nestjs.com/controllers#headers)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Header(name: string, value: string): MethodDecorator {
|
||||
return (target: object, key, descriptor) => {
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { HTTP_CODE_METADATA } from '../../constants';
|
||||
|
||||
/**
|
||||
* Defines the HTTP response status code.
|
||||
* It overrides default status code for the given request method.
|
||||
* Request method Decorator. Defines the HTTP response status code. Overrides
|
||||
* default status code for the decorated request method.
|
||||
*
|
||||
* @param {number} statusCode
|
||||
* @param statusCode HTTP response code to be returned by route handler.
|
||||
*
|
||||
* @see [Http Status Codes](https://docs.nestjs.com/controllers#status-code)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function HttpCode(statusCode: number): MethodDecorator {
|
||||
return (target: object, key, descriptor) => {
|
||||
|
||||
@@ -3,4 +3,5 @@ export * from './route-params.decorator';
|
||||
export * from './http-code.decorator';
|
||||
export * from './create-route-param-metadata.decorator';
|
||||
export * from './render.decorator';
|
||||
export * from './header.decorator';
|
||||
export * from './header.decorator';
|
||||
export * from './redirect.decorator';
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import { REDIRECT_METADATA } from '../../constants';
|
||||
|
||||
/**
|
||||
* Redirects request.
|
||||
* Redirects request to the specified URL.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Redirect(url: string): MethodDecorator {
|
||||
export function Redirect(url: string, statusCode?: number): MethodDecorator {
|
||||
return (target: object, key, descriptor) => {
|
||||
Reflect.defineMetadata(REDIRECT_METADATA, url, descriptor.value);
|
||||
Reflect.defineMetadata(
|
||||
REDIRECT_METADATA,
|
||||
{ statusCode, url },
|
||||
descriptor.value,
|
||||
);
|
||||
return descriptor;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import { RENDER_METADATA } from '../../constants';
|
||||
|
||||
/**
|
||||
* Defines a template to be rendered by the controller.
|
||||
* Route handler method Decorator. Defines a template to be rendered by the controller.
|
||||
*
|
||||
* For example: `@Render('index')`
|
||||
*
|
||||
* @param template name of the render engine template file
|
||||
*
|
||||
* @see [Model-View-Controller](https://docs.nestjs.com/techniques.mvc)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Render(template: string): MethodDecorator {
|
||||
return (target: object, key, descriptor) => {
|
||||
|
||||
@@ -31,41 +31,73 @@ const createMappingDecorator = (method: RequestMethod) => (
|
||||
};
|
||||
|
||||
/**
|
||||
* Routes HTTP POST requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP POST requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Post = createMappingDecorator(RequestMethod.POST);
|
||||
|
||||
/**
|
||||
* Routes HTTP GET requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP GET requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Get = createMappingDecorator(RequestMethod.GET);
|
||||
|
||||
/**
|
||||
* Routes HTTP DELETE requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP DELETE requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Delete = createMappingDecorator(RequestMethod.DELETE);
|
||||
|
||||
/**
|
||||
* Routes HTTP PUT requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP PUT requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Put = createMappingDecorator(RequestMethod.PUT);
|
||||
|
||||
/**
|
||||
* Routes HTTP PATCH requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP PATCH requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Patch = createMappingDecorator(RequestMethod.PATCH);
|
||||
|
||||
/**
|
||||
* Routes HTTP OPTIONS requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP OPTIONS requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Options = createMappingDecorator(RequestMethod.OPTIONS);
|
||||
|
||||
/**
|
||||
* Routes HTTP HEAD requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes HTTP HEAD requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Head = createMappingDecorator(RequestMethod.HEAD);
|
||||
|
||||
/**
|
||||
* Routes all HTTP requests to the specified path.
|
||||
* Route handler (method) Decorator. Routes all HTTP requests to the specified path.
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const All = createMappingDecorator(RequestMethod.ALL);
|
||||
|
||||
@@ -58,36 +58,198 @@ const createPipesRouteParamDecorator = (paramtype: RouteParamtypes) => (
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `Request`
|
||||
* object from the underlying platform and populates the decorated
|
||||
* parameter with the value of `Request`.
|
||||
*
|
||||
* Example: `logout(@Request() req)`
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Request: () => ParameterDecorator = createRouteParamDecorator(
|
||||
RouteParamtypes.REQUEST,
|
||||
);
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `Response`
|
||||
* object from the underlying platform and populates the decorated
|
||||
* parameter with the value of `Response`.
|
||||
*
|
||||
* Example: `logout(@Response() res)`
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Response: () => ParameterDecorator = createRouteParamDecorator(
|
||||
RouteParamtypes.RESPONSE,
|
||||
);
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts reference to the `Next` function
|
||||
* from the underlying platform and populates the decorated
|
||||
* parameter with the value of `Next`.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Next: () => ParameterDecorator = createRouteParamDecorator(
|
||||
RouteParamtypes.NEXT,
|
||||
);
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `Session` object
|
||||
* from the underlying platform and populates the decorated
|
||||
* parameter with the value of `Session`.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Session: () => ParameterDecorator = createRouteParamDecorator(
|
||||
RouteParamtypes.SESSION,
|
||||
);
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `file` object
|
||||
* and populates the decorated parameter with the value of `file`.
|
||||
* Used in conjunction with
|
||||
* [multer middleware](https://github.com/expressjs/multer).
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* uploadFile(@UploadedFile() file) {
|
||||
* console.log(file);
|
||||
* }
|
||||
* ```
|
||||
* @see [Request object](https://docs.nestjs.com/techniques/file-upload)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const UploadedFile: (
|
||||
fileKey?: string,
|
||||
) => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.FILE);
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `files` object
|
||||
* and populates the decorated parameter with the value of `files`.
|
||||
* Used in conjunction with
|
||||
* [multer middleware](https://github.com/expressjs/multer).
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* uploadFile(@UploadedFiles() files) {
|
||||
* console.log(files);
|
||||
* }
|
||||
* ```
|
||||
* @see [Request object](https://docs.nestjs.com/techniques/file-upload)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const UploadedFiles: () => ParameterDecorator = createRouteParamDecorator(
|
||||
RouteParamtypes.FILES,
|
||||
);
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `headers`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `headers`.
|
||||
*
|
||||
* For example: `async update(@Headers('Cache-Control') cacheControl: string)`
|
||||
*
|
||||
* @param property name of single header property to extract.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const Headers: (
|
||||
property?: string,
|
||||
) => ParameterDecorator = createRouteParamDecorator(RouteParamtypes.HEADERS);
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `query`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `query`. May also apply pipes to the bound
|
||||
* query parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async find(@Query('user') user: string)
|
||||
* ```
|
||||
*
|
||||
* @param property name of single property to extract from the `query` object
|
||||
* @param pipes one or more pipes to apply to the bound query parameter
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Query(): ParameterDecorator;
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `query`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `query`. May also apply pipes to the bound
|
||||
* query parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async find(@Query('user') user: string)
|
||||
* ```
|
||||
*
|
||||
* @param property name of single property to extract from the `query` object
|
||||
* @param pipes one or more pipes to apply to the bound query parameter
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Query(
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator;
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `query`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `query`. May also apply pipes to the bound
|
||||
* query parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async find(@Query('user') user: string)
|
||||
* ```
|
||||
*
|
||||
* @param property name of single property to extract from the `query` object
|
||||
* @param pipes one or more pipes to apply to the bound query parameter
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Query(
|
||||
property: string,
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator;
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `query`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `query`. May also apply pipes to the bound
|
||||
* query parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async find(@Query('user') user: string)
|
||||
* ```
|
||||
*
|
||||
* @param property name of single property to extract from the `query` object
|
||||
* @param pipes one or more pipes to apply to the bound query parameter
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Query(
|
||||
property?: string | (Type<PipeTransform> | PipeTransform),
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
@@ -98,14 +260,90 @@ export function Query(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the entire `body`
|
||||
* object from the `req` object and populates the decorated
|
||||
* parameter with the value of `body`.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async create(@Body() cat: CreateCatDto)
|
||||
* ```
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Body(): ParameterDecorator;
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the entire `body`
|
||||
* object from the `req` object and populates the decorated
|
||||
* parameter with the value of `body`. Also applies the specified
|
||||
* pipes to that parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async create(@Body(new ValidationPipe()) cat: CreateCatDto)
|
||||
* ```
|
||||
*
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound body parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Body(
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator;
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts a single property from
|
||||
* the `body` object property of the `req` object and populates the decorated
|
||||
* parameter with the value of that property. Also applies pipes to the bound
|
||||
* body parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async create(@Body('role', new ValidationPipe()) role: string)
|
||||
* ```
|
||||
*
|
||||
* @param property name of single property to extract from the `body` object
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound body parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Body(
|
||||
property: string,
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator;
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the entire `body` object
|
||||
* property, or optionally a named property of the `body` object, from
|
||||
* the `req` object and populates the decorated parameter with that value.
|
||||
* Also applies pipes to the bound body parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```typescript
|
||||
* async create(@Body('role', new ValidationPipe()) role: string)
|
||||
* ```
|
||||
*
|
||||
* @param property name of single property to extract from the `body` object
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound body parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Body(
|
||||
property?: string | (Type<PipeTransform> | PipeTransform),
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
@@ -116,14 +354,110 @@ export function Body(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `params`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `params`. May also apply pipes to the bound
|
||||
* parameter.
|
||||
*
|
||||
* For example, extracting all params:
|
||||
* ```typescript
|
||||
* findOne(@Param() params: string[])
|
||||
* ```
|
||||
*
|
||||
* For example, extracting a single param:
|
||||
* ```typescript
|
||||
* findOne(@Param('id') id: string)
|
||||
* ```
|
||||
* @param property name of single property to extract from the `req` object
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Param(): ParameterDecorator;
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `params`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `params`. May also apply pipes to the bound
|
||||
* parameter.
|
||||
*
|
||||
* For example, extracting all params:
|
||||
* ```typescript
|
||||
* findOne(@Param() params: string[])
|
||||
* ```
|
||||
*
|
||||
* For example, extracting a single param:
|
||||
* ```typescript
|
||||
* findOne(@Param('id') id: string)
|
||||
* ```
|
||||
* @param property name of single property to extract from the `req` object
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Param(
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator;
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `params`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `params`. May also apply pipes to the bound
|
||||
* parameter.
|
||||
*
|
||||
* For example, extracting all params:
|
||||
* ```typescript
|
||||
* findOne(@Param() params: string[])
|
||||
* ```
|
||||
*
|
||||
* For example, extracting a single param:
|
||||
* ```typescript
|
||||
* findOne(@Param('id') id: string)
|
||||
* ```
|
||||
* @param property name of single property to extract from the `req` object
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Param(
|
||||
property: string,
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
): ParameterDecorator;
|
||||
/**
|
||||
* Route handler parameter decorator. Extracts the `params`
|
||||
* property from the `req` object and populates the decorated
|
||||
* parameter with the value of `params`. May also apply pipes to the bound
|
||||
* parameter.
|
||||
*
|
||||
* For example, extracting all params:
|
||||
* ```typescript
|
||||
* findOne(@Param() params: string[])
|
||||
* ```
|
||||
*
|
||||
* For example, extracting a single param:
|
||||
* ```typescript
|
||||
* findOne(@Param('id') id: string)
|
||||
* ```
|
||||
* @param property name of single property to extract from the `req` object
|
||||
* @param pipes one or more pipes - either instances or classes - to apply to
|
||||
* the bound parameter.
|
||||
*
|
||||
* @see [Request object](https://docs.nestjs.com/controllers#request-object)
|
||||
* @see [Working with pipes](https://docs.nestjs.com/custom-decorators#working-with-pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Param(
|
||||
property?: string | (Type<PipeTransform> | PipeTransform),
|
||||
...pipes: (Type<PipeTransform> | PipeTransform)[]
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
import { GLOBAL_MODULE_METADATA } from '../../constants';
|
||||
|
||||
/**
|
||||
* Makes the module global-scoped.
|
||||
* Once imported will be available for all existing modules.
|
||||
* Decorator that makes a module global-scoped.
|
||||
*
|
||||
* Once imported into any module, a global-scoped module will be visible
|
||||
* in all modules. Thereafter, modules that wish to inject a service exported
|
||||
* from a global module do not need to import the provider module.
|
||||
*
|
||||
* @see [Global modules](https://docs.nestjs.com/modules#global-modules)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Global(): ClassDecorator {
|
||||
return (target: any) => {
|
||||
|
||||
@@ -21,12 +21,18 @@ const validateKeys = (keys: string[]) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the module
|
||||
* - `imports` - the set of the 'imported' modules
|
||||
* - `controllers` - the list of controllers (e.g. HTTP controllers)
|
||||
* - `providers` - the list of providers that belong to this module. They can be injected between themselves.
|
||||
* - `exports` - the set of components, which should be available for modules, which imports this module
|
||||
* @param metadata {ModuleMetadata} Module metadata
|
||||
* Decorator that marks a class as a [module](https://docs.nestjs.com/modules).
|
||||
*
|
||||
* Modules are used by Nest to organize the application structure into scopes. Controllers
|
||||
* and Providers are scoped by the module they are declared in. Modules and their
|
||||
* classes (Controllers and Providers) form a graph that determines how Nest
|
||||
* performs [Dependency Injection (DI)](https://docs.nestjs.com/providers#dependency-injection).
|
||||
*
|
||||
* @param metadata module configuration metadata
|
||||
*
|
||||
* @see [Modules](https://docs.nestjs.com/modules)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function Module(metadata: ModuleMetadata): ClassDecorator {
|
||||
const propsKeys = Object.keys(metadata);
|
||||
|
||||
@@ -5,4 +5,5 @@ export enum Transport {
|
||||
MQTT,
|
||||
GRPC,
|
||||
RMQ,
|
||||
KAFKA
|
||||
}
|
||||
|
||||
@@ -1,11 +1,42 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Bad Gateway* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class BadGatewayException extends HttpException {
|
||||
/**
|
||||
* Instantiate a `BadGatewayException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new BadGatewayException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Bad Gateway'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(message?: string | object | any, error = 'Bad Gateway') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.BAD_GATEWAY),
|
||||
HttpException.createBody(message, error, HttpStatus.BAD_GATEWAY),
|
||||
HttpStatus.BAD_GATEWAY,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,42 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Bad Request* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class BadRequestException extends HttpException {
|
||||
/**
|
||||
* Instantiate a `BadRequestException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new BadRequestException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Bad Request'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(message?: string | object | any, error = 'Bad Request') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.BAD_REQUEST),
|
||||
HttpException.createBody(message, error, HttpStatus.BAD_REQUEST),
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,41 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Conflict* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class ConflictException extends HttpException {
|
||||
constructor(message?: string | object | any, error = 'Conflict') {
|
||||
/**
|
||||
* Instantiate a `ConflictException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new ConflictException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Conflict'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/ constructor(message?: string | object | any, error = 'Conflict') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.CONFLICT),
|
||||
HttpException.createBody(message, error, HttpStatus.CONFLICT),
|
||||
HttpStatus.CONFLICT,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,42 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Forbidden* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class ForbiddenException extends HttpException {
|
||||
/**
|
||||
* Instantiate a `ForbiddenException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new ForbiddenException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Forbidden'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(message?: string | object | any, error = 'Forbidden') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.FORBIDDEN),
|
||||
HttpException.createBody(message, error, HttpStatus.FORBIDDEN),
|
||||
HttpStatus.FORBIDDEN,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,42 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Gatway Timeout* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class GatewayTimeoutException extends HttpException {
|
||||
/**
|
||||
* Instantiate a `GatewayTimeoutException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new GatewayTimeoutException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Gateway Timeout'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(message?: string | object | any, error = 'Gateway Timeout') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.GATEWAY_TIMEOUT),
|
||||
HttpException.createBody(message, error, HttpStatus.GATEWAY_TIMEOUT),
|
||||
HttpStatus.GATEWAY_TIMEOUT,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,42 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Gone* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class GoneException extends HttpException {
|
||||
/**
|
||||
* Instantiate a `GoneException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new GoneException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Gone'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(message?: string | object | any, error = 'Gone') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.GONE),
|
||||
HttpException.createBody(message, error, HttpStatus.GONE),
|
||||
HttpStatus.GONE,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,39 @@
|
||||
import { isString } from '../utils/shared.utils';
|
||||
import { isString, isObject } from '../utils/shared.utils';
|
||||
|
||||
/**
|
||||
* Defines the base Nest HTTP exception, which is handled by the default
|
||||
* Exceptions Handler.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class HttpException extends Error {
|
||||
public readonly message: any;
|
||||
|
||||
/**
|
||||
* Base Nest application exception, which is handled by the default Exceptions Handler.
|
||||
* If you throw an exception from your HTTP route handlers, Nest will map them to the appropriate HTTP response and send to the client.
|
||||
* Instantiate a plain HTTP Exception.
|
||||
*
|
||||
* When `response` is an object:
|
||||
* - object will be stringified and returned to the user as a JSON response,
|
||||
* @example
|
||||
* `throw new HttpException()`
|
||||
*
|
||||
* When `response` is a string:
|
||||
* - Nest will create a response with two properties:
|
||||
* ```
|
||||
* message: response,
|
||||
* statusCode: X
|
||||
* ```
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `response` argument (required) defines the JSON response body.
|
||||
* - The `status` argument (required) defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: a short description of the HTTP error by default; override this
|
||||
* by supplying a string in the `response` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `status` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param response string or object describing the error condition.
|
||||
* @param status HTTP response status code
|
||||
*/
|
||||
constructor(
|
||||
private readonly response: string | object,
|
||||
@@ -41,4 +59,17 @@ export class HttpException extends Error {
|
||||
private getErrorString(target: string | object): string {
|
||||
return isString(target) ? target : JSON.stringify(target);
|
||||
}
|
||||
|
||||
public static createBody = (
|
||||
message: object | string,
|
||||
error?: string,
|
||||
statusCode?: number,
|
||||
) => {
|
||||
if (!message) {
|
||||
return { statusCode, error };
|
||||
}
|
||||
return isObject(message) && !Array.isArray(message)
|
||||
? message
|
||||
: { statusCode, error, message };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,45 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
import { HttpException } from './http.exception';
|
||||
|
||||
/**
|
||||
* Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot".
|
||||
* The resulting entity body MAY be short and stout.
|
||||
* Defines an HTTP exception for *ImATeapotException* type errors.
|
||||
*
|
||||
* http://save418.com/
|
||||
* Any attempt to brew coffee with a teapot should result in the error code
|
||||
* "418 I'm a teapot". The resulting entity body MAY be short and stout.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class ImATeapotException extends HttpException {
|
||||
/**
|
||||
* Instantiate an `ImATeapotException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new BadGatewayException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `"I'm a Teapot"` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(message?: string | object | any, error = 'I\'m a teapot') {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.I_AM_A_TEAPOT),
|
||||
HttpException.createBody(message, error, HttpStatus.I_AM_A_TEAPOT),
|
||||
HttpStatus.I_AM_A_TEAPOT,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,45 @@
|
||||
import { HttpException } from './http.exception';
|
||||
import { HttpStatus } from '../enums/http-status.enum';
|
||||
import { createHttpExceptionBody } from '../utils/http-exception-body.util';
|
||||
|
||||
/**
|
||||
* Defines an HTTP exception for *Internal Server Error* type errors.
|
||||
*
|
||||
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class InternalServerErrorException extends HttpException {
|
||||
/**
|
||||
* Instantiate an `InternalServerErrorException` Exception.
|
||||
*
|
||||
* @example
|
||||
* `throw new InternalServerErrorException()`
|
||||
*
|
||||
* @usageNotes
|
||||
* The constructor arguments define the HTTP response.
|
||||
* - The `message` argument defines the JSON response body.
|
||||
* - The `error` argument defines the HTTP Status Code.
|
||||
*
|
||||
* By default, the JSON response body contains two properties:
|
||||
* - `statusCode`: defaults to the Http Status Code provided in the `error` argument
|
||||
* - `message`: the string `'Internal Server Error'` by default; override this by supplying
|
||||
* a string in the `message` parameter.
|
||||
*
|
||||
* To override the entire JSON response body, pass an object. Nest will serialize
|
||||
* the object and return it as the JSON response body.
|
||||
*
|
||||
* The `error` argument is required, and should be a valid HTTP status code.
|
||||
* Best practice is to use the `HttpStatus` enum imported from `nestjs/common`.
|
||||
*
|
||||
* @param message string or object describing the error condition.
|
||||
* @param error HTTP response status code
|
||||
*/
|
||||
constructor(
|
||||
message?: string | object | any,
|
||||
error = 'Internal Server Error',
|
||||
) {
|
||||
super(
|
||||
createHttpExceptionBody(message, error, HttpStatus.INTERNAL_SERVER_ERROR),
|
||||
HttpException.createBody(message, error, HttpStatus.INTERNAL_SERVER_ERROR),
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user