express-rate-limit 6.11.1 → 7.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/changelog.md CHANGED
@@ -6,6 +6,54 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to
7
7
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [7.0.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v7.0.0)
10
+
11
+ ### Breaking
12
+
13
+ - Changed behavior when `max` is set to 0:
14
+ - Previously, `max: 0` was treated as a 'disable' flag and would allow all
15
+ requests through.
16
+ - Starting with v7, all requests will be blocked when max is set to 0.
17
+ - To replicate the old behavior, use the
18
+ [skip](https://github.com/express-rate-limit/express-rate-limit#skip)
19
+ function instead.
20
+ - Renamed `req.rateLimit.current` to `req.rateLimit.used`.
21
+ - `current` is now a hidden getter that will return the `used` value, but it
22
+ will not appear when iterating over the keys or calling `JSON.stringify()`.
23
+ - Changed the minimum required Node version from v14 to v16.
24
+ - `express-rate-limit` now targets `es2022` in TypeScript/ESBuild.
25
+ - Bumped TypeScript from v4 to v5 and `dts-bundle-generator` from v7 to v8.
26
+
27
+ ### Deprecated
28
+
29
+ - Removed the `draft_polli_ratelimit_headers` option (it was deprecated in v6).
30
+ - Use `standardHeaders: 'draft-6'` instead.
31
+ - Removed the `onLimitReached` option (it was deprecated in v6).
32
+ - [This](<(https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#wrn_erl_deprecated_on_limit_reached)>)
33
+ is an example of how to replicate it's behavior with a custom `handler`
34
+ option.
35
+
36
+ ### Changed
37
+
38
+ - The `MemoryStore` now uses precise, per-user reset times rather than a global
39
+ window that resets all users at once.
40
+ - The `limit` configuration option is now prefered to `max`.
41
+ - It still shows the same behavior, and `max` is still supported. The change
42
+ was made to better align with terminology used in the IETF standard drafts.
43
+
44
+ ### Added
45
+
46
+ - The `validate` config option can now be an object with keys to enable or
47
+ disable specific validation checks. For more information, see
48
+ [this](https://github.com/express-rate-limit/express-rate-limit#validate).
49
+
50
+ ## [6.11.2](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.11.2)
51
+
52
+ ### Fixed
53
+
54
+ - Restored `IncrementResponse ` TypeScript type (See
55
+ [#397](https://github.com/express-rate-limit/express-rate-limit/pull/397))
56
+
9
57
  ## [6.11.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.11.1)
10
58
 
11
59
  ### Fixed
@@ -28,27 +76,27 @@ and this project adheres to
28
76
 
29
77
  - Support for combined `RateLimit` header from the
30
78
  [RateLimit header fields for HTTP standardization draft](https://github.com/ietf-wg-httpapi/ratelimit-headers)
31
- adopted by the IETF. Enable by setting `standardHeaders: 'draft-7'`
79
+ adopted by the IETF. Enable by setting `standardHeaders: 'draft-7'`.
32
80
  - New `standardHeaders: 'draft-6'` option, treated equivalent to
33
- `standardHeaders: true` from previous releases. (`true` and `false` are still
34
- supported.)
81
+ `standardHeaders: true` from previous releases. Note that `true` and `false`
82
+ are still supported.
35
83
  - New `RateLimit-Policy` header added when `standardHeaders` is set to
36
- `'draft-6'`, `'draft-7'`, or `true`
37
- - Warning when using deprecated `draft_polli_ratelimit_headers` option
38
- - Warning when using deprecated `onLimitReached` option
39
- - Warning when `totalHits` value returned from Store is invalid
84
+ `'draft-6'`, `'draft-7'`, or `true`.
85
+ - Warning when using deprecated `draft_polli_ratelimit_headers` option.
86
+ - Warning when using deprecated `onLimitReached` option.
87
+ - Warning when `totalHits` value returned from Store is invalid.
40
88
 
41
89
  ## [6.9.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.9.0)
42
90
 
43
91
  ### Added
44
92
 
45
- - New validaion check for double-counted requests
46
- - Added help link to each ValidationError, directing users to the appropriate
47
- wiki page for more info
93
+ - New validaion check for double-counted requests.
94
+ - Added help link to each validation error, directing users to the appropriate
95
+ wiki page for more info.
48
96
 
49
97
  ### Changed
50
98
 
51
- - Miscaleanous documenation improvements
99
+ - Miscellaneous documenation improvements.
52
100
 
53
101
  ## [6.8.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0) & [6.7.2](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0)
54
102
 
@@ -56,7 +104,7 @@ and this project adheres to
56
104
 
57
105
  - Revert 6.7.1 change that bumped typescript from 5.x to 4.x and
58
106
  dts-bundle-generator from 8.x to 7.x (See
59
- [#360](https://github.com/express-rate-limit/express-rate-limit/issues/360))
107
+ [#360](https://github.com/express-rate-limit/express-rate-limit/issues/360)).
60
108
 
61
109
  ## [6.8.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0)
62
110
 
@@ -66,7 +114,7 @@ and this project adheres to
66
114
  https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes for
67
115
  a list of potential errors. Can be disabled by setting `validate: false` in
68
116
  the configuration. Automatically disables after the first request. (See
69
- [#358](https://github.com/express-rate-limit/express-rate-limit/issues/358))
117
+ [#358](https://github.com/express-rate-limit/express-rate-limit/issues/358)).
70
118
 
71
119
  ## [6.7.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.7.1)
72
120
 
@@ -74,7 +122,7 @@ and this project adheres to
74
122
 
75
123
  - Fixed compatibility with TypeScript's TypeScript new `node16` module
76
124
  resolution strategy (See
77
- [#355](https://github.com/express-rate-limit/express-rate-limit/issues/355))
125
+ [#355](https://github.com/express-rate-limit/express-rate-limit/issues/355)).
78
126
 
79
127
  ### Changed
80
128