@fonderie/rate-limit 0.1.0 → 0.1.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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS fonderie_rate_limits (
|
|
2
|
+
key TEXT NOT NULL PRIMARY KEY,
|
|
3
|
+
tokens DOUBLE PRECISION NOT NULL,
|
|
4
|
+
last_refill_ms DOUBLE PRECISION NOT NULL,
|
|
5
|
+
granted BOOLEAN NOT NULL DEFAULT TRUE
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
-- Opportunistic cleanup scans by idle time.
|
|
9
|
+
CREATE INDEX IF NOT EXISTS fonderie_rate_limits_refill_idx
|
|
10
|
+
ON fonderie_rate_limits (last_refill_ms);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonderie/rate-limit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Distributed rate limiting for @fonderie-js — atomic token bucket over memory, PostgreSQL, or Redis, with standard RateLimit-* headers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fonderie-js",
|
|
@@ -63,16 +63,17 @@
|
|
|
63
63
|
},
|
|
64
64
|
"files": [
|
|
65
65
|
"dist",
|
|
66
|
+
"brain",
|
|
66
67
|
"LICENSE",
|
|
67
68
|
"README.md"
|
|
68
69
|
],
|
|
69
70
|
"repository": {
|
|
70
71
|
"type": "git",
|
|
71
|
-
"url": "git+https://github.com/
|
|
72
|
+
"url": "git+https://github.com/fonderiejs/sdk.git",
|
|
72
73
|
"directory": "packages/rate-limit"
|
|
73
74
|
},
|
|
74
|
-
"homepage": "https://github.com/
|
|
75
|
+
"homepage": "https://github.com/fonderiejs/sdk/tree/main/packages/rate-limit#readme",
|
|
75
76
|
"bugs": {
|
|
76
|
-
"url": "https://github.com/
|
|
77
|
+
"url": "https://github.com/fonderiejs/sdk/issues"
|
|
77
78
|
}
|
|
78
79
|
}
|