Releases: animir/node-rate-limiter-flexible
Releases · animir/node-rate-limiter-flexible
RateLimiterUnion works with one limiter
Fixes and improvements made since v2.3.4 release
- RateLimiterQueue
getTokensRemaining
with RateLimiterPostgres fixed. #125 - clear timeout on key delete from memory storage. #146 Thank you @jiddmeye
clearExpiredByTimeout
is added to TS types for MySQL and Postgres limiters. #156- fix negative remaining points in memory limiter. #172 Thank you @MiniKraken-Team
- added
browser
package.json settings to allow bundling. 6ce34b3 Thank you @achingbrain - use
nodejs.util.inspect.custom
for Symbol flexibility. 2c8bedb Thank you @shlavik inmemoryBlockOnConsumed
andinmemoryBlockDuration
options are renamed toinMemoryBlockOnConsumed
andinMemoryBlockDuration
. Old options are still supported, but deprecated and will be removed in v3 major release. #106
MongoDB version detection fixes and misc
- MongoDB version detection is fixed for
mongoose
client. Thank you @adrianvlupu - MongoDB version detection is fixed for 3.6.7+. Thank you @pavittarx
- Internal fix of
get
method. It incorrectly processedundefined
result from a store. Thank you @animir .editorconfig
added. Thank you @vinibeloni- TypeScript type for
RateLimiterQueueError
added. Thank you @adilhafeez - TypeScript type for
deleteInMemoryBlockedAll
method is added. Thank you @animir
MongoDB client v4 fix, delete and new method to delete all inMemory Blocked keys
- replace
replaceOne
withfindOneAndUpdate
to fix a bug related to absentops
attribute in MongoDB client v4+. Thank you @vdiez delete
method on any store limiter deletes inMemoryBlocked key if it is there. Thank you @evan361425- new
deleteInMemoryBlockedAll
method added to clean up all blocked keys at once. Thank you @evan361425 again :-) - @evan361425 also added tests to cover new lines 🥇
Support for mongodb client v4
- Missing get/set Typescript types added and documentation improved. Thanks @rijkvanzanten
- mongodb client v4 support. Thank you @backflip
PostgreSQL limiter supports TypeORM + fixes
- TypeORM Support for RateLimitPostgres, thank you @seromenho
- Readme links fixed, thanks @mriedem
- RateLimiterQueue TS types fixed
- Fix postgres consumed points increment on block, issue #95
BurstyRateLimiter and RateLimiterQueue improved + RateLimiterMemory works in browser
- RateLimiterQueue support of tokens removed by key. (single bucket for every key)
- Add RateLimiterQueue missing methods types. Thank you @bmenant
- RateLimiterPostgres fixed for [email protected] update. Thank you @matomesc
- tableCreated option for MySQL and PostgreSQL to skip checks for limiter tables.
- BurstyRateLimiter compatible with RateLimiterQueue now. Thanks a lot to @matomesc for a big help on this.
- RateLimiterMemory limiter works in browser now. Thanks a bunch to @cha0s. Also, thank you for test scripts improvements.
In memory Block Strategy
Every time consume
method executed, it returns msBeforeNext
milliseconds. This can be used to block key in memory for exact msBeforeNext
milliseconds until points are reset on store. Set inmemoryBlockOnConsumed
option and omit inmemoryBlockDuration
for this feature.
BurstyRateLimiter
Allow traffic bursts with BurstyRateLimiter
Redis Lua script + deprecated things removed
Changes
- Redis uses Lua script for expiring atomic increments. It allowed to remove a hack, which made extra queries to Redis, when TTL is not set on key set.
- RateLimiterCluster options type fixed.
BREAKING CHANGES:
isWhite
andisBlack
getters/setters and options support removed fromRLWrapperBlackAndWhite
.isWhiteListed
andisBlackListed
options should be used instead.IRateLimiterResOptions
interface type removed from lib/index.d.ts.IRateLimiterRes
should be used.