Compare commits

...

506 Commits

Author SHA1 Message Date
Kamil Myśliwiec
2f535c33ae chore(@nestjs) publish v5.3.5 release 2018-09-05 10:04:15 +02:00
Kamil Myśliwiec
20dd9fc8ca bugfix(common) remove useless parts of cache interceptor 2018-09-05 10:03:28 +02:00
Kamil Myśliwiec
6110526402 chore(@nestjs) publish v5.3.4 release 2018-09-05 09:38:05 +02:00
Kamil Myśliwiec
0a1f44ac4d bugfix(common) export CACHE_MANAGER, fix trackBy method 2018-09-05 09:37:33 +02:00
Kamil Myśliwiec
d048f23ff8 improvement(microservices) ensure that connection is shared across promises 2018-09-05 09:37:09 +02:00
Kamil Myśliwiec
f5f8255a37 bugfix(core) check bootstrap lifecycle hook 2018-09-05 09:36:23 +02:00
Kamil Myśliwiec
cc4d91fcb3 chore(@nestjs) publish v5.3.3 release 2018-09-04 11:48:10 +02:00
Kamil Myśliwiec
89c76a682e chore(nestjs) publish 5.3.2 release 2018-09-03 18:05:35 +02:00
Kamil Myśliwiec
63577b9986 chore(@nestjs) publish v5.3.2 release 2018-09-03 18:01:18 +02:00
Kamil Myśliwiec
713e97f6c3 chore(nestjs) publish 5.3.1 release 2018-09-03 17:10:59 +02:00
Kamil Myśliwiec
c392da09a6 Merge branch 'master' of https://github.com/nestjs/nest 2018-09-03 17:10:16 +02:00
Kamil Myśliwiec
02d4841d05 chore(@nestjs) publish v5.3.1 release 2018-09-03 17:09:48 +02:00
Kamil Myśliwiec
cbe9ed4980 Merge pull request #1036 from cschroeter/master
sample(nestjs) update GraphQL example
2018-09-03 12:52:59 +02:00
Kamil Myśliwiec
d654e5e84f deps(nestjs) replace generate-safe-id with uuid 2018-09-03 12:52:25 +02:00
Christian Schröter
9d2bd82173 Enable subscriptions in GraphQLModule 2018-09-03 12:25:53 +02:00
Christian Schröter
02affa5677 Update and clean up dependencies 2018-09-03 12:25:07 +02:00
Kamil Myśliwiec
71a023ebae Merge branch 'master' of https://github.com/nestjs/nest 2018-09-02 22:47:57 +02:00
Kamil Myśliwiec
aa75b52255 build(nestjs) fix package-lock.json 2018-09-02 22:47:47 +02:00
Kamil Myśliwiec
6cf7cdc2a6 Merge pull request #1008 from jbpionnier/refactor/unnecessary_instanceof_promise
refactor(nestjs) unnecessary instanceOf Promise deletion
2018-09-02 22:43:37 +02:00
Kamil Myśliwiec
5b804f5a35 tests(microservices) fix broken options unit tests 2018-09-02 22:42:05 +02:00
Kamil Myśliwiec
b348920d25 build(nestjs) update bundle, add opencollective 2018-09-02 22:31:39 +02:00
Kamil Myśliwiec
b6fe9b06cc refactor(microservices) remove unecessary options object 2018-09-02 22:31:11 +02:00
Kamil Myśliwiec
fde2041f17 sample(nestjs) update framework to 5.3.0 in all samples 2018-08-31 16:30:03 +02:00
Kamil Myśliwiec
7a4b0e64ad Merge branch '5.3.0' 2018-08-31 13:18:21 +02:00
Kamil Myśliwiec
afe9c4b5f4 sample(@nestjs) update auth and graphql sample 2018-08-31 13:18:02 +02:00
Kamil Myśliwiec
5e6694cb8b Merge pull request #1024 from nestjs/5.3.0
chore(nestjs) publish minor release 5.3.0
2018-08-31 13:09:39 +02:00
Kamil Myśliwiec
d20f6bb653 chore(nestjs) publish 5.3.0 minor release 2018-08-31 12:47:11 +02:00
Kamil Myśliwiec
e8032f37fc chore(@nestjs) publish v5.3.0 release 2018-08-31 12:46:22 +02:00
Kamil Myśliwiec
cae159e77c sample(@nestjs) update gateways and graphql sample 2018-08-31 12:24:50 +02:00
Kamil Myśliwiec
47812f5822 refactor(@nestsjs) replace underlying http server (express) 2018-08-31 12:24:29 +02:00
Kamil Myśliwiec
afa9903882 refactor(@nestjs/common) rename class serializer 2018-08-31 12:23:51 +02:00
Kamil Myśliwiec
a7d465bfa1 enhancement(@nestjs/core) injector improvements (circular dependencies) 2018-08-31 12:23:22 +02:00
Kamil Myśliwiec
95dfd59e4e sample(@nestjs) add class serializer sample 2018-08-27 16:58:39 +02:00
Kamil Myśliwiec
08e6278a77 sample(common) add cache module sample 2018-08-27 16:58:24 +02:00
Kamil Myśliwiec
fbf47a2825 feature(common) add class serializer interceptor 2018-08-27 16:57:46 +02:00
Kamil Myśliwiec
643e84c49a feature(common) cache module 2018-08-27 16:57:12 +02:00
Kamil Myśliwiec
25c7e8909e enhancement(common) add default options to MulterModule 2018-08-27 16:56:41 +02:00
Kamil Myśliwiec
0d5972c66b build(@nestjs) force compilation (new bundle) 2018-08-27 16:55:46 +02:00
Kamil Myśliwiec
394d7f23bf refactor(common) move multer module spec files 2018-08-27 12:25:29 +02:00
Kamil Myśliwiec
09d9c6597f refactor(common) move file interceptors to files module 2018-08-27 08:59:40 +02:00
Kamil Myśliwiec
1d8c8ee264 refactor(@nestjs) update dependencies 2018-08-27 08:59:15 +02:00
Kamil Myśliwiec
5a9d6d6d14 sample(nestjs) update auth sample 2018-08-27 00:01:57 +02:00
Kamil Myśliwiec
4d13ee8100 feature(common) add MulterModule 2018-08-27 00:00:51 +02:00
Kamil Myśliwiec
6b0ae0602c feature(websockets) support ack in socketio, enhancements 2018-08-26 23:59:30 +02:00
Kamil Myśliwiec
d0bd2f7b20 Update CONTRIBUTING.md 2018-08-26 23:59:10 +02:00
Jean-Baptiste Pionnier
5f965cf174 refactor: unnecessary instanceOf Promise deletion 2018-08-26 21:05:14 +02:00
Kamil Myśliwiec
504a10ce5e Merge branch 'master' of https://github.com/nestjs/nest 2018-08-25 15:48:03 +02:00
Kamil Myśliwiec
a9abd1c2ea sample(@nestjs) update graphql example, add integration test 2018-08-25 15:47:46 +02:00
Kamil Myśliwiec
e7e859adce Merge pull request #989 from BrunnerLivio/feature/add-im-a-teapot-exception
feature(@nestjs/common) add im a teapot exception
2018-08-25 14:44:08 +02:00
Kamil Myśliwiec
0c98a65e79 chore(@nestjs) publish 5.2.2 release 2018-08-24 12:43:03 +02:00
Kamil Myśliwiec
cd30d7a4a5 chore(@nestjs) publish v5.2.2 release 2018-08-24 12:42:29 +02:00
Kamil Myśliwiec
a6d837e64a bugfix(@nestjs/common) fix custom decorators (data isnt always string) 2018-08-24 12:13:48 +02:00
Kamil Myśliwiec
0904b0ba56 Merge branch 'master' of https://github.com/nestjs/nest 2018-08-24 10:38:12 +02:00
Kamil Myśliwiec
150c81e397 feature(@nestjs/core) add prefix property to ServeStaticOptions 2018-08-24 10:35:04 +02:00
Kamil Myśliwiec
1717f35717 Merge pull request #997 from alerosa/fix-auth-sample-missing-dependency
example(@nestjs) add @nestjs/jwt to auth sample dependencies
2018-08-23 08:53:01 +02:00
alerosa
61b6b346da add @nestjs/jwt to auth sample dependencies 2018-08-23 00:55:19 +01:00
Kamil Myśliwiec
b02fb57d8f chore(@nestjs) publish 2.3.1 patch release 2018-08-22 22:00:42 +02:00
Kamil Myśliwiec
cb302e6719 chore(@nestjs) publish v5.2.1 release 2018-08-22 21:59:35 +02:00
Kamil Myśliwiec
1f9030c504 Merge branch 'master' of https://github.com/nestjs/nest 2018-08-22 21:58:18 +02:00
Kamil Myśliwiec
af5a4af675 chore(@nestjs) publish v5.2.1 release 2018-08-22 21:57:52 +02:00
Kamil Myśliwiec
664321465c Update Readme.md 2018-08-22 21:16:43 +02:00
Kamil Myśliwiec
f6d4b5e82a test(@nestjs/common) exclude load package 2018-08-22 20:21:55 +02:00
Kamil Myśliwiec
09c9f704e5 Merge pull request #909 from nestjs/5.2.0
chore(@nestjs) publish 5.2.0 minor release
2018-08-22 15:47:53 +02:00
Kamil Myśliwiec
8a8b780273 chore(@nestjs) publish 5.2.0 minor release 2018-08-22 15:44:30 +02:00
Kamil Myśliwiec
1f0de4923e chore(@nestjs) publish v5.2.0 release 2018-08-22 15:37:56 +02:00
Kamil Myśliwiec
d5833e3e4b feature(@nestjs/core) extract helpers to context utils class 2018-08-22 14:37:07 +02:00
Kamil Myśliwiec
deffcdcd84 example(@nestjs) update examples - auth, graphql 2018-08-22 14:36:43 +02:00
Livio Brunner
ba2eeeeac7 feature(@nestjs/common) add im a teapot exception
"It’s a reminder that the underlying
processes of computers
are still made by humans.
It'd be a real shame to see 418 go."
2018-08-21 13:43:50 +02:00
Kamil Myśliwiec
36b94b37d0 feature: add enhancers to custom decorator factory, fixes 2018-08-17 14:55:27 +02:00
Kamil Myśliwiec
85b93260e2 refactor(@nestjs) resolve merge conflicts 2018-08-16 16:30:33 +02:00
Kamil Myśliwiec
94f74a485b packages(@nestjs/core) add path-to-regexp to dependencies 2018-08-16 16:29:53 +02:00
Kamil Myśliwiec
b4253525fe Merge pull request #977 from nestjs/feature/938-hierarchical-lifecycle
feature(@nestjs/core) add hierarchical lifecycle hooks #938
2018-08-16 16:23:25 +02:00
Kamil Myśliwiec
c38c91217c feature(@nestjs/core) add hierarchical lifecycle hooks #938 2018-08-16 16:11:18 +02:00
Kamil Myśliwiec
f024af4912 Merge pull request #975 from nestjs/bugfix/fastify-wildcard
bugfix(@nestjs/core) middleware wildcard is not working with fastify
2018-08-16 15:11:43 +02:00
Kamil Myśliwiec
6976ffe079 bugfix(@nestjs/core) middleware wildcard is not working with fastify 2018-08-16 15:08:50 +02:00
Kamil Myśliwiec
2812c3863d Merge pull request #895 from jbpionnier/feature/grpc-loader
feature(@nestjs/microservices) load proto with proto-loader
2018-08-16 14:13:52 +02:00
Kamil Myśliwiec
9ad7927c4c Merge pull request #974 from nestjs/bugfix/948-nats-wildcards
bugfix(@nestjs/microservices) fix nats wildcards
2018-08-16 14:13:32 +02:00
Kamil Myśliwiec
afae462b6e Merge pull request #955 from jbpionnier/refactor/use_some_method
refactor(@nestjs) use some() method (arrays)
2018-08-16 14:08:36 +02:00
Kamil Myśliwiec
62e733c018 test(@nestjs/microservices) fix failing unit tests 2018-08-16 14:07:37 +02:00
Kamil Myśliwiec
d446a56381 bugfix(@nestjs/microservices) fix nats wildcards 2018-08-16 13:50:56 +02:00
Jean-Baptiste Pionnier
2bdf47a572 refactor: use some method 2018-08-09 08:27:39 +02:00
Jean-Baptiste Pionnier
caf99c6cf8 bugfix(@nestjs/microservice) fix invalid proto 2018-08-09 07:45:33 +02:00
Jean-Baptiste Pionnier
5415659fb9 feature(@nestjs/microservices) use grpc/proto-loader 2018-08-08 16:58:09 +02:00
Kamil Myśliwiec
e967ba15cf Merge pull request #936 from nestjs/bugfix/935-file-interceptor
bugfix(@nestjs/common) fix multiple file interceptors issue
2018-08-02 09:33:10 +02:00
Kamil Myśliwiec
0b191fbd17 bugfix(@nestjs/common) fix multiple file interceptors issue 2018-08-02 09:32:12 +02:00
Kamil Myśliwiec
2ea58acc70 sample(@nestjs) fix paths join usage 2018-08-01 22:38:47 +02:00
Kamil Myśliwiec
1f59a81c28 Merge branch 'master' into 5.2.0 2018-08-01 22:38:23 +02:00
Kamil Myśliwiec
fbcb18c978 Merge pull request #934 from nestjs/feature/926-use-logger
feature(@nestjs/core) add useLogger() to Nest context #926
2018-08-01 22:34:48 +02:00
Kamil Myśliwiec
dd7bb313f4 Merge pull request #933 from nestjs/feature/847-optional-decorator
feature(@nestjs/core) add @Optional() decorator #847
2018-08-01 22:34:16 +02:00
Kamil Myśliwiec
946ed2e339 feature(@nestjs/core) add useLogger() to Nest context #926 2018-08-01 22:33:02 +02:00
Kamil Myśliwiec
96da5bd9c5 feature(@nestjs/core) add @Optional() decorator #847 2018-08-01 22:31:39 +02:00
Kamil Myśliwiec
9f77d5f550 bugfix(@nestjs/common) revert @Catch() validation 2018-08-01 21:09:12 +02:00
Kamil Myśliwiec
9e6cf1f1aa Merge pull request #911 from Patrick-Remy/patch-1
sample(@nestjs) fix path.join arguments seperation
2018-08-01 20:34:32 +02:00
Kamil Myśliwiec
d92fa0dee1 Merge branch 'master' into 5.2.0 2018-08-01 20:10:53 +02:00
Kamil Myśliwiec
63109f5717 bugfix(@nestjs/common) fix pipes typing issue 2018-08-01 20:09:19 +02:00
Kamil Myśliwiec
dc33ea57ef Merge pull request #903 from nestjs/feature/module-ref
feature(@nestjs/core) expose container to ModuleRef, add close()
2018-08-01 20:08:49 +02:00
Kamil Myśliwiec
780bd9c0f9 Merge pull request #904 from nestjs/feature/846-axios
feature(@nestjs/common) add configurable dynamic module (HttpModule)
2018-08-01 20:08:06 +02:00
Kamil Myśliwiec
a79041d211 Merge pull request #908 from nestjs/feature/860-default-filter
feature(@nestjs) expose default exception filters #860
2018-08-01 19:55:16 +02:00
Kamil Myśliwiec
eda8e293c3 chore(@nestjs) add package-lock.json 2018-08-01 19:52:25 +02:00
Kamil Myśliwiec
fd797b1a69 chore(@nestjs) fix gulpfile 2018-08-01 19:47:33 +02:00
Kamil Myśliwiec
fd098fc3f7 chore(@nestjs) fix gulp scripts 2018-08-01 19:40:18 +02:00
Kamil Myśliwiec
1be2ccdb0b Update Readme.md 2018-07-31 13:43:07 +02:00
Kamil Myśliwiec
cb46174bae Merge pull request #906 from nestjs/bugfix/892-custom-decorators
bugfix(@nestjs/common) data parameter is not required (custom decorators)
2018-07-26 15:04:14 +02:00
Kamil Myśliwiec
ac1578793f Merge pull request #902 from nestjs/feature/720-decorators-validation
enhancement(@nestjs/common) add validation to @catch() decorator
2018-07-26 14:55:11 +02:00
Kamil Myśliwiec
525922ee69 Merge pull request #907 from nestjs/bugfix/879-injectable-inheritance
bugfix(@nestjs/core) inherited metadata is not applied #879
2018-07-26 14:54:32 +02:00
Patrick-Remy
5327979745 Fix path.join arguments seperation 2018-07-26 10:40:50 +02:00
Kamil Myśliwiec
3a0e404832 Merge pull request #901 from nestjs/bugfix/854-mixing-testing
bugfix(@nestjs/common) fix mixin testing issue #854
2018-07-25 20:08:24 +02:00
Kamil Myśliwiec
55b1f1e08e Merge pull request #900 from nestjs/bugfix/671-dynamic-modules
bugfix(@nestjs/core) enable dynamic modules recursive imports #671
2018-07-25 20:03:40 +02:00
Kamil Myśliwiec
a05383c635 Merge pull request #644 from DanielRuf/chore/add-nodejs-10
chore(@nestjs): add Node.js 10 (travis)
2018-07-25 19:57:09 +02:00
Kamil Myśliwiec
86abc0001c Merge branch '5.2.0' into chore/add-nodejs-10 2018-07-25 19:56:49 +02:00
Kamil Myśliwiec
c4ff2e736a Merge pull request #642 from DanielRuf/chore/cache-node-modules
chore(@nestjs): cache node_modules
2018-07-25 19:54:42 +02:00
Kamil Myśliwiec
d00d5f2996 Merge branch '5.2.0' into chore/cache-node-modules 2018-07-25 19:54:28 +02:00
Kamil Myśliwiec
5f0f6e5b61 Merge pull request #878 from wbhob/npm6-scripts
chore(): rename prepublish commands to prepare
2018-07-25 19:53:40 +02:00
Kamil Myśliwiec
f39573007c Merge pull request #877 from wbhob/master
refactor(): reduce complexity of NestFactory.create signature
2018-07-25 19:49:50 +02:00
Kamil Myśliwiec
f7a367e895 Merge pull request #814 from BrunnerLivio/master
feature(@nestjs/core) display known dependency names in unknown dependency exception
2018-07-25 19:43:21 +02:00
Kamil Myśliwiec
dcba92190f feature(@nestjs) add barrel files 2018-07-25 18:49:24 +02:00
Kamil Myśliwiec
614d57f130 feature(@nestjs) expose default exception filters 2018-07-25 18:47:40 +02:00
Kamil Myśliwiec
9e170c4ae4 bugfix(@nestjs/core) inherited metadata is not applied #879 2018-07-25 13:57:45 +02:00
Kamil Myśliwiec
85070a5c9c refactor: cleanup 2018-07-25 13:17:29 +02:00
Kamil Myśliwiec
f86fc35fa7 refactor: cleanup 2018-07-25 13:16:58 +02:00
Kamil Myśliwiec
53184b8df0 bugfix(@nestjs/common) data parameter is not required (custom decorators) #892 2018-07-25 13:16:05 +02:00
Kamil Myśliwiec
f385d5c47d feature(@nestjs/common) add configurable dynamic module (HttpModule) 2018-07-24 22:32:10 +02:00
Kamil Myśliwiec
1527e12013 feature(@nestjs/core) expose container to ModuleRef, add close() to NestContext 2018-07-24 22:07:14 +02:00
Kamil Myśliwiec
58800f69b1 enhancement(@nestjs/common) add validation to @Catch() decorator 2018-07-24 20:18:10 +02:00
Kamil Myśliwiec
049da42d4a enhancement(@nestjs/common) add validation to @Catch() decorator 2018-07-24 20:17:54 +02:00
Kamil Myśliwiec
21f2e8a9f7 bugfix(@nestjs/common) fix mixin testing issue #854 2018-07-24 19:55:09 +02:00
Kamil Myśliwiec
432b777f2c bugfix(@nestjs/core) enable dynamic modules recursive imports #671 2018-07-24 16:47:53 +02:00
Kamil Myśliwiec
e39c9d920d bugfix(@nestjs/core) add circular dependency (related modules) check 2018-07-24 16:23:53 +02:00
Kamil Myśliwiec
b84c2b0884 bugfix(@nestjs/core) add circular dependency (related modules) check 2018-07-24 16:10:10 +02:00
Livio Brunner
e4d0118e9d refactor(@nestjs/core) change any[] types to a custom interface 2018-07-16 10:45:33 +02:00
Wilson Hobbs
0bf98c46cb chore(): rename prepublish commands to prepare, to comply with https://docs.npmjs.com/misc/scripts#deprecation-note 2018-07-15 12:43:12 -04:00
Wilson Hobbs
442b08fdb9 refactor(): reduce complexity of NestFactory.create signature 2018-07-15 12:30:55 -04:00
Livio Brunner
9c2a9d76d2 refactor(@nestjs/core) rename args parameter to dependencies 2018-07-15 13:25:17 +02:00
Livio Brunner
a354741c31 fix(@nestjs/core) show token name in unk. dep. exception message 2018-07-09 17:49:32 +02:00
Kamil Myśliwiec
8d62307987 sample(@nestjs) update packages 2018-07-05 17:37:44 +02:00
Kamil Myśliwiec
e2de979081 build(@nestjs) fix README copy&move 2018-07-05 14:38:30 +02:00
Kamil Myśliwiec
0f62bcd41f chore(@nestjs) publish 5.1.0 release 2018-07-05 14:31:21 +02:00
Kamil Myśliwiec
d4c9644368 chore(@nestjs) publish v5.1.0 release 2018-07-05 14:28:27 +02:00
Kamil Myśliwiec
0c4fe26c21 sample(@nestjs) move public and views dirs outside of the src 2018-07-05 09:10:10 +02:00
Kamil Myśliwiec
3cf8607b20 enhancement(@nestjs/microservices) disable internal gRPC errors swallow 2018-07-04 23:17:02 +02:00
Kamil Myśliwiec
3d2d838bd1 bugfix(@nestjs/core) multi global providers issue #812 2018-07-04 19:36:29 +02:00
Kamil Myśliwiec
a9204cb399 bugfix(@nestjs/testing) await scan() operation 2018-07-04 18:30:08 +02:00
Kamil Myśliwiec
bd3b102c2f Merge branch 'master' of https://github.com/nestjs/nest 2018-07-04 17:46:44 +02:00
Kamil Myśliwiec
9cf27a35dd feature(@nestjs/core) add axiosRef to the HttpService #842 2018-07-04 17:46:14 +02:00
Kamil Myśliwiec
c1c5b15859 Merge pull request #839 from Y0hy0h/patch-1
refactor(@nestjs/core) rephrase error messages
2018-07-04 16:33:58 +02:00
Y0hy0h
3e55de545f refactor(core) rephrase error messages
Fixes typo, clarifies what actions are expected.
2018-07-03 17:11:33 +02:00
Kamil Myśliwiec
ced6729157 Update Readme.md 2018-06-29 20:44:34 +02:00
Kamil Myśliwiec
a57eb17640 Update Readme.md 2018-06-29 20:44:13 +02:00
Kamil Myśliwiec
6c2863d709 Merge pull request #823 from ZQun/patch-2
Update Chinese guide format
2018-06-29 18:39:26 +02:00
Kamil Myśliwiec
fc05b244a8 Merge pull request #822 from ZQun/patch-1
Update Chinese guide format
2018-06-29 18:38:58 +02:00
ZQun
c80fd77416 Update Chinese guide format
Update Chinese guide format
2018-06-28 11:10:02 +08:00
ZQun
e2d15db3f4 Update Chinese guide format
Update Chinese guide format
2018-06-28 11:02:39 +08:00
Livio Brunner
8057a5cf19 feature(@nestjs/core) display dependency names in unknown dependency ex
This feature displays the found dependency names when any unknown
dependency is getting injected. Before this feature the error message
gets displayed like (?, +). After this implementation, like this e.g.
(?, CatsService).
2018-06-26 10:49:16 +02:00
Kamil Myśliwiec
a6ab849df2 Merge pull request #808 from autaut03/autaut03-fix/forbiddenNotHttpException
bugfix(@nestjs/core): use ForbiddenException instead of HttpException
2018-06-25 13:41:09 +02:00
Alex_Wells
7143d3b8ac bugfix(@nestjs/core): use ForbiddenException instead of HttpException
Two modified files are the only places in the whole framework where HttpException specifically is used
and used to be used wrong. It's easier to handle and catch ForbiddenException (and other HttpException
child) rather than having to compare HttpStatus to catch it. As ForbiddenException extends HttpException
and provides same HttpStatus, old code catching HttpException still works.
2018-06-24 20:50:30 +03:00
Kamil Myśliwiec
be6d90ace2 feature(@nestjs/core) enable deffered dynamic modules 2018-06-24 13:26:55 +02:00
Kamil Myśliwiec
7023905b53 feature(@nestjs/core) FastifyAdapter matches URL and request method 2018-06-22 10:41:52 +02:00
Kamil Myśliwiec
f4817ee4eb feature(@nestjs/common) add error messages disabled mode (ValidationPipe) 2018-06-21 23:00:33 +02:00
Kamil Myśliwiec
a87eee0849 example(@nestjs) fix HttpExceptionFilter example (missing status) 2018-06-21 22:43:50 +02:00
Kamil Myśliwiec
a8803fd166 Merge branch 'master' of https://github.com/nestjs/nest 2018-06-21 22:19:43 +02:00
Kamil Myśliwiec
18f68d96b7 Merge branch 'thg303-feature/add-FileFieldsInterceptor' 2018-06-21 22:19:18 +02:00
Kamil Myśliwiec
ecd61e3777 feature(@nestjs/common) add field name to the @UploadedFile() decorator 2018-06-21 22:18:55 +02:00
Kamil Myśliwiec
10eeac9ae7 Merge branch 'feature/add-FileFieldsInterceptor' of https://github.com/thg303/nest into thg303-feature/add-FileFieldsInterceptor 2018-06-21 22:02:46 +02:00
Kamil Myśliwiec
59e6a3d262 Merge pull request #802 from nestjs/790-feature-middleware
feature(@nestjs/core) superior MiddlewareConsumer, add exclude
2018-06-21 21:59:08 +02:00
Kamil Myśliwiec
292fe2136c Merge branch 'micmro-feature/grpc-cancellation' 2018-06-21 21:53:43 +02:00
Kamil Myśliwiec
f80cd9edd1 refactor(@nestjs/microservices) extract magic strings into constants 2018-06-21 21:51:48 +02:00
Kamil Myśliwiec
adbfae2b71 Merge branch 'feature/grpc-cancellation' of https://github.com/micmro/nest into micmro-feature/grpc-cancellation 2018-06-21 21:23:40 +02:00
Kamil Myśliwiec
4cfda07b2a tests(@nestjs/core) fix failing unit tests 2018-06-21 21:22:14 +02:00
Kamil Myśliwiec
3ac7802315 Merge branch 'master' of https://github.com/nestjs/nest 2018-06-21 20:51:04 +02:00
Kamil Myśliwiec
1813e5a09c build(@nestjs) add copy README gulp script 2018-06-21 20:50:50 +02:00
Kamil Myśliwiec
c9184acee1 feature(@nestjs/core) superior MiddlewareConsumer, add exclude 2018-06-21 15:48:31 +02:00
Kamil Myśliwiec
1c98d6b18c Merge pull request #795 from nestjs/734-bugfix-validation
bugfix(@nestjs/common) ValidationPipe throws 500 error
2018-06-20 17:51:18 +02:00
Kamil
7172671dcc Merge branch 'master' of https://github.com/nestjs/nest 2018-06-20 17:49:14 +02:00
Kamil
294e269ede Merge branch 'RivaCode-message_pattern_string-key' 2018-06-20 17:48:54 +02:00
Kamil
00c98501ff enhancement(@nestjs/microservices) use isString helper instead 2018-06-20 17:47:17 +02:00
Kamil Myśliwiec
51d5be4e9d Merge pull request #794 from nestjs/772-bugfix-testing
bugfix(@nestjs/core) issue #772 testing - too restrictive typings
2018-06-20 17:37:59 +02:00
Kamil
f86c0e33c4 Merge branch 'message_pattern_string-key' of https://github.com/RivaCode/nest into RivaCode-message_pattern_string-key 2018-06-20 17:36:58 +02:00
Kamil
3888d8ee8b bugfix(@nestjs/common) ValidationPipe throws 500 error 2018-06-20 17:34:00 +02:00
Kamil
8029796193 bugfix(@nestjs/core) testing utilities typings are too restrictive 2018-06-20 17:33:13 +02:00
Kamil
f3c28f57ac refactor(@nestjs/common) reorganize imports in create route param 2018-06-20 17:21:56 +02:00
Kamil
03db0d357a improvement(@nestjs/common) add missing typings to custom param factory 2018-06-20 17:15:55 +02:00
Kamil
7ad6095e16 Merge branch 'master' of https://github.com/nestjs/nest 2018-06-20 17:13:10 +02:00
Kamil Myśliwiec
617bc70944 Merge pull request #788 from Defenderbass/bugfix/types_in_createParamDecorator
bugfix(@nestjs/common) changes the types of arguments in createParamD…
2018-06-20 17:12:49 +02:00
Kamil
f2d2d56111 bundle(@nestjs/core) remove needless middlewares directory 2018-06-20 17:11:08 +02:00
Kamil Myśliwiec
84d31f9449 Update Readme.md 2018-06-19 09:54:59 +02:00
Igor Katsuba
da3745f386 bugfix(@nestjs/common) changes the types of arguments in createParamDecorator 2018-06-18 10:39:27 +03:00
Stas Rivkin
7e47100d3e bugfix(@nestjs/microservices): messagePattern string key
stringify on a string key added an extra parentheses to the pattern
2018-06-17 14:32:15 +03:00
Michael
0c8e8fb4f7 chore(@nestjs/microservices) add tests to grpc clients disconnection 2018-06-10 23:38:21 +02:00
Michael Mrowetz
f337206785 chore(microservice) tests for grpc cancelling - server side 2018-06-09 17:25:58 +02:00
Michael Mrowetz
3984bc92f2 fix(tests) fix the grpc tests 2018-06-08 17:51:31 +02:00
Michael
89fe60a213 chore(@nestjs/microservices) improve ClientGrpcProxy.getService typing 2018-06-08 15:24:24 +02:00
Michael
3ebec419fe feature(@nestjs/microservices) allow grpc clients to disconnect
- when client cancels the server stream gets completed too
- client introduced disconnection does not throw errors on the client side
- release client's event listener on 'end'
2018-06-08 15:21:37 +02:00
Kamil Myśliwiec
fed2459677 Merge pull request #750 from ltciro/fix_typo_01catsapp_guard
sample(@nestjs) fix hasRole is not a function (01-cats-app)
2018-06-04 22:34:18 +02:00
Kamil Myśliwiec
33c7049d71 Merge pull request #760 from yingye/master
Update readme_zh.md
2018-06-04 21:43:14 +02:00
yingye
e44f51d647 update readme_zh.md 2018-06-04 18:52:04 +08:00
Laura Ciro
31aa2f09c5 sample(@nestjs) fix hasRole is not a function (01-cats-app) 2018-05-30 23:37:36 -05:00
Ali Ghanavatian
3fffc01890 feature(@nestjs/common) add file-fields interceptor
usage will be like:
```import {FileFieldsInterceptor} from '@nest/common';

@UseInterceptors(FileFieldsInterceptor([{name: 'avatar', maxCount: 1},
{name: 'passport', maxCount: 1}]))
```
2018-05-30 19:32:05 +04:30
Kamil Myśliwiec
e1abf80569 Update Readme.md 2018-05-28 09:44:41 +02:00
Kamil Myśliwiec
a7fde9b6cc Update Readme.md 2018-05-26 20:44:02 +02:00
Kamil Myśliwiec
92d3ed48db integration(@nestjs) add mongoose integration test 2018-05-26 14:51:10 +02:00
Kamil Myśliwiec
c5455de9d1 chore(@nestjs) publish v5.0.1 release 2018-05-25 13:26:37 +02:00
Kamil Myśliwiec
7b5b054818 integration(@nestjs) add typeorm integration test 2018-05-25 12:48:38 +02:00
Kamil Myśliwiec
17a609cd9c feature(@nestjs/microservices) grpc improvements (add root), cleanup 2018-05-25 12:44:18 +02:00
Kamil Myśliwiec
ae128f6e91 feature(@nestjs/testing) add error logs in the testing mode (#709, #713) 2018-05-20 15:06:03 +02:00
Kamil Myśliwiec
cb24ca9ee5 bugfix(@nestjs/websockets) handle invalid payloads (#683) 2018-05-20 15:04:04 +02:00
Kamil Myśliwiec
e37b9f7d81 bugfix(@nestjs/core) support circular deps in dynamic modules (#678) 2018-05-20 15:02:32 +02:00
Kamil Myśliwiec
55600edb2d docs(@nestjs) add PULL_REQUEST_TEMPLATE 2018-05-19 10:32:27 +02:00
Kamil Myśliwiec
033068b5d7 Update CONTRIBUTING.md 2018-05-19 10:30:09 +02:00
Kamil Myśliwiec
9ea7db9160 Merge branch 'master' of https://github.com/nestjs/nest 2018-05-19 10:25:54 +02:00
Kamil Myśliwiec
1801bf86b6 Update readme_zh.md 2018-05-19 10:25:32 +02:00
Kamil Myśliwiec
ba5c59bc34 Merge pull request #700 from zuohuadong/patch-1
chore(readme) upgrade chinese
2018-05-19 10:23:51 +02:00
Kamil Myśliwiec
bf30a304d8 Merge pull request #702 from alQlagin/patch-1
bugfix(@nestjs/common) incorrect aixos methods in HttpService
2018-05-19 10:23:25 +02:00
Alex Kulagin
310d530308 Fix: incorrect aixos methods in HttpService
HttpService.put and HttpService.patch use axios.post 
Changed to axios.put and axios.patch
2018-05-17 14:36:38 +05:00
huadong zuo
75775d6ea1 chore(readme) upgrade chinese
update 5.0
2018-05-17 13:16:06 +08:00
Kamil Myśliwiec
f9e02b60fa feature(@nestjs/core) add getInstance() to HTTP adapters 2018-05-16 15:17:30 +02:00
Kamil Myśliwiec
c5a3385156 ci(@nestjs) add package-lock.json 2018-05-13 14:01:23 +02:00
Kamil Myśliwiec
403a137847 ci: remove package-lock.json 2018-05-13 13:42:55 +02:00
Kamil Myśliwiec
c7bd1afc39 sample(@nestjs) update samples package.json 2018-05-13 13:30:10 +02:00
Kamil Myśliwiec
fcf24d32c9 chore(@nestjs) update README in bundle directory 2018-05-13 11:05:26 +02:00
Kamil Myśliwiec
53bcbefb63 chore(@nestjs) publish v5.0.0 release 2018-05-13 11:03:01 +02:00
Kamil Myśliwiec
e010ebd09e Merge branch 'master' of https://github.com/nestjs/nest 2018-05-13 10:24:42 +02:00
Kamil Myśliwiec
663ca6981e feature(@nestjs/microservices) more descriptive gRPC errors 2018-05-13 10:24:33 +02:00
Kamil Myśliwiec
e41c4d806f Update Readme.md 2018-05-13 10:23:49 +02:00
Kamil Myśliwiec
6ad5ae6a67 chore(release) publish v5.0.0-rc.4 2018-05-09 20:36:38 +02:00
Kamil Myśliwiec
0da348045f tests(@nestjs) fix broken stubs, flush out exceptions 2018-05-09 18:18:52 +02:00
Kamil Myśliwiec
64629cfb4d tests(@nestjs/common) fix broken promise rejection in ValidationPipe 2018-05-09 18:04:43 +02:00
Kamil Myśliwiec
4a589d52d5 tests(@nestjs/microservices) fix broken mqtt and redis client tests 2018-05-09 17:51:05 +02:00
Kamil Myśliwiec
8f30e6769b Merge branch 'master' of https://github.com/nestjs/nest 2018-05-09 17:21:34 +02:00
Kamil Myśliwiec
6016f8d175 feature(@nestjs/microservices) expose connect method, improvements & fixes 2018-05-09 17:21:21 +02:00
Kamil Myśliwiec
7b950ffa6e feature(@nestjs/common) make ValidationPipe properties protected 2018-05-09 17:19:38 +02:00
Kamil Myśliwiec
f037edad14 integration(@nestjs) add circular dependency integration test 2018-05-09 17:19:12 +02:00
Kamil Myśliwiec
9c404cddea bugfix: remove invalid MiddlewareConsumer typings 2018-05-09 17:18:06 +02:00
Kamil Myśliwiec
3900cadbd9 Update Readme.md 2018-05-07 13:31:39 +02:00
Kamil Myśliwiec
8b04584ca9 chore(release) publish v5.0.0-rc.3 2018-05-07 13:23:08 +02:00
Kamil Myśliwiec
c5e560d1cf samples(@nestjs) fix grpc client options, remove slash (swagger) 2018-05-07 13:18:48 +02:00
Kamil Myśliwiec
bae969c601 Merge branch 'master' of https://github.com/nestjs/nest 2018-05-07 13:18:07 +02:00
Kamil Myśliwiec
0fcdf4ee2c bugfix(@nestjs/common) add missing forward reference typing 2018-05-07 11:14:19 +02:00
Kamil Myśliwiec
4a744d1c1b Merge pull request #640 from DanielRuf/style/reformat-travis-ci-config
style: reformat Travis CI config
2018-05-07 11:08:48 +02:00
Daniel Ruf
c9daccda3a style: reformat Travis CI config 2018-05-06 23:59:01 +02:00
Kamil Myśliwiec
72aad1d90e bugfix(@nestjs/core) export FastifyAdapter at the root level #622 2018-05-06 22:41:06 +02:00
Kamil Myśliwiec
cb9896ed7f Merge branch 'master' of https://github.com/nestjs/nest 2018-05-06 22:34:24 +02:00
Kamil Myśliwiec
f81f14364a sample(@nestjs) fix invalid message property (16-gateways-ws) #635 2018-05-06 22:34:02 +02:00
Kamil Myśliwiec
8a77bfab55 Merge pull request #645 from DanielRuf/chore/upgrade-grpc
chore: upgrade grpc
2018-05-06 22:19:55 +02:00
Kamil Myśliwiec
04cd077426 Merge pull request #641 from DanielRuf/chore/clone-only-the-last-5-commits
ci: clone only the last 5 commits
2018-05-06 22:19:25 +02:00
Kamil Myśliwiec
e84979d04a Merge pull request #639 from DanielRuf/chore/use-npm-ci
chore: use npm ci instead of npm install (travis)
2018-05-06 22:17:36 +02:00
Daniel Ruf
f9cdb6168d chore: update lockfile 2018-05-06 18:43:30 +02:00
Daniel Ruf
bc1eab1b3d chore: upgrade grpc 2018-05-06 18:10:44 +02:00
Daniel Ruf
aba394f742 chore: migrate to gulp 4 2018-05-06 17:58:31 +02:00
Daniel Ruf
6a49b833ca chore: trigger new build 2018-05-06 16:51:48 +02:00
Daniel Ruf
2c9a07b64a chore: clone only the last 5 commits 2018-05-06 16:26:55 +02:00
Daniel Ruf
7e022be24a chore: cache node_modules 2018-05-06 16:23:14 +02:00
Daniel Ruf
8bf9cecd10 chore: use npm ci 2018-05-06 16:21:36 +02:00
Daniel Ruf
fb860c70e3 chore: add Node.js 10 2018-05-06 16:17:49 +02:00
Kamil Myśliwiec
eb639de347 chore(release) publish v5.0.0-rc.2 2018-05-02 23:30:42 +02:00
Kamil Myśliwiec
5bd3a83cb2 ci(@nestjs) remove platform (node 10) 2018-05-02 23:15:27 +02:00
Kamil Myśliwiec
382d99986b bugfix(@nestjs/websockets) lifecycle hooks multi execution 2018-05-02 23:07:53 +02:00
Kamil Myśliwiec
154b865d7b Merge pull request #621 from patrickhousley/bugfix/express-engine
fix(core): Fix express adapter
2018-05-02 15:21:10 +02:00
Patrick Housley
d001a2f34a fix(core): Fix express adapter 2018-05-01 18:33:48 -05:00
Kamil Myśliwiec
4cfdbe2220 chore(release) publish v5.0.0-rc.1 2018-04-30 23:40:59 +02:00
Kamil Myśliwiec
0266ffdb97 chore(release) publish v5.0.0-rc.1 2018-04-30 23:38:37 +02:00
Kamil Myśliwiec
1f7ae5ef3a chore(release) publish v5.0.0-beta.8 2018-04-30 13:05:50 +02:00
Kamil Myśliwiec
aeda614c5c test(@nestjs/common) fix broken unit tests 2018-04-30 13:04:36 +02:00
Kamil Myśliwiec
181d8c6585 feature(@nestjs/common) add package loader utility 2018-04-30 13:01:37 +02:00
Kamil Myśliwiec
195ae2726d chore(release) publish v5.0.0-beta.7 2018-04-29 16:13:44 +02:00
Kamil Myśliwiec
484a2eb4ec sample(@nestjs) update authentication example (passport) 2018-04-29 16:03:25 +02:00
Kamil Myśliwiec
6630313ece improvement(@nestjs/common) move class-validator and class-transformer 2018-04-29 15:58:44 +02:00
Kamil Myśliwiec
c7a8caacef Merge remote-tracking branch 'origin/master' 2018-04-28 18:10:33 +02:00
Kamil Myśliwiec
021b96eaa0 chore(release) publish v5.0.0-beta.6 2018-04-28 18:05:23 +02:00
Kamil Myśliwiec
fb53ba2b1a chore(release) publish v5.0.0-beta.6 2018-04-28 18:03:49 +02:00
Kamil Myśliwiec
bf2fcb7aa1 Update CHANGELOG.md 2018-04-28 15:27:00 +02:00
Kamil Myśliwiec
518ea8d33f chore(release) publish v5.0.0-beta.4 2018-04-28 15:24:39 +02:00
Kamil Myśliwiec
3ad570e62e bugfix(@nestjs/microservices) extract external typings #594 2018-04-28 15:23:03 +02:00
Kamil Myśliwiec
5cfb0bfc85 refactor(@nestjs) fix typos, extract module compiler, fix broken guards 2018-04-28 12:42:35 +02:00
Kamil Myśliwiec
59fb9c71e2 Merge branch 'master' of https://github.com/nestjs/nest 2018-04-27 13:52:24 +02:00
Kamil Myśliwiec
8e2c957833 sample(@nestjs) bump packages versions 2018-04-27 13:42:09 +02:00
Kamil Myśliwiec
944921f2e9 external(@nestjs) update to rxjs@6.0.0 2018-04-27 13:13:02 +02:00
Kamil Myśliwiec
59f5d68df5 feature(@nestjs/common) add @Header() decorator 2018-04-23 22:44:57 +02:00
Kamil Myśliwiec
91c879d922 Update CHANGELOG.md 2018-04-22 12:12:20 +02:00
Kamil Myśliwiec
f918e2b774 Update CHANGELOG.md 2018-04-22 12:08:13 +02:00
Kamil Myśliwiec
6cac4b7e1e chore(release) publish v5.0.0-beta.3 2018-04-22 11:45:33 +02:00
Kamil Myśliwiec
8117cfb10b chore(release) publish v5.0.0-beta.3 2018-04-22 11:42:26 +02:00
Kamil Myśliwiec
4b926da0d6 format(@nestjs) revert lint precommit hook 2018-04-21 16:03:16 +02:00
Kamil Myśliwiec
77d4ea7513 ci(@nestjs) fix unit tests, falling linux build 2018-04-21 16:01:59 +02:00
Kamil Myśliwiec
3160245145 refactor(@nestjs) fix tslint issues, format code 2018-04-21 14:22:24 +02:00
Kamil Myśliwiec
6e19f3554a Merge branch 'update/version-5' 2018-04-21 13:57:28 +02:00
Kamil Myśliwiec
ae6eb8fa7d format(@nestjs) add tslint precommit hook 2018-04-21 13:56:55 +02:00
Kamil Myśliwiec
5d28b98a8c feature(@nestjs/core) add async lifecycle hooks support 2018-04-21 13:55:58 +02:00
Kamil Myśliwiec
52acfe4ea2 tests(@nestjs) add dynamic modules & express instance integration tests 2018-04-21 00:04:18 +02:00
Kamil Myśliwiec
01a4f64a2e Merge pull request #577 from afurculita/patch-1
Update http.exception.ts
2018-04-20 15:54:17 +02:00
Alexandru Furculita ♻
b47a384621 Update http.exception.ts 2018-04-19 14:21:02 +03:00
Alexandru Furculita ♻
e842768bb1 Update http.exception.ts
Some remains from a git merge/rebase conflict
2018-04-19 14:20:22 +03:00
Kamil Myśliwiec
998a24d62f Update Readme.md 2018-04-18 23:25:03 +02:00
Kamil Myśliwiec
64d072d8bb Merge pull request #489 from nestjs/update/version-5
Update: release v5.0.0-beta
2018-04-18 12:50:06 +02:00
Kamil Myśliwiec
6835dd9819 chore(release) publish v5.0.0-beta.2 2018-04-18 12:31:45 +02:00
Kamil Myśliwiec
5f735b11c9 bugfix: deprecate missing @Pipe() decorator, fix HttpModule 2018-04-18 12:29:39 +02:00
Kamil Myśliwiec
4fad0ae2bc Merge branch 'master' into update/version-5 2018-04-17 18:55:09 +02:00
Kamil Myśliwiec
45da5db11b refactor(@nestjs) remove redundant lib directory 2018-04-17 18:51:56 +02:00
Kamil Myśliwiec
0b9baf8588 refactor(@nestjs) move reflect-metadata to internal dependencies 2018-04-17 18:49:03 +02:00
Kamil Myśliwiec
cef628f314 Update README.md 2018-04-17 18:44:46 +02:00
Kamil Myśliwiec
421c2f69f7 Update README.md 2018-04-17 18:39:29 +02:00
Kamil Myśliwiec
69cd3ab5f9 chore(release) publish v5.0.0-beta.1 2018-04-17 18:33:30 +02:00
Kamil Myśliwiec
b144dbef8c chore(release) publish v5.0.0-beta.0 2018-04-17 18:22:27 +02:00
Kamil Myśliwiec
eff9942466 v5.0.0-beta.0 2018-04-17 18:13:20 +02:00
Kamil Myśliwiec
525a5969bc Update Readme.md 2018-04-03 12:47:07 +02:00
Kamil Myśliwiec
b49366fd31 feature(@nestjs/core) context creator improvements (injection support) 2018-03-31 16:43:07 +02:00
Kamil Myśliwiec
354277ba6e feature(@nestjs/core) reduce injector complexity (remove scopes) 2018-03-29 11:40:12 +02:00
Kamil Myśliwiec
658391fe85 sample(@nestjs) update graphql and mongoose example 2018-03-29 11:39:36 +02:00
Kamil Myśliwiec
b574bb3f4c lib(@nestjs) update packages README 2018-03-28 19:18:33 +02:00
Kamil Myśliwiec
7b760c645f Merge remote-tracking branch 'origin' into update/version-5 2018-03-28 19:15:41 +02:00
Kamil Myśliwiec
32445dcf55 lib(@nestjs) fix incorrect dependencies (multer) 2018-03-28 19:09:19 +02:00
Kamil Myśliwiec
e45fd1aa12 lib(@nestjs) update packages README 2018-03-28 19:08:05 +02:00
Kamil Myśliwiec
3855b3a710 lib(@nestjs) update package.json files 2018-03-28 19:03:47 +02:00
Kamil Myśliwiec
1ca812abbf Update Readme.md 2018-03-28 13:00:52 +02:00
Kamil Myśliwiec
7470911bd7 Update Readme.md 2018-03-28 12:43:30 +02:00
Kamil Myśliwiec
adf72acf63 Update Readme.md 2018-03-28 12:42:53 +02:00
Kamil Myśliwiec
0e9f8f5e7e Update Readme.md 2018-03-28 12:38:47 +02:00
Kamil Myśliwiec
eb05d237af sample(@nestjs) add execution context app example 2018-03-27 13:26:50 +02:00
Kamil Myśliwiec
fa8b4ecef4 Update Readme.md 2018-03-27 12:20:30 +02:00
Kamil Myśliwiec
707b3efea4 tests(@nestjs/core) fix router execution context unit test (render) 2018-03-26 19:15:28 +02:00
Kamil Myśliwiec
5f37fadd24 Auto stash before merge of "master" and "origin/master" 2018-03-26 17:10:32 +02:00
Kamil Myśliwiec
eefbece0e1 Merge branch 'master' into update/version-5 2018-03-26 17:07:19 +02:00
Kamil Myśliwiec
a54102a660 Merge pull request #517 from pumano/master
chore(@nestjs/core) update debug dependency due to security flaw
2018-03-26 17:05:51 +02:00
Kamil Myśliwiec
b5de592eee format(@nestjs) run prettier 2018-03-26 17:04:55 +02:00
Kamil Myśliwiec
20493377af Update Readme.md 2018-03-26 16:49:11 +02:00
Kamil Myśliwiec
f91a16268f Update Readme.md 2018-03-26 15:38:32 +02:00
Kamil Myśliwiec
34b3e77d47 Update Readme.md 2018-03-26 15:32:53 +02:00
Kamil Myśliwiec
557009c11e Update Readme.md 2018-03-26 15:31:12 +02:00
Kamil Myśliwiec
32bf174b5c samples(@nestjs) update sample applications 2018-03-25 23:28:44 +02:00
Kamil Myśliwiec
6a6d3d4805 sample(@nestjs) partial webpack integration 2018-03-25 21:43:37 +02:00
Kamil Myśliwiec
91b4974d2c samples(@nestjs) update sample applications 2018-03-25 21:38:52 +02:00
Kamil Myśliwiec
e50ddf9cb9 tests(@nestjs) fix broken unit tests 2018-03-24 20:55:06 +01:00
Kamil Myśliwiec
fdbf364087 feature(@nestjs) enhance execution context, create host 2018-03-24 17:19:47 +01:00
Kamil Myśliwiec
0eb3354344 /version-5: Auto stash before merge of "update/version-5" and "origin/update/version-5" 2018-03-24 15:28:40 +01:00
Kamil Myśliwiec
a798714f21 Merge remote-tracking branch 'origin/update/version-5' into update/version-5 2018-03-24 15:28:26 +01:00
Kamil Myśliwiec
574830796f build(@nestjs) fix gulpfile configuration 2018-03-24 15:28:13 +01:00
Kamil Myśliwiec
fb26c4ab60 Delete .DS_Store 2018-03-24 15:22:23 +01:00
Kamil Myśliwiec
614de27310 refactor(@nestjs) rename directories, add script, fix tests 2018-03-24 15:11:48 +01:00
Kamil Myśliwiec
3b6981918a format(@nestjs) run prettier, format existing codebase 2018-03-22 19:05:38 +01:00
Kamil Myśliwiec
84f531ca34 feature: generalise interfaces, improve decorators 2018-03-22 18:48:43 +01:00
Kamil Myśliwiec
11b397a348 test(@nestjs) update unit tests 2018-03-22 10:32:43 +01:00
pumano
9fe8c98a42 chore(@nestjs/core) update debug dependency due to security flaw
According to node security project
534 - Regular Expression Denial of Service
Vulnerable: <= 2.6.8 || >= 3.0.0 <= 3.0.1 - Patched: >= 2.6.9 < 3.0.0 || >= 3.1.0 - Path: @nestjs/core@4.6.4 > body-parser@1.17.2 > debug@2.6.7

How to fix
Upgrade to version 2.6.9 or greater if you are on the 2.6.x series or 3.1.0 or greater.
2018-03-19 14:46:14 +03:00
Kamil Myśliwiec
852ce08bf3 feature(@nestjs/microservices) add grpc, mqtt, microservices refactor 2018-03-18 15:49:26 +01:00
Kamil Myśliwiec
a18e4c69ee tests(@nestjs) push basic integration tests 2018-03-17 15:01:17 +01:00
Kamil Myśliwiec
43da706a61 feature(@nestjs/microservices) add stan transport strategy 2018-03-17 14:56:55 +01:00
Kamil Myśliwiec
81691afb46 Merge remote-tracking branch 'origin/update/version-5' into update/version-5 2018-03-15 23:21:44 +01:00
Kamil Myśliwiec
9258229fdb feature(@netsjs/microservices) add nats transport strategy 2018-03-15 23:20:51 +01:00
Kamil Myśliwiec
e481a71b5c feature(@nestjs/core) better type checking for fastify adapter 2018-03-14 14:27:12 +01:00
Kamil Myśliwiec
fc092ae0b3 Merge branch 'update/version-5' of https://github.com/nestjs/nest into update/version-5 2018-03-14 12:08:19 +01:00
Kamil Myśliwiec
6c70f9c777 test(@nestjs/common) cover multer, FileInterceptor unit tests 2018-03-14 12:07:43 +01:00
Kamil Myśliwiec
15a8225ec1 bugfix(@nestjs/core) fix express adapter incompatibility 2018-03-13 18:53:18 +01:00
Kamil Myśliwiec
7bb35c0b38 Update Readme.md 2018-03-12 20:27:33 +01:00
Kamil Myśliwiec
cc8c3ddc95 Update Readme.md 2018-03-12 20:26:34 +01:00
Kamil Myśliwiec
10781a7a8e merge(@nestjs) resolve conflicts with master branch 2018-03-11 14:11:51 +01:00
Kamil Myśliwiec
2f26e3a1dc chore(release) publish v4.6.6 2018-03-11 13:50:47 +01:00
Kamil Myśliwiec
94eed51465 chore(release) publish v4.6.6 2018-03-11 13:47:30 +01:00
Kamil Myśliwiec
786c344cc8 Auto stash before merge of "master" and "origin/master" 2018-03-11 13:42:58 +01:00
Kamil Myśliwiec
6042e71a0e Update Readme.md 2018-03-11 13:38:18 +01:00
Kamil Myśliwiec
199180406d Update Readme.md 2018-03-11 13:33:02 +01:00
Kamil Myśliwiec
81c916734b Update Readme.md 2018-03-11 13:32:17 +01:00
Kamil Myśliwiec
23c54c68b8 ci(@nestjs) fix gulpfile issues 2018-03-11 12:49:19 +01:00
Kamil Myśliwiec
2aa4bb9c9a style(@nestjs) run prettier, update code style 2018-03-11 12:37:56 +01:00
Kamil Myśliwiec
2a1cb06201 feature(@nestjs/core) more meaningful exception (exports inconsistency) 2018-03-10 13:40:42 +01:00
Kamil Myśliwiec
8f300b8d85 Auto stash before merge of "master" and "origin/master" 2018-03-09 17:50:56 +01:00
Kamil Myśliwiec
e51f3e06d4 Merge pull request #470 from patrickhousley/bugfix/axios-interfaces
fix(common): removing duplicated axios interfaces
2018-03-09 17:48:58 +01:00
Kamil Myśliwiec
109b91863b Merge pull request #483 from vologab/patch-1
fix class-transformer related issues
2018-03-09 17:46:56 +01:00
Kamil Myśliwiec
7b35193639 Merge pull request #486 from vologab/feat/ability_to_use_npm_link
build(packaging): add an ability to build libs with sourcemaps and ts…
2018-03-09 17:46:10 +01:00
Kamil Myśliwiec
531b2fe018 update(@nestjs) upgrade reflect-metadata package 2018-03-09 15:59:26 +01:00
Kamil Myśliwiec
2ebfca2f07 fix(@nestjs) fix merge conflicts 2018-03-08 21:45:24 +01:00
Kamil Myśliwiec
1746fb452a test(@nestjs) build & fix unit tests 2018-03-08 18:14:30 +01:00
Kamil Myśliwiec
9d85f8a29a feature(@nestjs) extract http server, increase flexibility 2018-03-08 16:40:51 +01:00
Vladimir Bloshchitsyn
4d2260bca9 build(packaging): add an ability to build libs with sourcemaps and ts files
npm has command `npm ln` which allow using link to local lib,
in this case, if you want to use the ability to debug ts sources.
you can run `gulp build:dev -dist lib` and lib dirs will contain
ts & source maps which allow effectively debug external apps together
with nestJS framework
2018-03-08 15:38:33 +03:00
Vladimir Bloshchitsyn
ccd36c8844 fix class-transformer related issues
see https://github.com/typestack/class-transformer/issues/28
2018-03-08 03:01:21 +03:00
Kamil Myśliwiec
a66537a2ff bugfix(@nestjs/common) fix NestMiddleware interface 2018-03-07 16:50:06 +01:00
Kamil Myśliwiec
981104a91e Merge pull request #468 from patrickhousley/feature/http-generic
fix(common): making http service methods generic
2018-03-06 23:07:28 +01:00
Patrick Housley
21be3f8ca6 fix(common): removing duplicated axios interfaces
- Removed the deprecated package @types/axios.
- Removed the duplicated axios interfaces.
- Updated the HttpService to use the interfaces provided by axios.
2018-03-03 18:17:33 -06:00
Patrick Housley
b0b98b8683 fix(common): making http service methods generic 2018-03-03 17:18:23 -06:00
Kamil Myśliwiec
eda82afb8b Merge remote-tracking branch 'origin/master' 2018-03-02 15:03:49 +01:00
Kamil Myśliwiec
937405432f bugfix(@nestjs/common) File(s)Interceptor throws http status code 500 2018-03-02 15:03:44 +01:00
Kamil Myśliwiec
d2814b4829 Update Readme.md 2018-03-02 09:30:55 +01:00
Kamil Myśliwiec
6d5f70c13a Update Readme.md 2018-03-02 09:19:44 +01:00
Kamil Myśliwiec
68c1c92a1e Update Readme.md 2018-03-02 08:47:40 +01:00
Kamil Myśliwiec
51197993b6 Merge pull request #464 from nestcn/master
Add Chinese document
2018-03-02 08:40:55 +01:00
Zuohuadong
224f996d06 Fix translation problem 2018-03-02 11:54:16 +08:00
Zuohuadong
902c065e0b Add Chinese document 2018-03-02 11:42:33 +08:00
Kamil Myśliwiec
df9fe07d26 feature(@nestjs/core) add find() method to NestApplicationContext 2018-03-02 00:01:03 +01:00
Kamil Myśliwiec
e7a3ad1cdd chore(@nestjs) update package.json 2018-03-01 22:36:14 +01:00
Kamil Myśliwiec
5f3066ae4b Auto stash before merge of "master" and "origin/master" 2018-03-01 22:35:37 +01:00
Kamil Myśliwiec
b6a36d27f3 Merge remote-tracking branch 'origin/master' 2018-03-01 22:35:08 +01:00
Kamil Myśliwiec
945dde6dba chore(release) publish v4.6.5 2018-03-01 22:31:02 +01:00
Kamil Myśliwiec
ff10b07044 bugfix(@nestjs/core) use ApplicationConfig within ExternalContextCreator 2018-03-01 22:27:17 +01:00
Kamil Myśliwiec
deaf3a2dcb feature(@nestjs/core) make cors middleware customizable 2018-03-01 22:26:52 +01:00
Kamil Myśliwiec
7e1cd077c5 Merge pull request #455 from iamclaytonray/patch-1
Update 05-sql-typeorm/~/photo.service.ts
2018-02-28 23:00:22 +01:00
Kamil Myśliwiec
5b7b4c73f4 feature(@nestjs/microservices) allow applying multiple params in ctx creator 2018-02-28 12:20:39 +01:00
Kamil Myśliwiec
2264d9aded Update Readme.md 2018-02-27 22:53:34 +01:00
Kamil Myśliwiec
6f479eafdd Update Readme.md 2018-02-27 22:52:47 +01:00
Kamil Myśliwiec
aafb62ee02 Update Readme.md 2018-02-27 22:52:03 +01:00
Clayton Ray
fa4698e28e Update 05-sql-typeorm/~/photo.service.ts
`Inject` wasn't being used.
2018-02-25 12:16:28 -05:00
Kamil Myśliwiec
400bfb512a Merge remote-tracking branch 'origin/master' 2018-02-24 13:34:40 +01:00
Kamil Myśliwiec
1d9dd18522 bugfix(@nestjs/core) NestFactory.create() returns any 2018-02-24 13:34:33 +01:00
Kamil Myśliwiec
c262b7caf6 feature(@nestjs/microservices) sendMessage breaking change 2018-02-24 13:30:06 +01:00
Kamil Myśliwiec
75ff071142 Merge pull request #447 from dmitriyshmatov/patch-1
Remove unused code
2018-02-21 21:15:25 +01:00
Kamil Myśliwiec
8c12c3b4b8 chore(@nestjs) update CHANGELOG 2018-02-21 20:24:52 +01:00
Kamil Myśliwiec
bd3bd4a96c feature(@nestjs) WsException and RpcException extend Error 2018-02-21 20:23:47 +01:00
Kamil Myśliwiec
b20b3cbc6f bugfix(@nestjs/common) populate multer exceptions 2018-02-21 20:19:21 +01:00
Kamil Myśliwiec
9bfb941b56 feature(@nestjs/common) HttpException extends Error 2018-02-21 20:17:25 +01:00
Dmitriy Shmatov
3ac76188e4 Remove unused code 2018-02-20 21:59:34 +03:00
Kamil Myśliwiec
e8a72e67e4 chore(release) publish v4.6.4 2018-02-18 22:54:38 +01:00
Kamil Myśliwiec
281bac103c bugfix(@nestjs/common) fix custom logger context 2018-02-18 22:48:33 +01:00
Kamil Myśliwiec
559e919636 feature(@nestjs/microservices) add TCP/Redis retrying strategy 2018-02-18 22:36:51 +01:00
Kamil Myśliwiec
5c7f9fa5a7 Merge branch 'master' into update/version-5 2018-02-18 13:38:57 +01:00
Kamil Myśliwiec
35fef2f525 feature(@nestjs/common) support Symbol as a token 2018-02-18 11:16:40 +01:00
Kamil Myśliwiec
cfa4bffcc5 bugfix(@nestjs/core) exceptions passed in done() function, SyntaxError 2018-02-18 11:16:20 +01:00
Kamil Myśliwiec
8235a0308b bugfix(@nestjs/common) FileInterceptor overrides multiple options 2018-02-18 11:15:37 +01:00
Kamil Myśliwiec
9b834871ea feature(@nestjs) improve typings, better type checking 2018-02-17 23:33:09 +01:00
Kamil Myśliwiec
23c46abd53 examples(@nestjs) update packages in examples 2018-02-16 13:39:42 +01:00
Kamil Myśliwiec
03216d27c8 bugfix(@nestjs/microservices) can't select/get from context 2018-02-16 12:01:12 +01:00
Kamil Myśliwiec
2b29461a68 chore(release) publish v4.6.3 2018-02-16 11:49:52 +01:00
Kamil Myśliwiec
3029e3c65a update(@nestjs) update to latest version of rxjs lib (v5.5.6) 2018-02-16 11:38:01 +01:00
Kamil Myśliwiec
a763e00507 Update CHANGELOG.md 2018-02-16 11:35:05 +01:00
Kamil Myśliwiec
649d99e09f Update CHANGELOG.md 2018-02-16 11:25:23 +01:00
Kamil Myśliwiec
581e183246 Update CHANGELOG.md 2018-02-16 11:24:52 +01:00
Kamil Myśliwiec
7e5d6a1f07 deprecate(@nestjs/common) deprecate modules and components property 2018-02-16 09:06:31 +01:00
Kamil Myśliwiec
d84f5adcad Merge pull request #328 from wbhob/deprecate-modules
[SEMVER-MAJOR] chore(): deprecate modules property
2018-02-16 01:13:12 +01:00
Kamil Myśliwiec
294bc5d053 Merge branch 'update/version-5' into deprecate-modules 2018-02-16 01:12:24 +01:00
Kamil Myśliwiec
f67c876c0d feature(@nestjs/common) add @Injectable() class, providers property integration 2018-02-16 01:10:15 +01:00
Kamil Myśliwiec
375028dbf2 Auto stash before merge of "master" and "origin/master" 2018-02-16 00:23:26 +01:00
Kamil Myśliwiec
97c6ae4481 Merge remote-tracking branch 'origin/master' 2018-02-16 00:23:08 +01:00
Kamil Myśliwiec
325748d945 chore(release) publish v4.6.2 2018-02-16 00:21:53 +01:00
Kamil Myśliwiec
e8d017398c Update CHANGELOG.md 2018-02-15 22:53:13 +01:00
Kamil Myśliwiec
0c06d41c9d chore(release) publish v4.6.1 2018-02-15 22:45:13 +01:00
Kamil Myśliwiec
7fb15113fa Auto stash before merge of "master" and "origin/master" 2018-02-15 22:40:18 +01:00
Kamil Myśliwiec
d489788248 chore(release) publish v4.6.1 2018-02-15 22:37:32 +01:00
Kamil Myśliwiec
ebf5dad9bb Merge remote-tracking branch 'origin/master' 2018-02-15 22:31:23 +01:00
Kamil Myśliwiec
7bc156f01e chore(release) publish v4.6.1 2018-02-15 22:24:53 +01:00
Kamil Myśliwiec
2c0902f248 Merge pull request #413 from BrianDGLS/patch-2
refactor(@common/utils): remove unused import in forward ref util
2018-02-13 13:46:00 +01:00
BrianDGLS
edaf60fea9 refactor(@common/utils): remove yarn.lock 2018-02-12 16:10:59 +00:00
BrianDGLS
5c47ccd78e refactor(@common/utils): remove unused import in forward ref util 2018-02-12 16:10:47 +00:00
Kamil Myśliwiec
6bb6286761 chore(release) publish v4.6.0 2018-02-11 23:46:25 +01:00
Kamil Myśliwiec
9ca38166dd Merge remote-tracking branch 'origin/master' 2018-02-11 23:45:05 +01:00
Kamil Myśliwiec
a2a00ad31a chore(release) publish v4.6.0 2018-02-11 23:44:11 +01:00
Kamil Myśliwiec
5fe79633bf chore(release) publish v4.6.0 2018-02-11 23:40:24 +01:00
Kamil Myśliwiec
450368779c chore(release) publish v4.5.12@next 2018-02-11 14:35:13 +01:00
Kamil Myśliwiec
4feba7504f chore(release) publish v4.5.12 2018-02-11 13:53:48 +01:00
Kamil Myśliwiec
d804d65cde chore(release) publish v4.5.11 2018-02-11 13:14:55 +01:00
Kamil Myśliwiec
3e2d887a12 tests(@nestjs/common) fix ValidationPipe spec files 2018-02-11 13:12:16 +01:00
Kamil Myśliwiec
e4549f8701 Merge branch 'fwoelffel-improve-validation-pipe' 2018-02-11 12:26:46 +01:00
Kamil Myśliwiec
80481a5117 Merge branch 'improve-validation-pipe' of https://github.com/fwoelffel/nest into fwoelffel-improve-validation-pipe 2018-02-11 12:25:50 +01:00
Kamil Myśliwiec
86e32f6aed Merge remote-tracking branch 'origin/master' 2018-02-11 12:24:46 +01:00
Kamil Myśliwiec
7415021ba1 feature(@nestjs/common) add enable() wrapper around express app 2018-02-11 12:24:34 +01:00
Kamil Myśliwiec
cd5ab322cb Merge pull request #408 from BrianDGLS/patch-1
refactor(examples): remove unneeded whitespace
2018-02-11 12:17:05 +01:00
Kamil Myśliwiec
ea1f1b14bd Merge remote-tracking branch 'origin/master' 2018-02-11 12:15:53 +01:00
Kamil Myśliwiec
b6817403ad bugfix(@nestjs/core) fix EXPRESS_REF issue 2018-02-11 12:15:48 +01:00
Kamil Myśliwiec
bc13118eb7 Merge pull request #401 from delasteve/feat/express-disable
feat(common): expose wrapper for express disable
2018-02-11 12:13:56 +01:00
BrianDGLS
b1502a6028 refactor(examples): remove unneeded whitespace for all demoes 2018-02-09 16:01:49 +00:00
Brian Douglas
9147a12705 refactor(examples): remove unneeded whitespace 2018-02-09 15:55:05 +00:00
Stephen Cavaliere
236cf1853f feat(common): expose wrapper for express disable 2018-02-06 17:45:31 -05:00
Frédéric Woelffel
27c083985c refactor(@nestjs/common): mark the ValidatorPipe parameters as optional 2018-02-05 20:27:06 +01:00
Kamil Myśliwiec
4c92b9418e Merge branch 'fwoelffel-improve-validation-pipe' 2018-02-05 16:34:56 +01:00
Kamil Myśliwiec
7fdd07cfa5 feature(@nestjs/common) improve variable name and single condition 2018-02-05 16:32:59 +01:00
Kamil Myśliwiec
11253f5009 Merge branch 'improve-validation-pipe' of https://github.com/fwoelffel/nest into fwoelffel-improve-validation-pipe 2018-02-05 16:18:31 +01:00
Kamil Myśliwiec
1279602f1c Merge branch 'oschweitzer-parseInt-pipe-improvement' 2018-02-05 16:15:44 +01:00
Kamil Myśliwiec
ec6b89160d feature(@nestjs/common) refactor ParseIntPipe 2018-02-05 16:14:12 +01:00
Kamil Myśliwiec
0dd55875f7 Merge branch 'parseInt-pipe-improvement' of https://github.com/oschweitzer/nest into oschweitzer-parseInt-pipe-improvement 2018-02-05 16:08:48 +01:00
Kamil Myśliwiec
2296d30900 Merge branch 'qbodart-controller-inheritance' 2018-02-05 16:07:03 +01:00
Kamil Myśliwiec
75600bc725 Update CHANGELOG.md 2018-02-05 16:05:32 +01:00
Kamil Myśliwiec
bc7914e1df feature(@nestjs/core) use generator instead of local variable 2018-02-05 16:03:10 +01:00
Kamil Myśliwiec
2003c1e7ff Merge branch 'controller-inheritance' of https://github.com/qbodart/nest into qbodart-controller-inheritance 2018-02-05 15:35:38 +01:00
Kamil Myśliwiec
cf5fcbdf0b bugfix(@nestjs/core) nest seems to fails silently #287 2018-02-05 15:34:58 +01:00
Kamil Myśliwiec
fde169636f bugfix(@nestjs/core) inconsistent arguments 2018-02-05 13:10:44 +01:00
Kamil Myśliwiec
7af4a012b4 Merge branch 'master' of https://github.com/nestjs/nest 2018-02-05 13:09:08 +01:00
Kamil Myśliwiec
8cd42f519b Merge branch 'shekohex-nest-router' 2018-02-05 13:08:52 +01:00
Kamil Myśliwiec
8fdf428143 fix missing space, remove yarn.lock 2018-02-05 13:04:22 +01:00
Oli1810
e089a4730f feat(@nestjs/common): update validation condition
This commit also removes the unused rxjs import
2018-02-05 12:40:32 +01:00
Kamil Myśliwiec
d843678ec4 feature(@nestjs/core) injectable APP_REF & Reflector bugfix 2018-02-05 12:39:41 +01:00
Kamil Myśliwiec
e6825dcc7b Merge branch 'nest-router' of https://github.com/shekohex/nest into shekohex-nest-router 2018-02-05 11:47:54 +01:00
Kamil Myśliwiec
08fc594349 feature(@nestjs/core) injectable APP_REF 2018-02-05 11:47:14 +01:00
Kamil Myśliwiec
68edfda978 Update Readme.md 2018-02-04 17:07:39 +01:00
Kamil Myśliwiec
68014d8f95 Update Readme.md 2018-02-04 17:03:52 +01:00
Frédéric Woelffel
aaab2bc6ef refactor(@nestjs/common): rewrite the ValidationPipe constructor
initialize the properties in a more elegant way
2018-02-04 13:04:08 +01:00
Kamil Myśliwiec
f0c92bb328 Merge pull request #374 from 4F2E4A2E/patch-1
Improvement: Unused constant schema
2018-02-04 09:39:32 +01:00
Kamil Myśliwiec
327f402c1c Merge pull request #375 from f3ath/patch-1
Remove unused import
2018-02-04 09:38:53 +01:00
Kamil Myśliwiec
708e36b7ed Merge pull request #395 from pmitrifork/fix-allow-string-pipe-port
Allow providing server port as a string
2018-02-04 09:34:25 +01:00
Frédéric Woelffel
ff229b522f feat(@nestjs/common): improve the ValidationPipe
add support for all class-validator options
2018-02-04 00:59:33 +01:00
Frédéric Woelffel
9992996104 refactor(@nestjs/common): rename the ValidationPipe properties
adopt the class-validator naming scheme
2018-02-04 00:45:34 +01:00
Frédéric Woelffel
eebd72c5e4 feat(@nestjs/common): improve the ValidationPipe
allow to whitelist and forbid properties without transforming the returned object
2018-02-04 00:43:57 +01:00
Przemyslaw Milosz Miszczuk
9ae0953b50 Allows providing string as port (e.g. IIS on Azure uses strings such as "\\.\pipe\d226d7b0-64a0-4d04-96d4-a75e1278b7a9") 2018-02-03 23:20:00 +01:00
Kamil Myśliwiec
7357007a50 Merge pull request #386 from beeman/beeman/add-http-status-418
feat: add HTTP Status Code 418
2018-02-03 20:58:08 +01:00
Shady Khalifa
8ae0a43282 feat(@nestjs/core): add the appilty to have a path prop for the Module by using RouterModule. 2018-01-31 21:43:29 +02:00
Shady Khalifa
2f3732ec77 feat(@nestjs/common) : Module Path 2018-01-31 21:41:09 +02:00
Quentin
dd7ceafc4d feature(@nestjs) Enable inheritance for controllers
Changes to metadataScanner to enable scanning of Parent classes
2018-01-31 12:15:19 +01:00
Bram Borggreve
e2ede3e976 feat: add HTTP Status Code 418 2018-01-30 09:51:00 -05:00
Olivier Schweitzer
f854ae6180 tests(@nestjs/common): update test for parseIntPipe 2018-01-30 09:15:46 +01:00
Olivier Schweitzer
122c145b6c feat(@nestjs/common): improve the parseIntPipe 2018-01-30 09:15:14 +01:00
Wilson Hobbs
05c44f66b8 Merge branch 'master' into deprecate-modules 2018-01-29 22:53:00 -05:00
Olivier Schweitzer
ba00ce65a6 tests(@nestjs/common): add tests for the ValidationPipe 2018-01-29 14:34:09 +01:00
Frédéric Woelffel
dc24a2072e feat(@nestjs/common) improve the ValidationPipe 2018-01-29 14:30:04 +01:00
Alexey
fbd2fea4f1 Remove unused import 2018-01-23 16:33:36 -08:00
4F2E4A2E
fad0e6a208 Improvement: Unused constant schema 2018-01-23 15:36:57 +01:00
Kamil Myśliwiec
18125677b2 examples(@nestjs) update plain mongoose example 2018-01-21 13:52:27 +01:00
Kamil Myśliwiec
43e99499a7 examples(@nestjs) update plain mongoose example 2018-01-21 13:51:37 +01:00
Kamil Myśliwiec
74468739a6 Merge remote-tracking branch 'origin/master' 2018-01-21 13:47:50 +01:00
Kamil Myśliwiec
214037f1bb examples(@nestjs) update websockets & graphql & mongoose 2018-01-21 13:47:42 +01:00
Kamil Myśliwiec
3ea0bd9d45 Merge pull request #369 from amitport/patch-1
remove old autoSchemaSync
2018-01-21 10:58:16 +01:00
Amit Portnoy
ee05a31f64 remove old autoSchemaSync 2018-01-21 11:37:52 +02:00
Kamil Myśliwiec
fc3e2fde78 bugfix(@nestjs/core) router execution context issue #343 2018-01-16 17:20:06 +01:00
Wilson Hobbs
ad3f679c5a chore(): deprecate modules property 2017-12-23 14:40:16 -05:00
2028 changed files with 139227 additions and 17178 deletions

41
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,41 @@
## PR Checklist
Please check if your PR fulfills the following requirements:
- [ ] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
```
## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
Issue Number: N/A
## What is the new behavior?
## Does this PR introduce a breaking change?
```
[ ] Yes
[ ] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
## Other information

5
.gitignore vendored
View File

@@ -1,14 +1,16 @@
# dependencies
node_modules/
package-lock.json
# IDE
/.idea
/.awcache
/.vscode
# misc
.DS_Store
lerna-debug.log
npm-debug.log
yarn-error.log
/src/common/npm-debug.log
/src/core/npm-debug.log
/src/testing/npm-debug.log
@@ -24,3 +26,4 @@ npm-debug.log
/test
/coverage
/.nyc_output
build/config\.gypi

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
/bundle

View File

@@ -1,14 +1,23 @@
language: node_js
node_js:
- "7"
- "8"
- "9"
- "10"
cache:
directories:
- "node_modules"
git:
depth: 5
addons:
firefox: "latest"
firefox: "latest"
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
before_install:
- npm i -g npm@latest
install:
- npm install
- gulp build
- npm ci
- gulp build
script:
- npm test
- npm test
after_success: npm run coverage

View File

@@ -1,299 +0,0 @@
## 4.5.7
- **core**: [bugfix] #337
## 4.5.6
- **core**: [bugfix] dynamic modules `exports`
## 4.5.5
- **core**: [bugfix] add missing `app.engine()` wrapper
## 4.5.4
- **core**: [bugfix] dynamic modules recurrent imports fix
## 4.5.3
- **testing**: [bugfix] issue #326
## 4.5.2
- **common**: [feature] rename `modules` to `imports` (`@Module()` decorator)
- **core**: [feature] exception filters with empty `@Catch()` metadata handle each occurred exception
- **core**: [improvement] increase performance
## 4.5.1
- **common**: [feature] `INestAplication` provides a `getHttpServer()` method now
- **websockets**: [bugfix] `IoAdapter` bugfix
## 4.5.0
- **common**: bugfix #286
- **core**: dynamic modules feature
- **core**: global scope feature
- **core**: `ExternalContextCreator` & `ModulesContainer`
- **core**: merge `NestApplicationContext` with `NestApplication`
- **core**: `NotFoundException` is thrown when route is not available #298
- **core**: add `set()` wrapper around native express methods
- **core**: bugfix #281
- **websockets**: bugfix #271
- **microservices**: log RPC exceptions #303
- **microservices**: merge `NestApplicationContext` with `NestMicroservice`
- **microservices**: handle ECONNREFUSED #288
## 4.4.1
- **common**: `ValidationPipe` improvement
- **common**: custom route params decorators accepts pipes now
- **core**: bugfix #268
## 4.4.0
- **core**: possibility to create the `NestApplicationContext` using `NestFactory.createApplicationContext()` (Nest application without HTTP server / microservice in the background)
- **core**: create custom params decorators feature (`createRouteParamDecorator()`)
## 4.3.3
- **common**: `ParseIntPipe` is now available out-of-the-box (`@nestjs/common`)
- **common**: package contains a set of useful HTTP exceptions now, such as `ForbiddenException`, `UnauthorizedException`, `BadRequestException` etc
- **core**: `HttpException` was moved to `@nestjs/common`. This one from `core` packages is now DEPRECATED and will be removed in the next MAJOR release
## 4.3.0
- **common**: `ValidationPipe` is now available out-of-the-box (`@nestjs/common`)
- **core**: `json` and `urlencoded` (`body-parser`) middlewares are applied by default now, bugfix #252
- **core** more informative error message (injector) #223
example: `[ExceptionHandler] Nest can't resolve dependencies of the UsersService (+, +, ?, +, +, +). Please verify whether [2] argument is available in the current context.`
- **core**: bugfix #240 - middlewares container state
- **core**: bugifx #257 - `@Next()` issue
- **testing**: testing module is now independent from `@nestjs/microservices`
## 4.2.2
- **websockets**: bugfix #242
## 4.2.1
- **core**: IoAdapter bugfix
## 4.2.0
- **core**: log controller prefix #153
- **websockets**: gateway listen the same port as the app #126
## 4.1.4
- **common**: remove deprecated `@ExceptionFilters()` decorator
- **core**: update to latest **express* version (4.16.2)
- **core**: bugfix #187
- **core**: bugfix #185
- **all**: packages codependency refactor
- **all**: add *lerna* package
## 4.1.3
- **core**: forward reference bugfixes & security updates
## 4.1.1
- **common**: add `forwardRef()` util
- **core**: improve injector & dependencies scanner
## 4.1.0
- **common**: add `@Bind()` and `@Dependencies()` decorators to fix route parameters decorators (pure JavaScript compatibility issue)
- **core**: improve performance
## 4.0.1
- **core**: add possibility to setup global guards and global interceptors
- **common**: `INestApplication` has `useGlobalInterceptors()` and `useGlobalGuards()` now
- **microservices**: add possibility to setup global guards, interceptors, filters and pipes
- **core**: add timestamp to log output
- **core**: improve pipes performance
- **core**: add ability to omit param name when passing param-scoped pipe/s
- **websockets**: fix disconnect event issue (pass client instead of socket.io instance)
## 4.0.0
**@nestjs/core**
- Asynchronous `NestFactory` [read more](http://www.docs.nestjs.com/first-steps)
- New response handling approach [read more](http://www.docs.nestjs.com/controllers)
- Interceptors feature [read more](http://www.docs.nestjs.com/interceptors)
- `@Shared()` deprecated (modules are singletons by default) [read more](http://www.docs.nestjs.com/modules)
- `@SingleScope()` decorator [read more](http://www.docs.nestjs.com/modules)
- Modules re-exporting [read more](http://www.docs.nestjs.com/modules)
- Deffered & functional middlewares [read more](http://www.docs.nestjs.com/middlewares)
- Guards feature [read more](http://www.docs.nestjs.com/guards)
- Async components [read more](http://www.docs.nestjs.com/advanced/async-components)
- Hierarchical injector improvements [read more](http://www.docs.nestjs.com/advanced/hierarchical-injector)
- Mixin classes [read more](http://www.docs.nestjs.com/advanced/mixins)
- New `INestApplication` API
**@nestjs/microservices**
- Possibility to return Promise / Observable / plain value [read more](http://www.docs.nestjs.com/microservices/basics)
- Guards & Interceptors & Pipes & Exception Filters integration
**@nestjs/websockets**
- Possibility to return Promise / Observable / plain value [read more](http://www.docs.nestjs.com/websockets/gateways)
- Guards & Interceptors & Pipes & Exception Filters integration
- New `WebSocketAdapter` API
**@nestjs/testing**
- Completely rewritten testing package
## 3.0.1 (24.06.2017)
**@nestjs/core**
- Hierarchical injector bugfix,
- Middlewares `@UseFilters()` bugfix (#95).
**@nestjs/microservices**
- TCP server / client bugfix (#91)
## 3.0.0 (03.06.2017)
**@nestjs/common - BREAKING CHANGE**
- You should now pass objects into `@UseFilters()` decorator instead of metatypes,
- Exception Filters can't inject dependencies (they're not coupled with modules),
- `@ExceptionFilters()` is deprecated, use `@UseFilters()` instead.
- `INestApplication` has new methods - `useGlobalFilters()` and `useGlobalPipes()`,
- New lifecycle hook - `OnModuleDestroy` interface.
**@nestjs/core**
- `@Pipe()` feature (async & sync),
- Exception Filters can have global, controller and method scope.
**@nestjs/websockets - BREAKING CHANGE**
- Use `useWebSocketAdapter()` instead of `setIoAdapter()`,
- You can port any WS library - just implement `WebSocketAdapter` (@nestjs/common).
**@nestjs/microservices - BREAKING CHANGE**
- Now methods have to return `Observable`, and they receive only one argument `data`,
- Microservices can return multiple values, but after emitting `Observable` has to be COMPLETED!
- You can port any transport strategy instead of built-in Redis/TCP, just implement `CustomTransportStrategy`.
## 2.1.3 (27.05.2017)
**@nestjs/common**, **@nestjs/websockets**
- `INestApplication` and `INestMicroservice` has new method now - `setIoAdapter()`,
- Ability to use custom `IoAdapter`
## 2.1.1 (24.05.2017)
**@nestjs/common**, **@nestjs/websockets**, **@nestjs/microservices**
- `INestApplication` and `INestMicroservice` has new method now - `setIoAdapter()`,
- Ability to use custom `IoAdapter`
## 2.1.0 (22.05.2017)
**@nestjs/common**, **@nestjs/core**
- `INestApplication` has new methods now - `init()`, `setGlobalPrefix()`, `connectMicroservice()`, `close()`, `startAllMicroservices()`,
- `INestMicroservice` has new method - `close()`
## 2.0.3 (15.05.2017)
**@nestjs/common**
- `Req()` (`Request()`) and `Res()` (`Response()`) aliases to avoid conflicts with express typings
## 2.0.0 (14.05.2017)
- **Hierarchical injector** improvements
- `@Shared(token?: string)` decorator for **scoped**, shared Modules
- Modules **are not singletons** anymore
- Added `iterare` library for applying multiple transformations to a collection
- `Logger` service is public,
- Nest is now splitted into feature packages:
```typescript
@nestjs/core
@nestjs/common
@nestjs/microservices
@nestjs/testing
@nestjs/websockets
```
- `rxjs`, `redis` and `reflect-metadata` moved into `peerDependencies`
- `@Patch()` support
## 1.0.0 (Final - 01.05.2017)
- Added **Gateway Middlewares** support:
```
@WebSocketGateway({
port: 2000,
middlewares: [ChatMiddleware],
})
```
Gateway Middleware example:
```
@Middleware()
export class ChatMiddleware implements GatewayMiddleware {
public resolve(): (socket, next) => void {
return (socket, next) => {
console.log('Authorization...');
next();
};
}
}
```
- New Gateway lifecycle interfaces `OnGatewayInit`, `OnGatewayConnection`, `OnGatewayDisconnect`
- `@SubscribeMessage()` now accepts also plain strings:
```
@SubscribeMessage('event')
```
- `@Controller()` now accepts also plain strings:
```
@Controller('users')
```
- `HttpStatus` (`HttpStatus.OK` etc.) enumerator
- **Route params decorators** support
```
Request: () => ParameterDecorator
Response: () => ParameterDecorator
Next: () => ParameterDecorator
Query: (property?: string) => ParameterDecorator
Body: (property?: string) => ParameterDecorator
Param: (property?: string) => ParameterDecorator
Session: () => ParameterDecorator
Headers: (property?: string) => ParameterDecorator
```
- `MiddlewaresBuilder` -> `MiddlewaresConsumer`
- **Exception Filters** support
```
@ExceptionFilters(CustomExceptionFilter, NextExceptionFilter)
export class UsersController {}
```
Exception filter example:
```
export class CustomException {}
@Catch(CustomException)
export class CustomExceptionFilter implements ExceptionFilter {
public catch(exception, response) {
response.status(500).json({
message: 'Custom exception message.',
});
}
}
```
- Module injection support:
```
export class UsersController {
constructor(private module: UsersModule) {}
}
```
- `ModuleRef` support
## 1.0.0-RC7 (08.04.2017)
- MiddlewareBuilder: `use()` deprecated, use `apply()` instead
- MiddlewareBuilder: new `apply()` method
## 1.0.0-RC4 (08.04.2017)
- Support for `@Post`, `@Get`, `@Delete`, `@Put`, `@All` decorators
- Added ability to pass data to middleware metatypes
## 1.0.0-BETA-1 (23.03.2017)
- `@Inject` -> `@Dependencies`
- `@Inject` decorator for custom constructor parameters
- Custom providers support (useClass, useValue, useFactory)
## 1.0.0-ALPHA-23 (19.03.2017)
- Microservices support (TCP & Redis transports)
- NestRunner -> NestFactory
- Simplify application initialization & configuration
- Added abillity to pass custom express instance
- `@Inject` decorator for ES6+
- SocketGateway -> WebSocketGateway
- GatewayServer -> WebSocketServer

View File

@@ -183,10 +183,10 @@ Footer should contain a [closing reference to an issue](https://help.github.com/
Samples: (even more [samples](https://github.com/nestjs/nest/commits/master))
```
docs(changelog): update change log to beta.5
docs(changelog) update change log to beta.5
```
```
fix(release): need to depend on latest rxjs and zone.js
bugfix(core) need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
```
@@ -200,8 +200,8 @@ Must be one of the following:
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix
* **feature**: A new feature
* **bugfix**: A bug fix
* **perf**: A code change that improves performance
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
@@ -214,7 +214,7 @@ The following is the list of supported scopes:
* **common**
* **core**
* **examples**
* **sample**
* **microservices**
* **testing**
* **websockets**
@@ -223,7 +223,7 @@ There are currently a few exceptions to the "use package name" rule:
* **packaging**: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc.
* **changelog**: used for updating the release notes in CHANGELOG.md
* **examples/#**: for the example apps directory, replacing # with the example app number
* **sample/#**: for the example apps directory, replacing # with the example app number
<!-- * **aio**: used for docs-app (angular.io) related changes within the /aio directory of the repo -->
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)

View File

@@ -1,12 +1,12 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="http://kamilmysliwiec.com/public/nest-logo.png#1" alt="Nest Logo" /></a>
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
[travis-url]: https://travis-ci.org/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
@@ -14,10 +14,12 @@
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#7" alt="Coverage" /></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
@@ -25,7 +27,8 @@
## Description
<p>Nest is a framework for building efficient, scalable <a href="http://nodejs.org" target="_blank">Node.js</a> server-side applications. It uses modern JavaScript, is built with <a href="http://www.typescriptlang.org" target="_blank">TypeScript</a> (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).</p>
<p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, allowing for easy use of the myriad third-party plugins which are available.</p>
<p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, but also, provides compatibility with a wide range of other libraries, like e.g. <a href="https://github.com/fastify/fastify" target="blank">Fastify</a>, allowing for easy use of the myriad third-party plugins which are available.</p>
## Philosophy
@@ -34,56 +37,39 @@
## Getting started
To check out the [guide](https://docs.nestjs.com), visit [docs.nestjs.com](https://docs.nestjs.com). :books:
* 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:
## Sponsors
## Support
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://opencollective.com/nest). Thanks! :heart_eyes:
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).
<h4>Sponsors via <a href="https://opencollective.com/nest">OpenCollective</a></h4>
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="210" /></a>
#### Principal Sponsor
<h4>Sponsors & <a href="http://ng-atl.org/workshops/level-up-your-node-js-application-with-nest-angular-sugar-on-the-server">ngAtl</a> Conference Partners </h4>
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.png" width="160" /></a>
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
## Backers
#### Gold Sponsors
<a href="https://opencollective.com/nest/backer/0/website" target="_blank"><img src="https://opencollective.com/nest/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/1/website" target="_blank"><img src="https://opencollective.com/nest/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/2/website" target="_blank"><img src="https://opencollective.com/nest/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/3/website" target="_blank"><img src="https://opencollective.com/nest/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/4/website" target="_blank"><img src="https://opencollective.com/nest/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/5/website" target="_blank"><img src="https://opencollective.com/nest/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/6/website" target="_blank"><img src="https://opencollective.com/nest/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/7/website" target="_blank"><img src="https://opencollective.com/nest/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/8/website" target="_blank"><img src="https://opencollective.com/nest/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/9/website" target="_blank"><img src="https://opencollective.com/nest/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/10/website" target="_blank"><img src="https://opencollective.com/nest/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/11/website" target="_blank"><img src="https://opencollective.com/nest/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/12/website" target="_blank"><img src="https://opencollective.com/nest/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/13/website" target="_blank"><img src="https://opencollective.com/nest/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/14/website" target="_blank"><img src="https://opencollective.com/nest/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/15/website" target="_blank"><img src="https://opencollective.com/nest/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/16/website" target="_blank"><img src="https://opencollective.com/nest/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/17/website" target="_blank"><img src="https://opencollective.com/nest/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/18/website" target="_blank"><img src="https://opencollective.com/nest/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/19/website" target="_blank"><img src="https://opencollective.com/nest/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/20/website" target="_blank"><img src="https://opencollective.com/nest/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/21/website" target="_blank"><img src="https://opencollective.com/nest/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/22/website" target="_blank"><img src="https://opencollective.com/nest/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/23/website" target="_blank"><img src="https://opencollective.com/nest/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/24/website" target="_blank"><img src="https://opencollective.com/nest/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/25/website" target="_blank"><img src="https://opencollective.com/nest/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/26/website" target="_blank"><img src="https://opencollective.com/nest/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/27/website" target="_blank"><img src="https://opencollective.com/nest/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/28/website" target="_blank"><img src="https://opencollective.com/nest/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/nest/backer/29/website" target="_blank"><img src="https://opencollective.com/nest/backer/29/avatar.svg"></a>
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="220" /></a>
## People
#### Silver Sponsors
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /></a>
#### Sponsors
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> &nbsp; <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="40" /> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a>
## Backers
<a href="https://opencollective.com/nest"><img src="https://opencollective.com/nest/backers.svg?width=890"></a>
## Stay in touch
* Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
* Website - [https://nestjs.com](https://nestjs.com/)
* Twitter - [@nestframework](https://twitter.com/nestframework)
## License
Nest is [MIT licensed](LICENSE).
Nest is [MIT licensed](LICENSE).

75
bundle/common/Readme.md Normal file
View File

@@ -0,0 +1,75 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
[travis-url]: https://travis-ci.org/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#7" alt="Coverage" /></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
## Description
<p>Nest is a framework for building efficient, scalable <a href="http://nodejs.org" target="_blank">Node.js</a> server-side applications. It uses modern JavaScript, is built with <a href="http://www.typescriptlang.org" target="_blank">TypeScript</a> (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).</p>
<p>Under the hood, Nest makes use of <a href="https://expressjs.com/" target="_blank">Express</a>, but also, provides compatibility with a wide range of other libraries, like e.g. <a href="https://github.com/fastify/fastify" target="blank">Fastify</a>, allowing for easy use of the myriad third-party plugins which are available.</p>
## Philosophy
<p>In recent years, thanks to Node.js, JavaScript has become the “lingua franca” of the web for both front and backend applications, giving rise to awesome projects like <a href="https://angular.io/" target="_blank">Angular</a>, <a href="https://github.com/facebook/react" target="_blank">React</a> and <a href="https://github.com/vuejs/vue" target="_blank">Vue</a> which improve developer productivity and enable the construction of fast, testable, extensible frontend applications. However, on the server-side, while there are a lot of superb libraries, helpers and tools for Node, none of them effectively solve the main problem - the architecture.</p>
<p>Nest aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications.</p>
## Getting started
* 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:
## Support
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/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
#### Gold Sponsors
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="220" /></a>
#### Silver Sponsors
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /></a>
#### Sponsors
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> &nbsp; <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="40" /> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a>
## Backers
<a href="https://opencollective.com/nest"><img src="https://opencollective.com/nest/backers.svg?width=890"></a>
## Stay in touch
* Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
* Website - [https://nestjs.com](https://nestjs.com/)
* Twitter - [@nestframework](https://twitter.com/nestframework)
## License
Nest is [MIT licensed](LICENSE).

View File

@@ -0,0 +1,3 @@
export declare const CACHE_MANAGER = "CACHE_MANAGER";
export declare const CACHE_MODULE_OPTIONS = "CACHE_MODULE_OPTIONS";
export declare const CACHE_KEY_METADATA = "cache_module:cache_key";

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CACHE_MANAGER = 'CACHE_MANAGER';
exports.CACHE_MODULE_OPTIONS = 'CACHE_MODULE_OPTIONS';
exports.CACHE_KEY_METADATA = 'cache_module:cache_key';

8
bundle/common/cache/cache.module.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
import { DynamicModule } from '../interfaces';
import { CacheModuleAsyncOptions, CacheModuleOptions } from './interfaces/cache-module.interface';
export declare class CacheModule {
static register(options?: CacheModuleOptions): DynamicModule;
static registerAsync(options: CacheModuleAsyncOptions): DynamicModule;
private static createAsyncProviders(options);
private static createAsyncOptionsProvider(options);
}

60
bundle/common/cache/cache.module.js vendored Normal file
View File

@@ -0,0 +1,60 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const decorators_1 = require("../decorators");
const cache_constants_1 = require("./cache.constants");
const cache_providers_1 = require("./cache.providers");
let CacheModule = CacheModule_1 = class CacheModule {
static register(options = {}) {
return {
module: CacheModule_1,
providers: [{ provide: cache_constants_1.CACHE_MODULE_OPTIONS, useValue: options }],
};
}
static registerAsync(options) {
return {
module: CacheModule_1,
imports: options.imports,
providers: this.createAsyncProviders(options),
};
}
static createAsyncProviders(options) {
if (options.useExisting || options.useFactory) {
return [this.createAsyncOptionsProvider(options)];
}
return [
this.createAsyncOptionsProvider(options),
{
provide: options.useClass,
useClass: options.useClass,
},
];
}
static createAsyncOptionsProvider(options) {
if (options.useFactory) {
return {
provide: cache_constants_1.CACHE_MODULE_OPTIONS,
useFactory: options.useFactory,
inject: options.inject || [],
};
}
return {
provide: cache_constants_1.CACHE_MODULE_OPTIONS,
useFactory: async (optionsFactory) => await optionsFactory.createCacheOptions(),
inject: [options.useExisting || options.useClass],
};
}
};
CacheModule = CacheModule_1 = __decorate([
decorators_1.Module({
providers: [cache_providers_1.createCacheManager()],
exports: [cache_constants_1.CACHE_MANAGER],
})
], CacheModule);
exports.CacheModule = CacheModule;
var CacheModule_1;

View File

@@ -0,0 +1,2 @@
import { Provider } from '../interfaces';
export declare function createCacheManager(): Provider;

17
bundle/common/cache/cache.providers.js vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const load_package_util_1 = require("../utils/load-package.util");
const cache_constants_1 = require("./cache.constants");
const default_options_1 = require("./default-options");
function createCacheManager() {
return {
provide: cache_constants_1.CACHE_MANAGER,
useFactory: (options) => {
const cacheManager = load_package_util_1.loadPackage('cache-manager', 'CacheModule');
const memoryCache = cacheManager.caching(Object.assign({}, default_options_1.defaultCacheOptions, (options || {})));
return memoryCache;
},
inject: [cache_constants_1.CACHE_MODULE_OPTIONS],
};
}
exports.createCacheManager = createCacheManager;

View File

@@ -0,0 +1 @@
export declare const CacheKey: (key: string) => (target: object, key?: any, descriptor?: any) => any;

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const decorators_1 = require("../../decorators");
const cache_constants_1 = require("../cache.constants");
exports.CacheKey = (key) => decorators_1.ReflectMetadata(cache_constants_1.CACHE_KEY_METADATA, key);

View File

@@ -0,0 +1 @@
export * from './cache-key.decorator';

View File

@@ -3,5 +3,4 @@ function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./client-proxy"));
__export(require("./client-proxy-factory"));
__export(require("./cache-key.decorator"));

View File

@@ -0,0 +1,5 @@
export declare const defaultCacheOptions: {
ttl: number;
max: number;
store: string;
};

View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultCacheOptions = {
ttl: 5,
max: 100,
store: 'memory',
};

5
bundle/common/cache/index.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
export { CACHE_MANAGER } from './cache.constants';
export * from './cache.module';
export * from './decorators';
export * from './interceptors';
export * from './interfaces';

10
bundle/common/cache/index.js vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var cache_constants_1 = require("./cache.constants");
exports.CACHE_MANAGER = cache_constants_1.CACHE_MANAGER;
__export(require("./cache.module"));
__export(require("./decorators"));
__export(require("./interceptors"));

View File

@@ -0,0 +1,11 @@
import { Observable } from 'rxjs';
import { ExecutionContext, HttpServer, NestInterceptor } from '../../interfaces';
export declare class CacheInterceptor implements NestInterceptor {
protected readonly httpServer: HttpServer;
protected readonly cacheManager: any;
protected readonly reflector: any;
protected readonly isHttpApp: boolean;
constructor(httpServer: HttpServer, cacheManager: any, reflector: any);
intercept(context: ExecutionContext, call$: Observable<any>): Promise<Observable<any>>;
trackBy(context: ExecutionContext): string | undefined;
}

View File

@@ -0,0 +1,68 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const decorators_1 = require("../../decorators");
const cache_constants_1 = require("../cache.constants");
// NOTE (external)
// We need to deduplicate them here due to the circular dependency
// between core and common packages
const HTTP_SERVER_REF = 'HTTP_SERVER_REF';
const REFLECTOR = 'Reflector';
let CacheInterceptor = class CacheInterceptor {
constructor(httpServer, cacheManager, reflector) {
this.httpServer = httpServer;
this.cacheManager = cacheManager;
this.reflector = reflector;
this.isHttpApp = httpServer && !!httpServer.getRequestMethod;
}
async intercept(context, call$) {
const key = this.trackBy(context);
if (!key) {
return call$;
}
try {
const value = await this.cacheManager.get(key);
if (value) {
return rxjs_1.of(value);
}
return call$.pipe(operators_1.tap(response => this.cacheManager.set(key, response)));
}
catch (_a) {
return call$;
}
}
trackBy(context) {
if (!this.isHttpApp) {
return this.reflector.get(cache_constants_1.CACHE_KEY_METADATA, context.getHandler());
}
const request = context.getArgByIndex(0);
const excludePaths = [];
if (this.httpServer.getRequestMethod(request) !== 'GET' ||
excludePaths.includes(this.httpServer.getRequestUrl)) {
return undefined;
}
return this.httpServer.getRequestUrl(context.getArgByIndex(0));
}
};
CacheInterceptor = __decorate([
decorators_1.Injectable(),
__param(0, decorators_1.Optional()),
__param(0, decorators_1.Inject(HTTP_SERVER_REF)),
__param(1, decorators_1.Inject(cache_constants_1.CACHE_MANAGER)),
__param(2, decorators_1.Inject(REFLECTOR)),
__metadata("design:paramtypes", [Object, Object, Object])
], CacheInterceptor);
exports.CacheInterceptor = CacheInterceptor;

View File

@@ -0,0 +1 @@
export * from './cache.interceptor';

View File

@@ -0,0 +1,6 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./cache.interceptor"));

View File

@@ -0,0 +1,17 @@
export interface LiteralObject {
[key: string]: any;
}
export interface CacheStore {
set<T>(key: string, value: T): Promise<void> | void;
get<T>(key: string): Promise<void> | void;
del(key: string): void | Promise<void>;
}
export interface CacheStoreFactory {
create(args: LiteralObject): CacheStore;
}
export interface CacheManagerOptions {
store?: string | CacheStoreFactory;
ttl?: number;
max?: number;
isCacheableValue?: (value: any) => boolean;
}

View File

@@ -0,0 +1,14 @@
import { ModuleMetadata, Type } from './../../interfaces';
import { CacheManagerOptions } from './cache-manager.interface';
export interface CacheModuleOptions extends CacheManagerOptions {
[key: string]: any;
}
export interface CacheOptionsFactory {
createCacheOptions(): Promise<CacheModuleOptions> | CacheModuleOptions;
}
export interface CacheModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
useExisting?: Type<CacheOptionsFactory>;
useClass?: Type<CacheOptionsFactory>;
useFactory?: (...args: any[]) => Promise<CacheModuleOptions> | CacheModuleOptions;
inject?: any[];
}

View File

@@ -0,0 +1,2 @@
export * from './cache-manager.interface';
export * from './cache-module.interface';

View File

@@ -2,6 +2,7 @@ export declare const metadata: {
MODULES: string;
IMPORTS: string;
COMPONENTS: string;
PROVIDERS: string;
CONTROLLERS: string;
EXPORTS: string;
};
@@ -10,6 +11,7 @@ export declare const GLOBAL_MODULE_METADATA = "__globalModule__";
export declare const PATH_METADATA = "path";
export declare const PARAMTYPES_METADATA = "design:paramtypes";
export declare const SELF_DECLARED_DEPS_METADATA = "self:paramtypes";
export declare const OPTIONAL_DEPS_METADATA = "optional:paramtypes";
export declare const METHOD_METADATA = "method";
export declare const ROUTE_ARGS_METADATA = "__routeArguments__";
export declare const CUSTOM_ROUTE_AGRS_METADATA = "__customRouteArgs__";
@@ -17,6 +19,10 @@ export declare const EXCEPTION_FILTERS_METADATA = "__exceptionFilters__";
export declare const FILTER_CATCH_EXCEPTIONS = "__filterCatchExceptions__";
export declare const PIPES_METADATA = "__pipes__";
export declare const GUARDS_METADATA = "__guards__";
export declare const RENDER_METADATA = "__renderTemplate__";
export declare const INTERCEPTORS_METADATA = "__interceptors__";
export declare const HTTP_CODE_METADATA = "__httpCode__";
export declare const GATEWAY_MIDDLEWARES = "__gatewayMiddlewares";
export declare const GATEWAY_MIDDLEWARES = "__gatewayMiddleware";
export declare const MODULE_PATH = "__module_path__";
export declare const HEADERS_METADATA = "__headers__";
export declare const REDIRECT_METADATA = "__redirect__";

View File

@@ -4,6 +4,7 @@ exports.metadata = {
MODULES: 'modules',
IMPORTS: 'imports',
COMPONENTS: 'components',
PROVIDERS: 'providers',
CONTROLLERS: 'controllers',
EXPORTS: 'exports',
};
@@ -12,6 +13,7 @@ exports.GLOBAL_MODULE_METADATA = '__globalModule__';
exports.PATH_METADATA = 'path';
exports.PARAMTYPES_METADATA = 'design:paramtypes';
exports.SELF_DECLARED_DEPS_METADATA = 'self:paramtypes';
exports.OPTIONAL_DEPS_METADATA = 'optional:paramtypes';
exports.METHOD_METADATA = 'method';
exports.ROUTE_ARGS_METADATA = '__routeArguments__';
exports.CUSTOM_ROUTE_AGRS_METADATA = '__customRouteArgs__';
@@ -19,6 +21,10 @@ exports.EXCEPTION_FILTERS_METADATA = '__exceptionFilters__';
exports.FILTER_CATCH_EXCEPTIONS = '__filterCatchExceptions__';
exports.PIPES_METADATA = '__pipes__';
exports.GUARDS_METADATA = '__guards__';
exports.RENDER_METADATA = '__renderTemplate__';
exports.INTERCEPTORS_METADATA = '__interceptors__';
exports.HTTP_CODE_METADATA = '__httpCode__';
exports.GATEWAY_MIDDLEWARES = '__gatewayMiddlewares';
exports.GATEWAY_MIDDLEWARES = '__gatewayMiddleware';
exports.MODULE_PATH = '__module_path__';
exports.HEADERS_METADATA = '__headers__';
exports.REDIRECT_METADATA = '__redirect__';

View File

@@ -1,6 +1,6 @@
/**
* Binds parameters decorators to the method
* Useful when the language doesn't provide a 'Parameter Decorators' feature
* Binds parameters decorators to the particular method
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
* @param {} ...decorators
*/
export declare function Bind(...decorators: any[]): (target: object, key: any, descriptor: any) => any;

View File

@@ -1,8 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Binds parameters decorators to the method
* Useful when the language doesn't provide a 'Parameter Decorators' feature
* Binds parameters decorators to the particular method
* Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
* @param {} ...decorators
*/
function Bind(...decorators) {

View File

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

View File

@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
/**
* Defines the Exceptions Filter. Takes set of exception types as an argument, which has to be catched by this Filter.
* The class should implements the `ExceptionFilter` interface.
* Defines the Exceptions Filter. Takes set of exception types as an argument which has to be caught by this Filter.
* The class should implement the `ExceptionFilter` interface.
*/
function Catch(...exceptions) {
return (target) => {

View File

@@ -1,21 +1,31 @@
/**
* Defines the injectable class. This class can inject dependencies through constructor.
* Those dependencies have to belong to the same module.
*/
export declare function Injectable(): ClassDecorator;
/**
* @deprecated
* Defines the Component. The component can inject dependencies through constructor.
* Those dependencies should belongs to the same module.
* Those dependencies have to belong to the same module.
*/
export declare function Component(): ClassDecorator;
/**
* Defines the Pipe. The Pipe should implements the `PipeTransform` interface.
* @deprecated
* Defines the Pipe. The Pipe should implement the `PipeTransform` interface.
*/
export declare function Pipe(): ClassDecorator;
/**
* @deprecated
* Defines the Guard. The Guard should implement the `CanActivate` interface.
*/
export declare function Guard(): ClassDecorator;
/**
* @deprecated
* Defines the Middleware. The Middleware should implement the `NestMiddleware` interface.
*/
export declare function Middleware(): ClassDecorator;
/**
* @deprecated
* Defines the Interceptor. The Interceptor should implement `HttpInterceptor`, `RpcInterceptor` or `WsInterceptor` interface.
*/
export declare function Interceptor(): ClassDecorator;

View File

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

View File

@@ -1,6 +1,6 @@
import 'reflect-metadata';
/**
* Defines the Controller. The controller can inject dependencies through constructor.
* Those dependencies should belongs to the same module.
* Those dependencies have to belong to the same module.
*/
export declare function Controller(prefix?: string): ClassDecorator;

View File

@@ -5,7 +5,7 @@ const shared_utils_1 = require("../../utils/shared.utils");
const constants_1 = require("../../constants");
/**
* Defines the Controller. The controller can inject dependencies through constructor.
* Those dependencies should belongs to the same module.
* Those dependencies have to belong to the same module.
*/
function Controller(prefix) {
const path = shared_utils_1.isUndefined(prefix) ? '/' : prefix;

View File

@@ -1,2 +1,3 @@
import 'reflect-metadata';
export declare function flatten(arr: any[]): any;
export declare const Dependencies: (...dependencies: any[]) => ClassDecorator;

View File

@@ -2,10 +2,11 @@
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
const flatten = arr => {
function flatten(arr) {
const flat = [].concat(...arr);
return flat.some(Array.isArray) ? flatten(flat) : flat;
};
}
exports.flatten = flatten;
exports.Dependencies = (...dependencies) => {
const flattenDeps = flatten(dependencies);
return (target) => {

View File

@@ -8,6 +8,6 @@ import { ExceptionFilter } from '../../index';
* When the `@UseFilters()` is used on the handle level:
* - Exception Filter will be set up only to specified method
*
* @param {ExceptionFilter[]} ...filters (instances)
* @param {ExceptionFilter[]} ...filters
*/
export declare const UseFilters: (...filters: ExceptionFilter[]) => (target: object, key?: any, descriptor?: any) => any;
export declare const UseFilters: (...filters: (Function | ExceptionFilter<any>)[]) => (target: any, key?: any, descriptor?: any) => any;

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
const shared_utils_1 = require("../../utils/shared.utils");
const validate_each_util_1 = require("../../utils/validate-each.util");
const defineFiltersMetadata = (...filters) => {
return (target, key, descriptor) => {
const isFilterValid = filter => filter && (shared_utils_1.isFunction(filter) || shared_utils_1.isFunction(filter.catch));
if (descriptor) {
validate_each_util_1.validateEach(target.constructor, filters, isFilterValid, '@UseFilters', 'filter');
extend_metadata_util_1.extendArrayMetadata(constants_1.EXCEPTION_FILTERS_METADATA, filters, descriptor.value);
return descriptor;
}
validate_each_util_1.validateEach(target, filters, isFilterValid, '@UseFilters', 'filter');
extend_metadata_util_1.extendArrayMetadata(constants_1.EXCEPTION_FILTERS_METADATA, filters, target);
return target;
};
};
/**
* Setups exception filters to the chosen context.
* When the `@UseFilters()` is used on the controller level:
* - Exception Filter will be set up to every handler (every method)
*
* When the `@UseFilters()` is used on the handle level:
* - Exception Filter will be set up only to specified method
*
* @param {ExceptionFilter[]} ...filters
*/
exports.UseFilters = (...filters) => defineFiltersMetadata(...filters);

View File

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

View File

@@ -3,14 +3,15 @@ function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./controller.decorator"));
__export(require("./component.decorator"));
__export(require("./dependencies.decorator"));
__export(require("./inject.decorator"));
__export(require("./catch.decorator"));
__export(require("./exception-filters.decorator"));
__export(require("./use-pipes.decorator"));
__export(require("./use-guards.decorator"));
__export(require("./reflect-metadata.decorator"));
__export(require("./use-interceptors.decorator"));
__export(require("./bind.decorator"));
__export(require("./catch.decorator"));
__export(require("./component.decorator"));
__export(require("./controller.decorator"));
__export(require("./dependencies.decorator"));
__export(require("./exception-filters.decorator"));
__export(require("./inject.decorator"));
__export(require("./optional.decorator"));
__export(require("./reflect-metadata.decorator"));
__export(require("./use-guards.decorator"));
__export(require("./use-interceptors.decorator"));
__export(require("./use-pipes.decorator"));

View File

@@ -0,0 +1,6 @@
import 'reflect-metadata';
/**
* Injects provider which has to be available in the current injector (module) scope.
* Providers are recognized by types or tokens.
*/
export declare function Inject<T = any>(token: T): ParameterDecorator;

View File

@@ -4,8 +4,8 @@ require("reflect-metadata");
const constants_1 = require("../../constants");
const shared_utils_1 = require("../../utils/shared.utils");
/**
* Injects component, which has to be available in the current injector (module) scope.
* Components are recognized by types / or tokens.
* Injects provider which has to be available in the current injector (module) scope.
* Providers are recognized by types or tokens.
*/
function Inject(token) {
return (target, key, index) => {

View File

@@ -0,0 +1,5 @@
import 'reflect-metadata';
/**
* Sets dependency as an optional one.
*/
export declare function Optional(): ParameterDecorator;

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
/**
* Sets dependency as an optional one.
*/
function Optional() {
return (target, key, index) => {
const args = Reflect.getMetadata(constants_1.OPTIONAL_DEPS_METADATA, target) || [];
Reflect.defineMetadata(constants_1.OPTIONAL_DEPS_METADATA, [...args, index], target);
};
}
exports.Optional = Optional;

View File

@@ -0,0 +1,5 @@
/**
* Assigns the metadata to the class/function under specified `key`.
* This metadata can be reflected using `Reflector` class.
*/
export declare const ReflectMetadata: <K = any, V = any>(metadataKey: K, metadataValue: V) => (target: object, key?: any, descriptor?: any) => any;

View File

@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Assigns the metadata to the class / function under specified `key`.
* Assigns the metadata to the class/function under specified `key`.
* This metadata can be reflected using `Reflector` class.
*/
exports.ReflectMetadata = (metadataKey, metadataValue) => (target, key, descriptor) => {

View File

@@ -0,0 +1,12 @@
import { CanActivate } from '../../interfaces';
/**
* Binds guards to the particular context.
* When the `@UseGuards()` is used on the controller level:
* - Guard will be register to each handler (every method)
*
* When the `@UseGuards()` is used on the handler level:
* - Guard will be registered only to specified method
*
* @param {} ...guards
*/
export declare function UseGuards(...guards: (CanActivate | Function)[]): (target: any, key?: any, descriptor?: any) => any;

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../../constants");
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
const validate_each_util_1 = require("../../utils/validate-each.util");
const shared_utils_1 = require("../../utils/shared.utils");
/**
* Binds guards to the particular context.
* When the `@UseGuards()` is used on the controller level:
* - Guard will be register to each handler (every method)
*
* When the `@UseGuards()` is used on the handler level:
* - Guard will be registered only to specified method
*
* @param {} ...guards
*/
function UseGuards(...guards) {
return (target, key, descriptor) => {
const isValidGuard = guard => guard && (shared_utils_1.isFunction(guard) || shared_utils_1.isFunction(guard.canActivate));
if (descriptor) {
validate_each_util_1.validateEach(target.constructor, guards, isValidGuard, '@UseGuards', 'guard');
extend_metadata_util_1.extendArrayMetadata(constants_1.GUARDS_METADATA, guards, descriptor.value);
return descriptor;
}
validate_each_util_1.validateEach(target, guards, isValidGuard, '@UseGuards', 'guard');
extend_metadata_util_1.extendArrayMetadata(constants_1.GUARDS_METADATA, guards, target);
return target;
};
}
exports.UseGuards = UseGuards;

View File

@@ -0,0 +1,12 @@
import { NestInterceptor } from '../../interfaces';
/**
* Binds interceptors to the particular context.
* When the `@UseInterceptors()` is used on the controller level:
* - Interceptor will be register to each handler (every method)
*
* When the `@UseInterceptors()` is used on the handle level:
* - Interceptor will be registered only to specified method
*
* @param {} ...interceptors
*/
export declare function UseInterceptors(...interceptors: (NestInterceptor | Function)[]): (target: any, key?: any, descriptor?: any) => any;

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../../constants");
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
const shared_utils_1 = require("../../utils/shared.utils");
const validate_each_util_1 = require("../../utils/validate-each.util");
/**
* Binds interceptors to the particular context.
* When the `@UseInterceptors()` is used on the controller level:
* - Interceptor will be register to each handler (every method)
*
* When the `@UseInterceptors()` is used on the handle level:
* - Interceptor will be registered only to specified method
*
* @param {} ...interceptors
*/
function UseInterceptors(...interceptors) {
return (target, key, descriptor) => {
const isValidInterceptor = interceptor => interceptor &&
(shared_utils_1.isFunction(interceptor) || shared_utils_1.isFunction(interceptor.intercept));
if (descriptor) {
validate_each_util_1.validateEach(target.constructor, interceptors, isValidInterceptor, '@UseInterceptors', 'interceptor');
extend_metadata_util_1.extendArrayMetadata(constants_1.INTERCEPTORS_METADATA, interceptors, descriptor.value);
return descriptor;
}
validate_each_util_1.validateEach(target, interceptors, isValidInterceptor, '@UseInterceptors', 'interceptor');
extend_metadata_util_1.extendArrayMetadata(constants_1.INTERCEPTORS_METADATA, interceptors, target);
return target;
};
}
exports.UseInterceptors = UseInterceptors;

View File

@@ -0,0 +1,12 @@
import { PipeTransform } from '../../interfaces/index';
/**
* Binds pipes to the particular context.
* When the `@UsePipes()` is used on the controller level:
* - Pipe will be register to each handler (every method)
*
* When the `@UsePipes()` is used on the handle level:
* - Pipe will be registered only to specified method
*
* @param {PipeTransform[]} ...pipes
*/
export declare function UsePipes(...pipes: (PipeTransform | Function)[]): (target: any, key?: any, descriptor?: any) => any;

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../../constants");
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
const validate_each_util_1 = require("../../utils/validate-each.util");
const shared_utils_1 = require("../../utils/shared.utils");
/**
* Binds pipes to the particular context.
* When the `@UsePipes()` is used on the controller level:
* - Pipe will be register to each handler (every method)
*
* When the `@UsePipes()` is used on the handle level:
* - Pipe will be registered only to specified method
*
* @param {PipeTransform[]} ...pipes
*/
function UsePipes(...pipes) {
return (target, key, descriptor) => {
const isPipeValid = pipe => pipe && (shared_utils_1.isFunction(pipe) || shared_utils_1.isFunction(pipe.transform));
if (descriptor) {
extend_metadata_util_1.extendArrayMetadata(constants_1.PIPES_METADATA, pipes, descriptor.value);
return descriptor;
}
validate_each_util_1.validateEach(target, pipes, isPipeValid, '@UsePipes', 'pipe');
extend_metadata_util_1.extendArrayMetadata(constants_1.PIPES_METADATA, pipes, target);
return target;
};
}
exports.UsePipes = UsePipes;

View File

@@ -0,0 +1,15 @@
import { PipeTransform } from '../../index';
import { Type } from '../../interfaces';
import { CustomParamFactory } from '../../interfaces/features/custom-route-param-factory.interface';
export declare type ParamDecoratorEnhancer = ParameterDecorator;
/**
* Defines HTTP route param decorator
* @param factory
*/
export declare function createParamDecorator(factory: CustomParamFactory, enhancers?: ParamDecoratorEnhancer[]): (...dataOrPipes: (Type<PipeTransform> | PipeTransform | any)[]) => ParameterDecorator;
/**
* Defines HTTP route param decorator
* @deprecated
* @param factory
*/
export declare function createRouteParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;

View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const deprecate = require("deprecate");
const uuid = require("uuid/v4");
const constants_1 = require("../../constants");
const shared_utils_1 = require("../../utils/shared.utils");
const assignCustomMetadata = (args, paramtype, index, factory, data, ...pipes) => (Object.assign({}, args, { [`${paramtype}${constants_1.CUSTOM_ROUTE_AGRS_METADATA}:${index}`]: {
index,
factory,
data,
pipes,
} }));
/**
* Defines HTTP route param decorator
* @param factory
*/
function createParamDecorator(factory, enhancers = []) {
const paramtype = uuid();
return (data, ...pipes) => (target, key, index) => {
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
const isPipe = pipe => pipe &&
((shared_utils_1.isFunction(pipe) && pipe.prototype) || shared_utils_1.isFunction(pipe.transform));
const hasParamData = shared_utils_1.isNil(data) || !isPipe(data);
const paramData = hasParamData ? data : undefined;
const paramPipes = hasParamData ? pipes : [data, ...pipes];
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignCustomMetadata(args, paramtype, index, factory, paramData, ...paramPipes), target.constructor, key);
enhancers.forEach(fn => fn(target, key, index));
};
}
exports.createParamDecorator = createParamDecorator;
/**
* Defines HTTP route param decorator
* @deprecated
* @param factory
*/
function createRouteParamDecorator(factory) {
deprecate('The "createRouteParamDecorator" function is deprecated and will be removed within next major release. Use "createParamDecorator" instead.');
return createParamDecorator(factory);
}
exports.createRouteParamDecorator = createRouteParamDecorator;

View File

@@ -0,0 +1,5 @@
import 'reflect-metadata';
/**
* Sets a response header.
*/
export declare function Header(name: string, value: string): MethodDecorator;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
const extend_metadata_util_1 = require("../../utils/extend-metadata.util");
/**
* Sets a response header.
*/
function Header(name, value) {
return (target, key, descriptor) => {
extend_metadata_util_1.extendArrayMetadata(constants_1.HEADERS_METADATA, [{ name, value }], descriptor.value);
return descriptor;
};
}
exports.Header = Header;

View File

@@ -1,5 +1,5 @@
/**
* Defines the HTTP status code, which should be sent with response.
* Defines the HTTP response status code.
* It overrides default status code for the given request method.
*
* @param {number} statusCode

View File

@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../../constants");
/**
* Defines the HTTP status code, which should be sent with response.
* Defines the HTTP response status code.
* It overrides default status code for the given request method.
*
* @param {number} statusCode

View File

@@ -2,3 +2,5 @@ export * from './request-mapping.decorator';
export * from './route-params.decorator';
export * from './http-code.decorator';
export * from './create-route-param-metadata.decorator';
export * from './render.decorator';
export * from './header.decorator';

View File

@@ -7,3 +7,5 @@ __export(require("./request-mapping.decorator"));
__export(require("./route-params.decorator"));
__export(require("./http-code.decorator"));
__export(require("./create-route-param-metadata.decorator"));
__export(require("./render.decorator"));
__export(require("./header.decorator"));

View File

@@ -0,0 +1,5 @@
import 'reflect-metadata';
/**
* Redirects request.
*/
export declare function Redirect(url: string): MethodDecorator;

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
/**
* Redirects request.
*/
function Redirect(url) {
return (target, key, descriptor) => {
Reflect.defineMetadata(constants_1.REDIRECT_METADATA, url, descriptor.value);
return descriptor;
};
}
exports.Redirect = Redirect;

View File

@@ -0,0 +1,5 @@
import 'reflect-metadata';
/**
* Defines a template to be rendered by the controller.
*/
export declare function Render(template: string): MethodDecorator;

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const constants_1 = require("../../constants");
/**
* Defines a template to be rendered by the controller.
*/
function Render(template) {
return (target, key, descriptor) => {
Reflect.defineMetadata(constants_1.RENDER_METADATA, template, descriptor.value);
return descriptor;
};
}
exports.Render = Render;

View File

@@ -1,5 +1,6 @@
import 'reflect-metadata';
import { PipeTransform } from '../../index';
import { Type } from '../../interfaces';
export declare type ParamData = object | string | number;
export interface RouteParamsMetadata {
[prop: number]: {
@@ -11,15 +12,17 @@ export declare const Request: () => ParameterDecorator;
export declare const Response: () => ParameterDecorator;
export declare const Next: () => ParameterDecorator;
export declare const Session: () => ParameterDecorator;
export declare const UploadedFile: (fileKey?: string) => ParameterDecorator;
export declare const UploadedFiles: () => ParameterDecorator;
export declare const Headers: (property?: string) => ParameterDecorator;
export declare function Query(): any;
export declare function Query(...pipes: PipeTransform<any>[]): any;
export declare function Query(property: string, ...pipes: PipeTransform<any>[]): any;
export declare function Query(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare function Query(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare function Body(): any;
export declare function Body(...pipes: PipeTransform<any>[]): any;
export declare function Body(property: string, ...pipes: PipeTransform<any>[]): any;
export declare function Body(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare function Body(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare function Param(): any;
export declare function Param(...pipes: PipeTransform<any>[]): any;
export declare function Param(property: string, ...pipes: PipeTransform<any>[]): any;
export declare function Param(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare function Param(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare const Req: () => ParameterDecorator;
export declare const Res: () => ParameterDecorator;

View File

@@ -11,21 +11,23 @@ const assignMetadata = (args, paramtype, index, data, ...pipes) => (Object.assig
} }));
const createRouteParamDecorator = (paramtype) => {
return (data) => (target, key, index) => {
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target, key) || {};
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data), target, key);
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, data), target.constructor, key);
};
};
const createPipesRouteParamDecorator = (paramtype) => (data, ...pipes) => (target, key, index) => {
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target, key) || {};
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
const hasParamData = shared_utils_1.isNil(data) || shared_utils_1.isString(data);
const paramData = hasParamData ? data : undefined;
const paramPipes = hasParamData ? pipes : [data, ...pipes];
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, paramData, ...paramPipes), target, key);
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, assignMetadata(args, paramtype, index, paramData, ...paramPipes), target.constructor, key);
};
exports.Request = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.REQUEST);
exports.Response = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.RESPONSE);
exports.Next = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.NEXT);
exports.Session = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.SESSION);
exports.UploadedFile = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.FILE);
exports.UploadedFiles = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.FILES);
exports.Headers = createRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.HEADERS);
function Query(property, ...pipes) {
return createPipesRouteParamDecorator(route_paramtypes_enum_1.RouteParamtypes.QUERY)(property, ...pipes);

View File

@@ -1,6 +1,6 @@
import 'reflect-metadata';
/**
* Makes the module global-scoped.
* Once imported will be available for all of the existing modules.
* Once imported will be available for all existing modules.
*/
export declare function Global(): ClassDecorator;

View File

@@ -4,7 +4,7 @@ require("reflect-metadata");
const constants_1 = require("../../constants");
/**
* Makes the module global-scoped.
* Once imported will be available for all of the existing modules.
* Once imported will be available for all existing modules.
*/
function Global() {
return (target) => {

View File

@@ -1,4 +1,3 @@
export * from './module.decorator';
export * from './shared.decorator';
export * from './single-scope.decorator';
export * from './global.decorator';

View File

@@ -4,6 +4,5 @@ function __export(m) {
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./module.decorator"));
__export(require("./shared.decorator"));
__export(require("./single-scope.decorator"));
__export(require("./global.decorator"));

View File

@@ -0,0 +1,12 @@
import 'reflect-metadata';
import { ModuleMetadata } from '../../interfaces/modules/module-metadata.interface';
/**
* Defines the module
* - `imports` - the set of the 'imported' modules
* - `controllers` - the list of controllers (e.g. HTTP controllers)
* - `providers` - the list of providers that belong to this module. They can be injected between themselves.
* - `exports` - the set of components, which should be available for modules, which imports this module
* - `components` - @deprecated the list of components that belong to this module. They can be injected between themselves.
* @param options {ModuleMetadata} Module metadata
*/
export declare function Module(metadata: ModuleMetadata): ClassDecorator;

View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("reflect-metadata");
const deprecate = require("deprecate");
const constants_1 = require("../../constants");
const invalid_module_config_exception_1 = require("./exceptions/invalid-module-config.exception");
const metadataKeys = [
constants_1.metadata.MODULES,
constants_1.metadata.IMPORTS,
constants_1.metadata.EXPORTS,
constants_1.metadata.COMPONENTS,
constants_1.metadata.CONTROLLERS,
constants_1.metadata.PROVIDERS,
];
const validateKeys = (keys) => {
const isKeyInvalid = key => metadataKeys.findIndex(k => k === key) < 0;
const validateKey = key => {
if (!isKeyInvalid(key)) {
return;
}
throw new invalid_module_config_exception_1.InvalidModuleConfigException(key);
};
keys.forEach(validateKey);
};
/**
* Defines the module
* - `imports` - the set of the 'imported' modules
* - `controllers` - the list of controllers (e.g. HTTP controllers)
* - `providers` - the list of providers that belong to this module. They can be injected between themselves.
* - `exports` - the set of components, which should be available for modules, which imports this module
* - `components` - @deprecated the list of components that belong to this module. They can be injected between themselves.
* @param options {ModuleMetadata} Module metadata
*/
function Module(metadata) {
const propsKeys = Object.keys(metadata);
validateKeys(propsKeys);
showDeprecatedWarnings(metadata);
overrideModuleMetadata(metadata);
return (target) => {
for (const property in metadata) {
if (metadata.hasOwnProperty(property)) {
Reflect.defineMetadata(property, metadata[property], target);
}
}
};
}
exports.Module = Module;
function overrideModuleMetadata(moduleMetadata) {
moduleMetadata.modules = moduleMetadata.imports
? moduleMetadata.imports
: moduleMetadata.modules;
moduleMetadata.components = moduleMetadata.providers
? moduleMetadata.providers
: moduleMetadata.components;
}
function showDeprecatedWarnings(moduleMetadata) {
const modulesDeprecatedWarning = 'The "modules" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "imports" key instead.';
const componentsDeprecatetWarning = 'The "components" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "providers" key instead.';
moduleMetadata.modules && deprecate(modulesDeprecatedWarning);
moduleMetadata.components && deprecate(componentsDeprecatetWarning);
}

View File

@@ -1,6 +1,6 @@
import 'reflect-metadata';
/**
* Makes the module single-scoped (not singleton).
* Nest will always create the new instance of the module, when it's imported by another one.
* In this case, Nest will always create a new instance of this particular module when it's imported by another one.
*/
export declare function SingleScope(): ClassDecorator;

View File

@@ -4,7 +4,7 @@ require("reflect-metadata");
const constants_1 = require("../../constants");
/**
* Makes the module single-scoped (not singleton).
* Nest will always create the new instance of the module, when it's imported by another one.
* In this case, Nest will always create a new instance of this particular module when it's imported by another one.
*/
function SingleScope() {
return (target) => {

View File

@@ -34,6 +34,7 @@ export declare enum HttpStatus {
UNSUPPORTED_MEDIA_TYPE = 415,
REQUESTED_RANGE_NOT_SATISFIABLE = 416,
EXPECTATION_FAILED = 417,
I_AM_A_TEAPOT = 418,
UNPROCESSABLE_ENTITY = 422,
TOO_MANY_REQUESTS = 429,
INTERNAL_SERVER_ERROR = 500,

View File

@@ -37,6 +37,7 @@ var HttpStatus;
HttpStatus[HttpStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
HttpStatus[HttpStatus["REQUESTED_RANGE_NOT_SATISFIABLE"] = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE";
HttpStatus[HttpStatus["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
HttpStatus[HttpStatus["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
HttpStatus[HttpStatus["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
HttpStatus[HttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
HttpStatus[HttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";

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