Compare commits

...

811 Commits

Author SHA1 Message Date
Kamil Myśliwiec
087e2cbfa5 chore(@nestjs) publish v7.4.2 release 2020-07-30 16:34:39 +02:00
Kamil Myśliwiec
eea77b720a Merge branch 'master' of https://github.com/nestjs/nest 2020-07-30 16:31:53 +02:00
Kamil Mysliwiec
1ade11ede4 Merge pull request #5161 from mkaufmaner/5126-change-kafka-visibility
fix(microservices): Changed visibility of Kafka variables for extension
2020-07-30 16:31:09 +02:00
Kamil Mysliwiec
b93812978c Merge pull request #5169 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v26.2.1
2020-07-30 16:30:44 +02:00
Kamil Mysliwiec
306adfb751 Merge pull request #5166 from nestjs/renovate/webpack-4.x
chore(deps): update dependency webpack to v4.44.1
2020-07-30 16:30:34 +02:00
Kamil Mysliwiec
0241aa0a68 Merge pull request #5163 from dkantereivin/feat/case-insensitive-headers
feat(core): case insensitive headers
2020-07-30 16:30:07 +02:00
Kamil Myśliwiec
9bbe4f11a1 Merge branch 'master' of https://github.com/nestjs/nest 2020-07-30 16:29:12 +02:00
Kamil Myśliwiec
7ecc6c7807 fix(platform-fastify): fix constructor signature, fallback to any 2020-07-30 16:29:01 +02:00
Kamil Mysliwiec
5dd7abb9fc Merge pull request #5168 from KASOGIT/17-mvc-fastify-add-missing-package-fastify-static
fix(sample): Add missing package fastify-static
2020-07-30 15:35:42 +02:00
Renovate Bot
ffb36a9309 chore(deps): update dependency jest to v26.2.1 2020-07-30 12:13:59 +00:00
Adam
44bbff494c fix(sample): Add missing package fastify-static 2020-07-30 12:06:16 +02:00
Renovate Bot
04d76ff4b2 chore(deps): update dependency webpack to v4.44.1 2020-07-30 08:24:10 +00:00
Kamil Mysliwiec
ea70f0348c Merge pull request #5159 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.4.1
2020-07-30 09:55:17 +02:00
Renovate Bot
3f52b32a75 fix(deps): update nest monorepo to v7.4.1 2020-07-30 07:21:42 +00:00
Kamil Mysliwiec
54434e75c5 Merge pull request #5164 from nestjs/renovate/class-transformer-0.x
fix(deps): update dependency class-transformer to v0.3.1
2020-07-30 08:56:06 +02:00
Renovate Bot
26f1ffa265 fix(deps): update dependency class-transformer to v0.3.1 2020-07-29 22:26:02 +00:00
D. Kanter
08d29be41d feat(core): case insensitive headers
@Headers(param) is now lowercased in order to match raw headers that are lower-cased by node https://nodejs.org/api/http.html#http_http
2020-07-29 14:25:55 -04:00
Kamil Mysliwiec
5cbe2404dc Merge pull request #5160 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.6.0
2020-07-29 18:15:29 +02:00
Kamil Myśliwiec
c4f94df2e7 chore(@nestjs) publish v7.4.1 release 2020-07-29 18:13:57 +02:00
Kamil Myśliwiec
b10b60a9b3 fix(platform-fastify): use external interfaces 2020-07-29 18:11:29 +02:00
Michael Kaufman
b9007dd93f fix(microservices): Changed visibility of Kafka variables for extension 2020-07-29 11:51:29 -04:00
Renovate Bot
9d5bc076ff fix(deps): update dependency @nestjs/graphql to v7.6.0 2020-07-29 13:04:40 +00:00
Kamil Myśliwiec
50c709c4d5 chore(): update package.json 2020-07-29 14:29:01 +02:00
Kamil Myśliwiec
2166af0eeb chore(@nestjs) publish v7.4.0 release 2020-07-29 14:27:43 +02:00
Kamil Mysliwiec
c91317e91c Merge pull request #5088 from nestjs/renovate/fastify-3.x
fix(deps): update dependency fastify to v3.1.1
2020-07-29 13:57:26 +02:00
Kamil Mysliwiec
5ec7246c18 Merge pull request #5112 from nestjs/renovate/fast-json-stringify-2.x
fix(deps): update dependency fast-json-stringify to v2.2.3
2020-07-29 13:30:45 +02:00
Renovate Bot
6df9595b35 fix(deps): update dependency fastify to v3.1.1 2020-07-29 11:09:24 +00:00
Kamil Mysliwiec
7b5e05e082 Merge pull request #5049 from nestjs/renovate/point-of-view-4.x
fix(deps): update dependency point-of-view to v4
2020-07-29 13:06:28 +02:00
Kamil Mysliwiec
c09028c60d Merge pull request #5047 from nestjs/renovate/fastify-cors-4.x
fix(deps): update dependency fastify-cors to v4.1.0
2020-07-29 13:06:14 +02:00
Kamil Mysliwiec
b013847b42 Merge pull request #5050 from nestjs/renovate/fastify-static-3.x
chore(deps): update dependency fastify-static to v3.2.0
2020-07-29 12:50:35 +02:00
Renovate Bot
fc37771375 fix(deps): update dependency point-of-view to v4 2020-07-29 10:09:42 +00:00
Renovate Bot
a749e0c53e fix(deps): update dependency fastify-cors to v4.1.0 2020-07-29 10:08:44 +00:00
Renovate Bot
2625b8829d fix(deps): update dependency fast-json-stringify to v2.2.3 2020-07-29 10:06:59 +00:00
Renovate Bot
6eda39b8f4 chore(deps): update dependency fastify-static to v3.2.0 2020-07-29 10:05:19 +00:00
Kamil Myśliwiec
4c816a7efd Merge branch 'master' of https://github.com/nestjs/nest 2020-07-29 11:53:40 +02:00
Kamil Myśliwiec
9ac0cf1457 style(): fix linter issues 2020-07-29 11:53:31 +02:00
Kamil Mysliwiec
645075750e Merge pull request #5097 from mikicho/explicit-validation-type
feat(common) add expected type option to validation pipe
2020-07-29 11:42:48 +02:00
Kamil Myśliwiec
f0e7597635 Merge branch 'master' of https://github.com/nestjs/nest 2020-07-29 11:34:25 +02:00
Kamil Myśliwiec
77e2f395e7 Merge branch 'hongyiweiwu-fastify3.0' 2020-07-29 11:34:17 +02:00
Kamil Myśliwiec
7a749add7c feat(platform-fastify): support middleware with fastify adapter 2020-07-29 11:33:46 +02:00
Kamil Mysliwiec
c420898cfa Merge pull request #5136 from danielscw/fix/microservice-on-module-init-error-handling
fix(microservice): handle promise return by 'registerModules' properly
2020-07-29 11:01:11 +02:00
Kamil Myśliwiec
0006d31ffe fix(): resolve merge conflicts 2020-07-29 10:19:51 +02:00
Kamil Mysliwiec
752033edac Merge pull request #5116 from dsebastien/feature/preconditionfailed
feat(common): add precondition failed exception
2020-07-29 10:16:50 +02:00
Kamil Mysliwiec
63d0693360 Update packages/microservices/nest-microservice.ts 2020-07-29 10:15:55 +02:00
Kamil Myśliwiec
443da3993b Merge branch 'master' of https://github.com/nestjs/nest 2020-07-29 10:11:31 +02:00
Kamil Myśliwiec
1e3b5f5f51 Merge branch 'Zorato-microservice-dispose-fix' 2020-07-29 10:11:16 +02:00
Kamil Myśliwiec
74f89a737f fix(microservices): close socket module on dispose 2020-07-29 10:01:09 +02:00
Kamil Mysliwiec
33912c8613 Merge pull request #5138 from nestjs/renovate/chai-4.x
chore(deps): update dependency @types/chai to v4.2.12
2020-07-29 09:24:09 +02:00
Kamil Mysliwiec
f6982aa2a3 Create codeql-analysis.yml 2020-07-29 09:07:14 +02:00
Kamil Mysliwiec
c56b1ae778 Merge pull request #5153 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.26
2020-07-29 08:54:12 +02:00
Kamil Mysliwiec
c516135c9a Merge pull request #5151 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3.7.1
2020-07-28 21:17:52 +02:00
Kamil Mysliwiec
aa93a69158 Merge pull request #5152 from nestjs/renovate/uuid-8.x
fix(deps): update dependency uuid to v8.3.0
2020-07-28 21:17:33 +02:00
Kamil Mysliwiec
0a3a36377b Merge pull request #5111 from nestjs/renovate/apollo-graphql-packages
fix(deps): update apollo graphql packages to v2.16.1
2020-07-28 21:17:10 +02:00
Kamil Mysliwiec
1901a623ac Merge pull request #5157 from nestjs/renovate/ts-jest-26.x
chore(deps): update dependency ts-jest to v26.1.4
2020-07-28 21:17:00 +02:00
Renovate Bot
046ff4ccb4 fix(deps): update dependency mongoose to v5.9.26 2020-07-28 19:10:21 +00:00
Renovate Bot
a794f27dd1 chore(deps): update dependency ts-jest to v26.1.4 2020-07-28 09:20:19 +00:00
Alexey Rehov
1796109481 fix(microservices): add microservice dispose to close server on shutdown 2020-07-28 11:48:33 +03:00
Renovate Bot
936aae57e0 fix(deps): update apollo graphql packages to v2.16.1 2020-07-27 20:57:25 +00:00
Renovate Bot
e4c7628e6b fix(deps): update dependency uuid to v8.3.0 2020-07-27 19:08:51 +00:00
Renovate Bot
3c235176ed chore(deps): update typescript-eslint monorepo to v3.7.1 2020-07-27 17:55:41 +00:00
Kamil Mysliwiec
288b01a774 Merge pull request #5146 from nestjs/renovate/webpack-4.x
chore(deps): update dependency webpack to v4.44.0
2020-07-27 08:57:05 +02:00
Renovate Bot
0fc2270092 chore(deps): update dependency webpack to v4.44.0 2020-07-24 17:36:58 +00:00
Kamil Mysliwiec
61ab2053de Merge pull request #5137 from nestjs/renovate/jest-26.x
chore(deps): update dependency @types/jest to v26.0.7
2020-07-24 11:35:10 +02:00
Renovate Bot
9023429dce chore(deps): update dependency @types/jest to v26.0.7 2020-07-24 00:25:25 +00:00
Renovate Bot
402b916d84 chore(deps): update dependency @types/chai to v4.2.12 2020-07-23 18:29:57 +00:00
danielscw
cbd3971c7d fix(microservice): handle promise return by 'registerModules' properly 2020-07-23 22:11:00 +08:00
Kamil Mysliwiec
1b43bac548 Merge pull request #5120 from nestjs/renovate/socket.io-2.x
chore(deps): update dependency @types/socket.io to v2.1.10
2020-07-23 14:26:35 +02:00
Kamil Mysliwiec
5f2027dc1e Merge pull request #5122 from nestjs/renovate/ts-morph-7.x
chore(deps): update dependency ts-morph to v7.1.3
2020-07-23 14:26:26 +02:00
Kamil Mysliwiec
a93d7d5d18 Merge pull request #5123 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3.7.0
2020-07-23 14:26:19 +02:00
Kamil Mysliwiec
c23afcd643 Merge pull request #5132 from nestjs/renovate/graphql-tools-monorepo
fix(deps): update dependency graphql-tools to v6.0.15
2020-07-23 14:26:08 +02:00
Renovate Bot
91d5c6ec53 fix(deps): update dependency graphql-tools to v6.0.15 2020-07-22 20:15:16 +00:00
Renovate Bot
646fd79d67 chore(deps): update dependency @types/socket.io to v2.1.10 2020-07-21 19:02:15 +00:00
Renovate Bot
c120503e46 chore(deps): update typescript-eslint monorepo to v3.7.0 2020-07-20 20:51:00 +00:00
Renovate Bot
ff86d1bd22 chore(deps): update dependency ts-morph to v7.1.3 2020-07-20 19:33:40 +00:00
Kamil Mysliwiec
89d8592388 Merge pull request #5118 from nestjs/renovate/jest-26.x
chore(deps): update dependency @types/jest to v26.0.5
2020-07-20 08:59:35 +02:00
Kamil Mysliwiec
e277b3bc3a Merge pull request #5119 from nestjs/renovate/eslint-7.x
chore(deps): update dependency eslint to v7.5.0
2020-07-20 08:59:24 +02:00
Renovate Bot
535755c925 chore(deps): update dependency eslint to v7.5.0 2020-07-20 00:53:43 +00:00
Renovate Bot
fdd3da241a chore(deps): update dependency @types/jest to v26.0.5 2020-07-20 00:31:45 +00:00
Kamil Mysliwiec
c3d2add2de Merge pull request #5066 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.25
2020-07-19 21:13:27 +02:00
Seb
85b0dc8495 feat(common): add precondition failed exception
closes #5113
2020-07-18 07:32:46 +02:00
Renovate Bot
f21ebbc346 fix(deps): update dependency mongoose to v5.9.25 2020-07-17 18:57:21 +00:00
Kamil Mysliwiec
b39cf9f210 Merge pull request #5098 from wayou/master
fix #5093
2020-07-17 15:39:35 +02:00
Kamil Mysliwiec
be50e6d834 Merge pull request #5103 from nestjs/renovate/graphql-tools-monorepo
fix(deps): update dependency graphql-tools to v6.0.14
2020-07-17 12:46:24 +02:00
Renovate Bot
c2fec010dc fix(deps): update dependency graphql-tools to v6.0.14 2020-07-17 07:43:27 +00:00
Kamil Mysliwiec
a792e88989 Merge pull request #5067 from nestjs/renovate/grpc-proto-loader-0.x
fix(deps): update dependency @grpc/proto-loader to v0.5.5
2020-07-17 09:40:38 +02:00
Kamil Mysliwiec
9cc3b149f4 Merge pull request #5105 from nestjs/renovate/typescript-3.x
chore(deps): update dependency typescript to v3.9.7
2020-07-17 09:40:22 +02:00
Kamil Mysliwiec
6f49c76f04 Merge pull request #5106 from nestjs/renovate/bull-3.x
fix(deps): update dependency bull to v3.16.0
2020-07-17 09:39:22 +02:00
Kamil Mysliwiec
0f7f413931 Merge pull request #5109 from nestjs/renovate/ts-jest-26.x
chore(deps): update dependency ts-jest to v26.1.3
2020-07-17 09:39:11 +02:00
Renovate Bot
c5b4e78a34 chore(deps): update dependency ts-jest to v26.1.3 2020-07-17 05:46:05 +00:00
Renovate Bot
75545d132e fix(deps): update dependency bull to v3.16.0 2020-07-16 20:50:45 +00:00
Renovate Bot
e79941fae2 chore(deps): update dependency typescript to v3.9.7 2020-07-16 20:47:43 +00:00
Kamil Mysliwiec
50a7d35f4c Merge pull request #5101 from nestjs/renovate/amqplib-0.x
chore(deps): update dependency amqplib to v0.6.0
2020-07-16 12:26:17 +02:00
Kamil Mysliwiec
b9242f7283 Merge pull request #5077 from nestjs/renovate/ts-jest-26.x
chore(deps): update dependency ts-jest to v26.1.2
2020-07-16 11:47:39 +02:00
Renovate Bot
4307da2f92 fix(deps): update dependency @grpc/proto-loader to v0.5.5 2020-07-16 09:32:44 +00:00
Kamil Mysliwiec
833f0f5532 Merge pull request #5075 from nestjs/renovate/commitlint-monorepo
chore(deps): update commitlint monorepo to v9.1.1
2020-07-16 11:26:31 +02:00
Kamil Mysliwiec
c970b50291 Merge pull request #5073 from nestjs/renovate/subscriptions-transport-ws-0.x
chore(deps): update dependency subscriptions-transport-ws to v0.9.17
2020-07-16 11:26:06 +02:00
Wayou Liu
9f80222fdc correct the type for name in another location 2020-07-16 17:07:18 +08:00
Renovate Bot
cbf2c3cf42 chore(deps): update dependency amqplib to v0.6.0 2020-07-16 08:38:07 +00:00
Renovate Bot
6cf9db941b chore(deps): update dependency ts-jest to v26.1.2 2020-07-16 08:07:26 +00:00
Kamil Mysliwiec
5a8b7bc3a0 Merge pull request #5063 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.5.5
2020-07-16 09:42:39 +02:00
Renovate Bot
ee01e60a95 chore(deps): update dependency subscriptions-transport-ws to v0.9.17 2020-07-16 07:17:07 +00:00
Kamil Mysliwiec
79ea8d2a79 Merge pull request #5099 from nestjs/dependabot/npm_and_yarn/sample/13-mongo-typeorm/lodash-4.17.19
chore(deps): bump lodash from 4.17.15 to 4.17.19 in /sample/13-mongo-typeorm
2020-07-16 09:10:25 +02:00
Kamil Mysliwiec
9b54ccb229 Merge pull request #5100 from nestjs/dependabot/npm_and_yarn/sample/01-cats-app/lodash-4.17.19
chore(deps): bump lodash from 4.17.15 to 4.17.19 in /sample/01-cats-app
2020-07-16 09:10:19 +02:00
Kamil Mysliwiec
ebe8255379 Merge pull request #5064 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.25
2020-07-16 09:09:51 +02:00
Kamil Mysliwiec
46db75dd79 Merge pull request #5074 from nestjs/renovate/mocha-8.x
chore(deps): update dependency @types/mocha to v8
2020-07-16 09:09:40 +02:00
dependabot[bot]
070df5a52b chore(deps): bump lodash from 4.17.15 to 4.17.19 in /sample/01-cats-app
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-16 07:09:37 +00:00
dependabot[bot]
445b296b76 chore(deps): bump lodash in /sample/13-mongo-typeorm
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-16 07:09:32 +00:00
Kamil Mysliwiec
408aa39c2e Merge pull request #5078 from Hwan-seok/update-webpack-sample
sample(webpack): update webpack-node-externals option property name
2020-07-16 09:09:23 +02:00
Kamil Mysliwiec
3a2ee4296a Merge pull request #5080 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3.6.1
2020-07-16 09:09:10 +02:00
Kamil Mysliwiec
42a84cda48 Merge pull request #5081 from nestjs/renovate/docker-mysql-5.x
chore(deps): update mysql docker tag to v5.7.31
2020-07-16 09:09:01 +02:00
Kamil Mysliwiec
6e84e2f425 Merge pull request #5086 from nestjs/renovate/graphql-tools-monorepo
fix(deps): update dependency graphql-tools to v6.0.13
2020-07-16 09:08:54 +02:00
Kamil Mysliwiec
58ca5771a1 Merge pull request #5087 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.15.2
2020-07-16 09:08:46 +02:00
Kamil Mysliwiec
4da3b5812a Merge pull request #5089 from nestjs/renovate/babel-monorepo
chore(deps): update babel monorepo to v7.10.5
2020-07-16 09:08:38 +02:00
Kamil Mysliwiec
44c8555402 Merge pull request #5091 from nestjs/renovate/ts-loader-8.x
chore(deps): update dependency ts-loader to v8.0.1
2020-07-16 09:08:23 +02:00
Wayou Liu
7e9fcc231d correct the type 2020-07-16 10:18:47 +08:00
Wayou Liu
0fb9778dad fix #5093 2020-07-16 09:43:14 +08:00
Michael Solomon
c1467c5c16 feat(common) add expected type option to validation pipe
It's possible to have multiple pipes for a single parameter, so the argument type won't necessary will be same as the original type and we need to explicitly set the type for the validation pipe
see discussion:
https://discord.com/channels/520622812742811698/520649487924985885/732209853854122055
2020-07-15 22:40:25 +03:00
Renovate Bot
77d9a9b9c4 chore(deps): update dependency ts-loader to v8.0.1 2020-07-15 06:09:10 +00:00
Renovate Bot
0b91ce9da8 chore(deps): update babel monorepo to v7.10.5 2020-07-14 18:44:35 +00:00
Renovate Bot
2af96b578e fix(deps): update dependency fastify to v2.15.2 2020-07-14 13:02:01 +00:00
Renovate Bot
7fa5082fa6 fix(deps): update dependency graphql-tools to v6.0.13 2020-07-14 11:18:40 +00:00
Renovate Bot
75216f4794 chore(deps): update mysql docker tag to v5.7.31 2020-07-14 03:24:08 +00:00
Renovate Bot
614ed4ff2f chore(deps): update typescript-eslint monorepo to v3.6.1 2020-07-13 17:37:55 +00:00
hwanseok
71cc3c0f8f sample(webpack): update webpack-node-externals option property name 2020-07-14 00:03:50 +09:00
Renovate Bot
92eef778e6 chore(deps): update commitlint monorepo to v9.1.1 2020-07-13 03:27:11 +00:00
Renovate Bot
8c59111764 chore(deps): update dependency @types/mocha to v8 2020-07-13 00:42:56 +00:00
hongyiweiwu
668e7bc80f fix(platform-fastify): sync package-lock.json 2020-07-11 13:17:11 -04:00
hongyiweiwu
a839a07713 fix(platform-fastify): added fastify-express package 2020-07-11 13:09:50 -04:00
hongyiweiwu
82021d876b fix(platform-fastify): fixed import of fastify plugins 2020-07-11 12:56:14 -04:00
hongyiweiwu
02baf5eac9 fix(fastify-adapter): added default constructor to the adapter 2020-07-11 00:33:09 -04:00
hongyiweiwu
42683d5008 fix(platform-fastify): updated version of fastify-multipart 2020-07-11 00:14:23 -04:00
hongyiweiwu
7fbe1f2c3f fix(platform-fastify): cleaned up fastify-related dependencies in root 2020-07-11 00:09:51 -04:00
hongyiweiwu
d355bc8464 fix(platform-fastify): updated dependencies in root package.json 2020-07-11 00:04:28 -04:00
hongyiweiwu
f11455d9c9 refactor(platform-fastify): supports fastify 3.0 2020-07-10 22:41:46 -04:00
Renovate Bot
d233c2fb35 chore(deps): update dependency @types/redis to v2.8.25 2020-07-10 13:43:16 +00:00
Renovate Bot
ac2827b090 fix(deps): update dependency @nestjs/graphql to v7.5.5 2020-07-10 11:59:51 +00:00
Kamil Mysliwiec
f81d65af58 Merge pull request #5061 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.5.3
2020-07-09 22:10:10 +02:00
Renovate Bot
285b14e127 fix(deps): update dependency @nestjs/graphql to v7.5.3 2020-07-09 11:45:15 +00:00
Kamil Mysliwiec
cc85f59869 Merge pull request #5059 from nestjs/renovate/nestjs-bull-0.x
fix(deps): update dependency @nestjs/bull to v0.1.2
2020-07-09 11:29:51 +02:00
Kamil Mysliwiec
3bc77d2c50 Merge pull request #5060 from nestjs/renovate/nestjs-jwt-7.x
fix(deps): update dependency @nestjs/jwt to v7.1.0
2020-07-09 11:12:23 +02:00
Renovate Bot
e158fbed4b fix(deps): update dependency @nestjs/jwt to v7.1.0 2020-07-09 08:57:32 +00:00
Renovate Bot
0d2870aeb6 fix(deps): update dependency @nestjs/bull to v0.1.2 2020-07-09 08:54:03 +00:00
Kamil Mysliwiec
54863260c8 Merge pull request #5056 from nestjs/renovate/fast-json-stringify-2.x
fix(deps): update dependency fast-json-stringify to v2.2.2
2020-07-09 10:21:51 +02:00
Kamil Mysliwiec
80b11f1cd8 Merge pull request #5058 from nestjs/renovate/ts-loader-8.x
chore(deps): update dependency ts-loader to v8
2020-07-09 10:21:09 +02:00
Kamil Mysliwiec
e3adee8249 Merge pull request #5054 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.3.2
2020-07-09 10:18:38 +02:00
Kamil Mysliwiec
be20f8f1bc Merge pull request #5040 from nestjs/renovate/jest-26.x
chore(deps): update dependency @types/jest to v26.0.4
2020-07-09 10:17:27 +02:00
Renovate Bot
39e0024a96 chore(deps): update dependency ts-loader to v8 2020-07-08 21:12:40 +00:00
Renovate Bot
a3cdf2ad05 fix(deps): update dependency fast-json-stringify to v2.2.2 2020-07-08 14:42:47 +00:00
Renovate Bot
52acdc5ae3 fix(deps): update nest monorepo to v7.3.2 2020-07-08 13:35:39 +00:00
Kamil Myśliwiec
d071c99a9c chore(): update README files 2020-07-08 14:52:42 +02:00
Kamil Myśliwiec
b85844c316 chore(@nestjs) publish v7.3.2 release 2020-07-08 14:49:38 +02:00
Kamil Myśliwiec
daeb99f858 Merge branch 'master' of https://github.com/nestjs/nest 2020-07-08 14:48:35 +02:00
Kamil Myśliwiec
3dca681a08 fix(core): instance links host should return the last instance 2020-07-08 14:48:24 +02:00
Kamil Myśliwiec
442e2f66a1 fix(testing): allow passing abstract http server 2020-07-08 14:48:07 +02:00
Kamil Myśliwiec
659c52f8bc fix(common): fix nan values for default value pipe 2020-07-08 14:47:50 +02:00
Kamil Mysliwiec
835e4ed94d Merge pull request #5038 from fuergaosi233/enhanceRMQGenerality
feat(microservices): ServerRMQ
2020-07-08 14:47:09 +02:00
Renovate Bot
5642ca7f5f chore(deps): update dependency @types/jest to v26.0.4 2020-07-08 12:25:24 +00:00
Kamil Mysliwiec
d9cfdd0846 Merge pull request #5039 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3.6.0
2020-07-08 14:18:07 +02:00
Kamil Mysliwiec
83251e3a45 Merge pull request #5042 from nestjs/renovate/chai-as-promised-7.x
chore(deps): update dependency @types/chai-as-promised to v7.1.3
2020-07-08 14:17:39 +02:00
Kamil Mysliwiec
eef373c93f Merge pull request #5041 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.22
2020-07-08 14:16:50 +02:00
Kamil Mysliwiec
83b3b6d9d5 Merge pull request #5043 from nestjs/renovate/express-4.x
chore(deps): update dependency @types/express to v4.17.7
2020-07-08 14:12:09 +02:00
Kamil Mysliwiec
0ac56fd62a Merge pull request #5029 from getspooky/my-branch-dev
feat(packages/common/exception): Export http-version-not-supported
2020-07-08 14:11:55 +02:00
Kamil Mysliwiec
8b97f94c38 Merge pull request #5053 from nestjs/renovate/nestjs-mongoose-7.x
fix(deps): update dependency @nestjs/mongoose to v7.0.2
2020-07-08 14:11:37 +02:00
Renovate Bot
b5a7a6cda4 fix(deps): update dependency @nestjs/mongoose to v7.0.2 2020-07-08 11:44:43 +00:00
Kamil Mysliwiec
2ce40138b9 Update Readme.md 2020-07-08 13:11:46 +02:00
Renovate Bot
53070f07f3 chore(deps): update dependency @types/express to v4.17.7 2020-07-07 00:55:52 +00:00
Renovate Bot
60c92fe5a8 chore(deps): update dependency @types/chai-as-promised to v7.1.3 2020-07-07 00:34:19 +00:00
Renovate Bot
c51984e440 fix(deps): update dependency mongoose to v5.9.22 2020-07-06 23:01:21 +00:00
Renovate Bot
05cc5b83f8 chore(deps): update typescript-eslint monorepo to v3.6.0 2020-07-06 18:58:34 +00:00
Holegots
28fcfe6647 feat(microservices): ServerRMQ 2020-07-07 01:39:09 +08:00
Kamil Mysliwiec
2fc29847f3 Merge pull request #5026 from nestjs/renovate/eslint-7.x
chore(deps): update dependency eslint to v7.4.0
2020-07-06 08:43:06 +02:00
Kamil Mysliwiec
1c846e46f9 Merge pull request #5033 from nestjs/renovate/graphql-15.x
fix(deps): update dependency graphql to v15.3.0
2020-07-06 08:42:57 +02:00
Kamil Mysliwiec
42fedbb81b Merge pull request #5032 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.24
2020-07-06 08:42:31 +02:00
Kamil Mysliwiec
7f2c35174d Merge pull request #5034 from nestjs/renovate/ws-7.x
fix(deps): update dependency ws to v7.3.1
2020-07-06 08:42:09 +02:00
Renovate Bot
1931283e75 fix(deps): update dependency ws to v7.3.1 2020-07-06 02:05:17 +00:00
Renovate Bot
dcabde2fb5 fix(deps): update dependency graphql to v15.3.0 2020-07-06 02:02:41 +00:00
Renovate Bot
b4f3cdc73b chore(deps): update dependency @types/redis to v2.8.24 2020-07-06 00:55:17 +00:00
yasser
32ed43b390 feat(packages/common/exception): Export http-version-not-supported 2020-07-04 13:21:43 +02:00
Renovate Bot
9d781cde22 chore(deps): update dependency eslint to v7.4.0 2020-07-03 21:20:37 +00:00
Kamil Mysliwiec
aed62cc7bd Merge pull request #5010 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.3.1
2020-07-03 09:18:54 +02:00
Renovate Bot
a4252b4285 fix(deps): update nest monorepo to v7.3.1 2020-07-03 06:31:01 +00:00
Kamil Mysliwiec
171cc9d392 Merge pull request #5012 from nestjs/renovate/typescript-3.x
chore(deps): update dependency typescript to v3.9.6
2020-07-03 08:07:55 +02:00
Kamil Mysliwiec
64b7237c23 Merge pull request #5018 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.5.1
2020-07-03 08:07:48 +02:00
Kamil Mysliwiec
c97e495c11 Merge pull request #5020 from nestjs/renovate/graphql-tools-monorepo
fix(deps): update dependency graphql-tools to v6.0.12
2020-07-03 08:07:41 +02:00
Kamil Mysliwiec
1534cf5d0a Merge pull request #5022 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.23
2020-07-03 08:06:20 +02:00
Renovate Bot
8436c27a65 fix(deps): update dependency @nestjs/graphql to v7.5.1 2020-07-02 19:41:50 +00:00
Renovate Bot
ab0b29b627 chore(deps): update dependency @types/redis to v2.8.23 2020-07-02 16:41:05 +00:00
Renovate Bot
6d034f5c1f fix(deps): update dependency graphql-tools to v6.0.12 2020-07-02 14:49:44 +00:00
Renovate Bot
1ddab1b2bb chore(deps): update dependency typescript to v3.9.6 2020-07-02 08:11:49 +00:00
Kamil Mysliwiec
364a963426 Merge pull request #5013 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.21
2020-07-02 09:06:33 +02:00
Kamil Mysliwiec
72ff7ae40e Merge pull request #5014 from nestjs/renovate/rxjs-compat-6.x
chore(deps): update dependency rxjs-compat to v6.6.0
2020-07-02 09:06:25 +02:00
Kamil Mysliwiec
184fffe043 Merge pull request #5015 from nestjs/renovate/rxjs-6.x
fix(deps): update dependency rxjs to v6.6.0
2020-07-02 09:06:19 +02:00
Kamil Myśliwiec
d92e85f297 chore(@nestjs) publish v7.3.1 release 2020-07-02 09:05:07 +02:00
Kamil Myśliwiec
acce5e953d fix(platform-fastify): catch close errors when server is closed already 2020-07-02 09:04:00 +02:00
Kamil Myśliwiec
dfd7846779 fix(common): use is nil in cache interceptor to prevent breaking changes 2020-07-02 09:03:41 +02:00
Renovate Bot
d895c367fe fix(deps): update dependency rxjs to v6.6.0 2020-07-02 02:43:33 +00:00
Renovate Bot
b9cf26708e chore(deps): update dependency rxjs-compat to v6.6.0 2020-07-02 02:16:36 +00:00
Renovate Bot
18979b3b46 fix(deps): update dependency mongoose to v5.9.21 2020-07-01 22:10:06 +00:00
Kamil Mysliwiec
877cc3e4d6 Merge pull request #4909 from Amorites/feat/client-registerAsync
feat(microservices): ClientsModule.registerAsync
2020-07-01 14:41:22 +02:00
Kamil Mysliwiec
feeed43c56 Merge pull request #4896 from nestjs/renovate/mocha-8.x
chore(deps): update dependency mocha to v8
2020-07-01 14:21:30 +02:00
Kamil Myśliwiec
a10bb787b8 chore(): update README files 2020-07-01 14:17:35 +02:00
Kamil Myśliwiec
ca7e348478 chore(@nestjs) publish v7.3.0 release 2020-07-01 14:14:39 +02:00
Kamil Myśliwiec
67e15afbf3 Merge branch 'master' of https://github.com/nestjs/nest 2020-07-01 14:05:42 +02:00
Kamil Myśliwiec
d59c7b87bd feat(core): add instance links, introspection and expose request provider 2020-07-01 14:05:32 +02:00
Kamil Mysliwiec
cf5e5bceca Merge pull request #5005 from nestjs/renovate/apollo-graphql-packages
fix(deps): update apollo graphql packages to v2.15.1
2020-07-01 12:11:24 +02:00
Renovate Bot
b5e8197500 fix(deps): update apollo graphql packages to v2.15.1 2020-07-01 09:36:55 +00:00
Kamil Mysliwiec
17969748e9 Merge pull request #5004 from nestjs/renovate/bull-3.x
fix(deps): update dependency bull to v3.15.0
2020-07-01 10:10:10 +02:00
Kamil Mysliwiec
8836251c88 Merge pull request #5006 from nestjs/renovate/babel-monorepo
chore(deps): update babel monorepo to v7.10.4
2020-07-01 10:09:59 +02:00
Kamil Mysliwiec
d74e173e59 Merge pull request #5007 from nestjs/renovate/fast-json-stringify-2.x
fix(deps): update dependency fast-json-stringify to v2.2.1
2020-07-01 10:09:50 +02:00
Kamil Mysliwiec
9511984f2c Merge pull request #5009 from nestjs/renovate/artillery-1.x
chore(deps): update dependency artillery to v1.6.1
2020-07-01 10:09:40 +02:00
Renovate Bot
eb7decd35c chore(deps): update dependency artillery to v1.6.1 2020-06-30 16:46:14 +00:00
Renovate Bot
cd6555edd3 fix(deps): update dependency fast-json-stringify to v2.2.1 2020-06-30 13:38:35 +00:00
Renovate Bot
5b15dbfbaa chore(deps): update babel monorepo to v7.10.4 2020-06-30 13:36:32 +00:00
Renovate Bot
8dcced7256 fix(deps): update dependency bull to v3.15.0 2020-06-30 11:22:18 +00:00
Kamil Mysliwiec
cf10752f40 Merge pull request #5000 from nestjs/renovate/supertest-2.x
chore(deps): update dependency @types/supertest to v2.0.10
2020-06-30 08:55:56 +02:00
Kamil Mysliwiec
1789753248 Merge pull request #5001 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3.5.0
2020-06-30 08:55:44 +02:00
Kamil Mysliwiec
fb62ffe48c Merge pull request #5003 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.22.3
2020-06-30 08:55:36 +02:00
Renovate Bot
f38223ade4 fix(deps): update dependency sequelize to v5.22.3 2020-06-30 06:35:28 +00:00
Renovate Bot
f95b219a3c chore(deps): update typescript-eslint monorepo to v3.5.0 2020-06-29 21:12:27 +00:00
Renovate Bot
b4adc2c771 chore(deps): update dependency @types/supertest to v2.0.10 2020-06-29 20:00:39 +00:00
Kamil Mysliwiec
d56267fb99 Merge pull request #4992 from nestjs/renovate/nestjs-passport-7.x
fix(deps): update dependency @nestjs/passport to v7.1.0
2020-06-29 21:40:50 +02:00
Kamil Mysliwiec
2971ba6a3c Merge pull request #4994 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.15.1
2020-06-29 21:40:44 +02:00
Kamil Mysliwiec
f7e4885c2d Merge pull request #4995 from nestjs/renovate/graphql-15.x
fix(deps): update dependency graphql to v15.2.0
2020-06-29 21:40:32 +02:00
Kamil Mysliwiec
cce0bc6407 Merge pull request #4998 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.29
2020-06-29 21:40:25 +02:00
Kamil Mysliwiec
ed4becbe99 Merge pull request #4999 from nestjs/renovate/ws-7.x
chore(deps): update dependency @types/ws to v7.2.6
2020-06-29 21:40:10 +02:00
Renovate Bot
3cac1ca2b2 chore(deps): update dependency @types/ws to v7.2.6 2020-06-29 17:26:41 +00:00
Renovate Bot
9059c3d5ac chore(deps): update dependency @types/mongoose to v5.7.29 2020-06-29 17:18:49 +00:00
Renovate Bot
3433ab06f4 fix(deps): update dependency graphql to v15.2.0 2020-06-29 14:28:31 +00:00
Renovate Bot
55bd8ab1c7 fix(deps): update dependency fastify to v2.15.1 2020-06-29 14:24:19 +00:00
Kamil Mysliwiec
2e5eb4b8e9 Merge pull request #4993 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.12
2020-06-29 14:23:27 +02:00
Renovate Bot
59ad650c8f fix(deps): update dependency @nestjs/swagger to v4.5.12 2020-06-29 12:12:52 +00:00
Renovate Bot
764d26b28e fix(deps): update dependency @nestjs/passport to v7.1.0 2020-06-29 12:11:57 +00:00
Kamil Mysliwiec
2f29d7790b Merge pull request #4989 from nestjs/renovate/eslint-plugin-import-2.x
chore(deps): update dependency eslint-plugin-import to v2.22.0
2020-06-29 13:10:21 +02:00
Kamil Mysliwiec
6a53d1e131 Merge pull request #4951 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v26.1.0
2020-06-29 13:09:37 +02:00
Kamil Mysliwiec
d37f68d05e Merge pull request #4972 from rraziel/module-metadata-export
chore(common): export the ModuleMetadata type
2020-06-29 13:09:25 +02:00
Renovate Bot
72c16ccd9a chore(deps): update dependency eslint-plugin-import to v2.22.0 2020-06-29 00:59:57 +00:00
Kamil Mysliwiec
3f9be96815 Update Readme.md 2020-06-27 10:17:16 +02:00
Kamil Mysliwiec
7bcf90cb8c Merge pull request #4943 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3.4.0
2020-06-27 09:50:45 +02:00
Kamil Mysliwiec
f4f85f254c Merge pull request #4978 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.22.2
2020-06-27 09:50:32 +02:00
Renovate Bot
fc625f2957 fix(deps): update dependency sequelize to v5.22.2 2020-06-27 05:21:02 +00:00
Renovate Bot
61b6c7df25 chore(deps): update dependency jest to v26.1.0 2020-06-26 16:53:05 +00:00
Kamil Mysliwiec
79caf671ea Merge pull request #4977 from nestjs/revert-4958-renovate/sequelize-6.x
Revert "fix(deps): update dependency sequelize to v6"
2020-06-26 17:22:15 +02:00
Kamil Mysliwiec
e24f23d030 Revert "fix(deps): update dependency sequelize to v6" 2020-06-26 17:22:02 +02:00
Renovate Bot
d184f906ff chore(deps): update typescript-eslint monorepo to v3.4.0 2020-06-26 13:06:26 +00:00
Kamil Mysliwiec
7efc27c186 Merge pull request #4960 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.4.6
2020-06-26 14:26:33 +02:00
Kamil Mysliwiec
27de22fdfb Merge pull request #4966 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.28
2020-06-26 14:26:25 +02:00
Renovate Bot
2342c65efc chore(deps): update dependency @types/mongoose to v5.7.28 2020-06-26 11:47:44 +00:00
Renovate Bot
7d03b2d78d fix(deps): update dependency @nestjs/graphql to v7.4.6 2020-06-26 11:42:03 +00:00
Kamil Mysliwiec
c0e6139419 Merge pull request #4973 from nestjs/renovate/graphql-tools-monorepo
fix(deps): update dependency graphql-tools to v6.0.11
2020-06-26 13:34:18 +02:00
Kamil Mysliwiec
f574663414 Merge pull request #4964 from nestjs/renovate/imports-loader-1.x
chore(deps): update dependency imports-loader to v1.1.0
2020-06-26 13:34:05 +02:00
Kamil Mysliwiec
7f3a9955be Merge pull request #4961 from nestjs/renovate/jest-26.x
chore(deps): update dependency @types/jest to v26.0.3
2020-06-26 13:33:55 +02:00
Kamil Mysliwiec
cc828d493a Merge pull request #4958 from nestjs/renovate/sequelize-6.x
fix(deps): update dependency sequelize to v6
2020-06-26 13:33:38 +02:00
Kamil Mysliwiec
dda9d52c4c Merge pull request #4925 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2020-06-26 13:33:27 +02:00
Renovate Bot
1194fbae9f fix(deps): update dependency sequelize to v6 2020-06-26 08:39:46 +00:00
Renovate Bot
b3542806d8 fix(deps): update dependency graphql-tools to v6.0.11 2020-06-26 00:01:03 +00:00
Raziel
3991fb9525 chore(common): export the ModuleMetadata type 2020-06-26 01:19:23 +02:00
Renovate Bot
91cf3190b3 chore(deps): update dependency @types/jest to v26.0.3 2020-06-24 17:10:49 +00:00
Renovate Bot
1ddeaa2aad chore(deps): update dependency imports-loader to v1.1.0 2020-06-24 16:49:23 +00:00
Kamil Mysliwiec
2bdcdb5814 Merge pull request #4957 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.22.0
2020-06-24 12:26:49 +02:00
Kamil Mysliwiec
bb4ed69b0e Merge pull request #4959 from nestjs/renovate/jest-26.x
chore(deps): update dependency @types/jest to v26.0.1
2020-06-24 12:26:37 +02:00
Renovate Bot
b69f3be0aa chore(deps): update dependency @types/jest to v26.0.1 2020-06-24 09:45:10 +00:00
Renovate Bot
96136f72e7 fix(deps): update dependency sequelize to v5.22.0 2020-06-24 08:30:18 +00:00
Renovate Bot
724403067b chore(deps): update nest monorepo 2020-06-24 08:29:13 +00:00
Kamil Mysliwiec
12b807f149 Merge pull request #4950 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.4.2
2020-06-24 08:33:47 +02:00
Kamil Mysliwiec
07237a07c7 Merge pull request #4955 from nestjs/renovate/uuid-8.x
fix(deps): update dependency uuid to v8.2.0
2020-06-24 08:33:37 +02:00
Renovate Bot
0e7197c828 fix(deps): update dependency uuid to v8.2.0 2020-06-23 21:13:04 +00:00
Renovate Bot
7c64c77031 fix(deps): update dependency @nestjs/graphql to v7.4.2 2020-06-23 13:41:01 +00:00
Renovate Bot
6e2033ba7e chore(deps): update dependency mocha to v8 2020-06-23 13:09:26 +00:00
Kamil Mysliwiec
ba2bdea524 Merge pull request #4942 from nestjs/renovate/nestjs-serve-static-2.x
fix(deps): update dependency @nestjs/serve-static to v2.1.3
2020-06-23 13:23:25 +02:00
Kamil Mysliwiec
12b9940b65 Update config.yml 2020-06-23 12:59:41 +02:00
Kamil Mysliwiec
8a02e39001 Merge pull request #4926 from nestjs/renovate/ts-morph-7.x
chore(deps): update dependency ts-morph to v7.1.2
2020-06-23 12:58:26 +02:00
Kamil Mysliwiec
b82f6f6b5b Merge pull request #4947 from nestjs/renovate/fast-json-stringify-2.x
fix(deps): update dependency fast-json-stringify to v2.2.0
2020-06-23 12:58:12 +02:00
Kamil Mysliwiec
6a754515a1 Merge pull request #4893 from nestjs/renovate/jest-26.x
chore(deps): update dependency @types/jest to v26
2020-06-23 12:57:49 +02:00
Kamil Mysliwiec
517cad59e9 Merge pull request #4933 from nestjs/renovate/babel-monorepo
chore(deps): update babel monorepo to v7.10.3
2020-06-23 12:57:36 +02:00
Kamil Mysliwiec
2714f57fcf Merge pull request #4936 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.15.0
2020-06-23 12:57:30 +02:00
Kamil Mysliwiec
e91d1b1ced Merge pull request #4937 from nestjs/renovate/major-commitlint-monorepo
chore(deps): update commitlint monorepo to v9 (major)
2020-06-23 12:57:23 +02:00
Kamil Mysliwiec
6e49223e4c Merge pull request #4940 from nestjs/renovate/ts-jest-26.x
chore(deps): update dependency ts-jest to v26.1.1
2020-06-23 12:57:18 +02:00
Kamil Mysliwiec
0b33f8fe31 Merge pull request #4941 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.11
2020-06-23 12:57:08 +02:00
Kamil Mysliwiec
b315162269 Merge pull request #4946 from nestjs/renovate/eslint-7.x
chore(deps): update dependency eslint to v7.3.1
2020-06-23 12:56:53 +02:00
Kamil Mysliwiec
cd21b2ff93 Merge pull request #4948 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.20
2020-06-23 12:56:44 +02:00
Renovate Bot
4a1eed1e44 chore(deps): update dependency eslint to v7.3.1 2020-06-23 03:49:43 +00:00
Renovate Bot
09a3ad2950 fix(deps): update dependency mongoose to v5.9.20 2020-06-22 21:32:52 +00:00
Renovate Bot
5e9d5c57ed fix(deps): update dependency fast-json-stringify to v2.2.0 2020-06-22 19:52:58 +00:00
Renovate Bot
d7c69707f6 fix(deps): update dependency @nestjs/serve-static to v2.1.3 2020-06-22 15:19:22 +00:00
Renovate Bot
f6114abea9 fix(deps): update dependency @nestjs/swagger to v4.5.11 2020-06-22 15:13:19 +00:00
Renovate Bot
33d6c393e0 chore(deps): update dependency ts-jest to v26.1.1 2020-06-22 08:02:08 +00:00
Renovate Bot
97edbe0c2a chore(deps): update commitlint monorepo to v9 2020-06-22 00:39:35 +00:00
Renovate Bot
2e9fcb1a42 fix(deps): update dependency fastify to v2.15.0 2020-06-22 00:37:44 +00:00
Renovate Bot
2581903818 chore(deps): update babel monorepo to v7.10.3 2020-06-19 21:25:56 +00:00
Renovate Bot
ab4295ed02 chore(deps): update dependency ts-morph to v7.1.2 2020-06-18 22:05:21 +00:00
Kamil Mysliwiec
f05786d8c1 Merge pull request #4924 from nestjs/renovate/webpack-cli-3.x
chore(deps): update dependency webpack-cli to v3.3.12
2020-06-18 16:17:50 +02:00
Kamil Mysliwiec
772e589327 Merge pull request #4923 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.27
2020-06-18 16:17:40 +02:00
Kamil Myśliwiec
82d0171bcf Merge branch 'elsangedy-patch-1' 2020-06-18 16:05:06 +02:00
Kamil Myśliwiec
706f55488c refactor(common): adjust to the code style 2020-06-18 16:04:53 +02:00
Kamil Myśliwiec
adce6c8ec0 Merge branch 'patch-1' of https://github.com/elsangedy/nest into elsangedy-patch-1 2020-06-18 16:04:26 +02:00
Renovate Bot
7d209e3d8f chore(deps): update dependency webpack-cli to v3.3.12 2020-06-18 14:03:39 +00:00
Renovate Bot
a718809f30 chore(deps): update dependency @types/mongoose to v5.7.27 2020-06-18 13:58:39 +00:00
Renovate Bot
25ba42cca2 chore(deps): update dependency @types/jest to v26 2020-06-18 13:51:52 +00:00
Kamil Myśliwiec
eb1828431d chore(@nestjs) publish v7.2.0 release 2020-06-18 15:50:29 +02:00
Kamil Myśliwiec
038beb0c54 fix(core): fix resolve() method (fallback to get() for static) 2020-06-18 15:34:03 +02:00
Kamil Myśliwiec
2a7bf6a357 fix(core): revert resolve method regression 2020-06-18 15:21:34 +02:00
amorites
d03830e998 feat(microservices): ClientsModule.registerAsync 2020-06-18 21:18:38 +08:00
Kamil Mysliwiec
dc35501e74 Merge pull request #4793 from nestjs/renovate/all-minor-patch
chore(deps): update all non-major dependencies
2020-06-18 15:11:38 +02:00
Kamil Myśliwiec
570dc303c9 fix(): fix update deps issues 2020-06-18 14:24:28 +02:00
Kamil Mysliwiec
300f0e39a5 Merge pull request #4897 from mattleff/graphql-lint-fixes
sample(graphql): Fix lint errors
2020-06-18 13:34:09 +02:00
Kamil Mysliwiec
c76e12eb17 Merge pull request #4907 from Larinel/patch-1
refactor(microservices): rmq connection errors are now being logged
2020-06-18 13:33:27 +02:00
Kamil Myśliwiec
5ca6a1e794 feat(microservices): add client opts to redis options 2020-06-18 12:50:36 +02:00
Kamil Myśliwiec
eb8f58a624 Merge branch 'master' of https://github.com/nestjs/nest 2020-06-18 12:50:17 +02:00
Kamil Myśliwiec
9e7c610ebe docs(): update readme file 2020-06-18 12:50:11 +02:00
Kamil Mysliwiec
f17d29bf99 Merge pull request #4920 from nestjs/renovate/imports-loader-1.x
chore(deps): update dependency imports-loader to v1
2020-06-18 12:31:26 +02:00
Renovate Bot
59c6cebb22 chore(deps): update all non-major dependencies 2020-06-18 10:12:03 +00:00
Renovate Bot
75e1e71e10 chore(deps): update dependency imports-loader to v1 2020-06-17 17:24:52 +00:00
Larinel
d4f93cd909 refactor(microservices): rmq connection errors are now being logged 2020-06-15 14:19:19 +03:00
Matthew Leffler
b5d553604d sample(graphql): Fix lint errors 2020-06-10 13:59:07 -06:00
Kamil Mysliwiec
41764370eb Merge pull request #4884 from nestjs/renovate/npm-apollo-server-express-vulnerability
fix(deps): update dependency apollo-server-express to v2.14.2 [security]
2020-06-08 16:04:41 +02:00
Renovate Bot
e14670ee16 fix(deps): update dependency apollo-server-express to v2.14.2 [security] 2020-06-05 21:33:18 +00:00
Munir Ahmed Elsangedy
1c4ab360e3 feat(core): make ClassSerializerInterceptor defaultOptions optional 2020-06-04 21:46:17 -03:00
Kamil Myśliwiec
5126ff4abc chore(@nestjs) publish v7.1.3 release 2020-06-03 14:16:39 +02:00
Kamil Myśliwiec
54570aa0c8 Merge branch 'master' of https://github.com/nestjs/nest 2020-06-03 14:15:42 +02:00
Kamil Myśliwiec
0b02176c2b fix(core): fix get all and merge (reduce on empty array) 2020-06-03 14:15:34 +02:00
Kamil Mysliwiec
9f14b14b9e Update set-metadata.decorator.ts 2020-06-03 08:55:08 +02:00
Kamil Mysliwiec
9c60cc82e3 Update Readme.md 2020-06-01 15:35:52 +02:00
Kamil Mysliwiec
471335a336 Update Readme.md 2020-06-01 15:35:33 +02:00
Kamil Myśliwiec
6ebe9bf1e0 sample(): remove exclude option from tsconfig 2020-06-01 11:41:42 +02:00
Kamil Myśliwiec
d8715eb7ff sample(): add allow synthetic default imports by default 2020-06-01 11:14:07 +02:00
Kamil Myśliwiec
84bc3581cd chore(@nestjs) publish v7.1.2 release 2020-06-01 11:11:25 +02:00
Kamil Myśliwiec
439736f051 fix(core): add more descriptive messages for invalid usage of resolve() 2020-06-01 11:10:24 +02:00
Kamil Myśliwiec
410fe85081 fix(platform-fastify): wrap response object when @all decorator is used 2020-06-01 11:10:06 +02:00
Kamil Myśliwiec
7ea7fd1f85 sample(graphql): lock packages to specific versions 2020-05-31 18:00:16 +02:00
Kamil Myśliwiec
e3a2c74558 sample(graphql): fix package json 2020-05-31 17:59:55 +02:00
Kamil Myśliwiec
7a8696365c Merge branch 'master' of https://github.com/nestjs/nest 2020-05-31 16:27:54 +02:00
Kamil Myśliwiec
1d15dc650e sample(graphql): add complexity plugin sample 2020-05-31 16:25:26 +02:00
Kamil Mysliwiec
ff75c1297c Merge pull request #4857 from nestjs/renovate/pin-dependencies
fix(deps): pin dependency @nestjs/mongoose to 7.0.1
2020-05-29 10:35:31 +02:00
Renovate Bot
033ac9cab2 fix(deps): pin dependency @nestjs/mongoose to 7.0.1 2020-05-29 08:21:15 +00:00
Kamil Myśliwiec
4f6d658467 sample(mongoose): lock nestjs mongoose package version 2020-05-29 10:19:22 +02:00
Kamil Myśliwiec
5435fab03b sample(): update nestjs mongoose package 2020-05-29 10:18:47 +02:00
Kamil Myśliwiec
c573fb3b89 sample(webpack): add nest cli config file 2020-05-29 09:44:51 +02:00
Kamil Myśliwiec
ae08b12119 fix(core): improve typings for unknown export exception 2020-05-29 08:49:34 +02:00
Kamil Myśliwiec
75e110f4c0 fix(core): use stringified symbol in unknown exported message #4856 2020-05-29 08:45:12 +02:00
Kamil Myśliwiec
230b84f163 chore(@nestjs) publish v7.1.1 release 2020-05-28 10:58:25 +02:00
Kamil Myśliwiec
60b2615d25 Merge branch 'master' of https://github.com/nestjs/nest 2020-05-28 10:57:07 +02:00
Kamil Myśliwiec
b8ce4121ed fix(core): filter out undefined values in get all and merge 2020-05-28 10:56:56 +02:00
Kamil Myśliwiec
486a40b852 fix(common): change first redirect arg to optional 2020-05-28 10:56:31 +02:00
Kamil Mysliwiec
6337793a84 Merge pull request #4843 from nestjs/renovate/pug-3.x
fix(deps): update dependency pug to v3
2020-05-27 08:58:21 +02:00
Renovate Bot
e5f0f54946 fix(deps): update dependency pug to v3 2020-05-25 12:40:05 +00:00
Kamil Myśliwiec
eee8faf433 chore(@nestjs) publish v7.1.0 release 2020-05-24 14:40:37 +02:00
Kamil Myśliwiec
07cb5a83e1 style(): minor style improvements 2020-05-24 14:37:30 +02:00
Kamil Myśliwiec
fa10ab7f7c Merge branch 'sjkummer-bugfix/grpc-options' 2020-05-24 13:54:38 +02:00
Kamil Myśliwiec
f315ca2b90 fix(): remove duplicated options, apply formatting rules 2020-05-24 13:54:25 +02:00
Kamil Myśliwiec
b397cec0fd Merge branch 'bugfix/grpc-options' of https://github.com/sjkummer/nest into sjkummer-bugfix/grpc-options 2020-05-24 13:51:51 +02:00
Kamil Myśliwiec
0d6ae6fe88 Merge branch '2Kable-fix/hybrid-configuration' 2020-05-24 13:50:51 +02:00
Kamil Myśliwiec
34f74561de test(): add tests for lifecycle hooks, remove scope from module 2020-05-24 13:50:26 +02:00
Kamil Myśliwiec
28b1784966 Merge branch 'fix/hybrid-configuration' of https://github.com/2Kable/nest into 2Kable-fix/hybrid-configuration 2020-05-24 13:20:53 +02:00
Kamil Myśliwiec
a683a545af Merge branch 'barbarosh-feature/message-pattern-bind-to-transport' 2020-05-24 13:19:36 +02:00
Kamil Myśliwiec
d1816a3199 refactor(): adjust style to the rest of codebase 2020-05-24 13:19:24 +02:00
Kamil Myśliwiec
3e4f8bcbf1 Merge branch 'feature/message-pattern-bind-to-transport' of https://github.com/barbarosh/nest into barbarosh-feature/message-pattern-bind-to-transport 2020-05-24 13:14:14 +02:00
Kamil Mysliwiec
a09e77a50a Merge pull request #4831 from nestjs/renovate/graphql-tools-6.x
fix(deps): update dependency graphql-tools to v6
2020-05-24 12:23:48 +02:00
Kamil Mysliwiec
7970c29f16 Merge pull request #4834 from nestjs/renovate/major-typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v3 (major)
2020-05-23 12:57:50 +02:00
Kamil Myśliwiec
09fea2b45c sample(): style tests change, module to module ref 2020-05-23 12:41:56 +02:00
Renovate Bot
3f68b08bfc fix(deps): update dependency graphql-tools to v6 2020-05-23 10:14:03 +00:00
Renovate Bot
5ba0164f35 chore(deps): update typescript-eslint monorepo to v3 2020-05-23 10:09:05 +00:00
Kamil Myśliwiec
d768b5df32 sample(): fix prisma bindings file 2020-05-23 11:50:36 +02:00
Kamil Myśliwiec
5388ffb09b feat(): update to the latest typescript eslint packages 2020-05-23 11:46:45 +02:00
Kamil Mysliwiec
3fae1c2503 Merge pull request #4802 from nestjs/renovate/tslib-2.x
fix(deps): update dependency tslib to v2
2020-05-23 11:38:10 +02:00
Kamil Mysliwiec
2aa0881b46 Merge pull request #4827 from soyuka/fix/axios-config-mutation
fix(http): remove axios config mutation #4803
2020-05-23 11:35:37 +02:00
Kamil Mysliwiec
55032c15f4 Merge pull request #4817 from Jekiwijaya/fix/grpc-client/option-value
fix(microservices): enable grpc option value to accept 0
2020-05-23 11:34:54 +02:00
Kamil Mysliwiec
de54172f6b Merge pull request #4808 from nestjs/renovate/ts-jest-26.x
chore(deps): update dependency ts-jest to v26
2020-05-23 11:34:31 +02:00
Sebastian Schmid
2dcff086b3 make channelOptions optional 2020-05-20 16:42:16 +02:00
soyuka
edadbb1af9 fix(http): remove axios config mutation 2020-05-20 16:03:40 +02:00
Jacky Wijaya
d562bc0225 fix(microservices): enable grpc option value to accept 0 2020-05-17 22:06:57 +07:00
Munir Ahmed Elsangedy
f8e788a929 feat(core): add support to default serializer options
Enable pass `ClassTransformOptions` when use `ClassSerializerInterceptor` as GlobalInterceptors.

```
const reflector = app.get<Reflector>(Reflector);

app.useGlobalInterceptors(
  new ClassSerializerInterceptor(reflector, {
    excludeExtraneousValues: true,
    enableImplicitConversion: true
  })
);
```
2020-05-16 21:42:04 -03:00
alex
07237f5aed test(microservices): add tests for new feature 2020-05-17 01:22:32 +03:00
alex
0432284865 feat(sample): add hybrid app microservices sample 2020-05-16 15:56:33 +03:00
alex
e2c8f74f19 feat(microservices): move getTransportId functions to public variable transportId and make it optional 2020-05-16 15:22:15 +03:00
Renovate Bot
19b4083936 chore(deps): update dependency ts-jest to v26 2020-05-15 19:34:09 +00:00
Kamil Myśliwiec
baadb3f925 chore(@nestjs) publish v7.0.13 release 2020-05-15 11:53:15 +02:00
Kamil Myśliwiec
f9ce824eaf chore(@nestjs) publish v7.0.12 release 2020-05-15 10:33:54 +02:00
Kamil Myśliwiec
43a4ea4d39 Merge branch 'soyuka-fix/axios-config-mutation' 2020-05-15 10:32:28 +02:00
Kamil Myśliwiec
138e2c41f0 refactor(): switch to an inline condition 2020-05-15 10:32:07 +02:00
Kamil Myśliwiec
53d3574a43 Merge branch 'fix/axios-config-mutation' of https://github.com/soyuka/nest into soyuka-fix/axios-config-mutation 2020-05-15 10:30:13 +02:00
Kamil Myśliwiec
f3a8f7f174 Merge branch 'master' of https://github.com/nestjs/nest 2020-05-15 10:28:41 +02:00
Kamil Myśliwiec
47cd27e0cc fix(core): enforce default scope if override provider (use value) #4800 2020-05-15 10:28:30 +02:00
soyuka
91d7564d92 fix(http): remove axios config mutation 2020-05-14 16:51:16 +02:00
Renovate Bot
b236e30231 fix(deps): update dependency tslib to v2 2020-05-13 23:37:49 +00:00
Kamil Mysliwiec
dc1bd46c03 Update renovate.json 2020-05-13 09:00:19 +02:00
Kamil Mysliwiec
8c146fe341 Merge pull request #4783 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.0.11
2020-05-12 15:04:31 +02:00
Renovate Bot
c49c271c22 fix(deps): update nest monorepo to v7.0.11 2020-05-12 12:18:23 +00:00
Kamil Mysliwiec
b59965ba76 Update LICENSE 2020-05-12 14:11:30 +02:00
Kamil Myśliwiec
b1ed6db4fb chore(): update readme file 2020-05-12 14:10:31 +02:00
Kamil Myśliwiec
661664d8be chore(@nestjs) publish v7.0.11 release 2020-05-12 14:06:57 +02:00
Kamil Myśliwiec
64df4a96c9 Merge branch 'master' of https://github.com/nestjs/nest 2020-05-12 14:05:14 +02:00
Kamil Myśliwiec
7775081159 fix(core): dont instantiate transient classes when inquirer is transient 2020-05-12 14:05:05 +02:00
Kamil Mysliwiec
dcf3ca0d4c Merge pull request #4587 from BrunnerLivio/fix/improve-invalid-module-exception
fix(core): improve error message when imported module is nil
2020-05-12 14:00:04 +02:00
Kamil Myśliwiec
9ee7c3ffa3 chore(@nestjs) publish v7.0.10 release 2020-05-12 12:24:32 +02:00
Kamil Myśliwiec
1f8b45bf9b sample(mongoose): use decorators to create a schema definition 2020-05-12 12:19:41 +02:00
Kamil Myśliwiec
97061348f5 Merge branch 'master' of https://github.com/nestjs/nest 2020-05-12 12:19:06 +02:00
Kamil Mysliwiec
a8da4f74da Merge pull request #4759 from nestjs/renovate/eslint-7.x
chore(deps): update dependency eslint to v7
2020-05-12 12:19:01 +02:00
Kamil Mysliwiec
1bc9939000 Update packages/core/errors/exceptions/undefined-forwardref.exception.ts 2020-05-12 12:08:10 +02:00
Kamil Mysliwiec
e4184145cb Update packages/core/injector/container.ts 2020-05-12 12:08:02 +02:00
Kamil Mysliwiec
3e0fb387a0 Update packages/core/injector/container.ts 2020-05-12 12:07:47 +02:00
Kamil Myśliwiec
630c3be032 Merge branch 'master' of https://github.com/nestjs/nest 2020-05-12 12:06:33 +02:00
Kamil Mysliwiec
1f880c7e8b Merge pull request #4629 from apatryda/4590-default-value-pipe
feat(common): add a default-value pipe
2020-05-12 12:06:27 +02:00
Kamil Mysliwiec
47184d4ddb Merge pull request #4699 from digital-value-apps/http_service_with_cancel_token
fix(common): Allow users to provide a cancellation token to http service
2020-05-12 12:05:54 +02:00
Kamil Mysliwiec
822bbba826 Merge pull request #4764 from nestjs/renovate/fastify-formbody-3.x
fix(deps): update dependency fastify-formbody to v3.2.0
2020-05-12 12:05:31 +02:00
Kamil Mysliwiec
91f44a0978 Merge pull request #4707 from nestjs/renovate/uuid-8.x
fix(deps): update dependency uuid to v8
2020-05-12 12:05:18 +02:00
Kamil Mysliwiec
53965ec396 Merge pull request #4774 from Durairaj/master
fix(deps): removed kafka-node, since that types is not used
2020-05-12 12:03:40 +02:00
Kamil Mysliwiec
e394f73a39 Merge pull request #4763 from nestjs/renovate/ts-jest-25.x
chore(deps): update dependency ts-jest to v25.5.1
2020-05-12 12:02:55 +02:00
Kamil Mysliwiec
f76ea42d4d Merge pull request #4782 from nestjs/renovate/nestjs-serve-static-2.x
fix(deps): update dependency @nestjs/serve-static to v2.1.1
2020-05-12 12:01:45 +02:00
Kamil Myśliwiec
bfcd6f25d6 Merge branch 'master' of https://github.com/nestjs/nest 2020-05-12 12:00:25 +02:00
Kamil Myśliwiec
d08c7c742b fix(core): resolve nested transient providers #4756 2020-05-12 11:59:59 +02:00
Renovate Bot
0fa229529e chore(deps): update dependency eslint to v7 2020-05-12 08:52:33 +00:00
Renovate Bot
47fcaaf855 fix(deps): update dependency fastify-formbody to v3.2.0 2020-05-12 08:42:09 +00:00
Renovate Bot
a4ea40dacc fix(deps): update dependency @nestjs/serve-static to v2.1.1 2020-05-12 08:40:23 +00:00
Renovate Bot
48ab7359e4 chore(deps): update dependency ts-jest to v25.5.1 2020-05-12 08:39:43 +00:00
Kamil Mysliwiec
cb65d90249 Merge pull request #4757 from nestjs/renovate/bull-3.x
fix(deps): update dependency bull to v3.14.0
2020-05-12 10:21:28 +02:00
Kamil Mysliwiec
341746313a Merge pull request #4758 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.14.1
2020-05-12 10:21:20 +02:00
Kamil Mysliwiec
d1d583af07 Merge pull request #4760 from nestjs/renovate/conventional-changelog-3.x
chore(deps): update dependency conventional-changelog to v3.1.21
2020-05-12 10:20:55 +02:00
Kamil Mysliwiec
60e77e92e2 Merge pull request #4761 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.13
2020-05-12 10:20:47 +02:00
Kamil Mysliwiec
306adf0b3f Merge pull request #4765 from nestjs/renovate/fastify-multipart-1.x
chore(deps): update dependency fastify-multipart to v1.0.6
2020-05-12 10:20:27 +02:00
Kamil Mysliwiec
092a6af52c Merge pull request #4770 from nestjs/renovate/ws-7.x
fix(deps): update dependency ws to v7.3.0
2020-05-12 10:19:56 +02:00
Kamil Mysliwiec
5462d1d152 Merge pull request #4771 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.21.8
2020-05-12 10:19:36 +02:00
Kamil Mysliwiec
9179b43f94 Merge pull request #4777 from nestjs/renovate/ts-loader-7.x
chore(deps): update dependency ts-loader to v7.0.4
2020-05-12 10:19:28 +02:00
Kamil Mysliwiec
824b543a94 Merge pull request #4779 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.32.0
2020-05-12 10:19:18 +02:00
Kamil Mysliwiec
25d9e138c1 Merge pull request #4780 from nestjs/renovate/apollo-graphql-packages
fix(deps): update apollo graphql packages to v2.13.1
2020-05-12 10:14:04 +02:00
Renovate Bot
e32270c202 fix(deps): update apollo graphql packages to v2.13.1 2020-05-11 20:25:17 +00:00
Renovate Bot
643d74df46 chore(deps): update typescript-eslint monorepo to v2.32.0 2020-05-11 17:41:35 +00:00
Renovate Bot
2bda4fca88 chore(deps): update dependency ts-loader to v7.0.4 2020-05-11 15:58:59 +00:00
Renovate Bot
d5807f160b fix(deps): update dependency bull to v3.14.0 2020-05-11 13:35:42 +00:00
Durairaj Subramaniam
fe9afa34ee fix(deps): removed kafka-node, since that types is not used 2020-05-10 20:51:01 +01:00
Renovate Bot
79c5014d82 fix(deps): update dependency sequelize to v5.21.8 2020-05-10 11:15:36 +00:00
Renovate Bot
3208409654 fix(deps): update dependency ws to v7.3.0 2020-05-10 06:37:58 +00:00
alex
0845dab3a3 feat(microservices): Add ability for pass transport to MessagePattern 2020-05-10 02:30:16 +03:00
Renovate Bot
56a24622b6 chore(deps): update dependency fastify-multipart to v1.0.6 2020-05-09 16:42:11 +00:00
Renovate Bot
62b0330a1c fix(deps): update dependency mongoose to v5.9.13 2020-05-09 10:10:35 +00:00
Renovate Bot
c0acada6a8 chore(deps): update dependency conventional-changelog to v3.1.21 2020-05-08 22:21:33 +00:00
Renovate Bot
75830c9eaf fix(deps): update dependency fastify to v2.14.1 2020-05-08 18:55:59 +00:00
Kamil Mysliwiec
bb71ceaf3d Merge pull request #4754 from nestjs/renovate/mqtt-4.x
chore(deps): update dependency mqtt to v4.0.1
2020-05-08 08:41:27 +02:00
Renovate Bot
34a6704b12 chore(deps): update dependency mqtt to v4.0.1 2020-05-07 17:33:06 +00:00
Kamil Mysliwiec
cbda11b4fb Merge pull request #4749 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.5
2020-05-07 10:02:49 +02:00
Renovate Bot
b4c06f2242 fix(deps): update dependency @nestjs/swagger to v4.5.5 2020-05-07 07:24:34 +00:00
Kamil Mysliwiec
1cb1c76f03 Merge pull request #4747 from nestjs/renovate/ts-loader-7.x
chore(deps): update dependency ts-loader to v7.0.3
2020-05-07 09:23:39 +02:00
Kamil Mysliwiec
ff6365225d Merge pull request #4748 from nestjs/renovate/nestjs-mongoose-7.x
fix(deps): update dependency @nestjs/mongoose to v7
2020-05-07 09:22:35 +02:00
Renovate Bot
902e6cd322 chore(deps): update dependency ts-loader to v7.0.3 2020-05-07 06:56:18 +00:00
Kamil Mysliwiec
ca065578f8 Merge pull request #4741 from nestjs/renovate/ts-jest-25.x
chore(deps): update dependency ts-jest to v25.5.0
2020-05-07 08:45:06 +02:00
Renovate Bot
221c2c839f fix(deps): update dependency @nestjs/mongoose to v7 2020-05-07 06:42:03 +00:00
Renovate Bot
a0b84ffd1e chore(deps): update dependency ts-jest to v25.5.0 2020-05-06 09:31:23 +00:00
Renovate Bot
e6233cbd5b fix(deps): update dependency uuid to v8 2020-05-06 07:40:30 +00:00
Kamil Mysliwiec
a2e1cfcd62 Merge pull request #4740 from nestjs/renovate/tslib-1.x
fix(deps): update dependency tslib to v1.11.2
2020-05-06 08:21:10 +02:00
Renovate Bot
8d2c79fa83 fix(deps): update dependency tslib to v1.11.2 2020-05-06 00:28:53 +00:00
Kamil Mysliwiec
8a2c6063b7 Merge pull request #4735 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v26.0.1
2020-05-05 20:48:45 +02:00
Kamil Mysliwiec
a4f8419698 Merge pull request #4738 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.20
2020-05-05 20:41:01 +02:00
Renovate Bot
4044d60583 chore(deps): update dependency @types/redis to v2.8.20 2020-05-05 17:00:54 +00:00
Renovate Bot
16ba70cba2 chore(deps): update dependency jest to v26.0.1 2020-05-05 12:05:39 +00:00
Kamil Mysliwiec
c31f2f6c5f Merge pull request #4730 from nestjs/renovate/major-jest-monorepo
chore(deps): update dependency jest to v26
2020-05-05 09:52:27 +02:00
Renovate Bot
b463a8e93b chore(deps): update dependency jest to v26 2020-05-05 07:17:46 +00:00
Kamil Mysliwiec
4e736b925c Merge pull request #4732 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.12
2020-05-05 08:49:24 +02:00
Kamil Mysliwiec
ec29c7e19c Merge pull request #4729 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.31.0
2020-05-05 08:49:12 +02:00
Kamil Mysliwiec
36c2ed1b9e Merge pull request #4728 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.4
2020-05-05 08:49:02 +02:00
Kamil Mysliwiec
8dac4d0f1c Merge pull request #4727 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.7
2020-05-05 08:48:53 +02:00
Kamil Mysliwiec
289e04dc86 Merge pull request #4726 from nestjs/renovate/apollo-graphql-packages
fix(deps): update apollo graphql packages to v2.13.0
2020-05-05 08:48:42 +02:00
Kamil Mysliwiec
90bfda4311 Merge pull request #4733 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.19
2020-05-05 08:46:45 +02:00
Renovate Bot
dd9086d612 chore(deps): update dependency @types/redis to v2.8.19 2020-05-05 00:55:56 +00:00
Renovate Bot
c8e678682a fix(deps): update dependency mongoose to v5.9.12 2020-05-04 22:48:37 +00:00
Renovate Bot
7b03a6c361 chore(deps): update typescript-eslint monorepo to v2.31.0 2020-05-04 18:02:41 +00:00
Renovate Bot
6634898334 fix(deps): update dependency @nestjs/swagger to v4.5.4 2020-05-04 17:01:42 +00:00
Renovate Bot
c7d890e604 fix(deps): update dependency @nestjs/graphql to v7.3.7 2020-05-04 15:31:23 +00:00
Renovate Bot
1d938fd911 fix(deps): update apollo graphql packages to v2.13.0 2020-05-04 15:28:26 +00:00
Kamil Mysliwiec
995e2870d5 Merge pull request #4725 from vferdiansyah/patch-1
Update README.md
2020-05-04 13:51:13 +02:00
Veri Ferdiansyah
6bb1d88d36 Update README.md 2020-05-04 18:49:01 +07:00
Kamil Mysliwiec
ea8fe39e43 Merge pull request #4714 from nestjs/renovate/supertest-2.x
chore(deps): update dependency @types/supertest to v2.0.9
2020-05-04 12:07:39 +02:00
Kamil Mysliwiec
3b189faa67 Merge pull request #4711 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.11
2020-05-04 12:06:35 +02:00
Kamil Mysliwiec
535dff89c0 Merge pull request #4712 from nestjs/renovate/cache-manager-3.x
chore(deps): update dependency cache-manager to v3.3.0
2020-05-04 11:23:24 +02:00
Renovate Bot
7aed631783 fix(deps): update dependency mongoose to v5.9.11 2020-05-04 08:28:59 +00:00
Renovate Bot
06f68651ec chore(deps): update dependency cache-manager to v3.3.0 2020-05-04 08:26:24 +00:00
Renovate Bot
447e1e3ed6 chore(deps): update dependency @types/supertest to v2.0.9 2020-05-04 08:22:29 +00:00
Kamil Mysliwiec
c8f5fc483d Merge pull request #4709 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.5
2020-05-04 10:12:42 +02:00
Kamil Mysliwiec
2379f9775e Merge pull request #4702 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.5.4
2020-05-04 10:12:32 +02:00
Kamil Mysliwiec
d4943751fa Merge pull request #4710 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.2.2
2020-05-04 10:12:11 +02:00
Kamil Mysliwiec
86e98dc74f Merge pull request #4720 from nestjs/renovate/ts-node-8.x
chore(deps): update dependency ts-node to v8.10.1
2020-05-04 10:11:53 +02:00
Kamil Mysliwiec
6f658624fd Merge pull request #4724 from nestjs/renovate/nest-monorepo
chore(deps): update dependency @nestjs/cli to v7.1.5
2020-05-04 10:11:31 +02:00
Renovate Bot
aad7ec2862 chore(deps): update dependency @nestjs/cli to v7.1.5 2020-05-04 07:56:10 +00:00
Renovate Bot
1ee4bc56b0 chore(deps): update dependency ts-node to v8.10.1 2020-05-03 07:13:50 +00:00
Renovate Bot
bacdc8676b chore(deps): update dependency jest to v25.5.4 2020-05-02 08:45:47 +00:00
Livio
36ba59553c fix(core): improve error message when imported module is nil
fixes #4586
2020-05-02 00:14:42 +02:00
Renovate Bot
9e9c649e6b chore(deps): update dependency lint-staged to v10.2.2 2020-05-01 04:31:51 +00:00
Renovate Bot
0bb5f91a67 fix(deps): update dependency @nestjs/graphql to v7.3.5 2020-04-30 08:05:00 +00:00
Kamil Mysliwiec
011ae85143 Merge pull request #4703 from nestjs/renovate/mongodb-3.x
fix(deps): update dependency mongodb to v3.5.7
2020-04-30 09:02:03 +02:00
Kamil Mysliwiec
b6433fc7ee Merge pull request #4705 from nestjs/renovate/babel-monorepo
chore(deps): update babel monorepo to v7.9.6
2020-04-30 09:01:58 +02:00
Kamil Mysliwiec
12a92d98c4 Merge pull request #4706 from nestjs/renovate/nats-1.x
chore(deps): update dependency nats to v1.4.9
2020-04-30 09:01:40 +02:00
Kamil Mysliwiec
142005573e Merge pull request #4708 from nestjs/renovate/ts-loader-7.x
chore(deps): update dependency ts-loader to v7.0.2
2020-04-30 09:01:24 +02:00
Renovate Bot
9349189a1a chore(deps): update dependency ts-loader to v7.0.2 2020-04-30 05:53:58 +00:00
Renovate Bot
8fff239f1b chore(deps): update dependency nats to v1.4.9 2020-04-29 20:43:36 +00:00
Renovate Bot
c7fee93706 chore(deps): update babel monorepo to v7.9.6 2020-04-29 18:46:12 +00:00
Renovate Bot
c70bbb1923 fix(deps): update dependency mongodb to v3.5.7 2020-04-29 12:13:38 +00:00
Kamil Mysliwiec
1e98a8e790 Merge pull request #4697 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.2.0
2020-04-29 09:04:54 +02:00
Kamil Mysliwiec
2d33f52b63 Merge pull request #4700 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.5.0
2020-04-29 09:03:26 +02:00
Renovate Bot
1280dd6188 chore(deps): update dependency jest to v25.5.0 2020-04-28 20:13:10 +00:00
Nicolas Lenepveu
2b7725bef5 fix(common): Allow users to provide a cancellation token to http service 2020-04-28 20:51:50 +02:00
Renovate Bot
a39a6e9ca5 chore(deps): update dependency lint-staged to v10.2.0 2020-04-28 13:24:21 +00:00
Kamil Mysliwiec
29ad228655 Merge pull request #4695 from nestjs/renovate/docker-mysql-5.x
chore(deps): update mysql docker tag to v5.7.30
2020-04-28 13:52:07 +02:00
Kamil Mysliwiec
f9e39c1b20 Merge pull request #4696 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.14.0
2020-04-28 13:51:56 +02:00
Renovate Bot
b6374e8b0d fix(deps): update dependency fastify to v2.14.0 2020-04-28 10:26:30 +00:00
Fabien Robert
a11da77144 feat(microservice): hybrid microservice can inherit config 2020-04-28 11:05:51 +02:00
Fabien Robert
10bd87cb7f feat(microservice): hybrid microservice can inherit config 2020-04-28 10:40:43 +02:00
Kamil Mysliwiec
b2d37b8de6 Merge pull request #4690 from nestjs/renovate/mqtt-4.x
chore(deps): update dependency mqtt to v4
2020-04-28 09:12:39 +02:00
Renovate Bot
ab2c58d573 chore(deps): update mysql docker tag to v5.7.30 2020-04-28 07:11:30 +00:00
Kamil Mysliwiec
de577292e3 Merge pull request #4689 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.30.0
2020-04-28 09:09:49 +02:00
Kamil Mysliwiec
04cb13aa4d Merge pull request #4687 from nestjs/renovate/nest-monorepo
chore(deps): update dependency @nestjs/cli to v7.1.4
2020-04-28 09:09:36 +02:00
Renovate Bot
380a68d3be chore(deps): update typescript-eslint monorepo to v2.30.0 2020-04-27 17:43:40 +00:00
Renovate Bot
abdeee69b4 chore(deps): update dependency mqtt to v4 2020-04-27 17:30:06 +00:00
Renovate Bot
47e25265f6 chore(deps): update dependency @nestjs/cli to v7.1.4 2020-04-27 13:36:39 +00:00
Kamil Mysliwiec
e95d527ed9 Merge pull request #4679 from nestjs/renovate/ts-node-8.x
chore(deps): update dependency ts-node to v8.9.1
2020-04-27 09:36:57 +02:00
Renovate Bot
694704c27b chore(deps): update dependency ts-node to v8.9.1 2020-04-27 07:20:03 +00:00
Kamil Mysliwiec
a92f1262e4 Merge pull request #4675 from nestjs/renovate/ws-7.x
fix(deps): update dependency ws to v7.2.5
2020-04-27 09:07:55 +02:00
Kamil Mysliwiec
f2b382538b Merge pull request #4680 from nestjs/renovate/mocha-7.x
chore(deps): update dependency mocha to v7.1.2
2020-04-27 09:07:26 +02:00
Kamil Mysliwiec
87bdf87d2f Merge pull request #4681 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.14
2020-04-27 09:06:29 +02:00
Kamil Mysliwiec
afc19bdd5d Merge pull request #4685 from nestjs/renovate/ts-morph-7.x
chore(deps): update dependency ts-morph to v7.0.3
2020-04-27 09:05:57 +02:00
Renovate Bot
649033ddbc chore(deps): update dependency ts-morph to v7.0.3 2020-04-26 22:52:00 +00:00
Renovate Bot
a215322ace chore(deps): update dependency @types/mongoose to v5.7.14 2020-04-26 18:04:44 +00:00
Renovate Bot
0c2e73c78e chore(deps): update dependency mocha to v7.1.2 2020-04-26 06:31:20 +00:00
Renovate Bot
74d7a2f4ca fix(deps): update dependency ws to v7.2.5 2020-04-25 10:58:46 +00:00
Kamil Mysliwiec
fb44f21e96 Merge pull request #4665 from nestjs/renovate/coveralls-3.x
chore(deps): update dependency coveralls to v3.1.0
2020-04-25 12:54:21 +02:00
Kamil Mysliwiec
b271d89146 Merge pull request #4667 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.0.9
2020-04-25 12:54:12 +02:00
Kamil Mysliwiec
1f6deb0c11 Merge pull request #4663 from nestjs/renovate/class-validator-0.x
fix(deps): update dependency class-validator to v0.12.2
2020-04-25 12:09:27 +02:00
Kamil Mysliwiec
392a13f758 Merge pull request #4672 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.13
2020-04-25 12:09:08 +02:00
Kamil Mysliwiec
e0a2eb7398 Merge pull request #4673 from nestjs/renovate/concurrently-5.x
chore(deps): update dependency concurrently to v5.2.0
2020-04-25 12:08:54 +02:00
Renovate Bot
426a3b04f2 chore(deps): update dependency concurrently to v5.2.0 2020-04-25 04:13:27 +00:00
Renovate Bot
f0973d607f chore(deps): update dependency @types/mongoose to v5.7.13 2020-04-24 23:51:43 +00:00
Renovate Bot
55a828a901 chore(deps): update dependency coveralls to v3.1.0 2020-04-24 22:44:52 +00:00
Renovate Bot
23181cb819 fix(deps): update nest monorepo to v7.0.9 2020-04-24 07:14:35 +00:00
Kamil Myśliwiec
a5a8712668 chore(@nestjs) publish v7.0.9 release 2020-04-24 09:02:26 +02:00
Kamil Myśliwiec
77fc5da848 Merge branch 'master' of https://github.com/nestjs/nest 2020-04-24 09:00:10 +02:00
Kamil Myśliwiec
b2bd950cc9 fix(core): fix nullable constructor host when factory provided 2020-04-24 08:59:38 +02:00
Kamil Myśliwiec
e5db8e414e sample(grpc): fix hero proto file 2020-04-24 08:59:05 +02:00
Renovate Bot
678986aa7e fix(deps): update dependency class-validator to v0.12.2 2020-04-23 20:26:22 +00:00
Kamil Mysliwiec
f4d8fad2d4 Merge pull request #4633 from apatryda/4632-tests-should-run-ootb
test: fix tests to make them run ootb
2020-04-23 09:09:08 +02:00
Kamil Mysliwiec
aaf4cb591e Merge pull request #4650 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.1.7
2020-04-23 09:08:36 +02:00
Kamil Mysliwiec
41f59daa58 Merge pull request #4651 from nestjs/renovate/webpack-4.x
chore(deps): update dependency webpack to v4.43.0
2020-04-23 09:08:28 +02:00
Kamil Mysliwiec
8a253c5f76 Merge pull request #4652 from nestjs/renovate/prettier-2.x
chore(deps): update dependency prettier to v2.0.5
2020-04-23 09:08:06 +02:00
Kamil Mysliwiec
1117b246c6 Merge pull request #4653 from nestjs/renovate/coveralls-3.x
chore(deps): update dependency coveralls to v3.0.13
2020-04-23 09:07:54 +02:00
Kamil Mysliwiec
661424f389 Merge pull request #4654 from nestjs/renovate/eslint-config-prettier-6.x
chore(deps): update dependency eslint-config-prettier to v6.11.0
2020-04-23 09:07:49 +02:00
Kamil Mysliwiec
d8ab987130 Merge pull request #4661 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.21.7
2020-04-23 09:07:42 +02:00
Renovate Bot
92908c8f0f fix(deps): update dependency sequelize to v5.21.7 2020-04-23 03:56:46 +00:00
Renovate Bot
5e820cc788 chore(deps): update dependency coveralls to v3.0.13 2020-04-21 20:44:09 +00:00
Renovate Bot
8edb035a87 chore(deps): update dependency eslint-config-prettier to v6.11.0 2020-04-21 19:45:37 +00:00
Renovate Bot
4022347860 chore(deps): update dependency prettier to v2.0.5 2020-04-21 17:50:59 +00:00
Renovate Bot
6ee10bef9d chore(deps): update dependency webpack to v4.43.0 2020-04-21 16:32:15 +00:00
Renovate Bot
cf2c279be2 chore(deps): update dependency lint-staged to v10.1.7 2020-04-21 14:43:20 +00:00
Kamil Mysliwiec
4c9d1de10e Merge pull request #4647 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.4
2020-04-21 10:02:07 +02:00
Renovate Bot
1a0b213d97 fix(deps): update dependency @nestjs/graphql to v7.3.4 2020-04-21 07:47:54 +00:00
Kamil Mysliwiec
8a7fc27513 Merge pull request #4642 from nestjs/renovate/ts-node-8.x
chore(deps): update dependency ts-node to v8.9.0
2020-04-21 09:07:31 +02:00
Kamil Mysliwiec
17edde1a22 Merge pull request #4643 from nestjs/renovate/fastify-static-2.x
chore(deps): update dependency fastify-static to v2.7.0
2020-04-21 09:06:46 +02:00
Kamil Mysliwiec
387f918973 Merge pull request #4645 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.10
2020-04-21 09:04:45 +02:00
Renovate Bot
11794b99c0 fix(deps): update dependency mongoose to v5.9.10 2020-04-20 22:02:07 +00:00
Renovate Bot
4a14444088 chore(deps): update dependency fastify-static to v2.7.0 2020-04-20 21:11:46 +00:00
Renovate Bot
44a23593aa chore(deps): update dependency ts-node to v8.9.0 2020-04-20 20:55:30 +00:00
Kamil Mysliwiec
e84d90ae86 Merge pull request #4638 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.3
2020-04-20 20:42:03 +02:00
Kamil Mysliwiec
e7ee336b8c Merge pull request #4637 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.3
2020-04-20 20:41:55 +02:00
Kamil Mysliwiec
7b241818a5 Merge pull request #4641 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.29.0
2020-04-20 20:40:54 +02:00
Renovate Bot
6d68283c4b chore(deps): update typescript-eslint monorepo to v2.29.0 2020-04-20 17:22:14 +00:00
Artur Nerkowski
f2726c19cb test: fix tests to make them run ootb 2020-04-20 17:04:59 +02:00
Renovate Bot
87c06eef42 fix(deps): update dependency @nestjs/swagger to v4.5.3 2020-04-20 14:54:54 +00:00
Artur Nerkowski
810bb029be feat(common): add a default-value pipe 2020-04-20 16:52:16 +02:00
Renovate Bot
e5dc2c29a5 fix(deps): update dependency @nestjs/graphql to v7.3.3 2020-04-20 14:46:34 +00:00
Kamil Mysliwiec
94a21eb683 Merge pull request #4636 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.2
2020-04-20 16:32:46 +02:00
Renovate Bot
ddb75ae335 fix(deps): update dependency @nestjs/graphql to v7.3.2 2020-04-20 11:40:13 +00:00
Kamil Mysliwiec
90506e09a6 Merge pull request #4626 from nestjs/renovate/class-validator-0.x
fix(deps): update dependency class-validator to v0.12.1
2020-04-20 11:21:44 +02:00
Kamil Mysliwiec
fc704b7cb9 Merge pull request #4635 from nestjs/renovate/nestjs-schedule-0.x
fix(deps): update dependency @nestjs/schedule to v0.3.1
2020-04-20 10:00:23 +02:00
Renovate Bot
307fbbf9df fix(deps): update dependency @nestjs/schedule to v0.3.1 2020-04-20 07:48:52 +00:00
Kamil Mysliwiec
bf09428376 Merge pull request #4620 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.1.6
2020-04-20 09:33:01 +02:00
Kamil Mysliwiec
99de33c79e Merge pull request #4625 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.18
2020-04-20 09:32:54 +02:00
Kamil Mysliwiec
017791186d Merge pull request #4624 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.12
2020-04-20 09:32:48 +02:00
Kamil Mysliwiec
f5a3269561 Merge pull request #4631 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.4.0
2020-04-20 09:32:33 +02:00
Kamil Mysliwiec
002878e091 Merge pull request #4634 from nestjs/renovate/ts-loader-7.x
chore(deps): update dependency ts-loader to v7.0.1
2020-04-20 09:23:57 +02:00
Renovate Bot
d439758319 chore(deps): update dependency ts-loader to v7.0.1 2020-04-20 05:27:29 +00:00
Renovate Bot
95f7eadd8d chore(deps): update dependency jest to v25.4.0 2020-04-19 22:26:24 +00:00
Renovate Bot
1bade34fe1 chore(deps): update dependency lint-staged to v10.1.6 2020-04-19 08:46:13 +00:00
Renovate Bot
c591059904 fix(deps): update dependency class-validator to v0.12.1 2020-04-18 12:30:33 +00:00
Renovate Bot
cf65f16ff3 chore(deps): update dependency @types/redis to v2.8.18 2020-04-17 23:21:12 +00:00
Renovate Bot
3a4b17271b chore(deps): update dependency @types/mongoose to v5.7.12 2020-04-17 23:19:38 +00:00
Kamil Mysliwiec
799ccc24d5 Merge pull request #4619 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.2
2020-04-17 14:18:04 +02:00
Renovate Bot
67bdae06e9 fix(deps): update dependency @nestjs/swagger to v4.5.2 2020-04-17 12:09:49 +00:00
Kamil Mysliwiec
33b40ff44f Merge pull request #4617 from nestjs/renovate/engine.io-client-3.x
chore(deps): update dependency engine.io-client to v3.4.1
2020-04-17 12:05:37 +02:00
Kamil Mysliwiec
fb3040f866 Merge pull request #4618 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.1
2020-04-17 12:05:27 +02:00
Renovate Bot
6c986e8c8d fix(deps): update dependency @nestjs/graphql to v7.3.1 2020-04-17 09:51:24 +00:00
Renovate Bot
f54f864b94 chore(deps): update dependency engine.io-client to v3.4.1 2020-04-17 08:52:13 +00:00
Kamil Myśliwiec
e834ec7f5f Merge branch 'master' of https://github.com/nestjs/nest 2020-04-17 10:02:38 +02:00
Kamil Myśliwiec
12de529a48 refactor(core): add missing type to the root module 2020-04-17 10:02:16 +02:00
Kamil Mysliwiec
c604ad18a9 Merge pull request #4611 from nestjs/renovate/merge-graphql-schemas-1.x
chore(deps): update dependency merge-graphql-schemas to v1.7.8
2020-04-17 09:22:55 +02:00
Kamil Mysliwiec
3ce5a028c7 Merge pull request #4616 from nestjs/renovate/ts-jest-25.x
chore(deps): update dependency ts-jest to v25.4.0
2020-04-17 08:55:43 +02:00
Renovate Bot
a2bf742111 chore(deps): update dependency ts-jest to v25.4.0 2020-04-17 06:14:32 +00:00
Sebastian Schmid
b0dc39e589 introduced GRPC channelOptions 2020-04-16 19:44:47 +02:00
Sebastian Schmid
653cc9a787 Merge branch 'master' into bugfix/grpc-options
# Conflicts:
#	packages/microservices/client/client-grpc.ts
2020-04-16 19:35:57 +02:00
Renovate Bot
18547a3879 chore(deps): update dependency merge-graphql-schemas to v1.7.8 2020-04-16 15:30:40 +00:00
Kamil Mysliwiec
50f91e798b Merge pull request #4610 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.3.0
2020-04-16 14:45:02 +02:00
Renovate Bot
95269309f8 fix(deps): update dependency @nestjs/graphql to v7.3.0 2020-04-16 12:28:07 +00:00
Kamil Mysliwiec
ac37717cc3 Merge pull request #4608 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.0.8
2020-04-16 11:14:15 +02:00
Renovate Bot
352e643c1a fix(deps): update nest monorepo to v7.0.8 2020-04-16 08:19:55 +00:00
Kamil Myśliwiec
83c2ebfcba chore(): update readme file in packages 2020-04-16 10:08:45 +02:00
Kamil Myśliwiec
edbac299c8 chore(@nestjs) publish v7.0.8 release 2020-04-16 10:07:49 +02:00
Kamil Myśliwiec
9a694cb853 fix(grpc): fix credentials options 2020-04-16 10:00:53 +02:00
Kamil Mysliwiec
2376aa43a5 Merge pull request #4604 from nestjs/renovate/apollo-graphql-packages
fix(deps): update dependency graphql-tools to v4.0.8
2020-04-16 09:27:24 +02:00
Kamil Mysliwiec
9ae9aa3059 Merge pull request #4606 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.11
2020-04-16 09:26:00 +02:00
Renovate Bot
014824121b chore(deps): update dependency @types/mongoose to v5.7.11 2020-04-15 23:51:45 +00:00
Sebastian Schmid
09ab0087af GRPC: Fix credentials and introduce arguments 2020-04-15 23:56:56 +02:00
Renovate Bot
647235f1ac fix(deps): update dependency graphql-tools to v4.0.8 2020-04-15 14:49:03 +00:00
Kamil Mysliwiec
b14b0f4376 Merge pull request #4594 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.2.4
2020-04-15 14:10:53 +02:00
Kamil Mysliwiec
7f5750660a Merge pull request #4600 from nestjs/renovate/ts-loader-7.x
chore(deps): update dependency ts-loader to v7
2020-04-15 14:10:42 +02:00
Renovate Bot
ac87ed8448 chore(deps): update dependency ts-loader to v7 2020-04-15 05:14:51 +00:00
Renovate Bot
2cd6cb9460 fix(deps): update dependency @nestjs/graphql to v7.2.4 2020-04-14 14:25:42 +00:00
Kamil Mysliwiec
e4682d537d Merge pull request #4591 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.2.3
2020-04-14 14:18:31 +02:00
Kamil Mysliwiec
e4b8e5d08e Merge pull request #4592 from nestjs/renovate/mongodb-3.x
fix(deps): update dependency mongodb to v3.5.6
2020-04-14 14:18:18 +02:00
Renovate Bot
88f7bd5583 fix(deps): update dependency @nestjs/graphql to v7.2.3 2020-04-14 12:03:17 +00:00
Renovate Bot
8b8156981a fix(deps): update dependency mongodb to v3.5.6 2020-04-14 11:53:57 +00:00
Kamil Mysliwiec
2b15735a33 Update Readme.md 2020-04-14 11:59:13 +02:00
Kamil Mysliwiec
ec0190eeaa Update Readme.md 2020-04-14 11:51:30 +02:00
Kamil Mysliwiec
571eff638d Merge pull request #4589 from nestjs/renovate/nestjs-bull-0.x
fix(deps): update dependency @nestjs/bull to v0.1.1
2020-04-14 11:31:01 +02:00
Renovate Bot
f23eba1f08 fix(deps): update dependency @nestjs/bull to v0.1.1 2020-04-14 09:19:45 +00:00
Kamil Mysliwiec
765a3191ae Merge pull request #4583 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.28.0
2020-04-14 10:21:35 +02:00
Renovate Bot
915d346855 chore(deps): update typescript-eslint monorepo to v2.28.0 2020-04-14 08:21:05 +00:00
Kamil Mysliwiec
d6e4af4b30 Merge pull request #4580 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.9
2020-04-14 10:09:21 +02:00
Kamil Mysliwiec
f729b2edd1 Merge pull request #4585 from nestjs/renovate/ws-7.x
chore(deps): update dependency @types/ws to v7.2.4
2020-04-14 10:09:06 +02:00
Renovate Bot
55c5ec8f46 chore(deps): update dependency @types/ws to v7.2.4 2020-04-13 18:59:17 +00:00
Renovate Bot
aa17f033ab fix(deps): update dependency mongoose to v5.9.9 2020-04-13 14:36:57 +00:00
Kamil Mysliwiec
cc6cfef4f0 Merge pull request #4569 from nestjs/renovate/fastify-2.x
fix(deps): update dependency fastify to v2.13.1
2020-04-13 15:24:23 +02:00
Renovate Bot
9edc6b8fe7 fix(deps): update dependency fastify to v2.13.1 2020-04-12 10:22:57 +00:00
Kamil Mysliwiec
016116a71c Update Readme.md 2020-04-10 15:43:46 +02:00
Kamil Mysliwiec
2c1407ad77 Update Readme.md 2020-04-10 15:42:40 +02:00
Kamil Mysliwiec
57435c2135 Update Readme.md 2020-04-10 14:41:31 +02:00
Kamil Mysliwiec
761d5d458a Update Readme.md 2020-04-10 14:40:52 +02:00
Kamil Mysliwiec
c0d3152492 Merge pull request #4506 from Emily-RoseSteyn/fix/#4447/non-expiring-cache
fix(common): change cache ttl decorator to set 0 value ttl
2020-04-10 13:36:36 +02:00
Kamil Mysliwiec
c007ef4025 Merge pull request #4554 from zivbar/my-fix-branch
fix(samples):  catsProvider's useFactory param type
2020-04-10 13:18:15 +02:00
Kamil Mysliwiec
e4598e484d Merge pull request #4556 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.1.3
2020-04-10 10:11:17 +02:00
Kamil Mysliwiec
2e928ca46f Merge pull request #4557 from nestjs/renovate/husky-4.x
chore(deps): update dependency husky to v4.2.5
2020-04-10 09:14:03 +02:00
Kamil Mysliwiec
0262e9fac1 Merge pull request #4558 from nestjs/renovate/core-js-3.x
chore(deps): update dependency core-js to v3.6.5
2020-04-10 09:13:56 +02:00
Kamil Mysliwiec
7dfb6ce9d7 Merge pull request #4559 from nestjs/renovate/bull-3.x
chore(deps): update dependency @types/bull to v3.12.2
2020-04-10 09:10:14 +02:00
Kamil Mysliwiec
3e7fd83e61 Merge pull request #4560 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.10
2020-04-10 09:10:09 +02:00
Kamil Mysliwiec
f12ad1bc3a Merge pull request #4561 from nestjs/renovate/express-4.x
chore(deps): update dependency @types/express to v4.17.6
2020-04-10 09:09:59 +02:00
Renovate Bot
10c8dd40d5 chore(deps): update dependency husky to v4.2.5 2020-04-09 21:43:07 +00:00
Renovate Bot
995aba763c chore(deps): update dependency @types/express to v4.17.6 2020-04-09 21:10:24 +00:00
Renovate Bot
c4e87f51f9 chore(deps): update dependency @types/mongoose to v5.7.10 2020-04-09 20:35:57 +00:00
Renovate Bot
e2674c6326 chore(deps): update dependency @types/bull to v3.12.2 2020-04-09 20:33:56 +00:00
Renovate Bot
c34e6901ae chore(deps): update dependency core-js to v3.6.5 2020-04-09 16:58:36 +00:00
Renovate Bot
d0dd846fcf chore(deps): update dependency lint-staged to v10.1.3 2020-04-09 14:19:00 +00:00
Kamil Mysliwiec
b70a5ebff9 Merge pull request #4545 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.3.0
2020-04-09 10:18:31 +02:00
Ziv Bar
005c2c4360 fixed catsProvider's useFactory param type 2020-04-09 10:57:37 +03:00
Renovate Bot
edffcc5463 chore(deps): update dependency jest to v25.3.0 2020-04-09 07:30:51 +00:00
Kamil Mysliwiec
d9e4bf47db Merge pull request #4544 from nestjs/renovate/sinon-9.x
chore(deps): update dependency sinon to v9.0.2
2020-04-09 09:04:31 +02:00
Kamil Mysliwiec
4fb7177f3b Merge pull request #4547 from nestjs/renovate/express-4.x
chore(deps): update dependency @types/express to v4.17.5
2020-04-09 09:04:19 +02:00
Kamil Mysliwiec
88aa0cef8b Merge pull request #4548 from nestjs/renovate/ts-morph-7.x
chore(deps): update dependency ts-morph to v7.0.2
2020-04-09 09:04:13 +02:00
Kamil Mysliwiec
9b11c86175 Merge pull request #4549 from nestjs/renovate/nodemon-2.x
chore(deps): update dependency nodemon to v2.0.3
2020-04-09 09:03:46 +02:00
Kamil Mysliwiec
8fde3283ac Merge pull request #4550 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.9
2020-04-09 09:03:38 +02:00
Renovate Bot
8832d15ba0 chore(deps): update dependency @types/mongoose to v5.7.9 2020-04-08 20:30:39 +00:00
Renovate Bot
515dbdb2c4 chore(deps): update dependency nodemon to v2.0.3 2020-04-08 19:00:12 +00:00
Renovate Bot
3870e1d98e chore(deps): update dependency ts-morph to v7.0.2 2020-04-08 17:33:21 +00:00
Renovate Bot
a835bf29f4 chore(deps): update dependency @types/express to v4.17.5 2020-04-08 16:53:38 +00:00
Renovate Bot
f3fc345cf2 chore(deps): update dependency sinon to v9.0.2 2020-04-08 11:46:59 +00:00
Kamil Mysliwiec
2d99ddc0a1 Merge pull request #4542 from nestjs/renovate/babel-monorepo
chore(deps): update dependency @babel/preset-env to v7.9.5
2020-04-08 08:50:27 +02:00
Kamil Mysliwiec
eebbb26de3 Merge pull request #4541 from nestjs/renovate/apollo-graphql-packages
fix(deps): update apollo graphql packages to v2.12.0
2020-04-08 08:50:09 +02:00
Renovate Bot
4dc5c7514c chore(deps): update dependency @babel/preset-env to v7.9.5 2020-04-07 19:30:34 +00:00
Renovate Bot
364085771e fix(deps): update apollo graphql packages to v2.12.0 2020-04-07 18:42:35 +00:00
Kamil Mysliwiec
9d829f5753 Merge pull request #4538 from nestjs/renovate/fast-json-stringify-2.x
fix(deps): update dependency fast-json-stringify to v2
2020-04-07 19:40:05 +02:00
Renovate Bot
8484c0c922 fix(deps): update dependency fast-json-stringify to v2 2020-04-07 10:46:44 +00:00
Kamil Mysliwiec
2ab3629a8a Merge pull request #4535 from webberwang/fix-invalid-docker-command
build(): fix invalid docker down command
2020-04-07 08:57:29 +02:00
Webber Wang
4c4242f37d build(): fix invalid docker down command
`-d` is not valid flag for `docker-compose down`
2020-04-06 15:37:53 -07:00
Emily
25a478a5a6 Changed to use isNil util 2020-04-06 22:01:22 +02:00
Kamil Mysliwiec
d4c6cfeed0 Merge pull request #4531 from FagundesFurtado/patch-1
Update nest-interceptor.interface.ts
2020-04-06 19:41:52 +02:00
Kamil Mysliwiec
4bb193f64d Merge pull request #4532 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.27.0
2020-04-06 19:39:49 +02:00
Renovate Bot
dce8d9c5e8 chore(deps): update typescript-eslint monorepo to v2.27.0 2020-04-06 17:21:06 +00:00
Cristiano Fagundes
7a7a71d911 Update nest-interceptor.interface.ts 2020-04-06 11:40:22 -03:00
Kamil Mysliwiec
956baed7cc Merge pull request #4530 from nestjs/renovate/prettier-2.x
chore(deps): update dependency prettier to v2.0.4
2020-04-06 14:29:31 +02:00
Renovate Bot
5d484c53ae chore(deps): update dependency prettier to v2.0.4 2020-04-06 12:18:37 +00:00
Kamil Mysliwiec
da4b1a3cce Merge pull request #4525 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.2.1
2020-04-06 10:26:12 +02:00
Kamil Mysliwiec
abb465d4dc Merge pull request #4528 from nestjs/renovate/prettier-2.x
chore(deps): update dependency prettier to v2.0.3
2020-04-06 10:11:27 +02:00
Renovate Bot
789f8a4b30 chore(deps): update dependency prettier to v2.0.3 2020-04-05 21:18:45 +00:00
Renovate Bot
549bb979de fix(deps): update dependency @nestjs/graphql to v7.2.1 2020-04-05 15:01:34 +00:00
Kamil Myśliwiec
1ef5fb8572 Merge branch 'master' of https://github.com/nestjs/nest 2020-04-05 16:28:45 +02:00
Kamil Myśliwiec
1a0d47a22d refactor(): small style improvements 2020-04-05 16:27:14 +02:00
Kamil Mysliwiec
fc0d73e971 Merge pull request #4519 from nestjs/renovate/fast-json-stringify-1.x
fix(deps): update dependency fast-json-stringify to v1.20.0
2020-04-05 11:51:40 +02:00
Kamil Mysliwiec
eb4e40873d Merge pull request #4520 from nestjs/renovate/ts-node-8.x
chore(deps): update dependency ts-node to v8.8.2
2020-04-05 11:51:22 +02:00
Kamil Mysliwiec
0609d6e647 Merge pull request #4522 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.1.2
2020-04-05 11:42:46 +02:00
Renovate Bot
cb944970ac chore(deps): update dependency lint-staged to v10.1.2 2020-04-05 09:22:05 +00:00
Renovate Bot
417d312692 chore(deps): update dependency ts-node to v8.8.2 2020-04-05 01:51:19 +00:00
Renovate Bot
c48b2efbfa fix(deps): update dependency fast-json-stringify to v1.20.0 2020-04-04 22:36:07 +00:00
Kamil Mysliwiec
fad533ba4d Merge pull request #4515 from nestjs/renovate/pin-dependencies
chore(deps): pin dependencies
2020-04-04 12:40:04 +02:00
Renovate Bot
430e9cf8b3 chore(deps): pin dependencies 2020-04-04 10:38:54 +00:00
Kamil Myśliwiec
f77d1df06b feat(): update to the latest version of graphql 2020-04-04 12:35:28 +02:00
Kamil Mysliwiec
814b3b58e6 Merge pull request #4514 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.2.0
2020-04-04 11:54:51 +02:00
Kamil Mysliwiec
a998251239 Merge pull request #4513 from nestjs/renovate/fast-json-stringify-1.x
fix(deps): update dependency fast-json-stringify to v1.19.0
2020-04-04 11:54:04 +02:00
Renovate Bot
9f19643924 fix(deps): update dependency @nestjs/graphql to v7.2.0 2020-04-04 09:27:08 +00:00
Kamil Mysliwiec
6cba88126a Merge pull request #4503 from nestjs/renovate/nyc-15.x
chore(deps): update dependency nyc to v15.0.1
2020-04-04 11:19:22 +02:00
Renovate Bot
f400673401 fix(deps): update dependency fast-json-stringify to v1.19.0 2020-04-04 09:02:57 +00:00
Kamil Mysliwiec
fbcb1c44a4 Merge pull request #4504 from nestjs/renovate/handlebars-4.x
fix(deps): update dependency handlebars to v4.7.6
2020-04-04 10:55:04 +02:00
Kamil Mysliwiec
e21a71568a Merge pull request #4512 from nestjs/renovate/sequelize-5.x
fix(deps): update dependency sequelize to v5.21.6
2020-04-04 10:54:58 +02:00
Kamil Mysliwiec
4396820aab Merge pull request #4507 from nestjs/renovate/jest-25.x
chore(deps): update dependency @types/jest to v25.2.1
2020-04-04 10:48:39 +02:00
Kamil Mysliwiec
5a507d4293 Merge pull request #4510 from nestjs/renovate/hbs-4.x
fix(deps): update dependency hbs to v4.1.1
2020-04-04 10:48:28 +02:00
Renovate Bot
82c9ce272c fix(deps): update dependency sequelize to v5.21.6 2020-04-04 08:45:07 +00:00
Renovate Bot
3b0e266084 fix(deps): update dependency hbs to v4.1.1 2020-04-04 03:50:43 +00:00
Renovate Bot
65f6c5fe51 chore(deps): update dependency @types/jest to v25.2.1 2020-04-03 21:26:40 +00:00
Emily
d68bb4a9db fix(common): change cache ttl decorator to set 0 value ttl
When used, @CacheTTL(0) will set no TTL on endpoint

Closes #4447
2020-04-03 22:05:58 +02:00
Renovate Bot
ada8808742 fix(deps): update dependency handlebars to v4.7.6 2020-04-03 18:09:49 +00:00
Renovate Bot
269b01d449 chore(deps): update dependency nyc to v15.0.1 2020-04-03 16:51:19 +00:00
Kamil Mysliwiec
e06915f148 Merge pull request #4502 from nestjs/renovate/ts-jest-25.x
chore(deps): update dependency ts-jest to v25.3.1
2020-04-03 18:08:50 +02:00
Renovate Bot
c0ecc34881 chore(deps): update dependency ts-jest to v25.3.1 2020-04-03 15:31:57 +00:00
Kamil Mysliwiec
94f52fc741 Merge pull request #4500 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.2.7
2020-04-03 10:37:45 +02:00
Renovate Bot
c6039a326f chore(deps): update dependency jest to v25.2.7 2020-04-03 08:24:41 +00:00
Kamil Mysliwiec
7f58fc6d85 Merge pull request #4498 from nestjs/renovate/rxjs-compat-6.x
chore(deps): update dependency rxjs-compat to v6.5.5
2020-04-03 09:09:12 +02:00
Kamil Mysliwiec
19d459aded Merge pull request #4494 from nestjs/renovate/handlebars-4.x
fix(deps): update dependency handlebars to v4.7.5
2020-04-03 09:08:35 +02:00
Kamil Mysliwiec
f153d5f6bb Merge pull request #4499 from nestjs/renovate/rxjs-6.x
fix(deps): update dependency rxjs to v6.5.5
2020-04-03 09:06:50 +02:00
Renovate Bot
89321242cc fix(deps): update dependency rxjs to v6.5.5 2020-04-03 01:51:25 +00:00
Renovate Bot
46318a7514 chore(deps): update dependency rxjs-compat to v6.5.5 2020-04-03 01:42:09 +00:00
Renovate Bot
6757530709 fix(deps): update dependency handlebars to v4.7.5 2020-04-02 19:16:05 +00:00
Kamil Mysliwiec
640bf671ff Merge pull request #4492 from nestjs/renovate/merge-graphql-schemas-1.x
chore(deps): update dependency merge-graphql-schemas to v1.7.7
2020-04-02 20:15:13 +02:00
Kamil Mysliwiec
4945764719 Merge pull request #4493 from nestjs/renovate/jest-25.x
chore(deps): update dependency @types/jest to v25.1.5
2020-04-02 20:15:01 +02:00
Renovate Bot
fed0f75565 chore(deps): update dependency @types/jest to v25.1.5 2020-04-02 17:08:57 +00:00
Renovate Bot
5fcbd1a59b chore(deps): update dependency merge-graphql-schemas to v1.7.7 2020-04-02 15:53:04 +00:00
Kamil Mysliwiec
150a763c05 Merge pull request #4488 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.2.6
2020-04-02 13:29:14 +02:00
Renovate Bot
4870a55adb chore(deps): update dependency jest to v25.2.6 2020-04-02 10:59:28 +00:00
Kamil Mysliwiec
e35016ce7c Merge pull request #4482 from nestjs/renovate/handlebars-4.x
fix(deps): update dependency handlebars to v4.7.4
2020-04-02 09:14:28 +02:00
Kamil Mysliwiec
52da4bb224 Merge pull request #4483 from nestjs/renovate/grpc-proto-loader-0.x
fix(deps): update dependency @grpc/proto-loader to v0.5.4
2020-04-02 09:06:00 +02:00
Renovate Bot
173dffe37c fix(deps): update dependency @grpc/proto-loader to v0.5.4 2020-04-01 18:50:08 +00:00
Renovate Bot
55c737e305 fix(deps): update dependency handlebars to v4.7.4 2020-04-01 17:26:11 +00:00
Kamil Mysliwiec
76ff1016da Merge pull request #4474 from nestjs/renovate/express-4.x
chore(deps): update dependency @types/express to v4.17.4
2020-04-01 08:40:20 +02:00
Kamil Mysliwiec
7c7125ac7f Merge pull request #4475 from nestjs/renovate/sinon-9.x
chore(deps): update dependency @types/sinon to v9
2020-04-01 08:40:12 +02:00
Kamil Mysliwiec
58eb602c09 Merge pull request #4473 from nestjs/renovate/uuid-7.x
fix(deps): update dependency uuid to v7.0.3
2020-04-01 08:39:58 +02:00
Renovate Bot
e936dd0da0 chore(deps): update dependency @types/sinon to v9 2020-03-31 23:45:14 +00:00
Renovate Bot
3f456f09b1 chore(deps): update dependency @types/express to v4.17.4 2020-03-31 23:32:55 +00:00
Renovate Bot
09f87ac0d4 fix(deps): update dependency uuid to v7.0.3 2020-03-31 19:48:01 +00:00
Kamil Mysliwiec
37aca3d3c6 Merge pull request #4470 from nestjs/renovate/nest-monorepo
chore(deps): update dependency @nestjs/cli to v7.1.2
2020-03-31 17:43:43 +02:00
Kamil Mysliwiec
7d5ff96957 Merge pull request #4472 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.1.1
2020-03-31 17:43:28 +02:00
Kamil Mysliwiec
4f91f18f3c Merge pull request #4471 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.1.5
2020-03-31 17:42:39 +02:00
Renovate Bot
3fe047ca55 chore(deps): update dependency lint-staged to v10.1.1 2020-03-31 14:16:33 +00:00
Renovate Bot
6cf3f468c3 fix(deps): update dependency @nestjs/graphql to v7.1.5 2020-03-31 13:29:52 +00:00
Renovate Bot
8dff04260c chore(deps): update dependency @nestjs/cli to v7.1.2 2020-03-31 13:25:09 +00:00
Kamil Myśliwiec
661370e3e8 sample(): update grpc sample (missing interface) 2020-03-31 09:48:41 +02:00
Kamil Mysliwiec
e57f4a6b28 Merge pull request #4463 from nestjs/renovate/typescript-eslint-monorepo
chore(deps): update typescript-eslint monorepo to v2.26.0
2020-03-31 09:23:47 +02:00
Kamil Mysliwiec
1d852b2ebf Merge pull request #4460 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.1.0
2020-03-31 09:23:40 +02:00
Kamil Mysliwiec
fc5d61b357 Merge pull request #4462 from nestjs/renovate/mongoose-5.x
fix(deps): update dependency mongoose to v5.9.7
2020-03-31 09:22:52 +02:00
Renovate Bot
e58a1efe3d chore(deps): update typescript-eslint monorepo to v2.26.0 2020-03-30 17:21:55 +00:00
Renovate Bot
616cb19832 fix(deps): update dependency mongoose to v5.9.7 2020-03-30 16:23:22 +00:00
Renovate Bot
3510629672 chore(deps): update dependency lint-staged to v10.1.0 2020-03-30 13:44:55 +00:00
Kamil Mysliwiec
0a84b2e59b Merge pull request #4449 from nestjs/renovate/nest-monorepo
fix(deps): update nest monorepo to v7.0.7
2020-03-30 09:36:33 +02:00
Renovate Bot
def30207ae fix(deps): update nest monorepo to v7.0.7 2020-03-30 06:57:58 +00:00
Kamil Mysliwiec
c377a19f15 Merge pull request #4455 from nestjs/renovate/ts-jest-25.x
chore(deps): update dependency ts-jest to v25.3.0
2020-03-30 08:39:56 +02:00
Kamil Mysliwiec
4eb449dd3d Merge pull request #4450 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.1.4
2020-03-30 08:34:16 +02:00
Kamil Mysliwiec
41b7f58bb3 Merge pull request #4451 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.2.4
2020-03-30 08:34:06 +02:00
Kamil Mysliwiec
0d13d2ef32 Merge pull request #4452 from nestjs/renovate/point-of-view-3.x
fix(deps): update dependency point-of-view to v3.8.0
2020-03-30 08:33:59 +02:00
Renovate Bot
f3d2b0c2f5 chore(deps): update dependency ts-jest to v25.3.0 2020-03-30 06:32:47 +00:00
Renovate Bot
3bc1c93bee fix(deps): update dependency point-of-view to v3.8.0 2020-03-29 20:13:34 +00:00
Renovate Bot
c62d9817c7 chore(deps): update dependency jest to v25.2.4 2020-03-29 19:59:30 +00:00
Renovate Bot
c19acf05ec fix(deps): update dependency @nestjs/graphql to v7.1.4 2020-03-29 18:14:29 +00:00
Kamil Myśliwiec
72ed4b595e chore(@nestjs) publish v7.0.7 release 2020-03-29 19:39:23 +02:00
Kamil Mysliwiec
f74375baa8 Merge pull request #4445 from danielscw/fix/multi-package-client-new
fix(microservices): multi package client getService error
2020-03-29 19:35:48 +02:00
Kamil Mysliwiec
7ac6624a3c Merge pull request #4446 from nestjs/renovate/lint-staged-10.x
chore(deps): update dependency lint-staged to v10.0.10
2020-03-29 18:41:52 +02:00
Renovate Bot
26b266048e chore(deps): update dependency lint-staged to v10.0.10 2020-03-29 13:26:01 +00:00
Kamil Mysliwiec
e5a4bb66f4 Merge pull request #4438 from nestjs/renovate/mongoose-5.x
chore(deps): update dependency @types/mongoose to v5.7.8
2020-03-29 14:12:58 +02:00
Kamil Mysliwiec
793b991621 Merge pull request #4441 from virkt25/patch-1
chore(common): add missing iterare dependency
2020-03-29 13:50:09 +02:00
Kamil Mysliwiec
1fc4833c06 Merge pull request #4434 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.1.3
2020-03-29 13:43:50 +02:00
Kamil Mysliwiec
f92ccae9d4 Merge pull request #4437 from nestjs/renovate/redis-2.x
chore(deps): update dependency @types/redis to v2.8.17
2020-03-29 13:43:43 +02:00
Renovate Bot
73094c3b43 chore(deps): update dependency @types/mongoose to v5.7.8 2020-03-29 11:41:07 +00:00
Kamil Mysliwiec
51b18db412 Merge pull request #4440 from nestjs/renovate/fastify-cors-3.x
fix(deps): update dependency fastify-cors to v3.0.3
2020-03-29 13:37:58 +02:00
Kamil Mysliwiec
f53cc505f1 Merge pull request #4442 from nestjs/renovate/ts-morph-7.x
chore(deps): update dependency ts-morph to v7.0.1
2020-03-29 13:37:22 +02:00
Renovate Bot
5ed98e220c chore(deps): update dependency ts-morph to v7.0.1 2020-03-29 11:17:50 +00:00
Kamil Mysliwiec
142a2e9113 Merge pull request #4443 from nestjs/renovate/eslint-plugin-import-2.x
chore(deps): update dependency eslint-plugin-import to v2.20.2
2020-03-29 13:14:30 +02:00
danielscw
a5bcb21388 test(microservice): update integration test for multi-package grpc 2020-03-29 15:46:11 +08:00
danielscw
0b38029830 fix(microservices): fix get service from multi package grpc client error
Calling getService of grpc clients with multiple packages shows error
'Channel third argument (options) must be an object with string keys
and integer or string values'. Which is caused by passing options with
GrpcOptions['options'] format to grpc client's constructor.
As the options are transformed and kept in 'maxMessageLengthOptions' and
'keepaliveOptions', we can remove and skip passing ClientGrpcProxy's
options to node grpc Client's constructor.
2020-03-29 15:43:32 +08:00
Renovate Bot
0a94d65490 chore(deps): update dependency eslint-plugin-import to v2.20.2 2020-03-29 04:43:58 +00:00
Taranveer Virk
691383c0a2 chore(common): add missing iterare dependency 2020-03-28 20:37:59 -04:00
Renovate Bot
8e6b6fa969 fix(deps): update dependency fastify-cors to v3.0.3 2020-03-28 14:55:02 +00:00
Kamil Mysliwiec
6135b623a0 Merge pull request #4439 from nestjs/renovate/nest-monorepo
chore(deps): update dependency @nestjs/cli to v7.1.1
2020-03-27 20:30:26 +01:00
Renovate Bot
e743162482 chore(deps): update dependency @nestjs/cli to v7.1.1 2020-03-27 18:01:58 +00:00
Renovate Bot
522ae200b5 chore(deps): update dependency @types/redis to v2.8.17 2020-03-27 16:00:19 +00:00
Renovate Bot
296e1aecf7 fix(deps): update dependency @nestjs/graphql to v7.1.3 2020-03-27 11:02:44 +00:00
Kamil Mysliwiec
7076aa46ee Merge pull request #4430 from nestjs/renovate/nest-monorepo
chore(deps): update nest monorepo
2020-03-27 09:12:41 +01:00
Renovate Bot
38a0610d38 chore(deps): update nest monorepo 2020-03-27 08:07:19 +00:00
Kamil Mysliwiec
e060888d37 Merge pull request #4431 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.2.3
2020-03-27 08:29:18 +01:00
Renovate Bot
6562f9faab chore(deps): update dependency jest to v25.2.3 2020-03-26 21:05:56 +00:00
Kamil Myśliwiec
abb4471d64 chore(): publish 7.0.5 version 2020-03-26 18:14:09 +01:00
Kamil Myśliwiec
134ef15093 chore(@nestjs) publish v7.0.6 release 2020-03-26 17:56:43 +01:00
Kamil Myśliwiec
4ebe4504b9 Merge branch 'master' of https://github.com/nestjs/nest 2020-03-26 17:53:02 +01:00
Kamil Myśliwiec
95b904efee Merge branch 'seclace-feat/nested_validation' 2020-03-26 17:52:57 +01:00
Kamil Myśliwiec
b039ac9f6d test(common): add test for flattening children errors (validation) 2020-03-26 17:52:39 +01:00
Kamil Mysliwiec
605e5baf58 Merge pull request #4429 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.2.2
2020-03-26 17:30:09 +01:00
Renovate Bot
263b38e302 chore(deps): update dependency jest to v25.2.2 2020-03-26 16:15:52 +00:00
Kamil Mysliwiec
9cba17d040 Merge pull request #4334 from cojack/feat/iterate-over-everything
Feat/iterate over everything
2020-03-26 17:01:47 +01:00
Kamil Mysliwiec
16b593765b Merge branch 'master' into feat/iterate-over-everything 2020-03-26 16:05:43 +01:00
Kamil Mysliwiec
15f3ee9ad6 Merge pull request #4427 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.1.1
2020-03-26 15:51:28 +01:00
Kamil Myśliwiec
e4a8cfbfa9 Merge branch 'Dominic-Preap-master' 2020-03-26 15:50:40 +01:00
Kamil Mysliwiec
749ab49153 Merge pull request #4404 from Dominic-Preap/master
feat(common): add exception code option in validation pipe
2020-03-26 14:22:36 +01:00
Renovate Bot
8fad078b5c fix(deps): update dependency @nestjs/graphql to v7.1.1 2020-03-26 13:18:14 +00:00
Kamil Mysliwiec
9d87d17ae3 Merge pull request #4230 from dot-i/add-grpc-max-metadata-option
feat(microservices): implement server grpc max metadata size option
2020-03-26 14:11:09 +01:00
Kamil Mysliwiec
b417928177 Merge pull request #4424 from nestjs/renovate/jest-monorepo
chore(deps): update dependency jest to v25.2.1
2020-03-26 14:10:12 +01:00
Kamil Mysliwiec
75799a31dc Merge pull request #4425 from nestjs/renovate/nestjs-graphql-7.x
fix(deps): update dependency @nestjs/graphql to v7.1.0
2020-03-26 14:10:06 +01:00
Kamil Mysliwiec
fb194199ad Merge pull request #4426 from nestjs/renovate/nestjs-swagger-4.x
fix(deps): update dependency @nestjs/swagger to v4.5.1
2020-03-26 14:10:01 +01:00
Renovate Bot
e9dcd8fc84 fix(deps): update dependency @nestjs/swagger to v4.5.1 2020-03-26 12:21:11 +00:00
Renovate Bot
93313f505a fix(deps): update dependency @nestjs/graphql to v7.1.0 2020-03-26 09:59:26 +00:00
Renovate Bot
05b3dee522 chore(deps): update dependency jest to v25.2.1 2020-03-26 09:48:15 +00:00
Nico Francois
4b3d476571 feat(microservices): implement server grpc max metadata size option 2020-03-24 16:35:32 +01:00
cojack
0168673d45 refactor(microservices): Revert contact scoped filters to external step 2020-03-23 15:40:39 +01:00
cojack
333677f009 refactor(core): Revert contact scoped filters to external step 2020-03-23 15:40:15 +01:00
Vadim Goldenko
70b7813915 feat(common): prepend nested validation errors with parent prop 2020-03-20 16:41:55 +03:00
Vadim Goldenko
41381dcd42 feat(common): add nested validation errors parse 2020-03-20 15:58:36 +03:00
cojack
d6bc71ddd4 chore(core): Refactor filterMiddleware to use iterare 2020-03-18 12:22:25 +01:00
cojack
47fd693e15 chore(core): refactor middleware builder to use iterare 2020-03-18 12:21:07 +01:00
cojack
6f1675f594 fix(websockets): Switch order to concat globalFilter at the end 2020-03-18 11:55:19 +01:00
cojack
8d809c56ea chore(websockets): change default import of iterate from iterare 2020-03-17 12:23:56 +01:00
cojack
e0dc092745 chore(core): change default import of iterate from iterare to explicit 2020-03-17 12:21:20 +01:00
cojack
cf44f1ab2c feat(websockets): use iterate to reduce number of loops 2020-03-17 10:57:07 +01:00
cojack
08559a1bbc feat(common): use iterate to reduce number of loops 2020-03-17 10:56:51 +01:00
cojack
182792ef24 feat(microservices): use iterate to reduce number of loops 2020-03-17 10:53:57 +01:00
cojack
4b7dcd6b2c feat(core): use iterate to reduce number of loops 2020-03-17 10:43:58 +01:00
272 changed files with 124037 additions and 78869 deletions

View File

@@ -70,10 +70,10 @@ jobs:
docker:
- image: circleci/node:10
test_node_8:
test_node_14:
<<: *unit-tests-template
docker:
- image: circleci/node:8
- image: circleci/node:14
lint:
working_directory: ~/nest
@@ -160,15 +160,15 @@ workflows:
build-and-test:
jobs:
- build
- test_node_14:
requires:
- build
- test_node_12:
requires:
- build
- test_node_10:
requires:
- build
- test_node_8:
requires:
- build
- lint:
requires:
- build

View File

@@ -19,6 +19,8 @@ module.exports = {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
},
};

54
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: "CodeQL"
on:
push:
branches: [master, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 17 * * 4'
jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

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

View File

@@ -38,6 +38,14 @@ Nest is a framework for building efficient, scalable <a href="http://nodejs.org"
* To check out the [guide](https://docs.nestjs.com), visit [docs.nestjs.com](https://docs.nestjs.com). :books:
* 要查看中文 [指南](readme_zh.md), 请访问 [docs.nestjs.cn](https://docs.nestjs.cn). :books:
## Questions
For questions and support please use the official [Discord channel](https://discord.gg/G7Qnnhy). The issue list of this repo is **exclusively** for bug reports and feature requests.
## Issues
Please make sure to read the [Issue Reporting Checklist](https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md#-submitting-an-issue) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
## 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://enterprise.nestjs.com).
@@ -46,32 +54,43 @@ With official support, you can get expert help straight from Nest core team. We
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
#### Principal Sponsor
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
#### Principal Sponsors
<table style="text-align:center;"><tr><td>
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
</tr></table>
#### Silver Sponsors
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> &nbsp;
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" height="95" /></a> &nbsp;
<a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="150" valign="middle" /></a> &nbsp;
<a href="http://www.leogistics.com" target="_blank"><img src="https://nestjs.com/img/leogistics-logo.jpeg" width="150" valign="middle" /></a>
<table style="text-align:center;"><tr><td>
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> </td><td>
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" width="100" /></a> </td><td>
<a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="170" valign="middle" /></a> </td><td>
<a href="http://www.leogistics.com" target="_blank"><img src="https://nestjs.com/img/leogistics-logo.jpeg" width="150" valign="middle" /></td></tr></table>
#### Sponsors
<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://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="27" 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://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> &nbsp;
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a>
<table><tr><td align="center" valign="middle">
<a href="https://www.swingdev.io" target="_blank"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="110" valign="middle" /> </a></td><td align="center" valign="middle">
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://ever.co/" target="_blank"><img src="https://nestjs.com/img/ever-logo.png" width="72" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" width="125" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" width="100" valign="middle" /></a> </td></tr><tr><td align="center" valign="middle">
<a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" width="95" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" width="107" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" width="71" valign="middle" /></a></td><td align="center" valign="middle">
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="100" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="75" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="120" valign="middle" /></a></td></tr><tr><td align="center" valign="middle">
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td>
<td align="center" valign="middle">
<a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" width="97" valign="middle" /></a> </td></tr>
<tr><td align="center" valign="middle"><a href="https://sanyodigital.com/" target="_blank"><img src="https://nestjs.com/img/sanyo-digital.png" width="130" valign="middle" /></a></td>
</tr></table>
## Backers

View File

@@ -23,7 +23,7 @@ services:
- "9001:9001"
restart: always
mysql:
image: mysql:5.7.29
image: mysql:5.7.31
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test

View File

@@ -2,9 +2,22 @@
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type Recipe {
id: ID!
title: String!
description: String
creationDate: Date!
ingredients: [String!]!
}
"""Date custom scalar type"""
scalar Date
type Query {
recipe(id: String!): Recipe!
recipes(skip: Int = 0, take: Int = 25): [Recipe!]!
}
type Mutation {
addRecipe(newRecipeData: NewRecipeInput!): Recipe!
removeRecipe(id: String!): Boolean!
@@ -16,19 +29,6 @@ input NewRecipeInput {
ingredients: [String!]!
}
type Query {
recipe(id: String!): Recipe!
recipes(skip: Int = 0, take: Int = 25): [Recipe!]!
}
type Recipe {
id: ID!
title: String!
description: String
creationDate: Date!
ingredients: [String!]!
}
type Subscription {
recipeAdded: Recipe!
}

View File

@@ -3,7 +3,6 @@ import {
NestFastifyApplication,
} from '@nestjs/platform-fastify';
import { Test } from '@nestjs/testing';
import { fail } from 'assert';
import { expect } from 'chai';
import { ApplicationModule } from '../src/app.module';
@@ -54,19 +53,14 @@ describe('Hello world (fastify adapter)', () => {
method: 'GET',
url: '/host',
})
.then(
({ payload }) => {
fail(`Unexpected success: ${payload}`);
},
err => {
expect(err.getResponse()).to.be.eql({
error: 'Internal Server Error',
message:
'HTTP adapter does not support filtering on host: ":tenant.example.com"',
statusCode: 500,
});
},
);
.then(({ payload }) => {
expect(JSON.parse(payload)).to.be.eql({
error: 'Internal Server Error',
message:
'HTTP adapter does not support filtering on host: ":tenant.example.com"',
statusCode: 500,
});
});
});
afterEach(async () => {

View File

@@ -19,7 +19,6 @@ class TestController {
}
@Get('tests/wildcard_nested')
// eslint-disable-next-line @typescript-eslint/camelcase
wildcard_nested() {
return RETURN_VALUE;
}

View File

@@ -21,7 +21,6 @@ class TestController {
}
@Get('tests/wildcard_nested')
// eslint-disable-next-line @typescript-eslint/camelcase
wildcard_nested() {
return RETURN_VALUE;
}

View File

@@ -0,0 +1,34 @@
import { Scope } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
import { Test, TestingModule } from '@nestjs/testing';
import { expect } from 'chai';
import { ScopedModule, STATIC_FACTORY } from '../src/scoped/scoped.module';
import { ScopedService } from '../src/scoped/scoped.service';
import { TransientService } from '../src/scoped/transient.service';
describe('Providers introspection', () => {
let testingModule: TestingModule;
let moduleRef: ModuleRef;
beforeEach(async () => {
testingModule = await Test.createTestingModule({
imports: [ScopedModule],
}).compile();
moduleRef = testingModule.get(ModuleRef);
});
it('should properly introspect a transient provider', async () => {
const introspectionResult = moduleRef.introspect(TransientService);
expect(introspectionResult.scope).to.be.equal(Scope.TRANSIENT);
});
it('should properly introspect a singleton provider', async () => {
const introspectionResult = moduleRef.introspect(STATIC_FACTORY);
expect(introspectionResult.scope).to.be.equal(Scope.DEFAULT);
});
it('should properly introspect a request-scoped provider', async () => {
const introspectionResult = moduleRef.introspect(ScopedService);
expect(introspectionResult.scope).to.be.equal(Scope.REQUEST);
});
});

View File

@@ -3,9 +3,15 @@ import { InvalidClassScopeException } from '@nestjs/core/errors/exceptions/inval
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 {
REQUEST_SCOPED_FACTORY,
ScopedModule,
STATIC_FACTORY,
TRANSIENT_SCOPED_FACTORY,
} from '../src/scoped/scoped.module';
import { ScopedService } from '../src/scoped/scoped.service';
import { TransientService } from '../src/scoped/transient.service';
import { Transient3Service } from '../src/scoped/transient3.service';
describe('Scoped Instances', () => {
let testingModule: TestingModule;
@@ -20,20 +26,47 @@ describe('Scoped Instances', () => {
const contextId = createContextId();
const transient1 = await testingModule.resolve(TransientService, contextId);
const transient2 = await testingModule.resolve(TransientService, contextId);
const transientFactory = await testingModule.resolve(
TRANSIENT_SCOPED_FACTORY,
);
expect(transient1).to.be.instanceOf(TransientService);
expect(transient2).to.be.instanceOf(TransientService);
expect(transient1).to.be.equal(transient2);
expect(transientFactory).to.be.true;
});
it('should dynamically resolve nested transient provider', async () => {
const contextId = createContextId();
const transientTwoDepthLevel = await testingModule.resolve(
TransientService,
contextId,
);
const transientThreeDepthLevel = await testingModule.resolve(
Transient3Service,
contextId,
);
expect(transientTwoDepthLevel.svc.logger).to.not.be.undefined;
expect(transientThreeDepthLevel.svc.svc.logger).to.not.be.undefined;
});
it('should dynamically resolve request-scoped provider', async () => {
const request1 = await testingModule.resolve(ScopedService);
const request2 = await testingModule.resolve(ScopedService);
const request3 = await testingModule.resolve(ScopedService, { id: 1 });
const ctxId = { id: 1 };
const requestProvider = { host: 'localhost' };
testingModule.registerRequestByContextId(requestProvider, ctxId);
const request3 = await testingModule.resolve(ScopedService, ctxId);
const requestFactory = await testingModule.resolve(REQUEST_SCOPED_FACTORY);
expect(request1).to.be.instanceOf(ScopedService);
expect(request2).to.be.instanceOf(ScopedService);
expect(request3).to.not.be.equal(request2);
expect(requestFactory).to.be.true;
expect(request3.request).to.be.equal(requestProvider);
});
it('should dynamically resolve request-scoped controller', async () => {
@@ -46,11 +79,19 @@ describe('Scoped Instances', () => {
expect(request3).to.not.be.equal(request2);
});
it('should throw an exception when "get()" method is used', async () => {
it('should throw an exception when "get()" method is used for scoped providers', () => {
try {
testingModule.get(ScopedController);
} catch (err) {
expect(err).to.be.instanceOf(InvalidClassScopeException);
}
});
it('should throw an exception when "resolve()" method is used for static providers', async () => {
try {
await testingModule.resolve(STATIC_FACTORY);
} catch (err) {
expect(err).to.be.instanceOf(InvalidClassScopeException);
}
});
});

View File

@@ -1,11 +1,35 @@
import { Module } from '@nestjs/common';
import { Module, Scope } from '@nestjs/common';
import { ScopedController } from './scoped.controller';
import { ScopedService } from './scoped.service';
import { TransientService } from './transient.service';
import { Transient2Service } from './transient2.service';
import { Transient3Service } from './transient3.service';
export const STATIC_FACTORY = 'STATIC_FACTORY';
export const REQUEST_SCOPED_FACTORY = 'REQUEST_SCOPED_FACTORY';
export const TRANSIENT_SCOPED_FACTORY = 'TRANSIENT_SCOPED_FACTORY';
@Module({
controllers: [ScopedController],
providers: [ScopedService, TransientService, Transient2Service],
providers: [
ScopedService,
TransientService,
Transient2Service,
Transient3Service,
{
provide: STATIC_FACTORY,
useFactory: () => true,
},
{
provide: REQUEST_SCOPED_FACTORY,
useFactory: () => true,
scope: Scope.REQUEST,
},
{
provide: TRANSIENT_SCOPED_FACTORY,
useFactory: () => true,
scope: Scope.TRANSIENT,
},
],
})
export class ScopedModule {}

View File

@@ -1,4 +1,7 @@
import { Injectable, Scope } from '@nestjs/common';
import { Inject, Injectable, Scope } from '@nestjs/common';
import { REQUEST } from '@nestjs/core';
@Injectable({ scope: Scope.REQUEST })
export class ScopedService {}
export class ScopedService {
constructor(@Inject(REQUEST) public readonly request) {}
}

View File

@@ -3,5 +3,5 @@ import { Transient2Service } from './transient2.service';
@Injectable({ scope: Scope.TRANSIENT })
export class TransientService {
constructor(private readonly svc: Transient2Service) {}
constructor(public readonly svc: Transient2Service) {}
}

View File

@@ -1,4 +1,6 @@
import { Injectable, Scope } from '@nestjs/common';
import { Injectable, Logger, Scope } from '@nestjs/common';
@Injectable({ scope: Scope.TRANSIENT })
export class Transient2Service {}
export class Transient2Service {
logger = new Logger();
}

View File

@@ -0,0 +1,7 @@
import { Injectable, Scope } from '@nestjs/common';
import { TransientService } from './transient.service';
@Injectable({ scope: Scope.TRANSIENT })
export class Transient3Service {
constructor(public readonly svc: TransientService) {}
}

View File

@@ -25,8 +25,11 @@ describe('GRPC transport', () => {
app.connectMicroservice({
transport: Transport.GRPC,
options: {
package: 'math',
protoPath: join(__dirname, '../src/grpc/math.proto'),
package: ['math', 'math2'],
protoPath: [
join(__dirname, '../src/grpc/math.proto'),
join(__dirname, '../src/grpc/math2.proto'),
],
},
});
// Start gRPC microservice
@@ -47,7 +50,19 @@ describe('GRPC transport', () => {
it(`GRPC Sending and Receiving HTTP POST`, () => {
return request(server)
.post('/')
.post('/sum')
.send([1, 2, 3, 4, 5])
.expect(200, { result: 15 });
});
it(`GRPC Sending and Receiving HTTP POST (multiple proto)`, async () => {
await request(server)
.post('/multi/sum')
.send([1, 2, 3, 4, 5])
.expect(200, { result: 15 });
await request(server)
.post('/multi/sum2')
.send([1, 2, 3, 4, 5])
.expect(200, { result: 15 });
});

View File

@@ -50,6 +50,20 @@ describe('RPC transport', () => {
.expect(200, '15');
});
it(`/POST (useFactory client)`, () => {
return request(server)
.post('/useFactory?command=sum')
.send([1, 2, 3, 4, 5])
.expect(200, '15');
});
it(`/POST (useClass client)`, () => {
return request(server)
.post('/useClass?command=sum')
.send([1, 2, 3, 4, 5])
.expect(200, '15');
});
it(`/POST (concurrent)`, () => {
return request(server)
.post('/concurrent')

View File

@@ -1,4 +1,11 @@
import { Body, Controller, HttpCode, Post, Query } from '@nestjs/common';
import {
Body,
Controller,
HttpCode,
Inject,
Post,
Query,
} from '@nestjs/common';
import {
Client,
ClientProxy,
@@ -11,6 +18,10 @@ import { scan } from 'rxjs/operators';
@Controller()
export class AppController {
constructor(
@Inject('USE_CLASS_CLIENT') private useClassClient: ClientProxy,
@Inject('USE_FACTORY_CLIENT') private useFactoryClient: ClientProxy,
) {}
static IS_NOTIFIED = false;
@Client({ transport: Transport.TCP })
@@ -22,6 +33,24 @@ export class AppController {
return this.client.send<number>({ cmd }, data);
}
@Post('useFactory')
@HttpCode(200)
callWithClientUseFactory(
@Query('command') cmd,
@Body() data: number[],
): Observable<number> {
return this.useFactoryClient.send<number>({ cmd }, data);
}
@Post('useClass')
@HttpCode(200)
callWithClientUseClass(
@Query('command') cmd,
@Body() data: number[],
): Observable<number> {
return this.useClassClient.send<number>({ cmd }, data);
}
@Post('stream')
@HttpCode(200)
stream(@Body() data: number[]): Observable<number> {

View File

@@ -1,7 +1,59 @@
import { Module } from '@nestjs/common';
import { Module, Injectable } from '@nestjs/common';
import { AppController } from './app.controller';
import {
ClientsModule,
Transport,
ClientsModuleOptionsFactory,
ClientOptions,
} from '@nestjs/microservices';
@Injectable()
class ConfigService {
private readonly config = {
transport: Transport.TCP,
};
get(key: string) {
return this.config[key];
}
}
@Module({
providers: [ConfigService],
exports: [ConfigService],
})
class ConfigModule {}
@Injectable()
class ClientOptionService implements ClientsModuleOptionsFactory {
constructor(private readonly configService: ConfigService) {}
createClientOptions(): Promise<ClientOptions> | ClientOptions {
return {
transport: this.configService.get('transport'),
options: {},
};
}
}
@Module({
imports: [
ClientsModule.registerAsync([
{
imports: [ConfigModule],
name: 'USE_FACTORY_CLIENT',
useFactory: (configService: ConfigService) => ({
transport: configService.get('transport'),
options: {},
}),
inject: [ConfigService],
},
{
imports: [ConfigModule],
name: 'USE_CLASS_CLIENT',
useClass: ClientOptionService,
inject: [ConfigService],
},
]),
],
controllers: [AppController],
})
export class ApplicationModule {}

View File

@@ -31,9 +31,9 @@ export class GrpcController {
],
},
})
client2: ClientGrpc;
clientMulti: ClientGrpc;
@Post()
@Post('sum')
@HttpCode(200)
call(@Body() data: number[]): Observable<number> {
const svc = this.client.getService<any>('Math');
@@ -77,10 +77,17 @@ export class GrpcController {
});
}
@Post()
@Post('multi/sum')
@HttpCode(200)
call2(@Body() data: number[]): Observable<number> {
const svc = this.client2.getService<any>('Math2');
callMultiSum(@Body() data: number[]): Observable<number> {
const svc = this.clientMulti.getService<any>('Math');
return svc.sum({ data });
}
@Post('multi/sum2')
@HttpCode(200)
callMultiSum2(@Body() data: number[]): Observable<number> {
const svc = this.clientMulti.getService<any>('Math2');
return svc.sum2({ data });
}
}

View File

@@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "7.0.5"
"version": "7.4.2"
}

11548
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/core",
"version": "7.0.3",
"version": "7.4.0",
"description": "Modern, fast, powerful node.js web framework",
"homepage": "https://nestjs.com",
"repository": {
@@ -27,7 +27,7 @@
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec --retries 3 --require 'node_modules/reflect-metadata/Reflect.js' --exit",
"test:integration": "mocha \"integration/*/{,!(node_modules)/**/}/*.spec.ts\" --reporter spec --require ts-node/register --require 'node_modules/reflect-metadata/Reflect.js' --exit",
"test:docker:up": "docker-compose -f integration/docker-compose.yml up -d",
"test:docker:down": "docker-compose -f integration/docker-compose.yml down -d",
"test:docker:down": "docker-compose -f integration/docker-compose.yml down",
"lint": "concurrently 'npm run lint:packages' 'npm run lint:integration' 'npm run lint:spec'",
"lint:integration": "eslint 'integration/*/{,!(node_modules)/**/}/*.ts' -c '.eslintrc.spec.js' --fix",
"lint:packages": "eslint 'packages/**/**.ts' --fix --ignore-pattern 'packages/**/*.spec.ts'",
@@ -53,116 +53,117 @@
"dependencies": {
"@nuxtjs/opencollective": "0.2.2",
"axios": "0.19.2",
"class-transformer": "0.2.3",
"class-validator": "0.11.1",
"class-transformer": "0.3.1",
"class-validator": "0.12.2",
"cli-color": "2.0.0",
"cors": "2.8.5",
"express": "4.17.1",
"fast-json-stringify": "1.18.0",
"fast-json-stringify": "2.2.3",
"fast-safe-stringify": "2.0.7",
"iterare": "1.2.0",
"iterare": "1.2.1",
"object-hash": "2.0.3",
"path-to-regexp": "3.2.0",
"reflect-metadata": "0.1.13",
"rxjs": "6.5.4",
"rxjs": "6.6.0",
"socket.io": "2.3.0",
"uuid": "7.0.2",
"tslib": "1.11.1"
"uuid": "8.3.0",
"tslib": "2.0.0"
},
"devDependencies": {
"@codechecks/client": "0.1.10",
"@commitlint/cli": "8.3.5",
"@commitlint/config-angular": "8.3.4",
"@grpc/proto-loader": "0.5.3",
"@nestjs/graphql": "7.0.15",
"@nestjs/mongoose": "6.4.0",
"@nestjs/typeorm": "7.0.0",
"@commitlint/cli": "9.1.1",
"@commitlint/config-angular": "9.1.1",
"@grpc/proto-loader": "0.5.5",
"@nestjs/graphql": "7.6.0",
"@nestjs/mongoose": "7.0.2",
"@nestjs/typeorm": "7.1.0",
"@types/amqplib": "0.5.13",
"@types/bytes": "3.1.0",
"@types/cache-manager": "2.10.2",
"@types/chai": "4.2.10",
"@types/chai-as-promised": "7.1.2",
"@types/cache-manager": "2.10.3",
"@types/chai": "4.2.12",
"@types/chai-as-promised": "7.1.3",
"@types/cors": "2.8.6",
"@types/express": "4.17.3",
"@types/fastify-cors": "2.1.0",
"@types/express": "4.17.7",
"@types/gulp": "4.0.6",
"@types/kafka-node": "2.0.9",
"@types/mocha": "7.0.2",
"@types/mongoose": "5.7.7",
"@types/mocha": "8.0.0",
"@types/mongoose": "5.7.34",
"@types/node": "10.17.3",
"@types/redis": "2.8.16",
"@types/redis": "2.8.25",
"@types/reflect-metadata": "0.0.5",
"@types/sinon": "7.5.2",
"@types/socket.io": "2.1.4",
"@types/ws": "7.2.3",
"@typescript-eslint/eslint-plugin": "2.25.0",
"@typescript-eslint/parser": "2.25.0",
"@types/sinon": "9.0.4",
"@types/socket.io": "2.1.10",
"@types/ws": "7.2.6",
"@typescript-eslint/eslint-plugin": "3.7.1",
"@typescript-eslint/parser": "3.7.1",
"amqp-connection-manager": "3.2.0",
"amqplib": "0.5.5",
"apollo-server-express": "2.11.0",
"artillery": "1.6.0",
"amqplib": "0.6.0",
"apollo-server-express": "2.16.1",
"artillery": "1.6.1",
"awesome-typescript-loader": "5.2.1",
"body-parser": "1.19.0",
"bytes": "3.1.0",
"cache-manager": "3.2.1",
"cache-manager": "3.3.0",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"clang-format": "1.4.0",
"commitlint-circle": "1.0.0",
"concurrently": "5.1.0",
"conventional-changelog": "3.1.18",
"core-js": "3.6.4",
"coveralls": "3.0.11",
"concurrently": "5.2.0",
"conventional-changelog": "3.1.21",
"core-js": "3.6.5",
"coveralls": "3.1.0",
"delete-empty": "3.0.0",
"engine.io-client": "3.4.0",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-import": "2.20.1",
"engine.io-client": "3.4.3",
"eslint": "7.5.0",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.22.0",
"fancy-log": "1.3.3",
"fastify": "2.13.0",
"fastify-cors": "3.0.2",
"fastify-formbody": "3.1.0",
"fastify-multipart": "1.0.5",
"fastify-static": "2.6.0",
"graphql": "14.6.0",
"graphql-tools": "4.0.7",
"grpc": "1.24.2",
"fastify": "3.1.1",
"fastify-cors": "4.1.0",
"fastify-formbody": "4.0.3",
"fastify-multipart": "2.0.3",
"fastify-static": "3.2.0",
"graphql": "15.3.0",
"graphql-tools": "6.0.15",
"grpc": "1.24.3",
"gulp": "4.0.2",
"gulp-clang-format": "1.0.27",
"gulp-clean": "0.4.0",
"gulp-sourcemaps": "2.6.5",
"gulp-typescript": "5.0.1",
"gulp-watch": "5.0.1",
"husky": "4.2.3",
"imports-loader": "0.8.0",
"husky": "4.2.5",
"imports-loader": "1.1.0",
"json-loader": "0.5.7",
"kafkajs": "1.12.0",
"lerna": "2.11.0",
"lint-staged": "10.0.9",
"light-my-request": "4.0.1",
"lint-staged": "10.2.11",
"markdown-table": "2.0.0",
"merge-graphql-schemas": "1.7.6",
"mocha": "7.1.1",
"mongoose": "5.9.6",
"mqtt": "3.0.0",
"merge-graphql-schemas": "1.7.8",
"middie": "5.1.0",
"mocha": "8.0.1",
"mongoose": "5.9.26",
"mqtt": "4.1.0",
"multer": "1.4.2",
"mysql": "2.18.1",
"nats": "1.4.8",
"nodemon": "2.0.2",
"nyc": "15.0.0",
"prettier": "2.0.2",
"nats": "1.4.9",
"nodemon": "2.0.4",
"nyc": "15.1.0",
"point-of-view": "4.2.0",
"prettier": "2.0.5",
"redis": "3.0.2",
"rxjs-compat": "6.5.4",
"sinon": "9.0.1",
"rxjs-compat": "6.6.0",
"sinon": "9.0.2",
"sinon-chai": "3.5.0",
"socket.io-client": "2.3.0",
"subscriptions-transport-ws": "0.9.16",
"subscriptions-transport-ws": "0.9.17",
"supertest": "4.0.2",
"ts-morph": "7.0.0",
"ts-node": "8.8.1",
"typeorm": "0.2.24",
"typescript": "3.7.2",
"ts-morph": "7.1.3",
"ts-node": "8.10.2",
"typeorm": "0.2.25",
"typescript": "3.9.7",
"wrk": "1.2.0",
"ws": "7.2.3"
"ws": "7.3.1"
},
"engines": {
"node": ">= 10.13.0"
@@ -193,7 +194,7 @@
"packages/microservices/microservices-module.ts",
"packages/core/middleware/middleware-module.ts",
"packages/core/injector/module-ref.ts",
"packages/core/injector/container-scanner.ts",
"packages/core/injector/instance-links-host.ts",
"packages/common/cache/**/*",
"packages/common/serializer/**/*",
"packages/common/services/logger.service.ts"

View File

@@ -38,6 +38,14 @@ Nest is a framework for building efficient, scalable <a href="http://nodejs.org"
* To check out the [guide](https://docs.nestjs.com), visit [docs.nestjs.com](https://docs.nestjs.com). :books:
* 要查看中文 [指南](readme_zh.md), 请访问 [docs.nestjs.cn](https://docs.nestjs.cn). :books:
## Questions
For questions and support please use the official [Discord channel](https://discord.gg/G7Qnnhy). The issue list of this repo is **exclusively** for bug reports and feature requests.
## Issues
Please make sure to read the [Issue Reporting Checklist](https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md#-submitting-an-issue) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
## 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://enterprise.nestjs.com).
@@ -46,32 +54,43 @@ With official support, you can get expert help straight from Nest core team. We
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
#### Principal Sponsor
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
#### Principal Sponsors
<table style="text-align:center;"><tr><td>
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
</tr></table>
#### Silver Sponsors
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> &nbsp;
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" height="95" /></a> &nbsp;
<a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="150" valign="middle" /></a> &nbsp;
<a href="http://www.leogistics.com" target="_blank"><img src="https://nestjs.com/img/leogistics-logo.jpeg" width="150" valign="middle" /></a>
<table style="text-align:center;"><tr><td>
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> </td><td>
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" width="100" /></a> </td><td>
<a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="170" valign="middle" /></a> </td><td>
<a href="http://www.leogistics.com" target="_blank"><img src="https://nestjs.com/img/leogistics-logo.jpeg" width="150" valign="middle" /></td></tr></table>
#### Sponsors
<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://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="27" 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://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> &nbsp;
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a>
<table><tr><td align="center" valign="middle">
<a href="https://www.swingdev.io" target="_blank"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="110" valign="middle" /> </a></td><td align="center" valign="middle">
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://ever.co/" target="_blank"><img src="https://nestjs.com/img/ever-logo.png" width="72" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" width="125" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" width="100" valign="middle" /></a> </td></tr><tr><td align="center" valign="middle">
<a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" width="95" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" width="107" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" width="71" valign="middle" /></a></td><td align="center" valign="middle">
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="100" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="75" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="120" valign="middle" /></a></td></tr><tr><td align="center" valign="middle">
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td>
<td align="center" valign="middle">
<a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" width="97" valign="middle" /></a> </td></tr>
<tr><td align="center" valign="middle"><a href="https://sanyodigital.com/" target="_blank"><img src="https://nestjs.com/img/sanyo-digital.png" width="130" valign="middle" /></a></td>
</tr></table>
## Backers

View File

@@ -7,6 +7,7 @@ import {
HttpServer,
NestInterceptor,
} from '../../interfaces';
import { isNil } from '../../utils/shared.utils';
import {
CACHE_KEY_METADATA,
CACHE_MANAGER,
@@ -44,13 +45,13 @@ export class CacheInterceptor implements NestInterceptor {
}
try {
const value = await this.cacheManager.get(key);
if (value) {
if (!isNil(value)) {
return of(value);
}
return next.handle().pipe(
tap(response => {
const args = ttl ? [key, response, { ttl }] : [key, response];
const args = isNil(ttl) ? [key, response] : [key, response, { ttl }];
this.cacheManager.set(...args);
}),
);

View File

@@ -9,7 +9,7 @@ export type CustomDecorator<TKey = string> = MethodDecorator &
*
* 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`
* - `value` - metadata to be associated with `key`
*
* This metadata can be reflected using the `Reflector` class.
*

View File

@@ -5,7 +5,7 @@ import { REDIRECT_METADATA } from '../../constants';
*
* @publicApi
*/
export function Redirect(url: string, statusCode?: number): MethodDecorator {
export function Redirect(url = '', statusCode?: number): MethodDecorator {
return (
target: object,
key: string | symbol,

View File

@@ -13,7 +13,9 @@ export * from './unsupported-media-type.exception';
export * from './unprocessable-entity.exception';
export * from './internal-server-error.exception';
export * from './not-implemented.exception';
export * from './http-version-not-supported.exception';
export * from './bad-gateway.exception';
export * from './service-unavailable.exception';
export * from './gateway-timeout.exception';
export * from './im-a-teapot.exception';
export * from './precondition-failed.exception';

View File

@@ -0,0 +1,49 @@
import { HttpStatus } from '../enums/http-status.enum';
import { HttpException } from './http.exception';
/**
* Defines an HTTP exception for *Precondition Failed* type errors.
*
* @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
*
* @publicApi
*/
export class PreconditionFailedException extends HttpException {
/**
* Instantiate a `PreconditionFailedException` Exception.
*
* @example
* `throw new PreconditionFailedException()`
*
* @usageNotes
* The HTTP response status code will be 412.
* - The `objectOrError` argument defines the JSON response body or the message string.
* - The `description` argument contains a short description of the HTTP error.
*
* By default, the JSON response body contains two properties:
* - `statusCode`: this will be the value 412.
* - `message`: the string `'Precondition Failed'` by default; override this by supplying
* a string in the `objectOrError` parameter.
*
* If the parameter `objectOrError` is a string, the response body will contain an
* additional property, `error`, with a short description of the HTTP error. To override the
* entire JSON response body, pass an object instead. Nest will serialize the object
* and return it as the JSON response body.
*
* @param objectOrError string or object describing the error condition.
* @param description a short description of the HTTP error.
*/
constructor(
objectOrError?: string | object | any,
description = 'Precondition Failed',
) {
super(
HttpException.createBody(
objectOrError,
description,
HttpStatus.PRECONDITION_FAILED,
),
HttpStatus.PRECONDITION_FAILED,
);
}
}

View File

@@ -1,8 +1,9 @@
import Axios, {
AxiosInstance,
AxiosPromise,
AxiosRequestConfig,
AxiosResponse,
AxiosPromise,
CancelTokenSource,
} from 'axios';
import { Observable } from 'rxjs';
import { Inject } from '../decorators';
@@ -72,13 +73,14 @@ export class HttpService {
...args: any[]
) {
return new Observable<AxiosResponse<T>>(subscriber => {
let config = args[args.length - 1];
if (!config) {
config = {};
args[args.length - 1] = config;
const config: AxiosRequestConfig = { ...(args[args.length - 1] || {}) };
let cancelSource: CancelTokenSource;
if (!config.cancelToken) {
cancelSource = Axios.CancelToken.source();
config.cancelToken = cancelSource.token;
}
const cancelSource = Axios.CancelToken.source();
config.cancelToken = cancelSource.token;
axios(...args)
.then(res => {
subscriber.next(res);
@@ -88,7 +90,11 @@ export class HttpService {
subscriber.error(err);
});
return () => {
if (config.responseType !== 'stream') {
if (config.responseType === 'stream') {
return;
}
if (cancelSource) {
cancelSource.cancel();
}
};

View File

@@ -30,8 +30,11 @@ export {
INestApplication,
INestApplicationContext,
INestMicroservice,
IntrospectionResult,
MiddlewareConsumer,
ModuleMetadata,
NestApplicationOptions,
NestHybridApplicationOptions,
NestInterceptor,
NestMiddleware,
NestModule,

View File

@@ -10,7 +10,7 @@ import { ExecutionContext } from './execution-context.interface';
*/
export interface CallHandler<T = any> {
/**
* Returns an `Observable` reprsenting the response stream from the route
* Returns an `Observable` representing the response stream from the route
* handler.
*/
handle(): Observable<T>;

View File

@@ -54,7 +54,9 @@ export interface HttpServer<TRequest = any, TResponse = any> {
setViewEngine?(engineOrOptions: any): this;
createMiddlewareFactory(
method: RequestMethod,
): (path: string, callback: Function) => any;
):
| ((path: string, callback: Function) => any)
| Promise<(path: string, callback: Function) => any>;
getRequestHostname?(request: TRequest): string;
getRequestMethod?(request: TRequest): string;
getRequestUrl?(request: TResponse): string;
@@ -65,4 +67,5 @@ export interface HttpServer<TRequest = any, TResponse = any> {
initHttpServer(options: NestApplicationOptions): void;
close(): any;
getType(): string;
init?(): Promise<void>;
}

View File

@@ -15,12 +15,9 @@ export * from './features/pipe-transform.interface';
export * from './hooks';
export * from './http/http-server.interface';
export * from './injectable.interface';
export * from './microservices/nest-hybrid-application-options.interface';
export * from './middleware';
export * from './modules/dynamic-module.interface';
export * from './modules/forward-reference.interface';
export * from './modules/module-metadata.interface';
export * from './modules/nest-module.interface';
export * from './modules/provider.interface';
export * from './modules';
export * from './nest-application-context.interface';
export * from './nest-application-options.interface';
export * from './nest-application.interface';

View File

@@ -0,0 +1,3 @@
export interface NestHybridApplicationOptions {
inheritAppConfig?: boolean;
}

View File

@@ -1,5 +1,6 @@
export * from './dynamic-module.interface';
export * from './forward-reference.interface';
export * from './introspection-result.interface';
export * from './module-metadata.interface';
export * from './nest-module.interface';
export * from './provider.interface';

View File

@@ -0,0 +1,11 @@
import { Scope } from '../scope-options.interface';
/**
* @publicApi
*/
export interface IntrospectionResult {
/**
* Enum defining lifetime of host class or factory.
*/
scope: Scope;
}

View File

@@ -34,6 +34,15 @@ export interface INestApplicationContext {
options?: { strict: boolean },
): Promise<TResult>;
/**
* Registers the request/context object for a given context ID (DI container sub-tree).
* @returns {void}
*/
registerRequestByContextId<T = any>(
request: T,
contextId: { id: number },
): void;
/**
* Terminates the application
* @returns {Promise<void>}

View File

@@ -2,7 +2,12 @@ import { CorsOptions } from './external/cors-options.interface';
import { CanActivate } from './features/can-activate.interface';
import { NestInterceptor } from './features/nest-interceptor.interface';
import { HttpServer } from './http/http-server.interface';
import { ExceptionFilter, INestMicroservice, PipeTransform } from './index';
import {
ExceptionFilter,
INestMicroservice,
NestHybridApplicationOptions,
PipeTransform,
} from './index';
import { INestApplicationContext } from './nest-application-context.interface';
import { WebSocketAdapter } from './websockets/web-socket-adapter.interface';
@@ -80,9 +85,13 @@ export interface INestApplication extends INestApplicationContext {
* to a hybrid instance.
*
* @param {T} options Microservice options object
* @param {NestHybridApplicationOptions} hybridOptions Hybrid options object
* @returns {INestMicroservice}
*/
connectMicroservice<T extends object = any>(options: T): INestMicroservice;
connectMicroservice<T extends object = any>(
options: T,
hybridOptions?: NestHybridApplicationOptions,
): INestMicroservice;
/**
* Returns array of the microservices connected to the NestApplication.

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/common",
"version": "7.0.5",
"version": "7.4.2",
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
"author": "Kamil Mysliwiec",
"homepage": "https://nestjs.com",
@@ -19,8 +19,9 @@
"dependencies": {
"axios": "0.19.2",
"cli-color": "2.0.0",
"tslib": "1.11.1",
"uuid": "7.0.2"
"iterare": "1.2.1",
"tslib": "2.0.0",
"uuid": "8.3.0"
},
"peerDependencies": {
"reflect-metadata": "^0.1.12",

View File

@@ -0,0 +1,25 @@
import { ArgumentMetadata, Injectable, PipeTransform } from '../index';
import { isNil } from '../utils/shared.utils';
/**
* Defines the built-in DefaultValue Pipe
*
* @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes)
*
* @publicApi
*/
@Injectable()
export class DefaultValuePipe<T = any, R = any>
implements PipeTransform<T, T | R> {
constructor(private readonly defaultValue: R) {}
transform(value?: T, _metadata?: ArgumentMetadata): T | R {
if (
isNil(value) ||
(typeof value === 'number' && isNaN((value as unknown) as number))
) {
return this.defaultValue;
}
return value;
}
}

View File

@@ -1,3 +1,4 @@
export * from './default-value.pipe';
export * from './parse-array.pipe';
export * from './parse-bool.pipe';
export * from './parse-int.pipe';

View File

@@ -1,4 +1,4 @@
import iterate from 'iterare';
import { iterate } from 'iterare';
import { Optional } from '../decorators';
import { Injectable } from '../decorators/core';
import { HttpStatus } from '../enums/http-status.enum';
@@ -6,6 +6,7 @@ import { ArgumentMetadata, ValidationError } from '../index';
import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface';
import { ValidatorOptions } from '../interfaces/external/validator-options.interface';
import { PipeTransform } from '../interfaces/features/pipe-transform.interface';
import { Type } from '../interfaces/type.interface';
import {
ErrorHttpStatusCode,
HttpErrorByCode,
@@ -20,6 +21,7 @@ export interface ValidationPipeOptions extends ValidatorOptions {
errorHttpStatusCode?: ErrorHttpStatusCode;
exceptionFactory?: (errors: ValidationError[]) => any;
validateCustomDecorators?: boolean;
expectedType?: Type<any>;
}
let classValidator: any = {};
@@ -32,6 +34,7 @@ export class ValidationPipe implements PipeTransform<any> {
protected validatorOptions: ValidatorOptions;
protected transformOptions: ClassTransformOptions;
protected errorHttpStatusCode: ErrorHttpStatusCode;
protected expectedType: Type<any>;
protected exceptionFactory: (errors: ValidationError[]) => any;
protected validateCustomDecorators: boolean;
@@ -41,6 +44,7 @@ export class ValidationPipe implements PipeTransform<any> {
transform,
disableErrorMessages,
errorHttpStatusCode,
expectedType,
transformOptions,
validateCustomDecorators,
...validatorOptions
@@ -52,6 +56,7 @@ export class ValidationPipe implements PipeTransform<any> {
this.isDetailedOutputDisabled = disableErrorMessages;
this.validateCustomDecorators = validateCustomDecorators || false;
this.errorHttpStatusCode = errorHttpStatusCode || HttpStatus.BAD_REQUEST;
this.expectedType = expectedType;
this.exceptionFactory =
options.exceptionFactory || this.createExceptionFactory();
@@ -64,7 +69,7 @@ export class ValidationPipe implements PipeTransform<any> {
}
public async transform(value: any, metadata: ArgumentMetadata) {
const { metatype } = metadata;
const metatype = this.expectedType || metadata.metatype;
if (!metatype || !this.toValidate(metadata)) {
return this.isTransformEnabled
? this.transformPrimitive(value, metadata)
@@ -120,12 +125,7 @@ export class ValidationPipe implements PipeTransform<any> {
if (this.isDetailedOutputDisabled) {
return new HttpErrorByCode[this.errorHttpStatusCode]();
}
const errors = iterate(validationErrors)
.filter(item => !!item.constraints)
.map(item => Object.values(item.constraints))
.flatten()
.toArray();
const errors = this.flattenValidationErrors(validationErrors);
return new HttpErrorByCode[this.errorHttpStatusCode](errors);
};
}
@@ -164,7 +164,7 @@ export class ValidationPipe implements PipeTransform<any> {
private stripProtoKeys(value: Record<string, any>) {
delete value.__proto__;
const keys = Object.keys(value);
keys
iterate(keys)
.filter(key => typeof value[key] === 'object' && value[key])
.forEach(key => this.stripProtoKeys(value[key]));
}
@@ -172,4 +172,46 @@ export class ValidationPipe implements PipeTransform<any> {
private isPrimitive(value: unknown): boolean {
return ['number', 'boolean', 'string'].includes(typeof value);
}
private flattenValidationErrors(
validationErrors: ValidationError[],
): string[] {
return iterate(validationErrors)
.map(error => this.mapChildrenToValidationErrors(error))
.flatten()
.filter(item => !!item.constraints)
.map(item => Object.values(item.constraints))
.flatten()
.toArray();
}
private mapChildrenToValidationErrors(
error: ValidationError,
): ValidationError[] {
if (!(error.children && error.children.length)) {
return [error];
}
const validationErrors = [];
for (const item of error.children) {
if (item.children && item.children.length) {
validationErrors.push(...this.mapChildrenToValidationErrors(item));
}
validationErrors.push(this.prependConstraintsWithParentProp(error, item));
}
return validationErrors;
}
private prependConstraintsWithParentProp(
parentError: ValidationError,
error: ValidationError,
): ValidationError {
const constraints = {};
for (const key in error.constraints) {
constraints[key] = `${parentError.property}.${error.constraints[key]}`;
}
return {
...error,
constraints,
};
}
}

View File

@@ -1,10 +1,10 @@
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Inject, Injectable } from '../decorators/core';
import { Inject, Injectable, Optional } from '../decorators/core';
import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces';
import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface';
import { loadPackage } from '../utils/load-package.util';
import { isObject } from '../utils/shared.utils';
import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces';
import { CLASS_SERIALIZER_OPTIONS } from './class-serializer.constants';
let classTransformer: any = {};
@@ -20,7 +20,10 @@ const REFLECTOR = 'Reflector';
@Injectable()
export class ClassSerializerInterceptor implements NestInterceptor {
constructor(@Inject(REFLECTOR) protected readonly reflector: any) {
constructor(
@Inject(REFLECTOR) protected readonly reflector: any,
@Optional() protected readonly defaultOptions: ClassTransformOptions = {},
) {
classTransformer = loadPackage(
'class-transformer',
'ClassSerializerInterceptor',
@@ -30,7 +33,11 @@ export class ClassSerializerInterceptor implements NestInterceptor {
}
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
const options = this.getContextOptions(context);
const contextOptions = this.getContextOptions(context);
const options = {
...this.defaultOptions,
...contextOptions,
};
return next
.handle()
.pipe(

View File

@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { ROUTE_ARGS_METADATA } from '../../constants';
import { Bind } from '../../decorators/core/bind.decorator';
import { ROUTE_ARGS_METADATA } from '@nestjs/common/constants';
import { Req } from '../../decorators/http/route-params.decorator';
describe('@Bind', () => {

View File

@@ -1,7 +1,7 @@
import { ParseIntPipe } from '@nestjs/common';
import { ROUTE_ARGS_METADATA } from '@nestjs/common/constants';
import { expect } from 'chai';
import { ROUTE_ARGS_METADATA } from '../../constants';
import { createParamDecorator } from '../../decorators/http/create-route-param-metadata.decorator';
import { ParseIntPipe } from '../../index';
describe('createParamDecorator', () => {
let result;

View File

@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { Redirect } from '../../decorators/http/redirect.decorator';
import { REDIRECT_METADATA } from '../../constants';
import { HttpStatus } from '@nestjs/common';
import { Redirect } from '../../decorators/http/redirect.decorator';
import { HttpStatus } from '../../index';
describe('@Redirect', () => {
const url = 'http://test.com';

View File

@@ -8,17 +8,17 @@ class Guard {}
describe('@UseGuards', () => {
const guards = [Guard, Guard];
@UseGuards(...(guards as any))
@UseGuards(...guards)
class Test {}
class TestWithMethod {
@UseGuards(...(guards as any))
@UseGuards(...guards)
public static test() {}
}
class Test2 {
@UseGuards(...(guards as any))
@UseGuards(...(guards as any))
@UseGuards(...guards)
@UseGuards(...guards)
public static test() {}
}

View File

@@ -8,11 +8,11 @@ class Interceptor {}
describe('@UseInterceptors', () => {
const interceptors = [Interceptor, Interceptor];
@UseInterceptors(...(interceptors as any))
@UseInterceptors(...interceptors)
class Test {}
class TestWithMethod {
@UseInterceptors(...(interceptors as any))
@UseInterceptors(...interceptors)
public static test() {}
}

View File

@@ -10,11 +10,11 @@ class Pipe {
describe('@UsePipes', () => {
const pipes = [new Pipe(), new Pipe()];
@UsePipes(...(pipes as any))
@UsePipes(...pipes)
class Test {}
class TestWithMethod {
@UsePipes(...(pipes as any))
@UsePipes(...pipes)
public static test() {}
}

View File

@@ -0,0 +1,18 @@
import { expect } from 'chai';
import { HttpService } from '../../http/http.service';
import { AxiosRequestConfig, AxiosInstance } from 'axios';
describe('HttpService', () => {
it('should not mutate user-given axios options object', done => {
const http = new HttpService({ get: () => Promise.resolve() } as any);
const options: AxiosRequestConfig = {};
http
.get('/', options)
.toPromise()
.then(() => {
expect(options.cancelToken).to.be.undefined;
done();
});
});
});

View File

@@ -0,0 +1,20 @@
import { expect } from 'chai';
import { DefaultValuePipe } from '../../pipes/default-value.pipe';
describe('DefaultValuePipe', () => {
const defaultValue = 'default';
const target = new DefaultValuePipe(defaultValue);
describe('transform', () => {
it('should return original value if one was provided', () => {
const value = 'value';
const result = target.transform(value);
expect(result).to.equal(value);
});
it('should return default value if no value was provided', () => {
const result = target.transform(undefined);
expect(result).to.equal(defaultValue);
});
});
});

View File

@@ -1,8 +1,14 @@
import * as chai from 'chai';
import { expect } from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import { Exclude, Expose } from 'class-transformer';
import { IsOptional, IsString } from 'class-validator';
import { Exclude, Expose, Type } from 'class-transformer';
import {
IsBoolean,
IsDefined,
IsOptional,
IsString,
ValidateNested,
} from 'class-validator';
import { HttpStatus } from '../../enums';
import { UnprocessableEntityException } from '../../exceptions';
import { ArgumentMetadata } from '../../interfaces';
@@ -27,10 +33,11 @@ class TestModelInternal {
}
class TestModel {
constructor() {}
@IsString() public prop1: string;
@IsString()
public prop1: string;
@IsString() public prop2: string;
@IsString()
public prop2: string;
@IsOptional()
@IsString()
@@ -112,6 +119,43 @@ describe('ValidationPipe', () => {
const testObj = { prop1: 'value1' };
return expect(target.transform(testObj, metadata)).to.be.rejected;
});
class TestModel2 {
@IsString()
public prop1: string;
@IsBoolean()
public prop2: string;
@IsOptional()
@IsString()
public optionalProp: string;
}
class TestModelWithNested {
@IsString()
prop: string;
@IsDefined()
@Type(() => TestModel2)
@ValidateNested()
test: TestModel2;
}
it('should flatten nested errors', async () => {
try {
const model = new TestModelWithNested();
model.test = new TestModel2();
await target.transform(model, {
type: 'body',
metatype: TestModelWithNested,
});
} catch (err) {
expect(err.getResponse().message).to.be.eql([
'prop must be a string',
'test.prop1 must be a string',
'test.prop2 must be a boolean value',
]);
}
});
});
describe('when validation transforms', () => {
it('should return a TestModel instance', async () => {
@@ -352,4 +396,31 @@ describe('ValidationPipe', () => {
});
});
});
describe('option: "expectedType"', () => {
class TestModel2 {
@IsString()
public prop1: string;
@IsBoolean()
public prop2: string;
@IsOptional()
@IsString()
public optionalProp: string;
}
it('should validate against the expected type if presented', async () => {
const m: ArgumentMetadata = {
type: 'body',
metatype: TestModel2,
data: '',
};
target = new ValidationPipe({ expectedType: TestModel });
const testObj = { prop1: 'value1', prop2: 'value2' };
expect(await target.transform(testObj, m)).to.equal(testObj);
});
});
});

View File

@@ -13,6 +13,7 @@ import {
NotFoundException,
NotImplementedException,
PayloadTooLargeException,
PreconditionFailedException,
RequestTimeoutException,
ServiceUnavailableException,
UnauthorizedException,
@@ -35,6 +36,7 @@ export type ErrorHttpStatusCode =
| HttpStatus.NOT_FOUND
| HttpStatus.NOT_IMPLEMENTED
| HttpStatus.PAYLOAD_TOO_LARGE
| HttpStatus.PRECONDITION_FAILED
| HttpStatus.REQUEST_TIMEOUT
| HttpStatus.SERVICE_UNAVAILABLE
| HttpStatus.UNAUTHORIZED
@@ -55,6 +57,7 @@ export const HttpErrorByCode: Record<ErrorHttpStatusCode, Type<unknown>> = {
[HttpStatus.NOT_FOUND]: NotFoundException,
[HttpStatus.NOT_IMPLEMENTED]: NotImplementedException,
[HttpStatus.PAYLOAD_TOO_LARGE]: PayloadTooLargeException,
[HttpStatus.PRECONDITION_FAILED]: PreconditionFailedException,
[HttpStatus.REQUEST_TIMEOUT]: RequestTimeoutException,
[HttpStatus.SERVICE_UNAVAILABLE]: ServiceUnavailableException,
[HttpStatus.UNAUTHORIZED]: UnauthorizedException,

View File

@@ -38,6 +38,14 @@ Nest is a framework for building efficient, scalable <a href="http://nodejs.org"
* To check out the [guide](https://docs.nestjs.com), visit [docs.nestjs.com](https://docs.nestjs.com). :books:
* 要查看中文 [指南](readme_zh.md), 请访问 [docs.nestjs.cn](https://docs.nestjs.cn). :books:
## Questions
For questions and support please use the official [Discord channel](https://discord.gg/G7Qnnhy). The issue list of this repo is **exclusively** for bug reports and feature requests.
## Issues
Please make sure to read the [Issue Reporting Checklist](https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md#-submitting-an-issue) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
## 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://enterprise.nestjs.com).
@@ -46,32 +54,43 @@ With official support, you can get expert help straight from Nest core team. We
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
#### Principal Sponsor
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
#### Principal Sponsors
<table style="text-align:center;"><tr><td>
<a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td><td>
<a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="180" valign="middle" /></a></td>
</tr></table>
#### Silver Sponsors
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> &nbsp;
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" height="95" /></a> &nbsp;
<a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="150" valign="middle" /></a> &nbsp;
<a href="http://www.leogistics.com" target="_blank"><img src="https://nestjs.com/img/leogistics-logo.jpeg" width="150" valign="middle" /></a>
<table style="text-align:center;"><tr><td>
<a href="https://neoteric.eu/" target="_blank"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" valign="middle" /></a> </td><td>
<a href="http://gojob.com" target="_blank"><img src="http://nestjs.com/img/gojob-logo.png" valign="middle" width="100" /></a> </td><td>
<a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="170" valign="middle" /></a> </td><td>
<a href="http://www.leogistics.com" target="_blank"><img src="https://nestjs.com/img/leogistics-logo.jpeg" width="150" valign="middle" /></td></tr></table>
#### Sponsors
<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://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="27" 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://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> &nbsp;
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a>
<table><tr><td align="center" valign="middle">
<a href="https://www.swingdev.io" target="_blank"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="110" valign="middle" /> </a></td><td align="center" valign="middle">
<a href="https://www.novologic.com/" target="_blank"><img src="https://nestjs.com/img/novologic.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://ever.co/" target="_blank"><img src="https://nestjs.com/img/ever-logo.png" width="72" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://blokt.com" target="_blank"><img src="https://nestjs.com/img/blokt-logo.png" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="http://architectnow.net/" target="_blank"><img src="https://nestjs.com/img/architectnow.png" width="125" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://quander.io/" target="_blank"><img src="https://nestjs.com/img/quander.png" width="100" valign="middle" /></a> </td></tr><tr><td align="center" valign="middle">
<a href="https://mantro.net/" target="_blank"><img src="https://nestjs.com/img/mantro-logo.svg" width="95" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://triplebyte.com/" target="_blank"><img src="https://nestjs.com/img/triplebyte.png" width="107" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://reposit.co.uk/" target="_blank"><img src="https://nestjs.com/img/reposit-logo.png" width="71" valign="middle" /></a></td><td align="center" valign="middle">
<a href="https://nearpod.com/" target="_blank"><img src="https://nestjs.com/img/nearpod-logo.svg" width="100" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://clay.global/" target="_blank"><img src="https://nestjs.com/img/clay-logo.svg" width="75" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://firesticktricks.com" target="_blank"><img src="https://nestjs.com/img/firesticktricks-logo.png" width="120" valign="middle" /></a></td></tr><tr><td align="center" valign="middle">
<a href="https://www.codeguesser.co.uk" target="_blank"><img src="https://nestjs.com/img/codeguesser-logo.svg" width="120" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://tekhattan.com" target="_blank"><img src="https://nestjs.com/img/tekhattan-logo.png" width="110" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://f-a.nz/" target="_blank"><img src="https://nestjs.com/img/franz.svg" width="80" valign="middle" /></a> </td><td align="center" valign="middle">
<a href="https://sparkfabrik.com/" target="_blank"><img src="https://nestjs.com/img/sparkfabrik-logo.png" width="120" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://www.thebigphonestore.co.uk/" target="_blank"><img src="https://nestjs.com/img/the-big-phone-store-logo.png" width="65" valign="middle" /></a></td>
<td align="center" valign="middle">
<a href="https://genuinebee.com/" target="_blank"><img src="https://nestjs.com/img/genuinebee.svg" width="97" valign="middle" /></a> </td></tr>
<tr><td align="center" valign="middle"><a href="https://sanyodigital.com/" target="_blank"><img src="https://nestjs.com/img/sanyo-digital.png" width="130" valign="middle" /></a></td>
</tr></table>
## Backers

View File

@@ -15,6 +15,9 @@ export abstract class AbstractHttpAdapter<
constructor(protected readonly instance: any) {}
// eslint-disable-next-line @typescript-eslint/no-empty-function
public async init() {}
public use(...args: any[]) {
return this.instance.use(...args);
}
@@ -97,6 +100,8 @@ export abstract class AbstractHttpAdapter<
abstract enableCors(options: CorsOptions, prefix?: string);
abstract createMiddlewareFactory(
requestMethod: RequestMethod,
): (path: string, callback: Function) => any;
):
| ((path: string, callback: Function) => any)
| Promise<(path: string, callback: Function) => any>;
abstract getType(): string;
}

View File

@@ -2,8 +2,7 @@ import { INVALID_MODULE_MESSAGE } from '../messages';
import { RuntimeException } from './runtime.exception';
export class InvalidModuleException extends RuntimeException {
constructor(trace: any[]) {
const scope = (trace || []).map(module => module.name).join(' -> ');
super(INVALID_MODULE_MESSAGE`${scope}`);
constructor(parentModule: any, index: number, scope: any[]) {
super(INVALID_MODULE_MESSAGE(parentModule, index, scope));
}
}

View File

@@ -0,0 +1,9 @@
import { UNDEFINED_FORWARDREF_MESSAGE } from '../messages';
import { RuntimeException } from './runtime.exception';
import { Type } from '@nestjs/common';
export class UndefinedForwardRefException extends RuntimeException {
constructor(scope: Type<any>[]) {
super(UNDEFINED_FORWARDREF_MESSAGE(scope));
}
}

View File

@@ -0,0 +1,8 @@
import { RuntimeException } from './runtime.exception';
import { UNDEFINED_MODULE_MESSAGE } from '../messages';
export class UndefinedModuleException extends RuntimeException {
constructor(parentModule: any, index: number, scope: any[]) {
super(UNDEFINED_MODULE_MESSAGE(parentModule, index, scope));
}
}

View File

@@ -1,7 +1,8 @@
import { RuntimeException } from './runtime.exception';
export class UnknownElementException extends RuntimeException {
constructor(name?: string) {
constructor(name?: string | symbol) {
name = name && name.toString();
super(
`Nest could not find ${
name || 'given'

View File

@@ -2,7 +2,7 @@ import { UNKNOWN_EXPORT_MESSAGE } from '../messages';
import { RuntimeException } from './runtime.exception';
export class UnknownExportException extends RuntimeException {
constructor(token: string, module: string) {
super(UNKNOWN_EXPORT_MESSAGE(token, module));
constructor(token: string | symbol, moduleName: string) {
super(UNKNOWN_EXPORT_MESSAGE(token, moduleName));
}
}

View File

@@ -37,6 +37,9 @@ const getDependencyName = (dependency: InjectorDependency): string =>
const getModuleName = (module: Module) =>
(module && getInstanceName(module.metatype)) || 'current';
const stringifyScope = (scope: any[]): string =>
(scope || []).map(getInstanceName).join(' -> ');
export const UNKNOWN_DEPENDENCIES_MESSAGE = (
type: string | symbol,
unknownDependencyContext: InjectorDependencyContext,
@@ -84,17 +87,50 @@ export const INVALID_MIDDLEWARE_MESSAGE = (
name: string,
) => `The middleware doesn't provide the 'use' method (${name})`;
export const INVALID_MODULE_MESSAGE = (
text: TemplateStringsArray,
scope: string,
) =>
`Nest cannot create the module instance. Often, this is because of a circular dependency between modules. Use forwardRef() to avoid it.
export const UNDEFINED_FORWARDREF_MESSAGE = (
scope: Type<any>[],
) => `Nest cannot create the module instance. Often, this is because of a circular dependency between modules. Use forwardRef() to avoid it.
(Read more: https://docs.nestjs.com/fundamentals/circular-dependency)
Scope [${scope}]
`;
Scope [${stringifyScope(scope)}]
`;
export const INVALID_MODULE_MESSAGE = (
parentModule: any,
index: number,
scope: any[],
) => {
const parentModuleName = parentModule?.name || 'module';
return `Nest cannot create the ${parentModuleName} instance.
Received an unexpected value at index [${index}] of the ${parentModuleName} "imports" array.
Scope [${stringifyScope(scope)}]`;
};
export const UNDEFINED_MODULE_MESSAGE = (
parentModule: any,
index: number,
scope: any[],
) => {
const parentModuleName = parentModule?.name || 'module';
return `Nest cannot create the ${parentModuleName} instance.
The module at index [${index}] of the ${parentModuleName} "imports" array is undefined.
Potential causes:
- A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
- The module at index [${index}] is of type "undefined". Check your import statements and the type of the module.
Scope [${stringifyScope(scope)}]`;
};
export const UNKNOWN_EXPORT_MESSAGE = (
token: string | symbol = 'item',
module: string,
) => {
token = isSymbol(token) ? token.toString() : token;
export const UNKNOWN_EXPORT_MESSAGE = (token = 'item', module: string) => {
return `Nest cannot export a provider/module that is not a part of the currently processed module (${module}). Please verify whether the exported ${token} is available in this particular context.
Possible Solutions:

View File

@@ -2,7 +2,7 @@ import { FILTER_CATCH_EXCEPTIONS } from '@nestjs/common/constants';
import { Type } from '@nestjs/common/interfaces';
import { ExceptionFilter } from '@nestjs/common/interfaces/exceptions/exception-filter.interface';
import { isEmpty, isFunction } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { iterate } from 'iterare';
import { ContextCreator } from '../helpers/context-creator';
import { STATIC_CONTEXT } from '../injector/constants';
import { NestContainer } from '../injector/container';

View File

@@ -1,4 +1,4 @@
import { HttpException } from '@nestjs/common';
import { HttpException, Type } from '@nestjs/common';
import { ExceptionFilterMetadata } from '@nestjs/common/interfaces/exceptions/exception-filter-metadata.interface';
import { ArgumentsHost } from '@nestjs/common/interfaces/features/arguments-host.interface';
import { isEmpty } from '@nestjs/common/utils/shared.utils';
@@ -26,14 +26,15 @@ export class ExceptionsHandler extends BaseExceptionFilter {
exception: T,
ctx: ArgumentsHost,
): boolean {
if (isEmpty(this.filters)) return false;
if (isEmpty(this.filters)) {
return false;
}
const isInstanceOf = (metatype: Type<unknown>) =>
exception instanceof metatype;
const filter = this.filters.find(({ exceptionMetatypes }) => {
const typeExists =
!exceptionMetatypes.length ||
exceptionMetatypes.some(
ExceptionMetatype => exception instanceof ExceptionMetatype,
);
!exceptionMetatypes.length || exceptionMetatypes.some(isInstanceOf);
return typeExists;
});
filter && filter.func(exception, ctx);

View File

@@ -9,6 +9,7 @@ import { InstanceWrapper } from '../injector/instance-wrapper';
import { RouterProxyCallback } from '../router/router-proxy';
import { BaseExceptionFilterContext } from './base-exception-filter-context';
import { ExternalExceptionsHandler } from './external-exceptions-handler';
import { iterate } from 'iterare';
export class ExternalExceptionFilterContext extends BaseExceptionFilterContext {
constructor(
@@ -54,10 +55,11 @@ export class ExternalExceptionFilterContext extends BaseExceptionFilterContext {
return globalFilters;
}
const scopedFilterWrappers = this.config.getGlobalRequestFilters() as InstanceWrapper[];
const scopedFilters = scopedFilterWrappers
const scopedFilters = iterate(scopedFilterWrappers)
.map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
.filter(host => host)
.map(host => host.instance);
.filter(host => !!host)
.map(host => host.instance)
.toArray();
return globalFilters.concat(scopedFilters) as T;
}

View File

@@ -1,3 +1,4 @@
import { Type } from '@nestjs/common';
import { ExceptionFilterMetadata } from '@nestjs/common/interfaces/exceptions';
import { ArgumentsHost } from '@nestjs/common/interfaces/features/arguments-host.interface';
import { isEmpty } from '@nestjs/common/utils/shared.utils';
@@ -29,11 +30,13 @@ export class ExternalExceptionsHandler extends ExternalExceptionFilter {
if (isEmpty(this.filters)) {
return null;
}
const isInstanceOf = metatype => exception instanceof metatype;
const filter = this.filters.find(({ exceptionMetatypes, func }) => {
const hasMetatype =
const isInstanceOf = (metatype: Type<unknown>) =>
exception instanceof metatype;
const filter = this.filters.find(({ exceptionMetatypes }) => {
const typeExists =
!exceptionMetatypes.length || exceptionMetatypes.some(isInstanceOf);
return hasMetatype;
return typeExists;
});
return filter ? filter.func(exception, host) : null;
}

View File

@@ -2,7 +2,7 @@ import { CanActivate } from '@nestjs/common';
import { GUARDS_METADATA } from '@nestjs/common/constants';
import { Controller } from '@nestjs/common/interfaces';
import { isEmpty, isFunction } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { iterate } from 'iterare';
import { ApplicationConfig } from '../application-config';
import { ContextCreator } from '../helpers/context-creator';
import { STATIC_CONTEXT } from '../injector/constants';
@@ -100,10 +100,11 @@ export class GuardsContextCreator extends ContextCreator {
return globalGuards;
}
const scopedGuardWrappers = this.config.getGlobalRequestGuards() as InstanceWrapper[];
const scopedGuards = scopedGuardWrappers
const scopedGuards = iterate(scopedGuardWrappers)
.map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
.filter(host => host)
.map(host => host.instance);
.filter(host => !!host)
.map(host => host.instance)
.toArray();
return globalGuards.concat(scopedGuards) as T;
}

View File

@@ -1,12 +1,12 @@
import { BeforeApplicationShutdown } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
import { iterate } from 'iterare';
import {
getNonTransientInstances,
getTransientInstances,
} from '../injector/transient-instances';
} from '../injector/helpers/transient-instances';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
/**
* Checks if the given instance has the `beforeApplicationShutdown` function

View File

@@ -1,12 +1,12 @@
import { OnApplicationBootstrap } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
import { iterate } from 'iterare';
import {
getNonTransientInstances,
getTransientInstances,
} from '../injector/transient-instances';
} from '../injector/helpers/transient-instances';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
/**
* Checks if the given instance has the `onApplicationBootstrap` function

View File

@@ -1,12 +1,12 @@
import { OnApplicationShutdown } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
import { iterate } from 'iterare';
import {
getNonTransientInstances,
getTransientInstances,
} from '../injector/transient-instances';
} from '../injector/helpers/transient-instances';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
/**
* Checks if the given instance has the `onApplicationShutdown` function

View File

@@ -1,12 +1,12 @@
import { OnModuleDestroy } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
import { iterate } from 'iterare';
import {
getNonTransientInstances,
getTransientInstances,
} from '../injector/transient-instances';
} from '../injector/helpers/transient-instances';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
/**
* Returns true or false if the given instance has a `onModuleDestroy` function

View File

@@ -1,12 +1,12 @@
import { OnModuleInit } from '@nestjs/common';
import { isNil } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
import { iterate } from 'iterare';
import {
getNonTransientInstances,
getTransientInstances,
} from '../injector/transient-instances';
} from '../injector/helpers/transient-instances';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { Module } from '../injector/module';
/**
* Returns true or false if the given instance has a `onModuleInit` function

View File

@@ -1,118 +0,0 @@
import { Type } from '@nestjs/common';
import { Abstract, Scope } from '@nestjs/common/interfaces';
import { isFunction } from '@nestjs/common/utils/shared.utils';
import { InvalidClassScopeException } from '../errors/exceptions/invalid-class-scope.exception';
import { UnknownElementException } from '../errors/exceptions/unknown-element.exception';
import { NestContainer } from './container';
import { InstanceWrapper } from './instance-wrapper';
import { Module } from './module';
type HostCollection = 'providers' | 'controllers' | 'injectables';
export class ContainerScanner {
private flatContainer: Partial<Module>;
constructor(private readonly container: NestContainer) {}
public find<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
): TResult {
this.initFlatContainer();
return this.findInstanceByToken<TInput, TResult>(
typeOrToken,
this.flatContainer,
);
}
public getWrapperCollectionPair<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
): [InstanceWrapper<TResult>, Map<string, InstanceWrapper>] {
this.initFlatContainer();
return this.getWrapperCollectionPairByHost<TInput, TResult>(
typeOrToken,
this.flatContainer,
);
}
public findInstanceByToken<TInput = any, TResult = TInput>(
metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
contextModule: Partial<Module>,
): TResult {
const [instanceWrapper] = this.getWrapperCollectionPairByHost(
metatypeOrToken,
contextModule,
);
if (
instanceWrapper.scope === Scope.REQUEST ||
instanceWrapper.scope === Scope.TRANSIENT
) {
throw new InvalidClassScopeException(metatypeOrToken);
}
return (instanceWrapper.instance as unknown) as TResult;
}
public getWrapperCollectionPairByHost<TInput = any, TResult = TInput>(
metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
contextModule: Partial<Module>,
): [InstanceWrapper<TResult>, Map<string, InstanceWrapper>] {
const name = isFunction(metatypeOrToken)
? (metatypeOrToken as Function).name
: metatypeOrToken;
const collectionName = this.getHostCollection(
name as string,
contextModule,
);
const instanceWrapper = contextModule[collectionName].get(name as string);
if (!instanceWrapper) {
throw new UnknownElementException(name && name.toString());
}
return [
instanceWrapper as InstanceWrapper<TResult>,
contextModule[collectionName],
];
}
private initFlatContainer() {
if (this.flatContainer) {
return;
}
const modules = this.container.getModules();
const initialValue: Record<string, any[]> = {
providers: [],
controllers: [],
injectables: [],
};
const merge = <T = unknown>(
initial: Map<string, T> | T[],
arr: Map<string, T>,
) => [...initial, ...arr];
const partialModule = ([...modules.values()].reduce(
(current, next) => ({
providers: merge(current.providers, next.providers),
controllers: merge(current.controllers, next.controllers),
injectables: merge(current.injectables, next.injectables),
}),
initialValue,
) as any) as Partial<Module>;
this.flatContainer = {
providers: new Map(partialModule.providers),
controllers: new Map(partialModule.controllers),
injectables: new Map(partialModule.injectables),
};
}
private getHostCollection(
token: string,
{ providers, controllers }: Partial<Module>,
): HostCollection {
if (providers.has(token)) {
return 'providers';
}
if (controllers.has(token)) {
return 'controllers';
}
return 'injectables';
}
}

View File

@@ -4,7 +4,7 @@ import { Injectable } from '@nestjs/common/interfaces/injectable.interface';
import { Type } from '@nestjs/common/interfaces/type.interface';
import { ApplicationConfig } from '../application-config';
import { CircularDependencyException } from '../errors/exceptions/circular-dependency.exception';
import { InvalidModuleException } from '../errors/exceptions/invalid-module.exception';
import { UndefinedForwardRefException } from '../errors/exceptions/undefined-forwardref.exception';
import { UnknownModuleException } from '../errors/exceptions/unknown-module.exception';
import { ExternalContextCreator } from '../helpers/external-context-creator';
import { HttpAdapterHost } from '../helpers/http-adapter-host';
@@ -55,8 +55,10 @@ export class NestContainer {
metatype: Type<any> | DynamicModule | Promise<DynamicModule>,
scope: Type<any>[],
): Promise<Module> {
// In DependenciesScanner#scanForModules we already check for undefined or invalid modules
// We sill need to catch the edge-case of `forwardRef(() => undefined)`
if (!metatype) {
throw new InvalidModuleException(scope);
throw new UndefinedForwardRefException(scope);
}
const { type, dynamicMetadata, token } = await this.moduleCompiler.compile(
metatype,
@@ -64,7 +66,7 @@ export class NestContainer {
if (this.modules.has(token)) {
return;
}
const moduleRef = new Module(type, scope, this);
const moduleRef = new Module(type, this);
this.modules.set(token, moduleRef);
this.addDynamicMetadata(token, dynamicMetadata, [].concat(scope, type));
@@ -180,11 +182,11 @@ export class NestContainer {
}
public replace(toReplace: any, options: any & { scope: any[] | null }) {
this.modules.forEach(module => module.replace(toReplace, options));
this.modules.forEach(moduleRef => moduleRef.replace(toReplace, options));
}
public bindGlobalScope() {
this.modules.forEach(module => this.bindGlobalsToImports(module));
this.modules.forEach(moduleRef => this.bindGlobalsToImports(moduleRef));
}
public bindGlobalsToImports(moduleRef: Module) {
@@ -194,7 +196,7 @@ export class NestContainer {
}
public bindGlobalModuleToModule(target: Module, globalModule: Module) {
if (target === globalModule) {
if (target === globalModule || target === this.internalCoreModule) {
return;
}
target.addRelatedModule(globalModule);
@@ -203,7 +205,7 @@ export class NestContainer {
public getDynamicMetadataByToken(
token: string,
metadataKey: keyof DynamicModule,
): any[] {
) {
const metadata = this.dynamicModulesMetadata.get(token);
if (metadata && metadata[metadataKey]) {
return metadata[metadataKey] as any[];

View File

@@ -1,6 +1,5 @@
import iterate from 'iterare';
import { InstanceWrapper } from './instance-wrapper';
import { iterate } from 'iterare';
import { InstanceWrapper } from '../instance-wrapper';
/**
* Returns the instances which are transient

View File

@@ -15,6 +15,7 @@ import {
isString,
isUndefined,
} from '@nestjs/common/utils/shared.utils';
import { iterate } from 'iterare';
import { RuntimeException } from '../errors/exceptions/runtime.exception';
import { UndefinedDependencyException } from '../errors/exceptions/undefined-dependency.exception';
import { UnknownDependenciesException } from '../errors/exceptions/unknown-dependencies.exception';
@@ -612,7 +613,7 @@ export class Injector {
if (!isObject(instance)) {
return undefined;
}
properties
iterate(properties)
.filter(item => !isNil(item.instance))
.forEach(item => (instance[item.key] = item.instance));
}
@@ -665,8 +666,11 @@ export class Injector {
wrapper?: InstanceWrapper,
): Promise<T> {
if (!wrapper) {
const ctor = instance.constructor;
wrapper = collection.get(ctor && ctor.name);
const providerCtor = instance.constructor;
const injectionToken =
(providerCtor && providerCtor.name) ||
((providerCtor as unknown) as string);
wrapper = collection.get(injectionToken);
}
await this.loadInstance(wrapper, collection, moduleRef, ctx, wrapper);
await this.loadEnhancersPerContext(wrapper, ctx, wrapper);

View File

@@ -0,0 +1,79 @@
import { Abstract, Type } from '@nestjs/common';
import { isFunction } from '@nestjs/common/utils/shared.utils';
import { UnknownElementException } from '../errors/exceptions/unknown-element.exception';
import { NestContainer } from './container';
import { InstanceWrapper } from './instance-wrapper';
import { Module } from './module';
type InstanceToken = string | symbol | Type<any> | Abstract<any> | Function;
type HostCollection = 'providers' | 'controllers' | 'injectables';
export interface InstanceLink<T = any> {
token: InstanceToken;
wrapperRef: InstanceWrapper<T>;
collection: Map<any, InstanceWrapper>;
moduleId: string;
}
export class InstanceLinksHost {
private readonly instanceLinks = new Map<InstanceToken, InstanceLink[]>();
constructor(private readonly container: NestContainer) {
this.initialize();
}
get<T = any>(token: InstanceToken, moduleId?: string): InstanceLink<T> {
const name = isFunction(token)
? (token as Function).name
: (token as string | symbol);
const modulesMap = this.instanceLinks.get(name);
if (!modulesMap) {
throw new UnknownElementException(name);
}
const instanceLink = moduleId
? modulesMap.find(item => item.moduleId === moduleId)
: modulesMap[modulesMap.length - 1];
if (!instanceLink) {
throw new UnknownElementException(name);
}
return instanceLink;
}
private initialize() {
const modules = this.container.getModules();
modules.forEach(moduleRef => {
const { providers, injectables, controllers } = moduleRef;
providers.forEach((wrapper, token) =>
this.addLink(wrapper, token, moduleRef, 'providers'),
);
injectables.forEach((wrapper, token) =>
this.addLink(wrapper, token, moduleRef, 'injectables'),
);
controllers.forEach((wrapper, token) =>
this.addLink(wrapper, token, moduleRef, 'controllers'),
);
});
}
private addLink(
wrapper: InstanceWrapper,
token: InstanceToken,
moduleRef: Module,
collectionName: HostCollection,
) {
const instanceLink: InstanceLink = {
moduleId: moduleRef.id,
wrapperRef: wrapper,
collection: moduleRef[collectionName],
token,
};
const existingLinks = this.instanceLinks.get(token);
if (!existingLinks) {
this.instanceLinks.set(token, [instanceLink]);
} else {
existingLinks.push(instanceLink);
}
}
}

View File

@@ -6,6 +6,7 @@ import {
} from '@nestjs/common/interfaces';
import { randomStringGenerator } from '@nestjs/common/utils/random-string-generator.util';
import { isNil, isUndefined } from '@nestjs/common/utils/shared.utils';
import { iterate } from 'iterare';
import { STATIC_CONTEXT } from './constants';
import { Module } from './module';
@@ -37,9 +38,9 @@ export class InstanceWrapper<T = any> {
public readonly name: any;
public readonly async?: boolean;
public readonly host?: Module;
public readonly scope?: Scope = Scope.DEFAULT;
public readonly isAlias: boolean = false;
public scope?: Scope = Scope.DEFAULT;
public metatype: Type<T> | Function;
public inject?: (string | symbol | Function | Type<any>)[];
public forwardRef?: boolean;
@@ -255,9 +256,11 @@ export class InstanceWrapper<T = any> {
): boolean {
const isDependencyTreeStatic = this.isDependencyTreeStatic();
return ((!isDependencyTreeStatic &&
return (
!isDependencyTreeStatic &&
contextId !== STATIC_CONTEXT &&
(!this.isTransient || (this.isTransient && inquirer))) as any) as boolean;
(!this.isTransient || (this.isTransient && !!inquirer))
);
}
public isLazyTransient(
@@ -279,10 +282,11 @@ export class InstanceWrapper<T = any> {
contextId: ContextId,
inquirer?: InstanceWrapper,
): boolean {
const isSelfRequested = inquirer === this;
return (
this.isDependencyTreeStatic() &&
contextId !== STATIC_CONTEXT &&
inquirer === this
(isSelfRequested || (inquirer && inquirer.scope === Scope.TRANSIENT))
);
}
@@ -297,7 +301,8 @@ export class InstanceWrapper<T = any> {
return (
this.isDependencyTreeStatic() &&
contextId === STATIC_CONTEXT &&
(!this.isTransient || (isStaticTransient && !!inquirer))
(!this.isTransient ||
(isStaticTransient && !!inquirer && !inquirer.isTransient))
);
}
@@ -306,15 +311,17 @@ export class InstanceWrapper<T = any> {
return [];
}
const instances = [...this.transientMap.values()];
return instances
return iterate(instances)
.map(item => item.get(STATIC_CONTEXT))
.filter(item => !!item);
.filter(item => !!item)
.toArray();
}
public mergeWith(provider: Provider) {
if ((provider as ValueProvider).useValue) {
this.metatype = null;
this.inject = null;
this.scope = Scope.DEFAULT;
this.setInstanceByContextId(STATIC_CONTEXT, {
instance: (provider as ValueProvider).useValue,

View File

@@ -1,19 +1,26 @@
import { Type } from '@nestjs/common';
import { IntrospectionResult, Scope, Type } from '@nestjs/common';
import { InvalidClassScopeException } from '../errors/exceptions/invalid-class-scope.exception';
import { UnknownElementException } from '../errors/exceptions/unknown-element.exception';
import { getClassScope } from '../helpers/get-class-scope';
import { NestContainer } from './container';
import { ContainerScanner } from './container-scanner';
import { Injector } from './injector';
import { InstanceLinksHost } from './instance-links-host';
import { ContextId, InstanceWrapper } from './instance-wrapper';
import { Module } from './module';
export abstract class ModuleRef {
private readonly injector = new Injector();
private readonly containerScanner: ContainerScanner;
private _instanceLinksHost: InstanceLinksHost;
constructor(protected readonly container: NestContainer) {
this.containerScanner = new ContainerScanner(container);
private get instanceLinksHost() {
if (!this._instanceLinksHost) {
this._instanceLinksHost = new InstanceLinksHost(this.container);
}
return this._instanceLinksHost;
}
constructor(protected readonly container: NestContainer) {}
public abstract get<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | string | symbol,
options?: { strict: boolean },
@@ -25,10 +32,70 @@ export abstract class ModuleRef {
): Promise<TResult>;
public abstract create<T = any>(type: Type<T>): Promise<T>;
public introspect<T = any>(
token: Type<T> | string | symbol,
): IntrospectionResult {
const { wrapperRef } = this.instanceLinksHost.get(token);
let scope = Scope.DEFAULT;
if (!wrapperRef.isDependencyTreeStatic()) {
scope = Scope.REQUEST;
} else if (wrapperRef.isTransient) {
scope = Scope.TRANSIENT;
}
return { scope };
}
public registerRequestByContextId<T = any>(request: T, contextId: ContextId) {
this.container.registerRequestProvider(request, contextId);
}
protected find<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | string | symbol,
contextModule?: Module,
): TResult {
return this.containerScanner.find<TInput, TResult>(typeOrToken);
const moduleId = contextModule && contextModule.id;
const { wrapperRef } = this.instanceLinksHost.get<TResult>(
typeOrToken,
moduleId,
);
if (
wrapperRef.scope === Scope.REQUEST ||
wrapperRef.scope === Scope.TRANSIENT
) {
throw new InvalidClassScopeException(typeOrToken);
}
return wrapperRef.instance;
}
protected async resolvePerContext<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | string | symbol,
contextModule: Module,
contextId: ContextId,
options?: { strict: boolean },
): Promise<TResult> {
const isStrictModeEnabled = options && options.strict;
const instanceLink = isStrictModeEnabled
? this.instanceLinksHost.get(typeOrToken, contextModule.id)
: this.instanceLinksHost.get(typeOrToken);
const { wrapperRef, collection } = instanceLink;
if (wrapperRef.isDependencyTreeStatic() && !wrapperRef.isTransient) {
return this.get(typeOrToken);
}
const ctorHost = wrapperRef.instance || { constructor: typeOrToken };
const instance = await this.injector.loadPerContext(
ctorHost,
wrapperRef.host,
collection,
contextId,
wrapperRef,
);
if (!instance) {
throw new UnknownElementException();
}
return instance;
}
protected async instantiateClass<T = any>(
@@ -38,8 +105,8 @@ export abstract class ModuleRef {
const wrapper = new InstanceWrapper({
name: type && type.name,
metatype: type,
instance: undefined,
isResolved: false,
scope: getClassScope(type),
host: moduleRef,
});
return new Promise<T>(async (resolve, reject) => {
@@ -64,47 +131,4 @@ export abstract class ModuleRef {
}
});
}
protected findInstanceByToken<TInput = any, TResult = TInput>(
metatypeOrToken: Type<TInput> | string | symbol,
contextModule: Module,
): TResult {
return this.containerScanner.findInstanceByToken<TInput, TResult>(
metatypeOrToken,
contextModule,
);
}
protected async resolvePerContext<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | string | symbol,
contextModule: Module,
contextId: ContextId,
options?: { strict: boolean },
): Promise<TResult> {
let wrapper: InstanceWrapper, collection: Map<string, InstanceWrapper>;
if (!(options && options.strict)) {
[wrapper, collection] = this.containerScanner.getWrapperCollectionPair(
typeOrToken,
);
} else {
[
wrapper,
collection,
] = this.containerScanner.getWrapperCollectionPairByHost(
typeOrToken,
contextModule,
);
}
const instance = await this.injector.loadPerContext(
wrapper.instance,
wrapper.host,
collection,
contextId,
wrapper,
);
if (!instance) {
throw new UnknownElementException();
}
return instance;
}
}

View File

@@ -19,6 +19,7 @@ import {
isSymbol,
isUndefined,
} from '@nestjs/common/utils/shared.utils';
import { iterate } from 'iterare';
import { ApplicationConfig } from '../application-config';
import { InvalidClassException } from '../errors/exceptions/invalid-class.exception';
import { RuntimeException } from '../errors/exceptions/runtime.exception';
@@ -49,7 +50,6 @@ export class Module {
constructor(
private readonly _metatype: Type<any>,
private readonly _scope: Type<any>[],
private readonly container: NestContainer,
) {
this.addCoreProviders();
@@ -60,10 +60,6 @@ export class Module {
return this._id;
}
get scope(): Type<any>[] {
return this._scope;
}
get providers(): Map<any, InstanceWrapper<Injectable>> {
return this._providers;
}
@@ -397,15 +393,16 @@ export class Module {
return token;
}
const importsArray = [...this._imports.values()];
const importsNames = importsArray
.filter(item => item)
const importsNames = iterate(importsArray)
.filter(item => !!item)
.map(({ metatype }) => metatype)
.filter(metatype => metatype)
.map(({ name }) => name);
.filter(metatype => !!metatype)
.map(({ name }) => name)
.toArray();
if (!importsNames.includes(token as any)) {
if (!importsNames.includes(token as string)) {
const { name } = this.metatype;
throw new UnknownExportException(token as any, name);
throw new UnknownExportException(token, name);
}
return token;
}
@@ -482,7 +479,7 @@ export class Module {
return [...this._providers].filter(([_, wrapper]) => !wrapper.isAlias);
}
public createModuleReferenceType(): any {
public createModuleReferenceType(): Type<ModuleRef> {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
return class extends ModuleRef {
@@ -494,10 +491,9 @@ export class Module {
typeOrToken: Type<TInput> | string | symbol,
options: { strict: boolean } = { strict: true },
): TResult {
if (!(options && options.strict)) {
return this.find<TInput, TResult>(typeOrToken);
}
return this.findInstanceByToken<TInput, TResult>(typeOrToken, self);
return !(options && options.strict)
? this.find<TInput, TResult>(typeOrToken)
: this.find<TInput, TResult>(typeOrToken, self);
}
public resolve<TInput = any, TResult = TInput>(

View File

@@ -1,7 +1,7 @@
import { INTERCEPTORS_METADATA } from '@nestjs/common/constants';
import { Controller, NestInterceptor } from '@nestjs/common/interfaces';
import { isEmpty, isFunction } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { iterate } from 'iterare';
import { ApplicationConfig } from '../application-config';
import { ContextCreator } from '../helpers/context-creator';
import { STATIC_CONTEXT } from '../injector/constants';
@@ -104,10 +104,11 @@ export class InterceptorsContextCreator extends ContextCreator {
return globalInterceptors;
}
const scopedInterceptorWrappers = this.config.getGlobalRequestInterceptors() as InstanceWrapper[];
const scopedInterceptors = scopedInterceptorWrappers
const scopedInterceptors = iterate(scopedInterceptorWrappers)
.map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
.filter(host => host)
.map(host => host.instance);
.filter(host => !!host)
.map(host => host.instance)
.toArray();
return globalInterceptors.concat(scopedInterceptors) as T;
}

View File

@@ -4,7 +4,7 @@ import {
isFunction,
isNil,
} from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { iterate } from 'iterare';
export class MetadataScanner {
public scanFromPrototype<T extends Injectable, R = any>(

View File

@@ -11,6 +11,7 @@ import {
import { MiddlewareConfiguration } from '@nestjs/common/interfaces/middleware/middleware-configuration.interface';
import { RoutesMapper } from './routes-mapper';
import { filterMiddleware } from './utils';
import { iterate } from 'iterare';
export class MiddlewareBuilder implements MiddlewareConsumer {
private readonly middlewareCollection = new Set<MiddlewareConfiguration>();
@@ -49,21 +50,16 @@ export class MiddlewareBuilder implements MiddlewareConsumer {
public exclude(
...routes: Array<string | RouteInfo>
): MiddlewareConfigProxy {
const { routesMapper } = this.builder;
this.excludedRoutes = this.mapRoutesToFlatList(
routes.map(route => routesMapper.mapRouteToRouteInfo(route)),
);
this.excludedRoutes = this.getRoutesFlatList(routes);
return this;
}
public forRoutes(
...routes: Array<string | Type<any> | RouteInfo>
): MiddlewareConsumer {
const { middlewareCollection, routesMapper } = this.builder;
const { middlewareCollection } = this.builder;
const forRoutes = this.mapRoutesToFlatList(
routes.map(route => routesMapper.mapRouteToRouteInfo(route)),
);
const forRoutes = this.getRoutesFlatList(routes);
const configuration = {
middleware: filterMiddleware(
this.middleware,
@@ -76,8 +72,15 @@ export class MiddlewareBuilder implements MiddlewareConsumer {
return this.builder;
}
private mapRoutesToFlatList(forRoutes: RouteInfo[][]): RouteInfo[] {
return forRoutes.reduce((a, b) => a.concat(b));
private getRoutesFlatList(
routes: Array<string | Type<any> | RouteInfo>,
): RouteInfo[] {
const { routesMapper } = this.builder;
return iterate(routes)
.map(route => routesMapper.mapRouteToRouteInfo(route))
.flatten()
.toArray();
}
};
}

View File

@@ -196,7 +196,7 @@ export class MiddlewareModule {
if (isUndefined(instance.use)) {
throw new InvalidMiddlewareException(metatype.name);
}
const router = applicationRef.createMiddlewareFactory(method);
const router = await applicationRef.createMiddlewareFactory(method);
const isStatic = wrapper.isDependencyTreeStatic();
if (isStatic) {
const proxy = await this.createProxy(instance);

View File

@@ -4,6 +4,7 @@ import { HttpServer, RouteInfo, Type } from '@nestjs/common/interfaces';
import { isFunction } from '@nestjs/common/utils/shared.utils';
import * as pathToRegexp from 'path-to-regexp';
import { v4 as uuid } from 'uuid';
import { iterate } from 'iterare';
type RouteInfoRegex = RouteInfo & { regex: RegExp };
@@ -16,10 +17,11 @@ export const filterMiddleware = <T extends Function | Type<any> = any>(
...route,
regex: pathToRegexp(route.path),
}));
return []
return iterate([])
.concat(middleware)
.filter(isFunction)
.map((item: T) => mapToClass(item, excluded, httpAdapter));
.map((item: T) => mapToClass(item, excluded, httpAdapter))
.toArray();
};
export const mapToClass = <T extends Function | Type<any>>(

View File

@@ -4,10 +4,12 @@ import {
LoggerService,
ShutdownSignal,
} from '@nestjs/common';
import { Abstract } from '@nestjs/common/interfaces';
import { Abstract, Scope } from '@nestjs/common/interfaces';
import { Type } from '@nestjs/common/interfaces/type.interface';
import { isEmpty } from '@nestjs/common/utils/shared.utils';
import { iterate } from 'iterare';
import { MESSAGES } from './constants';
import { InvalidClassScopeException } from './errors/exceptions/invalid-class-scope.exception';
import { UnknownElementException } from './errors/exceptions/unknown-element.exception';
import { UnknownModuleException } from './errors/exceptions/unknown-module.exception';
import { createContextId } from './helpers';
@@ -20,9 +22,8 @@ import {
} from './hooks';
import { ContextId } from './injector';
import { NestContainer } from './injector/container';
import { ContainerScanner } from './injector/container-scanner';
import { Injector } from './injector/injector';
import { InstanceWrapper } from './injector/instance-wrapper';
import { InstanceLinksHost } from './injector/instance-links-host';
import { Module } from './injector/module';
/**
@@ -33,15 +34,20 @@ export class NestApplicationContext implements INestApplicationContext {
protected readonly injector = new Injector();
private shutdownCleanupRef?: (...args: unknown[]) => unknown;
private readonly activeShutdownSignals = new Array<string>();
private readonly containerScanner: ContainerScanner;
private _instanceLinksHost: InstanceLinksHost;
private get instanceLinksHost() {
if (!this._instanceLinksHost) {
this._instanceLinksHost = new InstanceLinksHost(this.container);
}
return this._instanceLinksHost;
}
constructor(
protected readonly container: NestContainer,
private readonly scope = new Array<Type<any>>(),
private contextModule: Module = null,
) {
this.containerScanner = new ContainerScanner(container);
}
) {}
public selectContextModule() {
const modules = this.container.getModules().values();
@@ -66,13 +72,9 @@ export class NestApplicationContext implements INestApplicationContext {
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
options: { strict: boolean } = { strict: false },
): TResult {
if (!(options && options.strict)) {
return this.find<TInput, TResult>(typeOrToken);
}
return this.findInstanceByToken<TInput, TResult>(
typeOrToken,
this.contextModule,
);
return !(options && options.strict)
? this.find<TInput, TResult>(typeOrToken)
: this.find<TInput, TResult>(typeOrToken, this.contextModule);
}
public resolve<TInput = any, TResult = TInput>(
@@ -88,6 +90,10 @@ export class NestApplicationContext implements INestApplicationContext {
);
}
public registerRequestByContextId<T = any>(request: T, contextId: ContextId) {
this.container.registerRequestProvider(request, contextId);
}
/**
* Initalizes the Nest application.
* Calls the Nest lifecycle events.
@@ -110,7 +116,7 @@ export class NestApplicationContext implements INestApplicationContext {
await this.callBeforeShutdownHook();
await this.dispose();
await this.callShutdownHook();
await this.unsubscribeFromProcessSignals();
this.unsubscribeFromProcessSignals();
}
public useLogger(logger: LoggerService) {
@@ -137,10 +143,11 @@ export class NestApplicationContext implements INestApplicationContext {
signals = Array.from(new Set(signals));
}
signals = signals
signals = iterate(signals)
.map((signal: string) => signal.toString().toUpperCase().trim())
// filter out the signals which is already listening to
.filter(signal => !this.activeShutdownSignals.includes(signal));
.filter(signal => !this.activeShutdownSignals.includes(signal))
.toArray();
this.listenToShutdownSignals(signals);
return this;
@@ -253,18 +260,20 @@ export class NestApplicationContext implements INestApplicationContext {
protected find<TInput = any, TResult = TInput>(
typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
contextModule?: Module,
): TResult {
return this.containerScanner.find<TInput, TResult>(typeOrToken);
}
protected findInstanceByToken<TInput = any, TResult = TInput>(
metatypeOrToken: Type<TInput> | Abstract<TInput> | string | symbol,
contextModule: Partial<Module>,
): TResult {
return this.containerScanner.findInstanceByToken<TInput, TResult>(
metatypeOrToken,
contextModule,
const moduleId = contextModule && contextModule.id;
const { wrapperRef } = this.instanceLinksHost.get<TResult>(
typeOrToken,
moduleId,
);
if (
wrapperRef.scope === Scope.REQUEST ||
wrapperRef.scope === Scope.TRANSIENT
) {
throw new InvalidClassScopeException(typeOrToken);
}
return wrapperRef.instance;
}
protected async resolvePerContext<TInput = any, TResult = TInput>(
@@ -273,23 +282,20 @@ export class NestApplicationContext implements INestApplicationContext {
contextId: ContextId,
options?: { strict: boolean },
): Promise<TResult> {
let wrapper: InstanceWrapper, collection: Map<string, InstanceWrapper>;
if (!(options && options.strict)) {
[wrapper, collection] = this.containerScanner.getWrapperCollectionPair(
typeOrToken,
);
} else {
[
wrapper,
collection,
] = this.containerScanner.getWrapperCollectionPairByHost(
typeOrToken,
contextModule,
);
const isStrictModeEnabled = options && options.strict;
const instanceLink = isStrictModeEnabled
? this.instanceLinksHost.get(typeOrToken, contextModule.id)
: this.instanceLinksHost.get(typeOrToken);
const { wrapperRef, collection } = instanceLink;
if (wrapperRef.isDependencyTreeStatic() && !wrapperRef.isTransient) {
return this.get(typeOrToken);
}
const ctorHost = wrapperRef.instance || { constructor: typeOrToken };
const instance = await this.injector.loadPerContext(
wrapper.instance,
wrapper.host,
ctorHost,
wrapperRef.host,
collection,
contextId,
);

View File

@@ -4,6 +4,7 @@ import {
HttpServer,
INestApplication,
INestMicroservice,
NestHybridApplicationOptions,
NestInterceptor,
PipeTransform,
WebSocketAdapter,
@@ -13,7 +14,7 @@ import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-applicati
import { Logger } from '@nestjs/common/services/logger.service';
import { loadPackage } from '@nestjs/common/utils/load-package.util';
import { isObject, validatePath } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { iterate } from 'iterare';
import { platform } from 'os';
import { AbstractHttpAdapter } from './adapters';
import { ApplicationConfig } from './application-config';
@@ -137,6 +138,7 @@ export class NestApplication extends NestApplicationContext
public async init(): Promise<this> {
this.applyOptions();
await this.httpAdapter?.init();
const useBodyParser =
this.appOptions && this.appOptions.bodyParser !== false;
@@ -170,17 +172,23 @@ export class NestApplication extends NestApplicationContext
this.routesResolver.registerExceptionHandler();
}
public connectMicroservice<T extends object>(options: T): INestMicroservice {
public connectMicroservice<T extends object>(
microserviceOptions: T,
hybridAppOptions: NestHybridApplicationOptions = {},
): INestMicroservice {
const { NestMicroservice } = loadPackage(
'@nestjs/microservices',
'NestFactory',
() => require('@nestjs/microservices'),
);
const { inheritAppConfig } = hybridAppOptions;
const applicationConfig = inheritAppConfig
? this.config
: new ApplicationConfig();
const applicationConfig = new ApplicationConfig();
const instance = new NestMicroservice(
this.container,
options,
microserviceOptions,
applicationConfig,
);
instance.registerListeners();

View File

@@ -147,12 +147,15 @@ export class NestFactoryStatic {
httpServer: HttpServer = null,
) {
const instanceLoader = new InstanceLoader(container);
const metadataScanner = new MetadataScanner();
const dependenciesScanner = new DependenciesScanner(
container,
new MetadataScanner(),
metadataScanner,
config,
);
container.setHttpAdapter(httpServer);
await httpServer?.init();
try {
this.logger.log(MESSAGES.APPLICATION_START);
await ExceptionsZone.asyncRun(async () => {
@@ -190,7 +193,7 @@ export class NestFactoryStatic {
prop: string,
): Function {
return (...args: unknown[]) => {
let result;
let result: unknown;
ExceptionsZone.run(() => {
result = receiver[prop](...args);
});

View File

@@ -1,6 +1,6 @@
{
"name": "@nestjs/core",
"version": "7.0.5",
"version": "7.4.2",
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
"author": "Kamil Mysliwiec",
"license": "MIT",
@@ -29,11 +29,14 @@
"dependencies": {
"@nuxtjs/opencollective": "0.2.2",
"fast-safe-stringify": "2.0.7",
"iterare": "1.2.0",
"iterare": "1.2.1",
"object-hash": "2.0.3",
"path-to-regexp": "3.2.0",
"tslib": "1.11.1",
"uuid": "7.0.2"
"tslib": "2.0.0",
"uuid": "8.3.0"
},
"devDependencies": {
"@nestjs/common": "7.4.2"
},
"peerDependencies": {
"@nestjs/common": "^7.0.0",

View File

@@ -1,7 +1,7 @@
import { PIPES_METADATA } from '@nestjs/common/constants';
import { Controller, PipeTransform } from '@nestjs/common/interfaces';
import { isEmpty, isFunction } from '@nestjs/common/utils/shared.utils';
import iterate from 'iterare';
import { iterate } from 'iterare';
import { ApplicationConfig } from '../application-config';
import { ContextCreator } from '../helpers/context-creator';
import { STATIC_CONTEXT } from '../injector/constants';
@@ -96,10 +96,11 @@ export class PipesContextCreator extends ContextCreator {
return globalPipes;
}
const scopedPipeWrappers = this.config.getGlobalRequestPipes() as InstanceWrapper[];
const scopedPipes = scopedPipeWrappers
const scopedPipes = iterate(scopedPipeWrappers)
.map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
.filter(host => host)
.map(host => host.instance);
.filter(host => !!host)
.map(host => host.instance)
.toArray();
return globalPipes.concat(scopedPipes) as T;
}

View File

@@ -28,7 +28,7 @@ export class RouteParamsFactory implements IRouteParamsFactory {
case RouteParamtypes.QUERY:
return data ? req.query[data] : req.query;
case RouteParamtypes.HEADERS:
return data ? req.headers[data] : req.headers;
return data ? req.headers[data.toLowerCase()] : req.headers;
case RouteParamtypes.SESSION:
return req.session;
case RouteParamtypes.FILE:

View File

@@ -9,6 +9,7 @@ import { STATIC_CONTEXT } from '../injector/constants';
import { NestContainer } from '../injector/container';
import { InstanceWrapper } from '../injector/instance-wrapper';
import { RouterProxyCallback } from './router-proxy';
import { iterate } from 'iterare';
export class RouterExceptionFilters extends BaseExceptionFilterContext {
constructor(
@@ -52,10 +53,11 @@ export class RouterExceptionFilters extends BaseExceptionFilterContext {
return globalFilters;
}
const scopedFilterWrappers = this.config.getGlobalRequestFilters() as InstanceWrapper[];
const scopedFilters = scopedFilterWrappers
const scopedFilters = iterate(scopedFilterWrappers)
.map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
.filter(host => host)
.map(host => host.instance);
.filter(host => !!host)
.map(host => host.instance)
.toArray();
return globalFilters.concat(scopedFilters) as T;
}

View File

@@ -33,6 +33,7 @@ import {
isNil,
isUndefined,
} from '@nestjs/common/utils/shared.utils';
import { iterate } from 'iterare';
import { ApplicationConfig } from './application-config';
import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_PIPE } from './constants';
import { CircularDependencyException } from './errors/exceptions/circular-dependency.exception';
@@ -42,6 +43,8 @@ import { NestContainer } from './injector/container';
import { InstanceWrapper } from './injector/instance-wrapper';
import { Module } from './injector/module';
import { MetadataScanner } from './metadata-scanner';
import { InvalidModuleException } from './errors/exceptions/invalid-module.exception';
import { UndefinedModuleException } from './errors/exceptions/undefined-module.exception';
interface ApplicationProviderWrapper {
moduleKey: string;
@@ -89,7 +92,14 @@ export class DependenciesScanner {
...((module as DynamicModule).imports || []),
];
for (const innerModule of modules) {
for (const [index, innerModule] of modules.entries()) {
// In case of a circular dependency (ES module system), JavaScript will resolve the type to `undefined`.
if (innerModule === undefined) {
throw new UndefinedModuleException(module, index, scope);
}
if (!innerModule) {
throw new InvalidModuleException(module, index, scope);
}
if (ctxRegistry.includes(innerModule)) {
continue;
}
@@ -259,7 +269,7 @@ export class DependenciesScanner {
public async calculateModulesDistance(modules: ModulesContainer) {
const modulesGenerator = modules.values();
const rootModule = modulesGenerator.next().value;
const rootModule = modulesGenerator.next().value as Module;
const modulesStack = [rootModule];
const calculateDistance = (moduleRef: Module, distance = 1) => {
@@ -378,24 +388,20 @@ export class DependenciesScanner {
* to all controllers metadata storage
*/
public addScopedEnhancersMetadata() {
const scopedGlobalProviders = this.applicationProvidersApplyMap.filter(
wrapper => this.isRequestOrTransient(wrapper.scope),
);
iterate(this.applicationProvidersApplyMap)
.filter(wrapper => this.isRequestOrTransient(wrapper.scope))
.forEach(({ moduleKey, providerKey }) => {
const modulesContainer = this.container.getModules();
const { injectables } = modulesContainer.get(moduleKey);
const instanceWrapper = injectables.get(providerKey);
scopedGlobalProviders.forEach(({ moduleKey, providerKey }) => {
const modulesContainer = this.container.getModules();
const { injectables } = modulesContainer.get(moduleKey);
const instanceWrapper = injectables.get(providerKey);
const modules = [...modulesContainer.values()];
const controllersArray = modules.map(module => [
...module.controllers.values(),
]);
const controllers = this.flatten(controllersArray);
controllers.forEach(controller =>
controller.addEnhancerMetadata(instanceWrapper),
);
});
iterate(modulesContainer.values())
.map(module => module.controllers.values())
.flatten()
.forEach(controller =>
controller.addEnhancerMetadata(instanceWrapper),
);
});
}
public applyApplicationProviders() {

View File

@@ -1,5 +1,5 @@
import { Type } from '@nestjs/common';
import { isObject } from '@nestjs/common/utils/shared.utils';
import { isEmpty, isObject } from '@nestjs/common/utils/shared.utils';
/**
* Helper class providing Nest reflection capabilities.
@@ -53,7 +53,14 @@ export class Reflector {
metadataKey: TKey,
targets: (Type<any> | Function)[],
): TResult {
const metadataCollection = this.getAll(metadataKey, targets);
const metadataCollection = this.getAll<TResult, TKey>(
metadataKey,
targets,
).filter(item => item !== undefined);
if (isEmpty(metadataCollection)) {
return metadataCollection as TResult;
}
return metadataCollection.reduce((a, b) => {
if (Array.isArray(a)) {
return a.concat(b);

View File

@@ -2,161 +2,204 @@ import { expect } from 'chai';
import { UnknownDependenciesException } from '../../../errors/exceptions/unknown-dependencies.exception';
import { Module } from '../../../injector/module';
import { stringCleaner } from '../../utils/string.cleaner';
import {
UNDEFINED_MODULE_MESSAGE,
INVALID_MODULE_MESSAGE,
} from '../../../errors/messages';
describe('UnknownDependenciesMessage', () => {
const index = 0;
it('should display class', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, CatService). Please make sure that the argument dependency at index [0] is available in the current context.
describe('Error Messages', () => {
const CatsModule = { name: 'CatsModule' };
const AppModule = { name: 'AppModule' };
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
describe('UNKNOWN_DEPENDENCIES_MESSAGE', () => {
const index = 0;
it('should display class', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, CatService). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
class CatService {}
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', CatService],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the provide token', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, MY_TOKEN). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
})
`);
class CatService {}
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', 'MY_TOKEN'],
}).message,
);
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', CatService],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the provide token', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, MY_TOKEN). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', 'MY_TOKEN'],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the function name', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, CatFunction). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
function CatFunction() {}
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', CatFunction],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should use "+" if unknown dependency name', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, +). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
expect(actualMessage).to.equal(expectedResult);
});
it('should display the function name', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, CatFunction). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
`);
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', undefined],
}).message,
);
function CatFunction() {}
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', CatFunction],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should use "+" if unknown dependency name', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, +). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
expect(actualMessage).to.equal(expectedResult);
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatService', {
index,
dependencies: ['', undefined],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the module name', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, MY_TOKEN). Please make sure that the argument dependency at index [0] is available in the TestModule context.
Potential solutions:
- If dependency is a provider, is it part of the current TestModule?
- If dependency is exported from a separate @Module, is that module imported within TestModule?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
class MetaType {
name: string;
}
class TestModule {
metatype: MetaType;
}
const myModule = new TestModule();
const myMetaType = new MetaType();
myMetaType.name = 'TestModule';
myModule.metatype = myMetaType;
const actualMessage = stringCleaner(
new UnknownDependenciesException(
'CatService',
{ index, dependencies: ['', 'MY_TOKEN'] },
myModule as Module,
).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the symbol name of the provider', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the Symbol(CatProvider) (?). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
const actualMessage = stringCleaner(
new UnknownDependenciesException(Symbol('CatProvider'), {
index,
dependencies: [''],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the symbol dependency of the provider', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatProvider (?, Symbol(DogProvider)). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatProvider', {
index,
dependencies: ['', Symbol('DogProvider')],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
});
});
it('should display the module name', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatService (?, MY_TOKEN). Please make sure that the argument dependency at index [0] is available in the TestModule context.
Potential solutions:
- If dependency is a provider, is it part of the current TestModule?
- If dependency is exported from a separate @Module, is that module imported within TestModule?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
describe('UNDEFINED_MODULE_EXCEPTION', () => {
it('should display the module name with the undefined index and scope', () => {
const expectedMessage = stringCleaner(`Nest cannot create the CatsModule instance.
The module at index [0] of the CatsModule "imports" array is undefined.
class MetaType {
name: string;
}
class TestModule {
metatype: MetaType;
}
const myModule = new TestModule();
const myMetaType = new MetaType();
myMetaType.name = 'TestModule';
myModule.metatype = myMetaType;
Potential causes:
- A circular dependency between modules. Use forwardRef() to avoid it. Read more: https://docs.nestjs.com/fundamentals/circular-dependency
- The module at index [0] is of type "undefined". Check your import statements and the type of the module.
const actualMessage = stringCleaner(
new UnknownDependenciesException(
'CatService',
{ index, dependencies: ['', 'MY_TOKEN'] },
myModule as Module,
).message,
);
Scope [AppModule -> CatsModule]`);
expect(actualMessage).to.equal(expectedResult);
const actualMessage = stringCleaner(
UNDEFINED_MODULE_MESSAGE(CatsModule, 0, [AppModule, CatsModule]),
);
expect(actualMessage).to.be.eq(expectedMessage);
});
});
it('should display the symbol name of the provider', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the Symbol(CatProvider) (?). Please make sure that the argument dependency at index [0] is available in the current context.
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
describe('INVALID_MODULE_MESSAGE', () => {
it('should display the module name with the invalid index and scope', () => {
const expectedMessage = stringCleaner(`Nest cannot create the CatsModule instance.
Received an unexpected value at index [0] of the CatsModule "imports" array.
const actualMessage = stringCleaner(
new UnknownDependenciesException(Symbol('CatProvider'), {
index,
dependencies: [''],
}).message,
);
Scope [AppModule -> CatsModule]`);
expect(actualMessage).to.equal(expectedResult);
});
it('should display the symbol dependency of the provider', () => {
const expectedResult = stringCleaner(`Nest can't resolve dependencies of the CatProvider (?, Symbol(DogProvider)). Please make sure that the argument dependency at index [0] is available in the current context.
const actualMessage = stringCleaner(
INVALID_MODULE_MESSAGE(CatsModule, 0, [AppModule, CatsModule]),
);
Potential solutions:
- If dependency is a provider, is it part of the current current?
- If dependency is exported from a separate @Module, is that module imported within current?
@Module({
imports: [ /* the Module containing dependency */ ]
})
`);
const actualMessage = stringCleaner(
new UnknownDependenciesException('CatProvider', {
index,
dependencies: ['', Symbol('DogProvider')],
}).message,
);
expect(actualMessage).to.equal(expectedResult);
expect(actualMessage).to.be.eq(expectedMessage);
});
});
});

View File

@@ -0,0 +1,49 @@
import { BeforeApplicationShutdown } from '@nestjs/common';
import { expect } from 'chai';
import * as sinon from 'sinon';
import { callBeforeAppShutdownHook } from '../../hooks/before-app-shutdown.hook';
import { NestContainer } from '../../injector/container';
import { Module } from '../../injector/module';
class SampleProvider implements BeforeApplicationShutdown {
beforeApplicationShutdown(signal?: string) {}
}
class SampleModule implements BeforeApplicationShutdown {
beforeApplicationShutdown(signal?: string) {}
}
class WithoutHookProvider {}
describe('BeforeAppShutdown', () => {
let moduleRef: Module;
let sampleProvider: SampleProvider;
beforeEach(() => {
sampleProvider = new SampleProvider();
moduleRef = new Module(SampleModule, new NestContainer());
const moduleWrapperRef = moduleRef.getProviderByKey(SampleModule.name);
moduleWrapperRef.instance = new SampleModule();
moduleRef.addProvider({
provide: SampleProvider,
useValue: sampleProvider,
});
moduleRef.addProvider({
provide: WithoutHookProvider,
useValue: new WithoutHookProvider(),
});
});
describe('callBeforeAppShutdownHook', () => {
it('should call "beforeApplicationShutdown" hook for the entire module', async () => {
const signal = 'SIGTERM';
const hookSpy = sinon.spy(sampleProvider, 'beforeApplicationShutdown');
await callBeforeAppShutdownHook(moduleRef, signal);
expect(hookSpy.calledWith(signal)).to.be.true;
});
});
});

View File

@@ -0,0 +1,47 @@
import { OnApplicationBootstrap } from '@nestjs/common';
import { expect } from 'chai';
import * as sinon from 'sinon';
import { callModuleBootstrapHook } from '../../hooks/on-app-bootstrap.hook';
import { NestContainer } from '../../injector/container';
import { Module } from '../../injector/module';
class SampleProvider implements OnApplicationBootstrap {
onApplicationBootstrap() {}
}
class SampleModule implements OnApplicationBootstrap {
onApplicationBootstrap() {}
}
class WithoutHookProvider {}
describe('OnApplicationBootstrap', () => {
let moduleRef: Module;
let sampleProvider: SampleProvider;
beforeEach(() => {
sampleProvider = new SampleProvider();
moduleRef = new Module(SampleModule, new NestContainer());
const moduleWrapperRef = moduleRef.getProviderByKey(SampleModule.name);
moduleWrapperRef.instance = new SampleModule();
moduleRef.addProvider({
provide: SampleProvider,
useValue: sampleProvider,
});
moduleRef.addProvider({
provide: WithoutHookProvider,
useValue: new WithoutHookProvider(),
});
});
describe('callModuleBootstrapHook', () => {
it('should call "onApplicationBootstrap" hook for the entire module', async () => {
const hookSpy = sinon.spy(sampleProvider, 'onApplicationBootstrap');
await callModuleBootstrapHook(moduleRef);
expect(hookSpy.called).to.be.true;
});
});
});

View File

@@ -0,0 +1,47 @@
import { OnApplicationShutdown } from '@nestjs/common';
import { expect } from 'chai';
import * as sinon from 'sinon';
import { callAppShutdownHook } from '../../hooks/on-app-shutdown.hook';
import { NestContainer } from '../../injector/container';
import { Module } from '../../injector/module';
class SampleProvider implements OnApplicationShutdown {
onApplicationShutdown() {}
}
class SampleModule implements OnApplicationShutdown {
onApplicationShutdown() {}
}
class WithoutHookProvider {}
describe('OnApplicationShutdown', () => {
let moduleRef: Module;
let sampleProvider: SampleProvider;
beforeEach(() => {
sampleProvider = new SampleProvider();
moduleRef = new Module(SampleModule, new NestContainer());
const moduleWrapperRef = moduleRef.getProviderByKey(SampleModule.name);
moduleWrapperRef.instance = new SampleModule();
moduleRef.addProvider({
provide: SampleProvider,
useValue: sampleProvider,
});
moduleRef.addProvider({
provide: WithoutHookProvider,
useValue: new WithoutHookProvider(),
});
});
describe('callAppShutdownHook', () => {
it('should call "onApplicationShutdown" hook for the entire module', async () => {
const hookSpy = sinon.spy(sampleProvider, 'onApplicationShutdown');
await callAppShutdownHook(moduleRef);
expect(hookSpy.called).to.be.true;
});
});
});

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