@nestjs/throttler 3.1.0 → 4.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/throttler",
3
- "version": "3.1.0",
3
+ "version": "4.1.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": [],
@@ -24,83 +24,63 @@
24
24
  "files": [
25
25
  "dist"
26
26
  ],
27
- "scripts": {
28
- "prebuild": "rimraf dist",
29
- "preversion": "yarn run format && yarn run lint && yarn build",
30
- "build": "nest build",
31
- "commit": "git-cz",
32
- "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
33
- "start:dev": "nodemon --watch '{src,test/app}/**/*.ts' --ignore '**/*.spec.ts' --exec 'ts-node' test/app/main.ts",
34
- "lint": "eslint \"{src,test}/**/*.ts\" --fix",
35
- "test": "jest",
36
- "test:watch": "jest --watch",
37
- "test:cov": "jest --coverage",
38
- "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
39
- "test:e2e": "jest --config ./test/jest-e2e.json --detectOpenHandles",
40
- "test:e2e:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --config test/jest-e2e.json --runInBand",
41
- "test:e2e:dev": "yarn test:e2e --watchAll",
42
- "_postinstall": "husky install",
43
- "postpublish": "pinst --enable",
44
- "prepublishOnly": "pinst --disable",
45
- "release": "changeset publish"
46
- },
47
27
  "dependencies": {
48
28
  "md5": "^2.2.1"
49
29
  },
50
30
  "devDependencies": {
51
- "@changesets/cli": "2.25.0",
52
- "@commitlint/cli": "17.1.2",
53
- "@commitlint/config-angular": "17.1.0",
54
- "@nestjs/cli": "9.1.4",
55
- "@nestjs/common": "9.1.3",
56
- "@nestjs/core": "9.1.3",
57
- "@nestjs/graphql": "10.1.3",
58
- "@nestjs/platform-express": "9.1.3",
59
- "@nestjs/platform-fastify": "9.1.3",
60
- "@nestjs/platform-socket.io": "9.1.3",
61
- "@nestjs/platform-ws": "9.1.3",
62
- "@nestjs/schematics": "9.0.3",
63
- "@nestjs/testing": "9.1.3",
64
- "@nestjs/websockets": "9.1.3",
31
+ "@changesets/cli": "2.26.1",
32
+ "@commitlint/cli": "17.6.5",
33
+ "@commitlint/config-angular": "17.6.5",
34
+ "@nestjs/cli": "10.0.1",
35
+ "@nestjs/common": "10.0.0",
36
+ "@nestjs/core": "10.0.0",
37
+ "@nestjs/graphql": "11.0.6",
38
+ "@nestjs/platform-express": "10.0.0",
39
+ "@nestjs/platform-fastify": "10.0.0",
40
+ "@nestjs/platform-socket.io": "10.0.0",
41
+ "@nestjs/platform-ws": "10.0.0",
42
+ "@nestjs/schematics": "10.0.1",
43
+ "@nestjs/testing": "10.0.0",
44
+ "@nestjs/websockets": "10.0.0",
65
45
  "@semantic-release/git": "10.0.1",
66
- "@types/express": "4.17.14",
67
- "@types/express-serve-static-core": "4.17.31",
68
- "@types/jest": "29.1.2",
46
+ "@types/express": "4.17.17",
47
+ "@types/express-serve-static-core": "4.17.35",
48
+ "@types/jest": "29.5.2",
69
49
  "@types/md5": "2.3.2",
70
- "@types/node": "16.11.65",
50
+ "@types/node": "18.16.18",
71
51
  "@types/supertest": "2.0.12",
72
- "@typescript-eslint/eslint-plugin": "5.40.0",
73
- "@typescript-eslint/parser": "5.40.0",
74
- "apollo-server-express": "3.10.3",
75
- "apollo-server-fastify": "3.10.3",
76
- "conventional-changelog-cli": "2.2.2",
52
+ "@typescript-eslint/eslint-plugin": "5.59.11",
53
+ "@typescript-eslint/parser": "5.59.11",
54
+ "@apollo/server": "4.7.3",
55
+ "apollo-server-fastify": "3.12.0",
56
+ "conventional-changelog-cli": "3.0.0",
77
57
  "cz-conventional-changelog": "3.3.0",
78
- "eslint": "8.25.0",
79
- "eslint-config-prettier": "8.5.0",
80
- "eslint-plugin-import": "2.26.0",
58
+ "eslint": "8.42.0",
59
+ "eslint-config-prettier": "8.8.0",
60
+ "eslint-plugin-import": "2.27.5",
81
61
  "graphql": "16.6.0",
82
- "graphql-tools": "8.3.6",
83
- "husky": "8.0.1",
84
- "jest": "29.1.2",
85
- "lint-staged": "13.0.3",
86
- "nodemon": "2.0.20",
62
+ "graphql-tools": "8.3.20",
63
+ "husky": "8.0.3",
64
+ "jest": "29.5.0",
65
+ "lint-staged": "13.2.2",
66
+ "nodemon": "2.0.22",
87
67
  "pinst": "3.0.0",
88
- "prettier": "2.7.1",
68
+ "prettier": "2.8.8",
89
69
  "reflect-metadata": "0.1.13",
90
- "rimraf": "3.0.2",
91
- "rxjs": "7.5.7",
92
- "socket.io": "4.5.2",
93
- "supertest": "6.3.0",
94
- "ts-jest": "29.0.3",
95
- "ts-loader": "9.4.1",
70
+ "rimraf": "5.0.1",
71
+ "rxjs": "7.8.1",
72
+ "socket.io": "4.6.2",
73
+ "supertest": "6.3.3",
74
+ "ts-jest": "29.1.0",
75
+ "ts-loader": "9.4.3",
96
76
  "ts-node": "10.9.1",
97
- "tsconfig-paths": "4.1.0",
98
- "typescript": "4.8.4",
99
- "ws": "8.9.0"
77
+ "tsconfig-paths": "4.2.0",
78
+ "typescript": "5.1.3",
79
+ "ws": "8.13.0"
100
80
  },
101
81
  "peerDependencies": {
102
- "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0",
103
- "@nestjs/core": "^7.0.0 || ^8.0.0 || ^9.0.0",
82
+ "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
83
+ "@nestjs/core": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
104
84
  "reflect-metadata": "^0.1.13"
105
85
  },
106
86
  "jest": {
@@ -124,5 +104,23 @@
124
104
  "bugs": {
125
105
  "url": "https://github.com/nestjs/throttler/issues"
126
106
  },
127
- "homepage": "https://github.com/nestjs/throttler#readme"
128
- }
107
+ "homepage": "https://github.com/nestjs/throttler#readme",
108
+ "scripts": {
109
+ "prebuild": "rimraf dist",
110
+ "preversion": "yarn run format && yarn run lint && yarn build",
111
+ "build": "nest build",
112
+ "commit": "git-cz",
113
+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
114
+ "start:dev": "nodemon --watch '{src,test/app}/**/*.ts' --ignore '**/*.spec.ts' --exec 'ts-node' test/app/main.ts",
115
+ "lint": "eslint \"{src,test}/**/*.ts\" --fix",
116
+ "test": "jest",
117
+ "test:watch": "jest --watch",
118
+ "test:cov": "jest --coverage",
119
+ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
120
+ "test:e2e": "jest --config ./test/jest-e2e.json --detectOpenHandles",
121
+ "test:e2e:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --config test/jest-e2e.json --runInBand",
122
+ "test:e2e:dev": "yarn test:e2e --watchAll",
123
+ "_postinstall": "husky install",
124
+ "release": "changeset publish"
125
+ }
126
+ }
package/CHANGELOG.md DELETED
@@ -1,123 +0,0 @@
1
- # [2.0.0](https://github.com/nestjs/throttler/compare/v1.2.1...v2.0.0) (2021-07-09)
2
-
3
- ## 3.1.0
4
-
5
- ### Minor Changes
6
-
7
- - da3c950: Add `skipIf` option to throttler module options
8
-
9
- With the new option, you can pass a factory to `skipIf` and determine if the throttler guard should be used in the first palce or not. This acts just like applying `@SkipThrottle()` to every route, but can be customized to work off of the `process.env` or `ExecutionContext` object to provide better support for dev and QA environments.
10
-
11
- ## 3.0.0
12
-
13
- ### Major Changes
14
-
15
- - c9fcd51: Upgrade nest version to v9. No breaking changes in direct code, but in nest v9 upgrade
16
-
17
- ## 2.0.1
18
-
19
- ### Patch Changes
20
-
21
- - cf50808: fix memory leak for timeoutIds array. Before this, the timeoutIds array would not be trimmed and would grow until out of memory. Now ids are properly removed on timeout.
22
-
23
- ### Features
24
-
25
- - adding in a comment about version ([b13bf53](https://github.com/nestjs/throttler/commit/b13bf53542236ba6b05ac537b7a677e1644a0407))
26
-
27
- ### BREAKING CHANGES
28
-
29
- - v2 and above is now being developed specificially for
30
- nest v8 and could have some unforseen side effects with Nest v7. use with
31
- v7 at your own risk.
32
-
33
- ## [1.2.1](https://github.com/nestjs/throttler/compare/v1.2.0...v1.2.1) (2021-07-09)
34
-
35
- ### Performance Improvements
36
-
37
- - upgrade to nest v8 ([cb5dd91](https://github.com/nestjs/throttler/commit/cb5dd913e9fcc482cd74f2d49085b98dac630215))
38
-
39
- # [0.3.0](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.3...0.3.0) (2020-11-10)
40
-
41
- ### Bug Fixes
42
-
43
- - **module:** async register is now `forRootAsync` ([a1c6ace](https://github.com/jmcdo29/nestjs-throttler/commit/a1c6acef472e9d2368f2139e6b789ef184a7d952))
44
-
45
- ## [0.2.3](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.2...0.2.3) (2020-08-06)
46
-
47
- ### Features
48
-
49
- - **ws:** allows for optional use of @nestjs/websocket ([f437614](https://github.com/jmcdo29/nestjs-throttler/commit/f437614cab5aebfdfdb4d5884f45b58b16d5a140))
50
-
51
- ## [0.2.2](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.1...0.2.2) (2020-06-12)
52
-
53
- ### Bug Fixes
54
-
55
- - moves userAgent check to http handler ([87183af](https://github.com/jmcdo29/nestjs-throttler/commit/87183af8fc189d7d5c8237832089138a0b40589b))
56
-
57
- ### Features
58
-
59
- - **decorator:** add setThrottlerMetadata() function back ([ea31a9c](https://github.com/jmcdo29/nestjs-throttler/commit/ea31a9c86b82550e2d43f3433ec618785cf2b34a))
60
- - **graphql:** implements graphql limiter ([40eaff1](https://github.com/jmcdo29/nestjs-throttler/commit/40eaff16dae5c0279001e56ff64a2b540d82a3c7))
61
- - Add support for ws (websockets) ([a745295](https://github.com/jmcdo29/nestjs-throttler/commit/a74529517f989c43d77c9a63712e82244ebeefcd))
62
- - Add support for ws (websockets) ([8103a5a](https://github.com/jmcdo29/nestjs-throttler/commit/8103a5a11c1916f05f8c44e302ba93a98d7cb77d))
63
- - Make storage methods async ([92cd4eb](https://github.com/jmcdo29/nestjs-throttler/commit/92cd4ebf507b3bed4efbaeb7bb47bd1738a62dc3))
64
- - **exception:** Use const instead of duplicated string ([f95da2c](https://github.com/jmcdo29/nestjs-throttler/commit/f95da2c4fc787c7c5e525672d668745bc1f2301d))
65
- - **guard:** Add default case for context.getType() switch ([ff46d57](https://github.com/jmcdo29/nestjs-throttler/commit/ff46d57508c4b446918ccd75f704d0eed1ae352f))
66
- - Implement basic support for websocket ([3a0cf2e](https://github.com/jmcdo29/nestjs-throttler/commit/3a0cf2ed70c7abbe02e9d96f26ab2c81b3c7bb2f))
67
-
68
- ## [0.2.1](https://github.com/jmcdo29/nestjs-throttler/compare/0.2.0...0.2.1) (2020-06-09)
69
-
70
- ### Features
71
-
72
- - add support for ignoreUserAgents option ([1ab5e17](https://github.com/jmcdo29/nestjs-throttler/commit/1ab5e17a25a95ec14910e199726eac07f66f4475))
73
-
74
- # [0.2.0](https://github.com/jmcdo29/nestjs-throttler/compare/0.1.1...0.2.0) (2020-06-09)
75
-
76
- ### Bug Fixes
77
-
78
- - make core module global and export core module inside ThrottlerModule ([1f4df42](https://github.com/jmcdo29/nestjs-throttler/commit/1f4df42a5fc9a6f75c398bbb6a3f9ebaec6bc80f))
79
-
80
- ### Features
81
-
82
- - makes options required in forRoot and forRootAsync ([14e272a](https://github.com/jmcdo29/nestjs-throttler/commit/14e272a842a90db93dd9e8c60c936fbcf0bcd3b7))
83
- - remove global guard and require user to implement it manually ([840eae4](https://github.com/jmcdo29/nestjs-throttler/commit/840eae4643867390bc598937b20e132257e9b018))
84
-
85
- ## [0.1.1](https://github.com/jmcdo29/nestjs-throttler/compare/0.1.0...0.1.1) (2020-06-07)
86
-
87
- ### Bug Fixes
88
-
89
- - **interface:** fixes the storage interface to be async ([f7565d9](https://github.com/jmcdo29/nestjs-throttler/commit/f7565d9029baf4d7687f0913046f555d17cde44b))
90
-
91
- # 0.1.0 (2020-06-07)
92
-
93
- ### Bug Fixes
94
-
95
- - adds back AppModule to allow for running server for tests ([5af229b](https://github.com/jmcdo29/nestjs-throttler/commit/5af229ba69527daf3662b1899ed985fa9404251b))
96
- - updates some types ([b26fc06](https://github.com/jmcdo29/nestjs-throttler/commit/b26fc06841a430e5728cde6276515130b89a7289))
97
- - updates storage interface to use number ([339f29c](https://github.com/jmcdo29/nestjs-throttler/commit/339f29c12b4720a7376ec042988f73460172b32e))
98
- - updates tests and resolves comments from pr ([ee87e05](https://github.com/jmcdo29/nestjs-throttler/commit/ee87e05e2f5eb61b00b423d6394be9a131f84f8a))
99
- - **.gitignore:** Ignore all dist and node_modules rather than root-level only ([d9609af](https://github.com/jmcdo29/nestjs-throttler/commit/d9609afb9cf3561b84082ac9a3e2e26ddcbb2117))
100
- - **guard:** Change RateLimit header prefix to X-RateLimit ([328c0a3](https://github.com/jmcdo29/nestjs-throttler/commit/328c0a3c1009fdc65820125c2145de65aebd3fee))
101
- - **guard:** Change RateLimit header prefix to X-RateLimit ([3903885](https://github.com/jmcdo29/nestjs-throttler/commit/3903885df9eaac0d966c5b8207fae26b62f337f3))
102
- - **guard:** guard now binds globally without the use of @UseGuards() ([4022447](https://github.com/jmcdo29/nestjs-throttler/commit/40224475d27f1ec0cf792225bbc18df33ab14cc2))
103
- - **guard:** guard now binds globally without the use of @UseGuards() ([3ca146d](https://github.com/jmcdo29/nestjs-throttler/commit/3ca146d41afa71e3c68b73d8706e7431f929a85a))
104
- - **guard:** Prevent RateLimit-Remaining from going below 0 ([25e33c8](https://github.com/jmcdo29/nestjs-throttler/commit/25e33c882007892a3285c92449aa5bc0840a8909))
105
- - **guard:** Prevent RateLimit-Remaining from going below 0 ([74b1668](https://github.com/jmcdo29/nestjs-throttler/commit/74b166888ab283281a964d6c64b94224e2f96ba4))
106
- - **guard:** Use the correct approach to check for excluded routes ([38eac3c](https://github.com/jmcdo29/nestjs-throttler/commit/38eac3ca3bdad0b4b266587bc4b0287f3f69f640))
107
- - **guard:** Use the correct approach to check for excluded routes ([912813f](https://github.com/jmcdo29/nestjs-throttler/commit/912813f49cc98e8fbd2643650d22ea8cc88c77ae))
108
- - req.method value in httpPromise ([b9ee26e](https://github.com/jmcdo29/nestjs-throttler/commit/b9ee26e5e888e4d4f220e91adc996ade764f7002))
109
-
110
- ### Features
111
-
112
- - Swap excludeRoutes for @SkipThrottle() decorator ([16d6fac](https://github.com/jmcdo29/nestjs-throttler/commit/16d6facd5e8f648620fa47e372078db37472f619))
113
- - **fastify:** updates guard to work for fastify ([bc678a3](https://github.com/jmcdo29/nestjs-throttler/commit/bc678a363c367d132a90a2a4282e3f033f526e00))
114
- - Implement ignoreRoutes functionality ([7b8ab42](https://github.com/jmcdo29/nestjs-throttler/commit/7b8ab4273fffafc0dd0571393d8c0faf89afc42f))
115
- - **package.json:** Add --watch to start:dev script ([3c4c28a](https://github.com/jmcdo29/nestjs-throttler/commit/3c4c28abbb324e064f65b284f1a99683cd02030b))
116
- - Implement ignoreRoutes functionality ([75f870c](https://github.com/jmcdo29/nestjs-throttler/commit/75f870c5b49e4d22c70519d28f8efffc1da288eb))
117
- - **module:** implements start of limiter module ([35dbff5](https://github.com/jmcdo29/nestjs-throttler/commit/35dbff5d30e7a1385a4f4cf688992017eb7e0566))
118
- - **package.json:** Add --watch to start:dev script ([a6b441c](https://github.com/jmcdo29/nestjs-throttler/commit/a6b441cad221b7eee52be0ba81c66fca81853c4f))
119
- - Add global ThrottlerGuard ([9a84aff](https://github.com/jmcdo29/nestjs-throttler/commit/9a84afff5d57a16731d021cb47d60c2b4d02eb02))
120
- - adds httpromise for async/await http calls in tests ([70210c7](https://github.com/jmcdo29/nestjs-throttler/commit/70210c76173aabfd5f85f5a24e624e7c4c010ae2))
121
- - Rename certain variables to use the THROTTLER prefix ([6a21b21](https://github.com/jmcdo29/nestjs-throttler/commit/6a21b216a2738aa470e2138d44053ba8413ce117))
122
- - Setup example app ([df6b5f6](https://github.com/jmcdo29/nestjs-throttler/commit/df6b5f633ebbb4770d3eb9e72e8075cbe6b2f78a))
123
- - Setup example app ([30c7576](https://github.com/jmcdo29/nestjs-throttler/commit/30c75764fd20f3afe7a3f7533a3f4f08d275a741))