distributed-limiter 1.0.0 → 1.0.1
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 +0 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -3
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type RateLimiterOptions = {
|
|
|
11
11
|
tokenRequest: number;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
declare class
|
|
14
|
+
declare class TokenBucketLimiter {
|
|
15
15
|
private redis;
|
|
16
16
|
private capacity;
|
|
17
17
|
private refillRate;
|
|
@@ -19,4 +19,4 @@ declare class Limiter {
|
|
|
19
19
|
isAllowed({ key, tokenRequest }: RateLimiterOptions): Promise<Boolean>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export { type BucketOptions,
|
|
22
|
+
export { type BucketOptions, type RateLimiterOptions, TokenBucketLimiter };
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,7 @@ async function TokenBucket(redis, { key, capacity, refillRate, tokenRequest }) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// src/core/LimiterEngine.ts
|
|
90
|
-
var
|
|
90
|
+
var TokenBucketLimiter = class {
|
|
91
91
|
constructor(redis, capacity, refillRate) {
|
|
92
92
|
this.redis = redis;
|
|
93
93
|
this.capacity = capacity;
|
|
@@ -109,5 +109,5 @@ var Limiter = class {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
TokenBucketLimiter
|
|
113
113
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "distributed-limiter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Distributed token bucket rate limiter using Redis and Lua",
|
|
5
5
|
"homepage": "https://github.com/Toxic209/distributed-rate-limiter#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -30,12 +30,10 @@
|
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"ioredis": "^5.0.0"
|
|
32
32
|
},
|
|
33
|
-
|
|
34
33
|
"files": [
|
|
35
34
|
"dist",
|
|
36
35
|
"db"
|
|
37
36
|
],
|
|
38
|
-
|
|
39
37
|
"keywords": [
|
|
40
38
|
"rate-limiter",
|
|
41
39
|
"redis",
|