@clov-std/elysia-ratelimit 4.0.0 → 4.0.2

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/dist/index.js CHANGED
@@ -28,7 +28,7 @@ var extractClientIp = (request, server) => {
28
28
  }
29
29
  return request.headers.get("x-real-ip") ?? server?.requestIP(request)?.address ?? "127.0.0.1";
30
30
  };
31
- var rateLimitPlugin = (store = new MemoryStore) => new Elysia().macro({
31
+ var rateLimitPlugin = (store = new MemoryStore) => new Elysia({ name: "rateLimitPlugin" }).macro({
32
32
  rateLimit: ({
33
33
  limit,
34
34
  window,
@@ -41,7 +41,7 @@ type RateLimitMacro = (options: RateLimitMacroOptions) => {
41
41
  transform: (context: RateLimitTransformContext) => Promise<void>;
42
42
  };
43
43
  export declare const extractClientIp: (request: Request, server: Server<unknown> | null) => string;
44
- export declare const rateLimitPlugin: (store?: KvStore) => Elysia<'', 'local', {
44
+ export declare const rateLimitPlugin: (store?: KvStore) => Elysia<'rateLimitPlugin', 'local', {
45
45
  decorator: {};
46
46
  derive: {};
47
47
  store: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clov-std/elysia-ratelimit",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Rate limiting plugin for Elysia framework.",
5
5
  "keywords": [
6
6
  "bun",
@@ -44,14 +44,14 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/bun": "^1.3.14",
47
- "oxfmt": "0.61.0",
48
- "oxlint": "1.76.0",
47
+ "oxfmt": "0.62.0",
48
+ "oxlint": "1.77.0",
49
49
  "oxlint-tsgolint": "7.0.2001",
50
50
  "typescript": "^7.0.2"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@clov-std/kv-store": "^2.0.0",
54
- "elysia": "^2.0.0-beta.1",
55
- "typebox": "^1.3.10"
54
+ "elysia": "^2.0.0-beta.2",
55
+ "typebox": "^1.3.11"
56
56
  }
57
57
  }