@nestjs/throttler 1.1.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/index.js +46 -23
- package/dist/throttler-module-options.interface.js +3 -3
- package/dist/throttler-storage.interface.js +3 -3
- package/dist/throttler.constants.js +8 -4
- package/dist/throttler.decorator.js +29 -25
- package/dist/throttler.exception.js +7 -7
- package/dist/throttler.guard.d.ts +1 -0
- package/dist/throttler.guard.js +107 -79
- package/dist/throttler.guard.js.map +1 -1
- package/dist/throttler.module.js +77 -58
- package/dist/throttler.providers.js +22 -18
- package/dist/throttler.service.js +47 -36
- package/dist/tsconfig.build.tsbuildinfo +1 -4833
- package/package.json +48 -47
- package/CHANGELOG.md +0 -94
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/throttler",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A Rate-Limiting module for NestJS to work on Express, Fastify, Websockets, Socket.IO, and GraphQL, all rolled up into a simple package.",
|
|
5
5
|
"author": "Jay McDoniel <me@jaymcdoniel.dev>",
|
|
6
6
|
"contributors": [],
|
|
@@ -48,60 +48,61 @@
|
|
|
48
48
|
"md5": "^2.2.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@commitlint/cli": "12.
|
|
52
|
-
"@commitlint/config-angular": "12.
|
|
53
|
-
"@nestjs/cli": "
|
|
54
|
-
"@nestjs/common": "
|
|
55
|
-
"@nestjs/core": "
|
|
56
|
-
"@nestjs/graphql": "
|
|
57
|
-
"@nestjs/platform-express": "
|
|
58
|
-
"@nestjs/platform-fastify": "
|
|
59
|
-
"@nestjs/platform-socket.io": "
|
|
60
|
-
"@nestjs/platform-ws": "
|
|
61
|
-
"@nestjs/schematics": "
|
|
62
|
-
"@nestjs/testing": "
|
|
63
|
-
"@nestjs/websockets": "
|
|
64
|
-
"@
|
|
65
|
-
"@types/express
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/
|
|
70
|
-
"@types/socket.io
|
|
71
|
-
"@types/
|
|
72
|
-
"@
|
|
73
|
-
"@typescript-eslint/
|
|
74
|
-
"
|
|
75
|
-
"apollo-server-
|
|
51
|
+
"@commitlint/cli": "12.1.4",
|
|
52
|
+
"@commitlint/config-angular": "12.1.4",
|
|
53
|
+
"@nestjs/cli": "8.0.2",
|
|
54
|
+
"@nestjs/common": "8.0.1",
|
|
55
|
+
"@nestjs/core": "8.0.1",
|
|
56
|
+
"@nestjs/graphql": "8.0.2",
|
|
57
|
+
"@nestjs/platform-express": "8.0.1",
|
|
58
|
+
"@nestjs/platform-fastify": "8.0.1",
|
|
59
|
+
"@nestjs/platform-socket.io": "8.0.1",
|
|
60
|
+
"@nestjs/platform-ws": "8.0.1",
|
|
61
|
+
"@nestjs/schematics": "8.0.0",
|
|
62
|
+
"@nestjs/testing": "8.0.1",
|
|
63
|
+
"@nestjs/websockets": "8.0.1",
|
|
64
|
+
"@semantic-release/git": "9.0.0",
|
|
65
|
+
"@types/express": "4.17.13",
|
|
66
|
+
"@types/express-serve-static-core": "4.17.24",
|
|
67
|
+
"@types/jest": "26.0.24",
|
|
68
|
+
"@types/md5": "2.3.1",
|
|
69
|
+
"@types/node": "16.3.0",
|
|
70
|
+
"@types/socket.io": "3.0.2",
|
|
71
|
+
"@types/socket.io-client": "3.0.0",
|
|
72
|
+
"@types/supertest": "2.0.11",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "4.28.2",
|
|
74
|
+
"@typescript-eslint/parser": "4.28.2",
|
|
75
|
+
"apollo-server-express": "2.25.2",
|
|
76
|
+
"apollo-server-fastify": "2.25.2",
|
|
76
77
|
"conventional-changelog-cli": "2.1.1",
|
|
77
78
|
"cz-conventional-changelog": "3.3.0",
|
|
78
|
-
"eslint": "7.
|
|
79
|
-
"eslint-config-prettier": "
|
|
80
|
-
"eslint-plugin-import": "2.
|
|
81
|
-
"graphql": "15.5.
|
|
82
|
-
"graphql-tools": "7.0.
|
|
83
|
-
"husky": "
|
|
84
|
-
"jest": "
|
|
85
|
-
"lint-staged": "
|
|
86
|
-
"nodemon": "2.0.
|
|
79
|
+
"eslint": "7.30.0",
|
|
80
|
+
"eslint-config-prettier": "8.3.0",
|
|
81
|
+
"eslint-plugin-import": "2.23.4",
|
|
82
|
+
"graphql": "15.5.1",
|
|
83
|
+
"graphql-tools": "7.0.5",
|
|
84
|
+
"husky": "7.0.1",
|
|
85
|
+
"jest": "27.0.6",
|
|
86
|
+
"lint-staged": "11.0.0",
|
|
87
|
+
"nodemon": "2.0.10",
|
|
87
88
|
"pinst": "2.1.6",
|
|
88
|
-
"prettier": "2.2
|
|
89
|
+
"prettier": "2.3.2",
|
|
89
90
|
"reflect-metadata": "0.1.13",
|
|
90
91
|
"rimraf": "3.0.2",
|
|
91
|
-
"rxjs": "
|
|
92
|
-
"semantic-release": "17.4.
|
|
93
|
-
"socket.io": "4.
|
|
92
|
+
"rxjs": "7.2.0",
|
|
93
|
+
"semantic-release": "17.4.4",
|
|
94
|
+
"socket.io": "4.1.2",
|
|
94
95
|
"supertest": "6.1.3",
|
|
95
|
-
"ts-jest": "
|
|
96
|
-
"ts-loader": "
|
|
97
|
-
"ts-node": "
|
|
98
|
-
"tsconfig-paths": "3.
|
|
99
|
-
"typescript": "4.
|
|
100
|
-
"ws": "7.
|
|
96
|
+
"ts-jest": "27.0.3",
|
|
97
|
+
"ts-loader": "9.2.3",
|
|
98
|
+
"ts-node": "10.0.0",
|
|
99
|
+
"tsconfig-paths": "3.10.1",
|
|
100
|
+
"typescript": "4.3.5",
|
|
101
|
+
"ws": "7.5.2"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
|
-
"@nestjs/common": "^7.0.0",
|
|
104
|
-
"@nestjs/core": "^7.0.0",
|
|
104
|
+
"@nestjs/common": "^7.0.0 || ^8.0.0",
|
|
105
|
+
"@nestjs/core": "^7.0.0 || ^8.0.0",
|
|
105
106
|
"reflect-metadata": "^0.1.13"
|
|
106
107
|
},
|
|
107
108
|
"jest": {
|
package/CHANGELOG.md
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
## [1.1.3](https://github.com/nestjs/throttler/compare/v1.1.2...v1.1.3) (2021-03-30)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* expose injection tokens and allow for tracker override ([3444608](https://github.com/nestjs/throttler/commit/34446083b563ea9361c268fc951de79e88c51165))
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# [0.3.0](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.3...0.3.0) (2020-11-10)
|
|
11
|
-
|
|
12
|
-
### Bug Fixes
|
|
13
|
-
|
|
14
|
-
- **module:** async register is now `forRootAsync` ([a1c6ace](https://github.com/jmcdo29/nestjs-throttler/commit/a1c6acef472e9d2368f2139e6b789ef184a7d952))
|
|
15
|
-
|
|
16
|
-
## [0.2.3](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.2...0.2.3) (2020-08-06)
|
|
17
|
-
|
|
18
|
-
### Features
|
|
19
|
-
|
|
20
|
-
- **ws:** allows for optional use of @nestjs/websocket ([f437614](https://github.com/jmcdo29/nestjs-throttler/commit/f437614cab5aebfdfdb4d5884f45b58b16d5a140))
|
|
21
|
-
|
|
22
|
-
## [0.2.2](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.1...0.2.2) (2020-06-12)
|
|
23
|
-
|
|
24
|
-
### Bug Fixes
|
|
25
|
-
|
|
26
|
-
- moves userAgent check to http handler ([87183af](https://github.com/jmcdo29/nestjs-throttler/commit/87183af8fc189d7d5c8237832089138a0b40589b))
|
|
27
|
-
|
|
28
|
-
### Features
|
|
29
|
-
|
|
30
|
-
- **decorator:** add setThrottlerMetadata() function back ([ea31a9c](https://github.com/jmcdo29/nestjs-throttler/commit/ea31a9c86b82550e2d43f3433ec618785cf2b34a))
|
|
31
|
-
- **graphql:** implements graphql limiter ([40eaff1](https://github.com/jmcdo29/nestjs-throttler/commit/40eaff16dae5c0279001e56ff64a2b540d82a3c7))
|
|
32
|
-
- Add support for ws (websockets) ([a745295](https://github.com/jmcdo29/nestjs-throttler/commit/a74529517f989c43d77c9a63712e82244ebeefcd))
|
|
33
|
-
- Add support for ws (websockets) ([8103a5a](https://github.com/jmcdo29/nestjs-throttler/commit/8103a5a11c1916f05f8c44e302ba93a98d7cb77d))
|
|
34
|
-
- Make storage methods async ([92cd4eb](https://github.com/jmcdo29/nestjs-throttler/commit/92cd4ebf507b3bed4efbaeb7bb47bd1738a62dc3))
|
|
35
|
-
- **exception:** Use const instead of duplicated string ([f95da2c](https://github.com/jmcdo29/nestjs-throttler/commit/f95da2c4fc787c7c5e525672d668745bc1f2301d))
|
|
36
|
-
- **guard:** Add default case for context.getType() switch ([ff46d57](https://github.com/jmcdo29/nestjs-throttler/commit/ff46d57508c4b446918ccd75f704d0eed1ae352f))
|
|
37
|
-
- Implement basic support for websocket ([3a0cf2e](https://github.com/jmcdo29/nestjs-throttler/commit/3a0cf2ed70c7abbe02e9d96f26ab2c81b3c7bb2f))
|
|
38
|
-
|
|
39
|
-
## [0.2.1](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.0...0.2.1) (2020-06-09)
|
|
40
|
-
|
|
41
|
-
### Features
|
|
42
|
-
|
|
43
|
-
- add support for ignoreUserAgents option ([1ab5e17](https://github.com/jmcdo29/nestjs-throttler/commit/1ab5e17a25a95ec14910e199726eac07f66f4475))
|
|
44
|
-
|
|
45
|
-
# [0.2.0](https://github.com/jmcdo29/nestjs-throttler/compare/0.1.1...0.2.0) (2020-06-09)
|
|
46
|
-
|
|
47
|
-
### Bug Fixes
|
|
48
|
-
|
|
49
|
-
- make core module global and export core module inside ThrottlerModule ([1f4df42](https://github.com/jmcdo29/nestjs-throttler/commit/1f4df42a5fc9a6f75c398bbb6a3f9ebaec6bc80f))
|
|
50
|
-
|
|
51
|
-
### Features
|
|
52
|
-
|
|
53
|
-
- makes options required in forRoot and forRootAsync ([14e272a](https://github.com/jmcdo29/nestjs-throttler/commit/14e272a842a90db93dd9e8c60c936fbcf0bcd3b7))
|
|
54
|
-
- remove global guard and require user to implement it manually ([840eae4](https://github.com/jmcdo29/nestjs-throttler/commit/840eae4643867390bc598937b20e132257e9b018))
|
|
55
|
-
|
|
56
|
-
## [0.1.1](https://github.com/jmcdo29/nestjs-throttler/compare/0.1.0...0.1.1) (2020-06-07)
|
|
57
|
-
|
|
58
|
-
### Bug Fixes
|
|
59
|
-
|
|
60
|
-
- **interface:** fixes the storage interface to be async ([f7565d9](https://github.com/jmcdo29/nestjs-throttler/commit/f7565d9029baf4d7687f0913046f555d17cde44b))
|
|
61
|
-
|
|
62
|
-
# 0.1.0 (2020-06-07)
|
|
63
|
-
|
|
64
|
-
### Bug Fixes
|
|
65
|
-
|
|
66
|
-
- adds back AppModule to allow for running server for tests ([5af229b](https://github.com/jmcdo29/nestjs-throttler/commit/5af229ba69527daf3662b1899ed985fa9404251b))
|
|
67
|
-
- updates some types ([b26fc06](https://github.com/jmcdo29/nestjs-throttler/commit/b26fc06841a430e5728cde6276515130b89a7289))
|
|
68
|
-
- updates storage interface to use number ([339f29c](https://github.com/jmcdo29/nestjs-throttler/commit/339f29c12b4720a7376ec042988f73460172b32e))
|
|
69
|
-
- updates tests and resolves comments from pr ([ee87e05](https://github.com/jmcdo29/nestjs-throttler/commit/ee87e05e2f5eb61b00b423d6394be9a131f84f8a))
|
|
70
|
-
- **.gitignore:** Ignore all dist and node_modules rather than root-level only ([d9609af](https://github.com/jmcdo29/nestjs-throttler/commit/d9609afb9cf3561b84082ac9a3e2e26ddcbb2117))
|
|
71
|
-
- **guard:** Change RateLimit header prefix to X-RateLimit ([328c0a3](https://github.com/jmcdo29/nestjs-throttler/commit/328c0a3c1009fdc65820125c2145de65aebd3fee))
|
|
72
|
-
- **guard:** Change RateLimit header prefix to X-RateLimit ([3903885](https://github.com/jmcdo29/nestjs-throttler/commit/3903885df9eaac0d966c5b8207fae26b62f337f3))
|
|
73
|
-
- **guard:** guard now binds globally without the use of @UseGuards() ([4022447](https://github.com/jmcdo29/nestjs-throttler/commit/40224475d27f1ec0cf792225bbc18df33ab14cc2))
|
|
74
|
-
- **guard:** guard now binds globally without the use of @UseGuards() ([3ca146d](https://github.com/jmcdo29/nestjs-throttler/commit/3ca146d41afa71e3c68b73d8706e7431f929a85a))
|
|
75
|
-
- **guard:** Prevent RateLimit-Remaining from going below 0 ([25e33c8](https://github.com/jmcdo29/nestjs-throttler/commit/25e33c882007892a3285c92449aa5bc0840a8909))
|
|
76
|
-
- **guard:** Prevent RateLimit-Remaining from going below 0 ([74b1668](https://github.com/jmcdo29/nestjs-throttler/commit/74b166888ab283281a964d6c64b94224e2f96ba4))
|
|
77
|
-
- **guard:** Use the correct approach to check for excluded routes ([38eac3c](https://github.com/jmcdo29/nestjs-throttler/commit/38eac3ca3bdad0b4b266587bc4b0287f3f69f640))
|
|
78
|
-
- **guard:** Use the correct approach to check for excluded routes ([912813f](https://github.com/jmcdo29/nestjs-throttler/commit/912813f49cc98e8fbd2643650d22ea8cc88c77ae))
|
|
79
|
-
- req.method value in httpPromise ([b9ee26e](https://github.com/jmcdo29/nestjs-throttler/commit/b9ee26e5e888e4d4f220e91adc996ade764f7002))
|
|
80
|
-
|
|
81
|
-
### Features
|
|
82
|
-
|
|
83
|
-
- Swap excludeRoutes for @SkipThrottle() decorator ([16d6fac](https://github.com/jmcdo29/nestjs-throttler/commit/16d6facd5e8f648620fa47e372078db37472f619))
|
|
84
|
-
- **fastify:** updates guard to work for fastify ([bc678a3](https://github.com/jmcdo29/nestjs-throttler/commit/bc678a363c367d132a90a2a4282e3f033f526e00))
|
|
85
|
-
- Implement ignoreRoutes functionality ([7b8ab42](https://github.com/jmcdo29/nestjs-throttler/commit/7b8ab4273fffafc0dd0571393d8c0faf89afc42f))
|
|
86
|
-
- **package.json:** Add --watch to start:dev script ([3c4c28a](https://github.com/jmcdo29/nestjs-throttler/commit/3c4c28abbb324e064f65b284f1a99683cd02030b))
|
|
87
|
-
- Implement ignoreRoutes functionality ([75f870c](https://github.com/jmcdo29/nestjs-throttler/commit/75f870c5b49e4d22c70519d28f8efffc1da288eb))
|
|
88
|
-
- **module:** implements start of limiter module ([35dbff5](https://github.com/jmcdo29/nestjs-throttler/commit/35dbff5d30e7a1385a4f4cf688992017eb7e0566))
|
|
89
|
-
- **package.json:** Add --watch to start:dev script ([a6b441c](https://github.com/jmcdo29/nestjs-throttler/commit/a6b441cad221b7eee52be0ba81c66fca81853c4f))
|
|
90
|
-
- Add global ThrottlerGuard ([9a84aff](https://github.com/jmcdo29/nestjs-throttler/commit/9a84afff5d57a16731d021cb47d60c2b4d02eb02))
|
|
91
|
-
- adds httpromise for async/await http calls in tests ([70210c7](https://github.com/jmcdo29/nestjs-throttler/commit/70210c76173aabfd5f85f5a24e624e7c4c010ae2))
|
|
92
|
-
- Rename certain variables to use the THROTTLER prefix ([6a21b21](https://github.com/jmcdo29/nestjs-throttler/commit/6a21b216a2738aa470e2138d44053ba8413ce117))
|
|
93
|
-
- Setup example app ([df6b5f6](https://github.com/jmcdo29/nestjs-throttler/commit/df6b5f633ebbb4770d3eb9e72e8075cbe6b2f78a))
|
|
94
|
-
- Setup example app ([30c7576](https://github.com/jmcdo29/nestjs-throttler/commit/30c75764fd20f3afe7a3f7533a3f4f08d275a741))
|