Compare commits

...

412 Commits

Author SHA1 Message Date
Kamil Myśliwiec
35c79bd491 chore(@nestjs) publish v6.7.1 release 2019-09-16 13:16:01 +02:00
Kamil Myśliwiec
35635be02e fix(common) add missing getType method to httpserver 2019-09-16 13:13:52 +02:00
Kamil Myśliwiec
d936627214 test() update noop http adapter 2019-09-16 11:19:05 +02:00
Kamil Myśliwiec
f12bae62a0 chore() publish 6.7.0 release 2019-09-16 11:00:05 +02:00
Kamil Myśliwiec
c40f1ff767 chore(@nestjs) publish v6.7.0 release 2019-09-16 10:59:34 +02:00
Kamil Myśliwiec
2b94f16d41 feat(platform) add getType method 2019-09-16 10:58:02 +02:00
Kamil Mysliwiec
6fc41cab72 Merge pull request #2967 from nestjs/6.7.0
release(minor) 6.7.0 release
2019-09-16 10:55:44 +02:00
Kamil Myśliwiec
cf389312ce chore() publish 6.7.0 release 2019-09-16 10:28:54 +02:00
Kamil Mysliwiec
0bb86b386b Merge pull request #2966 from nestjs/renovate/pin-dependencies
chore(deps): pin dependencies
2019-09-16 10:25:27 +02:00
Renovate Bot
0584093419 chore(deps): pin dependencies 2019-09-16 08:23:18 +00:00
Kamil Myśliwiec
3254a3afa8 resolve conflicts 2019-09-16 10:19:21 +02:00
Kamil Myśliwiec
dc8d362e36 Merge branch 'krzkaczor-feature/ci-benchmarks' 2019-09-16 10:18:26 +02:00
Kamil Myśliwiec
ee89e12e03 resolve conflicts 2019-09-16 10:18:14 +02:00
Kamil Mysliwiec
9b391c836f Merge pull request #2889 from jrmce/rabbitmq-socketoptions-fix
bugfix(microservices) respect socketOptions for rabbitmq tls
2019-09-16 10:14:15 +02:00
Kamil Mysliwiec
c52d494e3a Merge pull request #2885 from Diluka/patch-1
fix(common) ParseIntPipe should properly handle number value
2019-09-16 10:14:00 +02:00
Kamil Mysliwiec
a395ca02a3 Merge pull request #2915 from nestjs/feat/grpc-service-refs
feat(microservices) add getClientByServiceName to client grpc
2019-09-16 10:13:05 +02:00
Kamil Mysliwiec
4d374e12ea Merge pull request #2935 from anchan828/fix-cachestore-interface
fix(common) change CacheStore.get return type
2019-09-16 10:12:50 +02:00
Kamil Mysliwiec
3d72259e8f Merge pull request #2843 from cor-ferro/export-app-options-interface
refactor(common) export NestApplicationOptions interface from index
2019-09-16 10:11:59 +02:00
Kamil Mysliwiec
3e173a2d7a Merge pull request #2855 from boenrobot/patch-2
style(common) added return types to Controller decorator overloads
2019-09-16 10:11:36 +02:00
Kamil Mysliwiec
f2f63aa0d5 Merge pull request #2493 from nestjs/feature/1581-context-check
feature(core) add ExecutionContext, ArgumentsHost type check #1581
2019-09-16 10:10:57 +02:00
Kamil Mysliwiec
38d1cfd757 Merge pull request #2964 from nestjs/renovate/ts-node-8.x
chore(deps): update dependency ts-node to v8.4.1
2019-09-16 10:08:56 +02:00
Renovate Bot
d2cca0cffe chore(deps): update dependency ts-node to v8.4.1 2019-09-16 07:52:53 +00:00
Kamil Mysliwiec
efb7de2f3e Merge pull request #2962 from nestjs/renovate/graphql-14.x
fix(deps): update dependency graphql to v14.5.6
2019-09-16 09:48:09 +02:00
Kamil Myśliwiec
8e7fe10c66 test(microservices) spy on connect method (client proxy) 2019-09-16 09:41:41 +02:00
Renovate Bot
0789aad977 fix(deps): update dependency graphql to v14.5.6 2019-09-15 16:57:44 +00:00
Kamil Mysliwiec
248271397b Merge pull request #2950 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.7.1
2019-09-15 10:11:17 +02:00
Kamil Mysliwiec
cbf263a17f Merge pull request #2940 from nestjs/renovate/webpack-4.x
chore(deps): update dependency webpack to v4.40.2
2019-09-14 13:13:45 +02:00
Kamil Mysliwiec
18fe2f1d2c Merge pull request #2949 from nestjs/renovate/graphql-14.x
fix(deps): update dependency graphql to v14.5.5
2019-09-14 12:57:08 +02:00
Kamil Mysliwiec
17514942e7 Merge pull request #2947 from nestjs/renovate/engine.io-client-3.x
fix(deps): update dependency engine.io-client to v3.4.0
2019-09-14 12:56:58 +02:00
Kamil Mysliwiec
741eb75cb3 Merge pull request #2951 from nestjs/renovate/typeorm-0.x
fix(deps): update dependency typeorm to v0.2.19
2019-09-14 12:56:52 +02:00
Kamil Mysliwiec
a39bf86d83 Update Readme.md 2019-09-14 12:46:14 +02:00
Renovate Bot
62c1d4d673 fix(deps): update dependency typeorm to v0.2.19 2019-09-13 16:39:07 +00:00
Renovate Bot
140904025d fix(deps): update dependency mongoose to v5.7.1 2019-09-13 16:02:28 +00:00
Renovate Bot
59195609bc fix(deps): update dependency graphql to v14.5.5 2019-09-13 15:31:21 +00:00
Renovate Bot
8ff06ff38a chore(deps): update dependency webpack to v4.40.2 2019-09-13 14:35:47 +00:00
Kamil Mysliwiec
4ce61867c4 Merge pull request #2942 from nestjs/renovate/tsconfig-paths-3.x
chore(deps): update dependency tsconfig-paths to v3.9.0
2019-09-13 14:06:13 +02:00
Renovate Bot
810ba2a484 fix(deps): update dependency engine.io-client to v3.4.0 2019-09-13 12:04:20 +00:00
Kamil Mysliwiec
71ade30129 Merge pull request #2941 from nestjs/renovate/ts-jest-24.x
chore(deps): update dependency ts-jest to v24.1.0
2019-09-13 13:46:16 +02:00
Kamil Mysliwiec
2dce56fe9d Merge pull request #2944 from nestjs/renovate/ts-morph-4.x
fix(deps): update dependency ts-morph to v4.0.1
2019-09-13 13:44:20 +02:00
Renovate Bot
a6b47321de fix(deps): update dependency ts-morph to v4.0.1 2019-09-12 23:24:30 +00:00
Renovate Bot
7d68f8c690 chore(deps): update dependency tsconfig-paths to v3.9.0 2019-09-12 20:25:15 +00:00
Renovate Bot
a6e9a13c7c chore(deps): update dependency ts-jest to v24.1.0 2019-09-12 20:24:49 +00:00
Kamil Mysliwiec
b4baa995e4 Merge pull request #2936 from nestjs/renovate/swagger-ui-express-4.x
fix(deps): update dependency swagger-ui-express to v4.1.0
2019-09-12 10:03:51 +02:00
Kamil Mysliwiec
924503535a Update readme_zh.md 2019-09-12 10:02:05 +02:00
Kamil Mysliwiec
d035a725cf Update readme_zh.md 2019-09-12 10:00:47 +02:00
Renovate Bot
96a051c2cc fix(deps): update dependency swagger-ui-express to v4.1.0 2019-09-11 20:56:02 +00:00
Kamil Mysliwiec
cee1a23878 Merge pull request #2923 from nestjs/renovate/ts-loader-6.x
chore(deps): update dependency ts-loader to v6.1.0
2019-09-11 21:15:37 +02:00
Renovate Bot
d4a68a61cf chore(deps): update dependency ts-loader to v6.1.0 2019-09-11 19:01:28 +00:00
Kamil Mysliwiec
d3df303781 Merge pull request #2919 from nestjs/renovate/supertest-2.x
chore(deps): update dependency @types/supertest to v2.0.8
2019-09-11 20:58:15 +02:00
Kamil Mysliwiec
8df62fa49b Merge pull request #2921 from nestjs/renovate/typescript-3.x
fix(deps): update dependency typescript to v3.6.3
2019-09-11 20:58:02 +02:00
Kamil Mysliwiec
de85a539d1 Merge pull request #2922 from nestjs/renovate/tsc-watch-3.x
chore(deps): update dependency tsc-watch to v3
2019-09-11 20:57:48 +02:00
Kamil Mysliwiec
dc87cd92ab Merge pull request #2925 from nestjs/renovate/node-10.x
chore(deps): update dependency @types/node to v10.14.18
2019-09-11 20:57:33 +02:00
Kamil Mysliwiec
99074a8d9d Merge pull request #2926 from nestjs/renovate/node-12.x
chore(deps): update dependency @types/node to v12.7.5
2019-09-11 20:57:04 +02:00
Kamil Mysliwiec
e5c32f21d1 Merge pull request #2930 from nestjs/renovate/docker-confluentinc-cp-kafka-5.x
chore(deps): update confluentinc/cp-kafka docker tag to v5.3.1
2019-09-11 20:56:32 +02:00
Kamil Mysliwiec
ae207ca6c9 Merge pull request #2927 from nestjs/renovate/node-8.x
chore(deps): update dependency @types/node to v8.10.54
2019-09-11 20:56:20 +02:00
Kamil Mysliwiec
c5a641d3ee Merge pull request #2931 from asnowwolf/patch-2
docs() fix broken link
2019-09-11 20:54:43 +02:00
Kamil Mysliwiec
0f6920894f Merge pull request #2932 from nestjs/renovate/docker-confluentinc-cp-zookeeper-5.x
chore(deps): update confluentinc/cp-zookeeper docker tag to v5.3.1
2019-09-11 20:53:47 +02:00
Kamil Mysliwiec
635f332314 Merge pull request #2933 from nestjs/renovate/fast-safe-stringify-2.x
fix(deps): update dependency fast-safe-stringify to v2.0.7
2019-09-11 20:53:37 +02:00
Kamil Mysliwiec
b49f3ce82c Merge pull request #2934 from nestjs/renovate/cache-manager-2.x
chore(deps): update dependency @types/cache-manager to v2
2019-09-11 20:52:58 +02:00
Kamil Mysliwiec
18e3445934 Merge pull request #2929 from yort-feng/patch-1
sample() combine multiple imports from the same module
2019-09-11 20:51:53 +02:00
kyusyukeigo
edc7bd0c6c fix(common) change CacheStore.get return type 2019-09-12 00:15:13 +09:00
Renovate Bot
f3a352c760 chore(deps): update dependency @types/cache-manager to v2 2019-09-11 14:36:38 +00:00
Renovate Bot
75636abf2a fix(deps): update dependency fast-safe-stringify to v2.0.7 2019-09-11 12:32:13 +00:00
Renovate Bot
f9fb143d28 chore(deps): update confluentinc/cp-zookeeper docker tag to v5.3.1 2019-09-11 10:26:52 +00:00
雪狼
83c0d6df67 docs: fix broken link 2019-09-11 17:41:45 +08:00
Renovate Bot
7ec42164cc chore(deps): update confluentinc/cp-kafka docker tag to v5.3.1 2019-09-11 09:21:47 +00:00
Yort
f397af3fa7 Combined multiple imports from the same module
Multiple imports from '@nestjs/common' can be combined into one
2019-09-11 16:40:57 +08:00
Renovate Bot
feefeec083 chore(deps): update dependency @types/node to v8.10.54 2019-09-11 06:29:52 +00:00
Renovate Bot
b5f932db07 chore(deps): update dependency @types/node to v12.7.5 2019-09-11 05:51:14 +00:00
Renovate Bot
16a80d2ffd chore(deps): update dependency @types/node to v10.14.18 2019-09-11 05:50:55 +00:00
Renovate Bot
43cff1603b chore(deps): update dependency tsc-watch to v3 2019-09-10 21:06:33 +00:00
Renovate Bot
0b2e5652ed fix(deps): update dependency typescript to v3.6.3 2019-09-10 21:06:00 +00:00
Renovate Bot
32651fa06a chore(deps): update dependency @types/supertest to v2.0.8 2019-09-10 20:40:42 +00:00
Kamil Mysliwiec
af88637435 Merge pull request #2917 from nestjs/renovate/node-11.x
chore(deps): update dependency @types/node to v11.13.20
2019-09-10 21:43:53 +02:00
Kamil Mysliwiec
b4dd1829ab Merge pull request #2916 from nestjs/renovate/pin-dependencies
fix(deps): pin dependencies
2019-09-10 21:43:42 +02:00
Renovate Bot
7d8e668ff6 chore(deps): update dependency @types/node to v11.13.20 2019-09-10 19:31:38 +00:00
Renovate Bot
f63028026d fix(deps): pin dependencies 2019-09-10 19:31:14 +00:00
Kamil Mysliwiec
84997f0c3f Merge pull request #2911 from johnbiundo/biundo/25-dynamic-modules
docs(samples) add 25-dynamic-modules
2019-09-10 21:29:36 +02:00
John Biundo
70c3f2e476 fix code to match docs 2019-09-10 08:43:19 -07:00
John Biundo
fdfc399184 fix build errors 2019-09-10 08:38:11 -07:00
Kamil Myśliwiec
155f917195 refactor(core) simplify getType usage 2019-09-10 14:55:47 +02:00
Kamil Myśliwiec
886220d9f8 resolve conflicts 2019-09-10 14:29:12 +02:00
Kamil Myśliwiec
73ff3d18ef remove exceptions 2019-09-10 14:26:29 +02:00
Kamil Myśliwiec
733560d873 refactor(microservices) use delete instead of object destructing 2019-09-10 14:22:42 +02:00
Kamil Myśliwiec
73c1cf34c1 feat(microservices) add getClientByServiceName to client grpc 2019-09-10 14:20:35 +02:00
Kamil Myśliwiec
d3bea8a222 bugfix(microservices) exclude duplicated methods #2557 2019-09-10 13:41:55 +02:00
Kamil Mysliwiec
7bb3b01f39 Merge pull request #2910 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.7.0
2019-09-10 09:05:57 +02:00
Kamil Mysliwiec
a8b98419f5 Merge pull request #2912 from nestjs/renovate/kafka-node-2.x
chore(deps): update dependency @types/kafka-node to v2.0.9
2019-09-10 09:05:30 +02:00
Kamil Mysliwiec
4c9b334c2c Merge pull request #2913 from nestjs/renovate/tslint-5.x
chore(deps): update dependency tslint to v5.20.0
2019-09-10 09:00:07 +02:00
Kamil Mysliwiec
d14f2de4fb Merge pull request #2908 from nestjs/renovate/chai-4.x
chore(deps): update dependency @types/chai to v4.2.2
2019-09-10 08:59:59 +02:00
Kamil Mysliwiec
1e3594b050 Update Readme.md 2019-09-10 08:00:44 +02:00
Renovate Bot
6cd3968b20 chore(deps): update dependency tslint to v5.20.0 2019-09-10 00:52:44 +00:00
Renovate Bot
25e3a7c808 chore(deps): update dependency @types/kafka-node to v2.0.9 2019-09-10 00:45:41 +00:00
John Biundo
e82c8a7804 docs(samples) add 25-dynamic-modules 2019-09-09 15:24:36 -07:00
Renovate Bot
1b79e146a7 fix(deps): update dependency mongoose to v5.7.0 2019-09-09 17:14:51 +00:00
Renovate Bot
8834c5f3f4 chore(deps): update dependency @types/chai to v4.2.2 2019-09-09 13:07:52 +00:00
Kamil Mysliwiec
80622253be Merge pull request #2900 from nestjs/renovate/prisma-binding-2.x
fix(deps): update dependency prisma-binding to v2.3.16
2019-09-09 14:04:36 +02:00
Kamil Mysliwiec
cee461096d Merge pull request #2904 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.18.4
2019-09-09 14:04:29 +02:00
Renovate Bot
dc633a2c3b fix(deps): update dependency sequelize to v5.18.4 2019-09-08 12:01:20 +00:00
Krzysztof Kaczor
5ff3754b4f Merge branch 'master' into feature/ci-benchmarks
# Conflicts:
#	package-lock.json
#	package.json
2019-09-07 16:24:11 -07:00
Krzysztof Kaczor
a7993df60d update codechecks 2019-09-07 16:17:13 -07:00
Krzysztof Kaczor
29745813e6 update codechecks client 2019-09-07 00:19:10 -07:00
Krzysztof Kaczor
5d0da3e38d install native wrk on CI 2019-09-07 00:19:10 -07:00
Krzysztof Kaczor
27b9629bb0 add codechecks to CI pipeline 2019-09-07 00:19:10 -07:00
Renovate Bot
5190adcc0a fix(deps): update dependency prisma-binding to v2.3.16 2019-09-06 18:40:00 +00:00
Kamil Mysliwiec
c39d4fc798 Merge pull request #2892 from nestjs/renovate/webpack-cli-3.x
chore(deps): update dependency webpack-cli to v3.3.8
2019-09-06 12:27:34 +02:00
Kamil Mysliwiec
22f0390047 Merge pull request #2896 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.6.13
2019-09-06 12:27:26 +02:00
Renovate Bot
f6c37bbb9c fix(deps): update dependency mongoose to v5.6.13 2019-09-06 02:09:52 +00:00
Renovate Bot
cb79818989 chore(deps): update dependency webpack-cli to v3.3.8 2019-09-05 17:12:27 +00:00
John McEntee
15df360f8e bugfix(microservices) respect socketOptions for rabbitmq tls
socketOptions are currently being ignored when creating
a rabbitMQ microservice and client. This PR correctly passes
socketOptions to external libraries.

Fixes #2887
2019-09-05 10:47:03 -04:00
Krzysztof Kaczor
cb36a98607 initial version of benchmark codecheck 2019-09-04 17:13:13 -07:00
Krzysztof Kaczor
52dee78f13 add types to get-benchmarks, simple document explaining report contents 2019-09-04 13:43:48 -07:00
Kamil Mysliwiec
3df7d92d06 Merge pull request #2886 from nestjs/renovate/nestjs-graphql-6.x
fix(deps): update dependency @nestjs/graphql to v6.5.1
2019-09-04 15:08:51 +02:00
Renovate Bot
c1c8bc33e0 fix(deps): update dependency @nestjs/graphql to v6.5.1 2019-09-04 12:02:20 +00:00
Kamil Myśliwiec
fbb894a10a refactor() resolve conflicts 2019-09-04 13:12:49 +02:00
Kamil Myśliwiec
7db42a1a2c refactor(microservices) adjust to codebase style 2019-09-04 13:08:31 +02:00
Kamil Mysliwiec
77297cabea Merge pull request #2876 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v6.6.7
2019-09-04 11:00:35 +02:00
Kamil Mysliwiec
afcff76e4e Merge pull request #2883 from nestjs/renovate/rxjs-compat-6.x
fix(deps): update dependency rxjs-compat to v6.5.3
2019-09-04 11:00:27 +02:00
Renovate Bot
450d5f7537 fix(deps): update nest monorepo to v6.6.7 2019-09-04 07:14:10 +00:00
Renovate Bot
6a37b6900e fix(deps): update dependency rxjs-compat to v6.5.3 2019-09-04 07:08:49 +00:00
Kamil Mysliwiec
cc3809be46 Merge pull request #2878 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.6.12
2019-09-04 09:06:31 +02:00
Kamil Mysliwiec
f2a2710746 Merge pull request #2879 from nestjs/renovate/grpc-proto-loader-0.x
fix(deps): update dependency @grpc/proto-loader to v0.5.2
2019-09-04 09:06:22 +02:00
Kamil Mysliwiec
5ba501330b Merge pull request #2882 from nestjs/renovate/rxjs-6.x
fix(deps): update dependency rxjs to v6.5.3
2019-09-04 09:06:15 +02:00
Kamil Mysliwiec
fb6dc8ad3b Merge pull request #2873 from nestjs/renovate/nodemon-1.x
chore(deps): update dependency nodemon to v1.19.2
2019-09-04 09:06:06 +02:00
Kamil Mysliwiec
4399e26d7a Merge pull request #2880 from nestjs/renovate/node-12.x
chore(deps): update dependency @types/node to v12.7.4
2019-09-04 08:51:37 +02:00
Kamil Mysliwiec
b754a5feef Merge pull request #2881 from nestjs/renovate/handlebars-4.x
fix(deps): update dependency handlebars to v4.2.0
2019-09-04 08:50:52 +02:00
Kamil Mysliwiec
ece9a6d285 Merge pull request #2884 from nestjs/renovate/chai-4.x
chore(deps): update dependency @types/chai to v4.2.1
2019-09-04 08:50:22 +02:00
Diluka
be2531907a fix(common): ParseIntPipe handle number value
handle `number` as `string` instead of throw an error
values may be parsed by other global pipes provided by other modules
we expect `ParseIntPipe` to return int value. it's doesn't break the logic.
2019-09-04 12:53:41 +08:00
Renovate Bot
c9cb147b6f chore(deps): update dependency @types/chai to v4.2.1 2019-09-04 00:56:11 +00:00
Renovate Bot
ec735b4a49 fix(deps): update dependency mongoose to v5.6.12 2019-09-04 00:12:03 +00:00
Renovate Bot
8ea9f8ae94 fix(deps): update dependency rxjs to v6.5.3 2019-09-03 22:01:00 +00:00
Renovate Bot
555a9691cd fix(deps): update dependency handlebars to v4.2.0 2019-09-03 20:04:01 +00:00
Renovate Bot
88c524611f chore(deps): update dependency @types/node to v12.7.4 2019-09-03 20:03:26 +00:00
Renovate Bot
772e8e82b9 fix(deps): update dependency @grpc/proto-loader to v0.5.2 2019-09-03 18:44:52 +00:00
Kamil Myśliwiec
432dc3bad5 chore(@nestjs) publish v6.6.7 release 2019-09-03 15:16:52 +02:00
Kamil Myśliwiec
d4bb43009b fix(common) add additional security check to validation pipe 2019-09-03 15:14:10 +02:00
Kamil Myśliwiec
bacad91d00 refactor(microservice) wip adjust kafka to code style 2019-09-03 15:06:28 +02:00
Kamil Myśliwiec
7f9e110c60 resolve conflicts 2019-09-03 13:30:12 +02:00
Renovate Bot
28ffffa5e4 chore(deps): update dependency nodemon to v1.19.2 2019-09-03 11:14:26 +00:00
Kamil Mysliwiec
fbe80927b3 Merge pull request #2872 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.18.1
2019-09-03 13:10:28 +02:00
Kamil Mysliwiec
3086df5a50 Merge pull request #2870 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v6.6.6
2019-09-03 13:10:21 +02:00
Renovate Bot
8a6476a008 fix(deps): update dependency sequelize to v5.18.1 2019-09-03 10:16:31 +00:00
Renovate Bot
8cac746b2c fix(deps): update nest monorepo to v6.6.6 2019-09-03 08:18:26 +00:00
Kamil Myśliwiec
f8088a0119 chore(@nestjs) publish v6.6.6 release 2019-09-03 10:11:30 +02:00
Kamil Myśliwiec
d36d2f5e2d hotfix(core) add root module to the modules stack 2019-09-03 10:04:02 +02:00
Kamil Myśliwiec
6b7e5c2918 chore(@nestjs) publish v6.6.5 release 2019-09-03 09:56:07 +02:00
Kamil Myśliwiec
a8160cfa38 chore() publish 6.6.5 version 2019-09-03 09:54:28 +02:00
Kamil Myśliwiec
3bd6d4de9b Merge branch 'master' of https://github.com/nestjs/nest 2019-09-03 09:54:05 +02:00
Kamil Myśliwiec
77fb3bae6b fix(core) improve topological sorting performance 2019-09-03 09:53:56 +02:00
Kamil Mysliwiec
d77cdef120 Merge pull request #2868 from nestjs/revert-2837-renovate/typescript-3.x
Revert "fix(deps): update dependency typescript to v3.6.2"
2019-09-03 09:21:27 +02:00
Kamil Mysliwiec
9af2f6eb0f Revert "fix(deps): update dependency typescript to v3.6.2" 2019-09-03 09:20:51 +02:00
Kamil Mysliwiec
c575f9dfd7 Merge pull request #2837 from nestjs/renovate/typescript-3.x
fix(deps): update dependency typescript to v3.6.2
2019-09-03 09:06:03 +02:00
Kamil Mysliwiec
af0d322fcf Merge pull request #2866 from nestjs/renovate/pin-dependencies
chore(deps): pin dependency typescript to 3.6.2
2019-09-03 08:59:49 +02:00
Renovate Bot
935399f146 fix(deps): update dependency typescript to v3.6.2 2019-09-03 06:52:48 +00:00
Renovate Bot
d469f1823b chore(deps): pin dependency typescript to 3.6.2 2019-09-03 06:50:41 +00:00
Kamil Myśliwiec
12368ffca7 chore() resolve conflicts 2019-09-03 08:46:50 +02:00
Kamil Myśliwiec
ce912dac83 deps() upgrade to the latest typescript version 2019-09-03 08:44:43 +02:00
Kamil Mysliwiec
0094b29283 Merge pull request #2864 from nestjs/renovate/ts-morph-4.x
fix(deps): update dependency ts-morph to v4
2019-09-03 08:39:30 +02:00
Renovate Bot
580eaab106 fix(deps): update dependency ts-morph to v4 2019-09-03 00:10:04 +00:00
Kamil Mysliwiec
b9d6508ead Merge pull request #2863 from nestjs/renovate/nestjs-graphql-6.x
fix(deps): update dependency @nestjs/graphql to v6.5.0
2019-09-02 15:16:28 +02:00
Renovate Bot
efeb072797 fix(deps): update dependency @nestjs/graphql to v6.5.0 2019-09-02 13:16:00 +00:00
Kamil Mysliwiec
64907e5879 Merge pull request #2862 from nestjs/renovate/sinon-7.x
chore(deps): update dependency sinon to v7.4.2
2019-09-02 15:14:16 +02:00
Kamil Mysliwiec
915fa708f0 Merge pull request #2860 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v6.6.4
2019-09-02 15:13:46 +02:00
Renovate Bot
565a5a8a11 chore(deps): update dependency sinon to v7.4.2 2019-09-02 11:53:54 +00:00
Renovate Bot
d357f1edfe fix(deps): update nest monorepo to v6.6.4 2019-09-02 09:42:44 +00:00
Kamil Myśliwiec
3148e0f866 chore(@nestjs) publish v6.6.4 release 2019-09-02 11:36:53 +02:00
Kamil Myśliwiec
5f3eeff77a Merge branch 'master' of https://github.com/nestjs/nest 2019-09-02 11:34:30 +02:00
Kamil Myśliwiec
17d29a952c chore() release 6.6.4 version 2019-09-02 11:34:16 +02:00
Kamil Myśliwiec
2bbff5432e fix(core) lookup enhancers on providers 2019-09-02 11:33:38 +02:00
Kamil Mysliwiec
d77936b7bd Merge pull request #2846 from nestjs/renovate/nestjs-graphql-6.x
fix(deps): update dependency @nestjs/graphql to v6.4.3
2019-09-02 09:19:35 +02:00
Kamil Mysliwiec
f48d4d422d Merge pull request #2847 from nestjs/renovate/graphql-14.x
fix(deps): update dependency graphql to v14.5.4
2019-09-02 09:19:26 +02:00
Kamil Mysliwiec
9874b55b27 Merge pull request #2849 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.5.16
2019-09-02 09:09:57 +02:00
Renovate Bot
74fb7917ce fix(deps): update dependency graphql to v14.5.4 2019-09-02 07:02:56 +00:00
Renovate Bot
f9ec473f64 fix(deps): update dependency @nestjs/graphql to v6.4.3 2019-09-02 07:00:40 +00:00
Renovate Bot
ad2fecfef8 chore(deps): update dependency @types/mongoose to v5.5.16 2019-09-02 06:59:40 +00:00
Kamil Mysliwiec
1e9930aa6c Merge pull request #2850 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.18.0
2019-09-02 08:53:18 +02:00
Kamil Mysliwiec
7c13c100e2 Merge pull request #2851 from nestjs/renovate/node-10.x
chore(deps): update dependency @types/node to v10.14.17
2019-09-02 08:53:11 +02:00
Kamil Mysliwiec
63ac6c098f Merge pull request #2852 from nestjs/renovate/node-12.x
chore(deps): update dependency @types/node to v12.7.3
2019-09-02 08:53:04 +02:00
Kamil Mysliwiec
a7c24a168e Merge pull request #2853 from nestjs/renovate/node-8.x
chore(deps): update dependency @types/node to v8.10.53
2019-09-02 08:52:51 +02:00
Kamil Mysliwiec
f690baf387 Merge pull request #2854 from nestjs/renovate/apollo-graphql-packages
fix(deps): update dependency apollo-server-express to v2.9.3
2019-09-02 08:52:43 +02:00
Kamil Mysliwiec
908438c98f Merge pull request #2857 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.8.0
2019-09-02 08:52:36 +02:00
Kamil Mysliwiec
4cf0e7bfab Merge pull request #2858 from nestjs/renovate/path-to-regexp-3.x
fix(deps): update dependency path-to-regexp to v3.1.0
2019-09-02 08:52:26 +02:00
Renovate Bot
707ff6e512 fix(deps): update dependency apollo-server-express to v2.9.3 2019-09-01 21:53:40 +00:00
Renovate Bot
37488d4d1e fix(deps): update dependency sequelize to v5.18.0 2019-08-31 11:39:32 +00:00
Renovate Bot
db61bc1729 fix(deps): update dependency path-to-regexp to v3.1.0 2019-08-31 04:05:12 +00:00
Renovate Bot
c0fc683b7c fix(deps): update dependency fastify to v2.8.0 2019-08-30 22:00:04 +00:00
Vasil Rangelov
6d90053f99 style(common): Added return types to Controller decorator overloads
This results in properly generated d.ts files, from which tslint won't complain about no-unsafe-any in controllers.
2019-08-30 14:23:48 +03:00
Renovate Bot
84acc114cf chore(deps): update dependency @types/node to v8.10.53 2019-08-30 06:32:10 +00:00
Renovate Bot
69dcf81f54 chore(deps): update dependency @types/node to v12.7.3 2019-08-30 05:29:23 +00:00
Renovate Bot
de4a990aae chore(deps): update dependency @types/node to v10.14.17 2019-08-30 05:29:05 +00:00
Kamil Mysliwiec
af54516b99 Merge pull request #2833 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v6.6.3
2019-08-29 11:59:43 +02:00
Renovate Bot
3c59864847 fix(deps): update nest monorepo to v6.6.3 2019-08-29 09:59:06 +00:00
Kamil Mysliwiec
741f55046f Merge pull request #2836 from nestjs/renovate/mongodb-3.x
fix(deps): update dependency mongodb to v3.3.2
2019-08-29 11:47:34 +02:00
Kamil Mysliwiec
1cf7610e9b Merge pull request #2841 from nestjs/renovate/apollo-graphql-packages
fix(deps): update dependency apollo-server-express to v2.9.1
2019-08-29 11:47:18 +02:00
Kamil Mysliwiec
bbb8000831 Merge pull request #2842 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.17.1
2019-08-29 11:46:44 +02:00
Livio Brunnner
ade87e1284 refactor(): Rewrite benchmark script to TS 2019-08-29 10:53:15 +02:00
Kamil Myśliwiec
f0d0ded2d7 chore(@nestjs) publish v6.6.3 release 2019-08-29 09:12:44 +02:00
Kamil Myśliwiec
02c8b5b2b9 fix(core) invert middleware execution order 2019-08-29 09:11:18 +02:00
cor-ferro
e062a1b960 refactor(common) export NestApplicationOptions interface from index 2019-08-29 08:03:39 +03:00
Renovate Bot
f1ab1f1ab0 fix(deps): update dependency sequelize to v5.17.1 2019-08-29 04:25:12 +00:00
Renovate Bot
a023c5871e fix(deps): update dependency apollo-server-express to v2.9.1 2019-08-28 20:38:41 +00:00
Renovate Bot
4cea99e16f fix(deps): update dependency mongodb to v3.3.2 2019-08-28 17:43:44 +00:00
Michael Kaufman
11625038e8 Rebuilt package-lock with kafkajs. 2019-08-28 12:37:37 -04:00
Michael Kaufman
df90e0dc62 Merge remote-tracking branch 'Nest/master' into 2361-kafka-micoservice-6-6-0
# Conflicts:
#	package-lock.json
2019-08-28 12:36:09 -04:00
Michael Kaufman
4632ba60cf Adds serializer and deserializer logic. 2019-08-28 12:34:49 -04:00
Kamil Myśliwiec
f791b3e6b1 fix(platform-fastify) fix invalid import statement for reply object 2019-08-28 15:56:09 +02:00
Kamil Myśliwiec
1a0102b007 chore() publish 6.6.2 release 2019-08-28 15:10:05 +02:00
Kamil Myśliwiec
7516de13a8 chore(@nestjs) publish v6.6.2 release 2019-08-28 15:09:14 +02:00
Kamil Myśliwiec
2cdebc888d fix(core) circular dependency when calculating distance of modules 2019-08-28 15:07:56 +02:00
Kamil Myśliwiec
557f585a00 fix(platform-fastify) wrap native response object for exception filter 2019-08-28 15:07:34 +02:00
Kamil Myśliwiec
892df6c433 chore() release 6.6.1 patch release 2019-08-28 12:51:48 +02:00
Kamil Myśliwiec
83e846633b chore(@nestjs) publish v6.6.1 release 2019-08-28 12:51:09 +02:00
Kamil Myśliwiec
709625e273 Merge branch 'master' of https://github.com/nestjs/nest 2019-08-28 12:50:09 +02:00
Kamil Myśliwiec
cb4eb3d7ad fix(common) fix logger levels default value #2832 2019-08-28 12:49:58 +02:00
Kamil Mysliwiec
1490a8a8b3 Merge pull request #2830 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v6.6.0
2019-08-28 10:06:13 +02:00
Kamil Myśliwiec
1b166131d7 Merge branch 'master' of https://github.com/nestjs/nest 2019-08-28 10:05:22 +02:00
Kamil Myśliwiec
37e41d7afe test() mqtt concurrent integration test comment out 2019-08-28 10:05:11 +02:00
Renovate Bot
40234488d6 fix(deps): update nest monorepo to v6.6.0 2019-08-28 07:42:18 +00:00
Kamil Mysliwiec
781bf4d283 Merge pull request #2829 from nestjs/renovate/mysql2-1.x
fix(deps): update dependency mysql2 to v1.7.0
2019-08-28 09:34:10 +02:00
Kamil Myśliwiec
c80834894a chore() release 6.6.0 version 2019-08-28 09:33:03 +02:00
Kamil Myśliwiec
16ae1407e1 chore(@nestjs) publish v6.6.0 release 2019-08-28 09:32:20 +02:00
Renovate Bot
2e05368b2e fix(deps): update dependency mysql2 to v1.7.0 2019-08-28 07:18:29 +00:00
Kamil Mysliwiec
a68ae579d4 Merge pull request #2816 from nestjs/6.6.0
chore() minor release [6.6.0]
2019-08-28 09:14:09 +02:00
Kamil Mysliwiec
aa9dfbb7ba Merge pull request #2827 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.5.15
2019-08-28 08:11:41 +02:00
Kamil Mysliwiec
8278746279 Merge pull request #2828 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.17.0
2019-08-28 08:11:32 +02:00
Renovate Bot
60eae53f98 fix(deps): update dependency sequelize to v5.17.0 2019-08-28 04:24:59 +00:00
Renovate Bot
77298e804a chore(deps): update dependency @types/mongoose to v5.5.15 2019-08-27 23:28:24 +00:00
Kamil Mysliwiec
9a53587afa Merge pull request #2825 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.5.14
2019-08-27 20:42:00 +02:00
Renovate Bot
7cfffb9a95 chore(deps): update dependency @types/mongoose to v5.5.14 2019-08-27 18:40:00 +00:00
Kamil Mysliwiec
0e2a4e7e84 Merge pull request #2820 from nestjs/renovate/webpack-4.x
chore(deps): update dependency webpack to v4.39.3
2019-08-27 18:56:53 +02:00
Michael Kaufman
a1b839e211 Starting implementation for Kafka with serializer/deserializer interfaces. 2019-08-27 09:52:24 -04:00
Michael Kaufman
461959e176 Updates package-lock. 2019-08-27 09:38:03 -04:00
Michael Kaufman
e39b6468f0 Merge remote-tracking branch 'Nest/6.6.0' into 2361-kafka-micoservice-6-6-0
# Conflicts:
#	package-lock.json
#	packages/microservices/interfaces/index.ts
#	packages/microservices/test/listeners-controller.spec.ts
2019-08-27 09:29:18 -04:00
Renovate Bot
25174cbef4 chore(deps): update dependency webpack to v4.39.3 2019-08-27 12:24:02 +00:00
Kamil Mysliwiec
8d9b996b2f Merge pull request #2818 from nestjs/renovate/lint-staged-9.x
chore(deps): update dependency lint-staged to v9.2.5
2019-08-27 10:20:17 +02:00
Renovate Bot
27c1c0881e chore(deps): update dependency lint-staged to v9.2.5 2019-08-27 06:50:58 +00:00
Kamil Myśliwiec
d01a798d7b lint() fix linter issues 2019-08-26 22:50:58 +02:00
Kamil Myśliwiec
b8fbda24bd docs() add comments for overloaded signatures 2019-08-26 22:49:50 +02:00
Kamil Mysliwiec
464c2bbef0 Merge pull request #2688 from BrunnerLivio/feature/api-docs
docs() add API documentation
2019-08-26 22:45:41 +02:00
Kamil Myśliwiec
a9aaf86099 Merge branch '6.6.0' of https://github.com/nestjs/nest into 6.6.0 2019-08-26 22:24:21 +02:00
John Biundo
85f3897ae1 feat(platform-express): Add documentation for public API 2019-08-26 22:18:04 +02:00
John Biundo
bed7ef1593 feat(core): Add documentation for public API 2019-08-26 22:18:04 +02:00
John Biundo
10c9d66cc4 feat(common): Add documentation for public API 2019-08-26 22:18:04 +02:00
Livio
6c035060a1 feat(): Add package description files 2019-08-26 22:18:00 +02:00
Kamil Myśliwiec
5ab5ed8736 tests() update middleware execution order e2e test 2019-08-26 22:09:46 +02:00
Livio
1682181b78 feat(): Add ScopeOptions to public API 2019-08-26 22:02:58 +02:00
Kamil Mysliwiec
16fdcd3a4f Update Readme.md 2019-08-26 21:37:10 +02:00
Kamil Myśliwiec
47ee1d68d5 ci() remove travis.yml file 2019-08-26 21:33:16 +02:00
Kamil Myśliwiec
acff437542 ci() prepare nvm task (integration) 2019-08-26 21:23:46 +02:00
Kamil Myśliwiec
48fc6473bd ci() add npm install before integration tests and samples
ci() add npm install before integration tests and sampels

ci() add machine option to integraiton tests

ci() setup remote docker for integration tests

ci() add unit tests mixin function

ci() add unit tests mixin function

ci() fix working directory for integration tests

ci() rename unit tests function

ci() use reusable run-unit-tests config

ci() update naming, add coveralls

ci() add alias for unit tests

ci() add aliases (circleci)

ci() remove run command from aliases

ci() fix aliases

ci(): fix restore cache alias

ci() add list containers step to integration tests

integration() bind urls and hosts to 0.0.0.0

ci() add waiting for mysql task

ci() hotfix, move tasks order (integration)

ci() wait for mysql - change hostname, increase sleep time

ci() add sleep after docker-compose up (integration)

ci() add sleep after docker-compose up fix (seconds)

ci() switch to machine mode (integration tests)

ci() use nvm to switch default node version

ci() hotfix, wrong indentation (integration tests)

ci() add ls-remove (nvm) and node version check

ci() fix install npm task

ci() wip use nvm to run integration tests

ci() remove NPM upgrade task
2019-08-26 21:23:53 +02:00
Kamil Myśliwiec
09c84e2086 ci() fix typo in samples job 2019-08-26 21:23:46 +02:00
Kamil Myśliwiec
0a7f37d90b feat(): add incoming request & response serializers 2019-08-26 21:23:46 +02:00
Kamil Myśliwiec
7f8aa92c0a feat(): add rpc serializer and deserializer, improve performance 2019-08-26 21:23:46 +02:00
Michael Kaufman
6ec98b8411 Fixes corrupt package-lock. 2019-08-26 11:10:19 -04:00
Michael Kaufman
418d4e3a79 Updates to dependencies after merge down from master. 2019-08-26 09:27:00 -04:00
Michael Kaufman
a9caead0bc Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice
# Conflicts:
#	package-lock.json
2019-08-26 09:22:50 -04:00
Michael Kaufman
0bd9a8c3d4 Remove erroneous code/config. 2019-08-26 09:21:31 -04:00
Kamil Myśliwiec
9885309cd5 ci() add samples and integration tests 2019-08-26 14:53:11 +02:00
Michael Kaufman
bba86dcac2 Removes @MessageRequest decorator in favor of subscribeToResponseOf() method. 2019-08-26 08:52:50 -04:00
Kamil Myśliwiec
51bde528c0 resolve conflicts 2019-08-26 14:32:21 +02:00
Kamil Myśliwiec
3c340b8a41 refactor() adjust coding style 2019-08-26 14:30:48 +02:00
Kamil Myśliwiec
64bc85ac28 Merge branch 'middleware-order' of https://github.com/underfin/nest into underfin-middleware-order 2019-08-26 14:23:40 +02:00
Michael Kaufman
1ff60ee0b6 Adds logic to prevent deserializing coercion of strings into numbers. 2019-08-26 08:12:25 -04:00
Kamil Mysliwiec
e974283ec8 Merge pull request #2813 from nestjs/feat/log-levels
feat(common) add log levels (error, info, etc union)
2019-08-26 14:11:37 +02:00
Kamil Myśliwiec
84d7178a59 fix(websockets) fix broken unit tests 2019-08-26 14:09:19 +02:00
Kamil Myśliwiec
844a69ee6a fix(core) request scoped middleware fix #2748 2019-08-26 13:46:46 +02:00
Kamil Myśliwiec
b4c190b912 refactor() add missing whitespace to gulp config 2019-08-26 13:26:40 +02:00
Kamil Myśliwiec
13cdc6d23b refactor() improve naming, remove inconsistency 2019-08-26 13:25:32 +02:00
Kamil Myśliwiec
e0fd3b8f3a refactor() add extra whiteline to gulp config file 2019-08-26 12:38:59 +02:00
Kamil Mysliwiec
ef264f1496 Merge pull request #2682 from nestjs/feat/resolve-scoped-classes
feat(core) add resolve method to load scoped classes
2019-08-26 12:38:41 +02:00
Kamil Mysliwiec
9d4d2abf46 Merge branch '6.6.0' into feat/resolve-scoped-classes 2019-08-26 12:38:15 +02:00
Kamil Mysliwiec
036bc562ea Merge pull request #2814 from nestjs/feat/hot-emit-microservices
feat(microservices) emit() should use hot observables
2019-08-26 12:35:21 +02:00
Kamil Myśliwiec
43db50c500 feat(common) add log levels to context options 2019-08-26 12:33:11 +02:00
Kamil Myśliwiec
5445997734 feat(common) add log levels (error, info, etc) 2019-08-26 12:30:38 +02:00
Kamil Myśliwiec
8b89187515 feat(microservices) emit() should use hot observables #2651 2019-08-26 12:19:15 +02:00
Kamil Myśliwiec
7af66c56fb ci() update ci build scripts 2019-08-26 12:08:58 +02:00
Kamil Myśliwiec
8da95030fe scripts() clarify names of build tasks 2019-08-26 11:58:15 +02:00
Kamil Myśliwiec
63644df773 feat(core) add error message to improve DX (get vs resolve) 2019-08-26 11:29:16 +02:00
Kamil Myśliwiec
12753dafb4 Merge branch 'renovate/sequelize-typescript-1.x' 2019-08-26 10:51:45 +02:00
Kamil Myśliwiec
de26bd490b sample(sequelize) fix sequelize options 2019-08-26 10:51:32 +02:00
Kamil Myśliwiec
b84246c641 Merge branch 'johnbiundo-feature-add-redirect-decorator' into 6.6.0 2019-08-26 10:42:19 +02:00
Kamil Myśliwiec
458e2ccd04 refactor(core) improve performance by moving reflection part (redirect) 2019-08-26 10:41:59 +02:00
Kamil Myśliwiec
a814974d6d Merge branch 'feature-add-redirect-decorator' of https://github.com/johnbiundo/nest into johnbiundo-feature-add-redirect-decorator 2019-08-26 10:27:12 +02:00
Kamil Myśliwiec
e7a049823d Merge branch '6.6.0' of https://github.com/nestjs/nest into 6.6.0 2019-08-26 10:18:48 +02:00
Kamil Myśliwiec
a651429697 Merge branch 'zailic-IonutZailic-IssueNo1384' into 6.6.0 2019-08-26 10:18:37 +02:00
Kamil Myśliwiec
6b56bdf216 resolve conflicts 2019-08-26 10:17:40 +02:00
Kamil Mysliwiec
47a1434b8a Merge pull request #2807 from nestjs/renovate/lint-staged-9.x
chore(deps): update dependency lint-staged to v9.2.4
2019-08-26 10:14:28 +02:00
Kamil Mysliwiec
ab43b862cc Merge pull request #2808 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.6.11
2019-08-26 10:14:19 +02:00
Kamil Myśliwiec
4f16736351 ci() remove artifacts 2019-08-26 09:15:17 +02:00
Kamil Myśliwiec
0ef817b9af ci() update scripts 2019-08-26 09:11:12 +02:00
Kamil Myśliwiec
b2135b43fb ci() add working directory 2019-08-26 08:59:13 +02:00
Kamil Myśliwiec
901191a9dd ci() use cached node_modules dir 2019-08-26 08:55:44 +02:00
Kamil Myśliwiec
781d43d8ec ci() hotfix build command 2019-08-26 08:50:28 +02:00
Kamil Myśliwiec
a6940be500 ci() add install deps script 2019-08-26 08:48:04 +02:00
Kamil Myśliwiec
44e62b3e7a ci() add missing require condition 2019-08-26 08:41:23 +02:00
Kamil Myśliwiec
8c9f6d75cf ci() fix scripts (wip) 2019-08-26 08:39:33 +02:00
Kamil Myśliwiec
8d58d70e1a ci() remove typos hotfix (wip) 2019-08-26 08:37:23 +02:00
Kamil Myśliwiec
6a8ffcabfa ci() add workflow (wip) 2019-08-26 08:36:56 +02:00
Kamil Myśliwiec
ce7eecb745 ci() set working directory (wip) 2019-08-26 08:35:58 +02:00
Kamil Myśliwiec
aebf29e657 ci() set working directory (wip) 2019-08-26 08:34:30 +02:00
Kamil Myśliwiec
69e689ac7a ci() moving to circleci (wip) 2019-08-26 08:34:01 +02:00
Kamil Myśliwiec
6652b55b20 ci() moving to circleci (wip) 2019-08-26 08:30:07 +02:00
Renovate Bot
5ed092a526 fix(deps): update dependency mongoose to v5.6.11 2019-08-25 20:35:30 +00:00
Renovate Bot
945a3d7a8b chore(deps): update dependency lint-staged to v9.2.4 2019-08-25 20:35:03 +00:00
Michael Kaufman
1e3c007e44 Finishes Kafka client test. 2019-08-25 16:10:14 -04:00
Kamil Mysliwiec
34f4a84534 Merge pull request #2805 from Reasno/proxy-fix
bugfix(microservices) pass all arguments to request-scoped proxies
2019-08-24 19:40:59 +02:00
Kamil Mysliwiec
311265fe81 Merge pull request #2770 from l2ubin/master
feat(common) added seconds to logger timestamp
2019-08-24 19:37:12 +02:00
vivi
3f496afc6a Merge branch 'IonutZailic-IssueNo1384' of https://github.com/zailic/nest into IonutZailic-IssueNo1384 2019-08-24 19:19:48 +03:00
vivi
e913ccf6de [#1384] Allow async NestModule.configure method 2019-08-24 19:06:30 +03:00
vivi
7d34529ece work in progress 2019-08-24 18:50:42 +03:00
Renovate Bot
e38999e6a9 fix(deps): update dependency sequelize-typescript to v1 2019-08-24 15:40:43 +00:00
Kamil Mysliwiec
a3c47d6280 Merge pull request #2567 from BrunnerLivio/feature/before-appplication-shutdown-hook
feat(core): Add beforeApplicationShutdown hook
2019-08-24 17:19:20 +02:00
Kamil Mysliwiec
6e686bc64b Merge pull request #2796 from iveselin/feature/createResponseBodyExport
feature(common) move createResponseBody to HttpException
2019-08-24 17:18:47 +02:00
vivi
1711527d4f forgotten semicolon 2019-08-24 18:16:44 +03:00
Kamil Mysliwiec
1b96a8de7f Merge pull request #2725 from andreimc/feature/better-error-message
refactor(core): more descriptive unknown element exception
2019-08-24 17:15:04 +02:00
Kamil Mysliwiec
648faecbcd Merge pull request #2778 from nestjs/renovate/apollo-graphql-packages
fix(deps): update dependency apollo-server-express to v2.9.0
2019-08-24 17:13:15 +02:00
vivi
86fd379ebb Kamil's CR recommendation 2019-08-24 17:50:10 +03:00
vivi
e23138a83e merging latest changes 2019-08-24 17:46:04 +03:00
Kamil Mysliwiec
9803e4e20e Merge pull request #2708 from bigzoo/fix-terminate-app-after-close
bugfix(microservices) update isTerminated during close
2019-08-24 11:16:14 +02:00
Kamil Mysliwiec
36db11c989 Merge pull request #2790 from BrunnerLivio/fix/null-hooks-bug
fix(core) do not call onModuleInit if is null
2019-08-24 11:15:49 +02:00
Kamil Mysliwiec
8bccfcab4e Merge pull request #2800 from Leth01/multer-interface-fix
bugfix(platform) updated the location of the PreservePath boolean
2019-08-24 11:12:40 +02:00
Kamil Mysliwiec
d521792c34 Merge pull request #2775 from nestjs/renovate/jest-24.x
chore(deps): update dependency @types/jest to v24.0.18
2019-08-24 11:10:40 +02:00
Renovate Bot
98a3630819 fix(deps): update dependency apollo-server-express to v2.9.0 2019-08-24 08:45:01 +00:00
Renovate Bot
e9d293f43d chore(deps): update dependency @types/jest to v24.0.18 2019-08-24 08:42:26 +00:00
Kamil Mysliwiec
e25d97412f Merge pull request #2804 from nestjs/renovate/graphql-14.x
fix(deps): update dependency graphql to v14.5.3
2019-08-24 10:41:07 +02:00
Reasno
67a9b2830f bugfix(microservices): pass all arguments to request-scoped proxies
Some microservices, such as gRPC, have more than one arguments in their
handler. Previously only the first argument, namely data itself, was passed
to the request-scoped proxies, stopping other arguments from propagating.

Related to #2802
2019-08-24 12:32:31 +08:00
Renovate Bot
5fdfd79eb3 fix(deps): update dependency graphql to v14.5.3 2019-08-24 00:53:18 +00:00
Michael Kaufman
362359f188 Changes method to setConsumerAssignment 2019-08-23 18:21:16 -04:00
Michael Kaufman
965521c0c0 Fixes undefined context within updating of consumer assignments. 2019-08-23 18:19:26 -04:00
Michael Kaufman
b8eb8f6f62 Started on the client kafka tests. 2019-08-23 17:22:30 -04:00
Kamil Mysliwiec
4a73b92bec Merge pull request #2801 from nestjs/renovate/graphql-14.x
fix(deps): update dependency graphql to v14.5.1
2019-08-23 23:00:29 +02:00
Kamil Mysliwiec
6c8a034784 Merge pull request #2741 from nestjs/renovate/mongodb-3.x
fix(deps): update dependency mongodb to v3.3.1
2019-08-23 23:00:18 +02:00
Renovate Bot
58f93edcb4 fix(deps): update dependency mongodb to v3.3.1 2019-08-23 19:36:50 +00:00
Renovate Bot
cffe8f919f fix(deps): update dependency graphql to v14.5.1 2019-08-23 19:31:16 +00:00
Michael Kaufman
be593afdb7 Finishes server unit tests. 2019-08-23 12:59:19 -04:00
Jonathan Letham
6b683eefbb bugfix: Updated the location of the 'PreservePath' boolean within the MulterOptions interface 2019-08-23 16:02:33 +01:00
Michael Kaufman
d96b8ebbc9 Moves kafka logger into its own helper. 2019-08-23 10:37:27 -04:00
Michael Kaufman
be239b598b Adds shared util for isPlainObject and tests for kafka serializer. 2019-08-22 20:28:08 -04:00
Michael Kaufman
dcbeb59596 Implements @Hexenon server tests after botched merge. 2019-08-22 17:01:46 -04:00
Michael Kaufman
e2ac748458 Revert "Merge pull request #2 from Hexenon/2361-kafka-microservice"
This reverts commit ebefabdbda, reversing
changes made to 836698317c.
2019-08-22 16:55:28 -04:00
Michael Kaufman
ebefabdbda Merge pull request #2 from Hexenon/2361-kafka-microservice
2361 kafka microservice
2019-08-22 16:50:47 -04:00
Michael Kaufman
836698317c Adds test for round robin by time. 2019-08-22 16:46:48 -04:00
Michael Kaufman
32f04ec382 Adds tests for the client proxy request map. 2019-08-22 15:06:32 -04:00
Michael Kaufman
4fc64486c6 Fixes options for Kafka server and client. 2019-08-22 14:00:23 -04:00
Hexenon
f25eadf86d refactor from async.parallel to Promise.all for concurrent tests. 2019-08-22 11:57:21 -06:00
Hexenon
710d00e369 Merge branch '2361-kafka-microservice' of https://github.com/mkaufmaner/nest into 2361-kafka-microservice
# Conflicts:
#	integration/microservices/e2e/sum-kafka.spec.ts
#	packages/microservices/test/server/server-kafka.spec.ts
2019-08-22 11:56:27 -06:00
Hexenon
3ed6d3bffa refactor from async.parallel to Promise.all for concurrent tests. 2019-08-22 11:53:31 -06:00
Michael Kaufman
e50203277b Adds Kafka to the client and server factory unit tests. 2019-08-22 13:13:36 -04:00
Michael Kaufman
d3ed627199 Adds integration tests for messaging pattern. 2019-08-22 12:33:16 -04:00
Michael Kaufman
00b1122591 Adds remote error and isDisposed message handling through kafka headers. 2019-08-22 11:32:51 -04:00
Ivan Veselin
e91b711456 feature(common) move createResponseBody to HttpException
renamed and moved createResponseBody function to be exported as a part
of HttpException

Closes #2727
2019-08-22 15:35:47 +02:00
Livio
106cdccefd test(core): Add e2e test for beforeAppShutdown hook 2019-08-22 08:55:30 +02:00
Livio
9c83b26486 feat(core): Add beforeApplicationShutdown hook 2019-08-22 08:53:59 +02:00
Livio Brunnner
a165ddbccf fix(core): Do not call onModuleInit if is null
Fixes #1252
2019-08-22 08:48:52 +02:00
Hexenon
dc020161b3 test for Messaging and Kafka Serializer 2019-08-21 19:31:00 -06:00
Hexenon
7cf4325472 Merge remote-tracking branch 'mkaufmaster/2361-kafka-microservice' into 2361-kafka-microservice 2019-08-21 13:24:35 -06:00
Hexenon
aa2e8f9ae9 add tests for bindEvent empty messageHandlers. 2019-08-21 13:22:40 -06:00
Michael Kaufman
f8a33ea09c Prevent sending error or isDisposed messages over the reply topic. 2019-08-21 14:33:32 -04:00
Michael Kaufman
8c6c707b2c Adds runtime exceptions for kafka client consumer topics. 2019-08-21 12:46:35 -04:00
Michael Kaufman
28ca9ba5d1 Adds the kafka round robin by time partition assigner. 2019-08-21 11:43:17 -04:00
Michael Kaufman
f9a574d2a4 Merge pull request #1 from Hexenon/2361-kafka-microservice
2361 kafka microservice
2019-08-21 09:51:27 -04:00
Hexenon
3273f9f784 add tests for close and listen for kafka server. 2019-08-20 19:22:50 -06:00
Hexenon
b5d8965c5e add tests for @MessageRequests for complex data types. 2019-08-20 18:22:22 -06:00
John Biundo
f4d3c03d6b feature(redirect decorator) add redirect decorator 2019-08-20 12:45:40 -07:00
Michael Kaufman
f906ec8625 Removes kafka serializer as the default export. 2019-08-20 12:00:27 -04:00
Michael Kaufman
9c711bf221 Adds test for explicit @MessageRequest listeners. 2019-08-20 11:50:18 -04:00
Michael Kaufman
ad44931eb3 Removes unused key in integration test for Kafka. 2019-08-19 22:01:34 -04:00
Michael Kaufman
84961d4079 Fixes unit test for mehod meta data where instance was removed because only the prototype was being used. 2019-08-19 21:03:09 -04:00
Michael Kaufman
cd9cb824a9 Adds kafkajs to package-lock after merge from master. 2019-08-19 19:23:02 -04:00
Michael Kaufman
f2d3420ba8 Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice
# Conflicts:
#	package-lock.json
2019-08-19 19:16:54 -04:00
Michael Kaufman
581a1dff17 Cleaned up unused code. 2019-08-19 19:15:55 -04:00
Michael Kaufman
4bba628ae9 Adds generic serialization which won't require users to implement custom serializations between microservices. 2019-08-19 19:13:19 -04:00
Michael Kaufman
4480a7c3a1 Formatting and general fixes for tests. 2019-08-19 15:48:16 -04:00
Michael Kaufman
c376018dc9 Adds MessageRequest decorator to define topic for client consumer subscriptions. 2019-08-19 13:56:39 -04:00
Rubin Bhandari
9d394f5668 Added seconds to logger timestamp
At the moment only hours and minutes are logged in the default Logger implementation.

This pull request add seconds to default logger format.

Note that I don't want to override the whole logger service. It's pretty nice, I just want another timestamp format
2019-08-19 12:52:14 +05:45
vivi
63e5d6b806 [#1384] Allow async NestModule.configure method 2019-08-18 20:54:03 +03:00
vivi
59bdc2e4d8 Merge branch 'master' into IonutZailic-IssueNo1384 2019-08-17 15:49:02 +03:00
Michael Kaufman
05fc85dae5 Needs work for but messaging pattern is sorta there. 2019-08-15 19:55:43 -04:00
Andrei Miulescu
1493c011ae Update packages/core/injector/container-scanner.ts
Co-Authored-By: Livio Brunner <livio.brunner.lb1@gmail.com>
2019-08-16 07:44:51 +10:00
Michael Kaufman
3e5a30d116 Started work on the implementation on the kafka message pattern. 2019-08-15 13:39:03 -04:00
Michael Kaufman
32e07c3ede Tracks package-lock again. 2019-08-13 14:36:19 -04:00
Michael Kaufman
52a736d95d Removes cached files. 2019-08-13 14:22:42 -04:00
Michael Kaufman
c70f3fe7f0 Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice
# Conflicts:
#	package-lock.json
#	package.json
2019-08-13 13:45:48 -04:00
Michael Kaufman
9dd8e46f10 Removes .npmrc which explicitly setts the registry to npmjs.org 2019-08-13 09:25:00 -04:00
Michael Kaufman
08e583d029 Adds sending options. 2019-08-12 20:14:44 -04:00
Michael Kaufman
cc5ea08c47 Update the timeout on the async messages. 2019-08-12 19:45:27 -04:00
Michael Kaufman
2c582c88d1 Puts kafka application start into it block to wait for leader election on the topics. 2019-08-12 19:34:50 -04:00
Michael Kaufman
4cc0b83cb6 Avoids passing the consumer where not referenced. 2019-08-12 19:19:15 -04:00
Michael Kaufman
41c8b39ca5 Properly dereferences the kafka server client and consumer upon close and fixes the test for kafka. 2019-08-12 19:17:54 -04:00
Michael Kaufman
c5f3dbf8b2 Fixes dependency mismatch. 2019-08-12 18:45:09 -04:00
Michael Kaufman
20636aa43f Cleanups unused code and documentation. 2019-08-12 18:40:13 -04:00
Michael Kaufman
c6123e790f Cleans up extraneous code and cleans up the tests. 2019-08-12 18:30:24 -04:00
Michael Kaufman
151e2025bb Event pattern producer and consumer initially working. Serialization still needs design. 2019-08-12 13:32:51 -04:00
Andrei Miulescu
f1271b6f1e Update packages/core/errors/exceptions/unknown-element.exception.ts
Co-Authored-By: Livio Brunner <livio.brunner.lb1@gmail.com>
2019-08-12 12:29:53 +10:00
Andrei Miulescu
7d9c0a1c0d Update packages/core/injector/container-scanner.ts
Co-Authored-By: Livio Brunner <livio.brunner.lb1@gmail.com>
2019-08-12 12:29:45 +10:00
Michael Kaufman
b295ea1850 Removes caret. 2019-08-09 13:20:49 -04:00
Michael Kaufman
27a26420ac Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice 2019-08-09 13:20:10 -04:00
Andrei Miulescu
abb3549f28 refactor(core): more descriptive unknown element exception
providing the element name would help you pin-point your missing provider quicker
2019-08-09 08:37:36 +10:00
Chris Nyaga
b9ce9b8d5f bugfix(microservices): update isTerminated during close
update isTerminated during close

Fixes #1364
2019-08-06 12:37:21 +03:00
Michael Kaufman
4fc5c893b8 Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice
# Conflicts:
#	integration/docker-compose.yml
#	package-lock.json
#	package.json
2019-07-31 10:09:52 -04:00
Kamil Myśliwiec
bdb0ede50d feat(core): add resolve method to load scoped classes 2019-07-31 11:37:22 +02:00
Michael Kaufman
547f6e9079 Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice
# Conflicts:
#	package-lock.json
#	package.json
2019-07-23 15:14:58 -04:00
Michael Kaufman
16dbe21d40 Initial work on the design and implementation. 2019-07-23 15:13:40 -04:00
vivi
2b5f0e2ba2 work in progress 2019-07-21 11:20:23 +03:00
likui
fcf5042d32 feat(@nestjs/core): execute middleware of dependent modules first. #1451 2019-07-05 19:14:56 +08:00
Kamil Myśliwiec
13ac2a95f1 feature(core): add ExecutionContext, ArgumentsHost type check #1581 2019-07-02 14:58:31 +02:00
Michael Kaufman
6aa4bfd873 Aligns transports in the interfaces between microservices and common. 2019-06-26 11:26:02 -04:00
Michael Kaufman
2c032adf91 Fixes dependency issues. 2019-06-26 10:31:43 -04:00
Michael Kaufman
4b034af203 Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice
# Conflicts:
#	integration/microservices/package-lock.json
#	package.json
2019-06-26 10:02:36 -04:00
Michael Kaufman
110a34b79f Working on Kafka Events. 2019-06-26 09:59:58 -04:00
mkaufmaner
1ee760d18b Merge remote-tracking branch 'Nest/master' into 2361-kafka-microservice 2019-06-20 14:02:33 -04:00
mkaufmaner
b5ed5dd166 feat(kafka): Starts work on implementing client/server 2019-06-20 14:02:10 -04:00
383 changed files with 20185 additions and 4717 deletions

178
.circleci/config.yml Normal file
View 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
View 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
View File

@@ -5,6 +5,7 @@ node_modules/
/.idea
/.awcache
/.vscode
*.code-workspace
# bundle
packages/**/*.d.ts

View File

@@ -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

View File

@@ -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

View File

@@ -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> &nbsp;
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="120" valign="middle" /></a> &nbsp;
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> &nbsp;
<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> &nbsp;
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a>
## Backers

View File

@@ -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

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View 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();
});
});

View File

@@ -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
}
}

View File

@@ -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"
}
}

View 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,
);
});
});

View 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);
});

View File

@@ -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,
);
});

View File

@@ -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);
});
});

View File

@@ -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);
});

View File

@@ -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);
});
});

View File

@@ -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);
});
});

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -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);
}
}

View 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);
}
});
});

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -0,0 +1,7 @@
import { Controller, Scope } from '@nestjs/common';
@Controller({
path: 'test',
scope: Scope.REQUEST,
})
export class ScopedController {}

View 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 {}

View File

@@ -0,0 +1,4 @@
import { Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.REQUEST })
export class ScopedService {}

View File

@@ -0,0 +1,4 @@
import { Injectable, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.TRANSIENT })
export class TransientService {}

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View 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);

View File

@@ -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)

View File

@@ -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();

View File

@@ -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();

View File

@@ -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 },

View File

@@ -20,6 +20,9 @@ describe('RPC transport', () => {
app.connectMicroservice({
transport: Transport.TCP,
options: {
host: '0.0.0.0',
},
});
await app.startAllMicroservicesAsync();
await app.init();

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -0,0 +1,7 @@
import { UserEntity } from '../entities/user.entity';
export class BusinessDto {
name: string;
phone: string;
user: UserEntity;
}

View File

@@ -0,0 +1,6 @@
export class UserDto {
name: string;
email: string;
phone: string;
years: number;
}

View File

@@ -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;
}

View 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;
}

View 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;
}
}

View File

@@ -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);
}
}

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -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
}
}

View File

@@ -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"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -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
}
}

View File

@@ -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"
}
}

View File

@@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "6.5.3"
"version": "6.7.1"
}

1043
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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",

View File

@@ -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.

View File

@@ -0,0 +1 @@
The common package comes with decorators such as `@Controller()`, `@Injectable()` and so on.

View File

@@ -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> &nbsp; <a href="https://blueanchor.io/" target="_blank"><img src="https://nestjs.com/img/blueanchor.png" width="180" valign="middle" /></a> &nbsp;
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="130" valign="middle" /></a> &nbsp;
<a href="https://scal.io" target="_blank"><img src="https://nestjs.com/img/scalio-logo.svg" width="100" valign="middle" /></a> &nbsp; <a href="http://angularity.io" target="_blank"><img src="http://angularity.io/media/logo.svg" height="26" valign="middle" /></a> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com" target="_blank"><img src="https://nestjs.com/img/hostpresto.png" height="30" valign="middle" /></a>
&nbsp; <a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" height="36" valign="middle" /></a> &nbsp; <a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" height="24" valign="middle" /></a> &nbsp; <a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" height="28" valign="middle" /></a> &nbsp; <a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" height="20" valign="middle" /></a> &nbsp; <a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" height="30" valign="middle" /></a> &nbsp;
<a href="https://ever.co/" target="_blank"><img src="https://nestjs.com/img/ever-logo.png" height="20" valign="middle" /></a> &nbsp;
<a href="https://buddy.works/" target="_blank"><img src="https://nestjs.com/img/buddy-logo.svg" height="35" valign="middle" /></a> &nbsp;
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" height="31" valign="middle" /></a> &nbsp;
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" height="28" valign="middle" /></a> &nbsp; &nbsp; <a href="https://yakaz.com/" target="_blank"><img src="https://nestjs.com/img/yakaz.png" width="80" valign="middle" /></a> &nbsp;
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="120" valign="middle" /></a> &nbsp;
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="90" valign="middle" /></a> &nbsp;
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="145" valign="middle" /></a> &nbsp;
<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> &nbsp; <a href="https://blueanchor.io/" target="_blank"><img src="https://nestjs.com/img/blueanchor.png" width="150" valign="middle" /></a> &nbsp;
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="110" valign="middle" /></a> &nbsp;
<a href="https://scal.io" target="_blank"><img src="https://nestjs.com/img/scalio-logo.svg" width="80" valign="middle" /></a> &nbsp; <a href="http://angularity.io" target="_blank"><img src="http://angularity.io/media/logo.svg" height="22" valign="middle" /></a> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com" 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> &nbsp;
<a href="https://buddy.works/" target="_blank"><img src="https://nestjs.com/img/buddy-logo.svg" height="25" valign="middle" /></a> &nbsp;
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" height="25" valign="middle" /></a> &nbsp; <a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" height="24" valign="middle" /></a> &nbsp; <a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" height="20" valign="middle" /></a> &nbsp; <a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" height="22" valign="middle" /></a> &nbsp; <a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" height="19" valign="middle" /></a> &nbsp; <a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" height="20" valign="middle" /></a> &nbsp;
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" height="18" valign="middle" /></a> &nbsp; &nbsp; <a href="https://yakaz.com/" target="_blank"><img src="https://nestjs.com/img/yakaz.png" width="70" valign="middle" /></a> &nbsp;
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="100" valign="middle" /></a> &nbsp;
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="75" valign="middle" /></a> &nbsp;
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="120" valign="middle" /></a> &nbsp;
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> &nbsp;
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> &nbsp;
<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

View File

@@ -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,

View File

@@ -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,

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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[];
}

View File

@@ -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>(

View File

@@ -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) => {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) => {

View File

@@ -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) => {

View File

@@ -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) => {

View File

@@ -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,

View File

@@ -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) => {

View File

@@ -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)[]

View File

@@ -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) =>

View File

@@ -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);

View File

@@ -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) => {

View File

@@ -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) => {

View File

@@ -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';

View File

@@ -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;
};
}

View File

@@ -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) => {

View File

@@ -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);

View File

@@ -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)[]

View File

@@ -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) => {

View File

@@ -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);

View File

@@ -5,4 +5,5 @@ export enum Transport {
MQTT,
GRPC,
RMQ,
KAFKA
}

View File

@@ -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,
);
}

View File

@@ -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,
);
}

View File

@@ -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,
);
}

View File

@@ -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,
);
}

View File

@@ -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,
);
}

View File

@@ -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,
);
}

View File

@@ -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 };
}
}

View File

@@ -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,
);
}

View File

@@ -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