@mindstone/mcp-server-runway 0.5.0 → 0.7.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/README.md +7 -3
- package/dist/auth.js +3 -0
- package/dist/bridge-reader.d.ts +85 -0
- package/dist/bridge-reader.js +125 -0
- package/dist/bridge.d.ts +11 -13
- package/dist/bridge.js +10 -39
- package/dist/client.d.ts +3 -0
- package/dist/client.js +44 -8
- package/dist/file-read-context.d.ts +4 -4
- package/dist/hardened-json-file.d.ts +15 -0
- package/dist/hardened-json-file.js +92 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/dist/key-filter.d.ts +40 -0
- package/dist/key-filter.js +95 -0
- package/dist/server.js +12 -1
- package/dist/tools/audio.js +20 -12
- package/dist/tools/configure.d.ts +2 -0
- package/dist/tools/configure.js +34 -31
- package/dist/tools/image.js +39 -16
- package/dist/tools/resold-models.d.ts +73 -0
- package/dist/tools/resold-models.js +231 -0
- package/dist/tools/resold-specs.generated.d.ts +24 -0
- package/dist/tools/resold-specs.generated.js +46 -0
- package/dist/tools/tasks.js +11 -5
- package/dist/tools/video.js +72 -12
- package/dist/tools/voices.js +3 -2
- package/dist/types.d.ts +18 -4
- package/dist/types.js +30 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +14 -5
- package/node_modules/@hono/node-server/README.md +118 -26
- package/node_modules/@hono/node-server/dist/conninfo.cjs +22 -0
- package/node_modules/@hono/node-server/dist/{conninfo.d.ts → conninfo.d.cts} +4 -3
- package/node_modules/@hono/node-server/dist/conninfo.d.mts +4 -3
- package/node_modules/@hono/node-server/dist/conninfo.mjs +19 -16
- package/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs +5 -0
- package/node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs +11 -0
- package/node_modules/@hono/node-server/dist/early-hints.cjs +35 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.cts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.d.mts +16 -0
- package/node_modules/@hono/node-server/dist/early-hints.mjs +33 -0
- package/node_modules/@hono/node-server/dist/index.cjs +1365 -0
- package/node_modules/@hono/node-server/dist/index.d.cts +101 -0
- package/node_modules/@hono/node-server/dist/index.d.mts +101 -8
- package/node_modules/@hono/node-server/dist/index.mjs +1336 -616
- package/node_modules/@hono/node-server/dist/serve-static.cjs +153 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.cts +19 -0
- package/node_modules/@hono/node-server/dist/serve-static.d.mts +15 -13
- package/node_modules/@hono/node-server/dist/serve-static.mjs +145 -145
- package/node_modules/@hono/node-server/dist/utils/response.cjs +8 -0
- package/node_modules/@hono/node-server/dist/utils/response.d.cts +4 -0
- package/node_modules/@hono/node-server/dist/utils/response.d.mts +3 -2
- package/node_modules/@hono/node-server/dist/utils/response.mjs +6 -9
- package/node_modules/@hono/node-server/dist/utils/stream.cjs +65 -0
- package/node_modules/@hono/node-server/dist/utils/stream.d.cts +6 -0
- package/node_modules/@hono/node-server/dist/utils/stream.d.mts +6 -0
- package/node_modules/@hono/node-server/dist/utils/stream.mjs +64 -0
- package/node_modules/@hono/node-server/package.json +80 -55
- package/node_modules/@modelcontextprotocol/sdk/README.md +8 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts +43 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js +26 -5
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth-extensions.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts +26 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js +127 -24
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/auth.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js +1 -12
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js +17 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/sse.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts +7 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js +9 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js +28 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js +11 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/client/simpleClientCredentials.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts +2 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js +63 -20
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js +71 -29
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js +45 -6
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js +71 -31
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js +61 -18
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js +57 -19
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js +64 -17
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js +61 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts +4 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts +17 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js +31 -14
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts +9 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js +17 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js +6 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js +3 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js +1 -12
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts +12 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js +56 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.d.ts +25 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js +64 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/requestBody.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js +17 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts +9 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js +10 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +31 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +252 -42
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js +25 -6
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js +12 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/auth.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts +32 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js +64 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js +39 -9
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/protocol.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js +10 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts +18 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js +77 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/transport.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts +43 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js +26 -5
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth-extensions.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts +26 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js +127 -24
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +2 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js +18 -5
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts +7 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js +9 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +29 -14
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js +11 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/client/simpleClientCredentials.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts +2 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/demoInMemoryOAuthProvider.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js +63 -20
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationFormExample.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js +71 -29
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/elicitationUrlExample.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js +45 -6
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/jsonResponseStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js +71 -31
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js +61 -18
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/simpleTaskInteractive.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js +57 -19
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/sseAndStreamableHttpCompatibleServer.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js +64 -17
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/ssePollingExample.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js +61 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/examples/server/standaloneSseWithGetStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts +4 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts +17 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js +31 -14
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/stores/in-memory.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts +9 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js +17 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/middleware/bearerAuth.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js +6 -3
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/providers/proxyProvider.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js +3 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/express.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +2 -13
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts +12 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +56 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.d.ts +25 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js +58 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/requestBody.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js +13 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts +9 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +10 -4
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +31 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +252 -42
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +25 -6
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts +3 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js +12 -2
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts +32 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js +57 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js.map +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +39 -9
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts +5 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +9 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts +18 -8
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js +72 -0
- package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.js.map +1 -1
- package/node_modules/@modelcontextprotocol/sdk/package.json +4 -3
- package/node_modules/body-parser/README.md +33 -14
- package/node_modules/body-parser/index.js +4 -20
- package/node_modules/body-parser/lib/read.js +85 -68
- package/node_modules/body-parser/lib/types/json.js +67 -39
- package/node_modules/body-parser/lib/types/raw.js +3 -3
- package/node_modules/body-parser/lib/types/text.js +3 -3
- package/node_modules/body-parser/lib/types/urlencoded.js +21 -25
- package/node_modules/body-parser/lib/utils.js +14 -27
- package/node_modules/body-parser/node_modules/content-type/LICENSE +22 -0
- package/node_modules/body-parser/node_modules/content-type/README.md +71 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/body-parser/node_modules/content-type/package.json +52 -0
- package/node_modules/body-parser/package.json +24 -16
- package/node_modules/es-object-atoms/CHANGELOG.md +21 -14
- package/node_modules/es-object-atoms/isObject.d.ts +1 -1
- package/node_modules/es-object-atoms/package.json +6 -7
- package/node_modules/es-object-atoms/tsconfig.json +1 -0
- package/node_modules/express-rate-limit/dist/index.cjs +142 -23
- package/node_modules/express-rate-limit/dist/index.d.cts +58 -1
- package/node_modules/express-rate-limit/dist/index.d.mts +58 -1
- package/node_modules/express-rate-limit/dist/index.d.ts +58 -1
- package/node_modules/express-rate-limit/dist/index.mjs +128 -23
- package/node_modules/express-rate-limit/{license.md → license} +7 -6
- package/node_modules/express-rate-limit/package.json +21 -17
- package/node_modules/express-rate-limit/readme.md +4 -0
- package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
- package/node_modules/fast-uri/README.md +8 -0
- package/node_modules/fast-uri/index.js +355 -50
- package/node_modules/fast-uri/lib/schemes.js +9 -4
- package/node_modules/fast-uri/lib/utils.js +448 -92
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
- package/node_modules/fast-uri/test/equal.test.js +31 -3
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
- package/node_modules/fast-uri/test/host-delimiter-security.test.js +94 -0
- package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
- package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/fast-uri/test/parse.test.js +7 -3
- package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/fast-uri/test/relative-normalization-security.test.js +156 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +137 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +163 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +139 -0
- package/node_modules/fast-uri/test/security.test.js +301 -3
- package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/hono/README.md +2 -3
- package/node_modules/hono/dist/_virtual/_rolldown/runtime.js +13 -0
- package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +42 -23
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +320 -351
- package/node_modules/hono/dist/adapter/aws-lambda/index.js +2 -8
- package/node_modules/hono/dist/adapter/aws-lambda/types.js +1 -0
- package/node_modules/hono/dist/adapter/bun/conninfo.js +20 -25
- package/node_modules/hono/dist/adapter/bun/index.js +3 -13
- package/node_modules/hono/dist/adapter/bun/serve-static.js +27 -27
- package/node_modules/hono/dist/adapter/bun/server.js +11 -5
- package/node_modules/hono/dist/adapter/bun/ssg.js +25 -15
- package/node_modules/hono/dist/adapter/bun/websocket.js +61 -66
- package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +24 -9
- package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +59 -62
- package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +2 -8
- package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +7 -9
- package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +3 -8
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +5 -6
- package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +26 -20
- package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +21 -34
- package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +31 -39
- package/node_modules/hono/dist/adapter/deno/conninfo.js +16 -13
- package/node_modules/hono/dist/adapter/deno/deno.d.js +1 -0
- package/node_modules/hono/dist/adapter/deno/index.js +3 -10
- package/node_modules/hono/dist/adapter/deno/serve-static.js +33 -38
- package/node_modules/hono/dist/adapter/deno/ssg.js +27 -16
- package/node_modules/hono/dist/adapter/deno/websocket.js +30 -26
- package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +7 -9
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +102 -71
- package/node_modules/hono/dist/adapter/lambda-edge/index.js +2 -6
- package/node_modules/hono/dist/adapter/netlify/conninfo.js +24 -9
- package/node_modules/hono/dist/adapter/netlify/handler.js +10 -8
- package/node_modules/hono/dist/adapter/netlify/index.js +3 -2
- package/node_modules/hono/dist/adapter/netlify/mod.js +2 -6
- package/node_modules/hono/dist/adapter/service-worker/handler.js +15 -19
- package/node_modules/hono/dist/adapter/service-worker/index.js +23 -7
- package/node_modules/hono/dist/adapter/service-worker/types.js +1 -0
- package/node_modules/hono/dist/adapter/vercel/conninfo.js +7 -10
- package/node_modules/hono/dist/adapter/vercel/handler.js +8 -6
- package/node_modules/hono/dist/adapter/vercel/index.js +2 -6
- package/node_modules/hono/dist/cjs/_virtual/_rolldown/runtime.js +33 -0
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +42 -44
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +328 -380
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +7 -34
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
- package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +21 -47
- package/node_modules/hono/dist/cjs/adapter/bun/index.js +14 -45
- package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +30 -51
- package/node_modules/hono/dist/cjs/adapter/bun/server.js +11 -26
- package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +24 -35
- package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +63 -89
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +25 -31
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +61 -85
- package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +7 -34
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +8 -31
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +7 -33
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +7 -29
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +28 -43
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +21 -55
- package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +33 -62
- package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +16 -34
- package/node_modules/hono/dist/cjs/adapter/deno/index.js +10 -38
- package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +34 -60
- package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
- package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -49
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +8 -31
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +105 -103
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +5 -30
- package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +25 -31
- package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +10 -29
- package/node_modules/hono/dist/cjs/adapter/netlify/index.js +5 -21
- package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +5 -30
- package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +16 -41
- package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +25 -30
- package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
- package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +8 -32
- package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +8 -27
- package/node_modules/hono/dist/cjs/adapter/vercel/index.js +5 -30
- package/node_modules/hono/dist/cjs/client/client.js +140 -190
- package/node_modules/hono/dist/cjs/client/fetch-result-please.js +62 -80
- package/node_modules/hono/dist/cjs/client/index.js +7 -32
- package/node_modules/hono/dist/cjs/client/types.js +0 -15
- package/node_modules/hono/dist/cjs/client/utils.js +54 -89
- package/node_modules/hono/dist/cjs/compose.js +49 -66
- package/node_modules/hono/dist/cjs/context.js +379 -431
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +50 -38
- package/node_modules/hono/dist/cjs/helper/accepts/index.js +3 -27
- package/node_modules/hono/dist/cjs/helper/adapter/index.js +33 -73
- package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
- package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
- package/node_modules/hono/dist/cjs/helper/cookie/index.js +75 -116
- package/node_modules/hono/dist/cjs/helper/css/common.js +167 -241
- package/node_modules/hono/dist/cjs/helper/css/index.js +136 -143
- package/node_modules/hono/dist/cjs/helper/dev/index.js +45 -71
- package/node_modules/hono/dist/cjs/helper/factory/index.js +30 -51
- package/node_modules/hono/dist/cjs/helper/html/index.js +32 -62
- package/node_modules/hono/dist/cjs/helper/proxy/index.js +113 -102
- package/node_modules/hono/dist/cjs/helper/route/index.js +125 -66
- package/node_modules/hono/dist/cjs/helper/ssg/index.js +19 -43
- package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +56 -64
- package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +55 -57
- package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +200 -298
- package/node_modules/hono/dist/cjs/helper/ssg/utils.js +53 -76
- package/node_modules/hono/dist/cjs/helper/streaming/index.js +8 -35
- package/node_modules/hono/dist/cjs/helper/streaming/sse.js +53 -84
- package/node_modules/hono/dist/cjs/helper/streaming/stream.js +23 -53
- package/node_modules/hono/dist/cjs/helper/streaming/text.js +10 -32
- package/node_modules/hono/dist/cjs/helper/streaming/utils.js +13 -32
- package/node_modules/hono/dist/cjs/helper/testing/index.js +16 -31
- package/node_modules/hono/dist/cjs/helper/websocket/index.js +51 -76
- package/node_modules/hono/dist/cjs/hono-base.js +346 -396
- package/node_modules/hono/dist/cjs/hono.js +27 -42
- package/node_modules/hono/dist/cjs/http-exception.js +55 -56
- package/node_modules/hono/dist/cjs/index.js +22 -27
- package/node_modules/hono/dist/cjs/jsx/base.js +264 -359
- package/node_modules/hono/dist/cjs/jsx/children.js +16 -41
- package/node_modules/hono/dist/cjs/jsx/components.js +120 -174
- package/node_modules/hono/dist/cjs/jsx/constants.js +17 -42
- package/node_modules/hono/dist/cjs/jsx/context.js +166 -58
- package/node_modules/hono/dist/cjs/jsx/dom/client.js +49 -69
- package/node_modules/hono/dist/cjs/jsx/dom/components.js +23 -52
- package/node_modules/hono/dist/cjs/jsx/dom/context.js +39 -67
- package/node_modules/hono/dist/cjs/jsx/dom/css.js +143 -158
- package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +55 -64
- package/node_modules/hono/dist/cjs/jsx/dom/index.js +114 -173
- package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +282 -375
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +14 -49
- package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +5 -32
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +471 -587
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +37 -60
- package/node_modules/hono/dist/cjs/jsx/dom/utils.js +7 -30
- package/node_modules/hono/dist/cjs/jsx/hooks/index.js +227 -317
- package/node_modules/hono/dist/cjs/jsx/index.js +86 -135
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +20 -43
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +117 -168
- package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
- package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +14 -39
- package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +29 -67
- package/node_modules/hono/dist/cjs/jsx/streaming.js +123 -165
- package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
- package/node_modules/hono/dist/cjs/jsx/utils.js +91 -175
- package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +98 -86
- package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +100 -109
- package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +65 -72
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +168 -114
- package/node_modules/hono/dist/cjs/middleware/combine/index.js +135 -95
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +76 -59
- package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +49 -41
- package/node_modules/hono/dist/cjs/middleware/cors/index.js +107 -107
- package/node_modules/hono/dist/cjs/middleware/csrf/index.js +103 -74
- package/node_modules/hono/dist/cjs/middleware/etag/digest.js +58 -51
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +73 -87
- package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +163 -141
- package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +99 -77
- package/node_modules/hono/dist/cjs/middleware/jwk/index.js +3 -27
- package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +118 -130
- package/node_modules/hono/dist/cjs/middleware/jwt/index.js +9 -38
- package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +120 -136
- package/node_modules/hono/dist/cjs/middleware/language/index.js +7 -35
- package/node_modules/hono/dist/cjs/middleware/language/language.js +184 -197
- package/node_modules/hono/dist/cjs/middleware/logger/index.js +41 -62
- package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +84 -0
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +101 -100
- package/node_modules/hono/dist/cjs/middleware/mount/index.js +72 -0
- package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +23 -30
- package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +40 -35
- package/node_modules/hono/dist/cjs/middleware/request-id/index.js +3 -27
- package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +34 -42
- package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +4 -29
- package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +143 -166
- package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +58 -93
- package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +15 -38
- package/node_modules/hono/dist/cjs/middleware/timeout/index.js +40 -45
- package/node_modules/hono/dist/cjs/middleware/timing/index.js +7 -35
- package/node_modules/hono/dist/cjs/middleware/timing/timing.js +178 -116
- package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +85 -58
- package/node_modules/hono/dist/cjs/preset/quick.js +18 -37
- package/node_modules/hono/dist/cjs/preset/tiny.js +15 -33
- package/node_modules/hono/dist/cjs/request/constants.js +5 -27
- package/node_modules/hono/dist/cjs/request.js +334 -321
- package/node_modules/hono/dist/cjs/router/linear-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/linear-router/router.js +95 -138
- package/node_modules/hono/dist/cjs/router/pattern-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/pattern-router/router.js +41 -69
- package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +7 -34
- package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +18 -45
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +95 -131
- package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +92 -161
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +88 -206
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +83 -80
- package/node_modules/hono/dist/cjs/router/smart-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/smart-router/router.js +49 -79
- package/node_modules/hono/dist/cjs/router/trie-router/index.js +3 -27
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +134 -200
- package/node_modules/hono/dist/cjs/router/trie-router/router.js +15 -47
- package/node_modules/hono/dist/cjs/router/utils.js +5 -0
- package/node_modules/hono/dist/cjs/router.js +37 -37
- package/node_modules/hono/dist/cjs/types.js +5 -28
- package/node_modules/hono/dist/cjs/utils/accept.js +177 -228
- package/node_modules/hono/dist/cjs/utils/basic-auth.js +16 -40
- package/node_modules/hono/dist/cjs/utils/body.js +89 -89
- package/node_modules/hono/dist/cjs/utils/buffer.js +43 -90
- package/node_modules/hono/dist/cjs/utils/color.js +35 -44
- package/node_modules/hono/dist/cjs/utils/compress.js +12 -27
- package/node_modules/hono/dist/cjs/utils/concurrent.js +29 -59
- package/node_modules/hono/dist/cjs/utils/constants.js +7 -26
- package/node_modules/hono/dist/cjs/utils/cookie.js +108 -177
- package/node_modules/hono/dist/cjs/utils/crypto.js +30 -61
- package/node_modules/hono/dist/cjs/utils/encode.js +31 -48
- package/node_modules/hono/dist/cjs/utils/filepath.js +23 -54
- package/node_modules/hono/dist/cjs/utils/handler.js +11 -33
- package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
- package/node_modules/hono/dist/cjs/utils/html.js +96 -137
- package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
- package/node_modules/hono/dist/cjs/utils/ipaddr.js +233 -121
- package/node_modules/hono/dist/cjs/utils/jwt/index.js +14 -27
- package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +25 -42
- package/node_modules/hono/dist/cjs/utils/jwt/jws.js +119 -199
- package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +123 -205
- package/node_modules/hono/dist/cjs/utils/jwt/types.js +122 -159
- package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +9 -28
- package/node_modules/hono/dist/cjs/utils/mime.js +75 -103
- package/node_modules/hono/dist/cjs/utils/mount.js +51 -0
- package/node_modules/hono/dist/cjs/utils/stream.js +88 -100
- package/node_modules/hono/dist/cjs/utils/types.js +0 -15
- package/node_modules/hono/dist/cjs/utils/url.js +199 -228
- package/node_modules/hono/dist/cjs/validator/index.js +3 -27
- package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
- package/node_modules/hono/dist/cjs/validator/validator.js +63 -106
- package/node_modules/hono/dist/client/client.js +139 -175
- package/node_modules/hono/dist/client/fetch-result-please.js +59 -56
- package/node_modules/hono/dist/client/index.js +3 -7
- package/node_modules/hono/dist/client/types.js +1 -0
- package/node_modules/hono/dist/client/utils.js +51 -65
- package/node_modules/hono/dist/compose.js +49 -45
- package/node_modules/hono/dist/context.js +376 -407
- package/node_modules/hono/dist/helper/accepts/accepts.js +49 -16
- package/node_modules/hono/dist/helper/accepts/index.js +1 -4
- package/node_modules/hono/dist/helper/adapter/index.js +33 -52
- package/node_modules/hono/dist/helper/conninfo/index.js +1 -0
- package/node_modules/hono/dist/helper/conninfo/types.js +1 -0
- package/node_modules/hono/dist/helper/cookie/index.js +74 -94
- package/node_modules/hono/dist/helper/css/common.js +169 -222
- package/node_modules/hono/dist/helper/css/index.js +132 -129
- package/node_modules/hono/dist/helper/dev/index.js +44 -49
- package/node_modules/hono/dist/helper/factory/index.js +27 -27
- package/node_modules/hono/dist/helper/html/index.js +30 -39
- package/node_modules/hono/dist/helper/proxy/index.js +116 -84
- package/node_modules/hono/dist/helper/route/index.js +123 -43
- package/node_modules/hono/dist/helper/ssg/index.js +3 -18
- package/node_modules/hono/dist/helper/ssg/middleware.js +53 -40
- package/node_modules/hono/dist/helper/ssg/plugins.js +55 -36
- package/node_modules/hono/dist/helper/ssg/ssg.js +200 -283
- package/node_modules/hono/dist/helper/ssg/utils.js +54 -56
- package/node_modules/hono/dist/helper/streaming/index.js +2 -8
- package/node_modules/hono/dist/helper/streaming/sse.js +50 -60
- package/node_modules/hono/dist/helper/streaming/stream.js +22 -31
- package/node_modules/hono/dist/helper/streaming/text.js +9 -10
- package/node_modules/hono/dist/helper/streaming/utils.js +9 -12
- package/node_modules/hono/dist/helper/testing/index.js +16 -10
- package/node_modules/hono/dist/helper/websocket/index.js +49 -53
- package/node_modules/hono/dist/hono-base.js +343 -372
- package/node_modules/hono/dist/hono.js +26 -20
- package/node_modules/hono/dist/http-exception.js +53 -33
- package/node_modules/hono/dist/index.js +19 -4
- package/node_modules/hono/dist/jsx/base.js +252 -326
- package/node_modules/hono/dist/jsx/children.js +16 -20
- package/node_modules/hono/dist/jsx/components.js +119 -152
- package/node_modules/hono/dist/jsx/constants.js +10 -15
- package/node_modules/hono/dist/jsx/context.js +162 -35
- package/node_modules/hono/dist/jsx/dom/client.js +45 -48
- package/node_modules/hono/dist/jsx/dom/components.js +21 -29
- package/node_modules/hono/dist/jsx/dom/context.js +37 -44
- package/node_modules/hono/dist/jsx/dom/css.js +142 -147
- package/node_modules/hono/dist/jsx/dom/hooks/index.js +52 -40
- package/node_modules/hono/dist/jsx/dom/index.js +71 -134
- package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +275 -359
- package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +14 -18
- package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +2 -8
- package/node_modules/hono/dist/jsx/dom/render.js +492 -593
- package/node_modules/hono/dist/jsx/dom/server.js +33 -29
- package/node_modules/hono/dist/jsx/dom/utils.js +6 -8
- package/node_modules/hono/dist/jsx/hooks/index.js +238 -307
- package/node_modules/hono/dist/jsx/index.js +45 -98
- package/node_modules/hono/dist/jsx/intrinsic-element/common.js +20 -22
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +113 -154
- package/node_modules/hono/dist/jsx/intrinsic-elements.js +1 -0
- package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +12 -16
- package/node_modules/hono/dist/jsx/jsx-runtime.js +25 -42
- package/node_modules/hono/dist/jsx/streaming.js +121 -142
- package/node_modules/hono/dist/jsx/types.js +1 -0
- package/node_modules/hono/dist/jsx/utils.js +105 -168
- package/node_modules/hono/dist/middleware/basic-auth/index.js +96 -63
- package/node_modules/hono/dist/middleware/bearer-auth/index.js +101 -89
- package/node_modules/hono/dist/middleware/body-limit/index.js +65 -51
- package/node_modules/hono/dist/middleware/cache/index.js +169 -94
- package/node_modules/hono/dist/middleware/combine/index.js +134 -73
- package/node_modules/hono/dist/middleware/compress/index.js +76 -39
- package/node_modules/hono/dist/middleware/context-storage/index.js +49 -19
- package/node_modules/hono/dist/middleware/cors/index.js +107 -86
- package/node_modules/hono/dist/middleware/csrf/index.js +103 -53
- package/node_modules/hono/dist/middleware/etag/digest.js +59 -31
- package/node_modules/hono/dist/middleware/etag/index.js +73 -66
- package/node_modules/hono/dist/middleware/ip-restriction/index.js +163 -127
- package/node_modules/hono/dist/middleware/jsx-renderer/index.js +97 -54
- package/node_modules/hono/dist/middleware/jwk/index.js +1 -4
- package/node_modules/hono/dist/middleware/jwk/jwk.js +116 -107
- package/node_modules/hono/dist/middleware/jwt/index.js +2 -10
- package/node_modules/hono/dist/middleware/jwt/jwt.js +114 -109
- package/node_modules/hono/dist/middleware/language/index.js +2 -15
- package/node_modules/hono/dist/middleware/language/language.js +180 -172
- package/node_modules/hono/dist/middleware/logger/index.js +43 -37
- package/node_modules/hono/dist/middleware/method-not-allowed/index.js +83 -0
- package/node_modules/hono/dist/middleware/method-override/index.js +101 -79
- package/node_modules/hono/dist/middleware/mount/index.js +71 -0
- package/node_modules/hono/dist/middleware/powered-by/index.js +23 -9
- package/node_modules/hono/dist/middleware/pretty-json/index.js +40 -14
- package/node_modules/hono/dist/middleware/request-id/index.js +1 -4
- package/node_modules/hono/dist/middleware/request-id/request-id.js +33 -20
- package/node_modules/hono/dist/middleware/secure-headers/index.js +1 -5
- package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +1 -0
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +145 -147
- package/node_modules/hono/dist/middleware/serve-static/index.js +58 -72
- package/node_modules/hono/dist/middleware/serve-static/path.js +15 -17
- package/node_modules/hono/dist/middleware/timeout/index.js +40 -23
- package/node_modules/hono/dist/middleware/timing/index.js +2 -9
- package/node_modules/hono/dist/middleware/timing/timing.js +178 -95
- package/node_modules/hono/dist/middleware/trailing-slash/index.js +85 -37
- package/node_modules/hono/dist/preset/quick.js +17 -15
- package/node_modules/hono/dist/preset/tiny.js +14 -11
- package/node_modules/hono/dist/request/constants.js +4 -5
- package/node_modules/hono/dist/request.js +329 -295
- package/node_modules/hono/dist/router/linear-router/index.js +1 -4
- package/node_modules/hono/dist/router/linear-router/router.js +93 -115
- package/node_modules/hono/dist/router/pattern-router/index.js +1 -4
- package/node_modules/hono/dist/router/pattern-router/router.js +39 -46
- package/node_modules/hono/dist/router/reg-exp-router/index.js +1 -7
- package/node_modules/hono/dist/router/reg-exp-router/matcher.js +17 -23
- package/node_modules/hono/dist/router/reg-exp-router/node.js +90 -108
- package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +89 -137
- package/node_modules/hono/dist/router/reg-exp-router/router.js +82 -183
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +80 -56
- package/node_modules/hono/dist/router/smart-router/index.js +1 -4
- package/node_modules/hono/dist/router/smart-router/router.js +46 -55
- package/node_modules/hono/dist/router/trie-router/index.js +1 -4
- package/node_modules/hono/dist/router/trie-router/node.js +132 -177
- package/node_modules/hono/dist/router/trie-router/router.js +11 -22
- package/node_modules/hono/dist/router/utils.js +4 -0
- package/node_modules/hono/dist/router.js +35 -14
- package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +150 -104
- package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +4 -8
- package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +152 -113
- package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/bun/index.d.ts +6 -10
- package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +8 -3
- package/node_modules/hono/dist/types/adapter/bun/server.d.ts +4 -5
- package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +5 -1
- package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +31 -16
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +29 -17
- package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +3 -7
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +4 -7
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +5 -2
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +11 -6
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +10 -2
- package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/deno/deno.d.ts +1 -0
- package/node_modules/hono/dist/types/adapter/deno/index.d.ts +5 -8
- package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +8 -3
- package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +5 -1
- package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +84 -58
- package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +3 -7
- package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +4 -1
- package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +3 -5
- package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +3 -2
- package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +9 -7
- package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +7 -9
- package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +12 -7
- package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +6 -1
- package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +3 -6
- package/node_modules/hono/dist/types/client/client.d.ts +5 -3
- package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +21 -19
- package/node_modules/hono/dist/types/client/index.d.ts +5 -7
- package/node_modules/hono/dist/types/client/types.d.ts +135 -160
- package/node_modules/hono/dist/types/client/utils.d.ts +6 -4
- package/node_modules/hono/dist/types/compose.d.ts +4 -2
- package/node_modules/hono/dist/types/context.d.ts +335 -331
- package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +11 -9
- package/node_modules/hono/dist/types/helper/accepts/index.d.ts +2 -5
- package/node_modules/hono/dist/types/helper/adapter/index.d.ts +4 -6
- package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +2 -5
- package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +25 -23
- package/node_modules/hono/dist/types/helper/cookie/index.d.ts +10 -12
- package/node_modules/hono/dist/types/helper/css/common.d.ts +11 -9
- package/node_modules/hono/dist/types/helper/css/index.d.ts +26 -28
- package/node_modules/hono/dist/types/helper/dev/index.d.ts +10 -12
- package/node_modules/hono/dist/types/helper/factory/index.d.ts +26 -73
- package/node_modules/hono/dist/types/helper/html/index.d.ts +4 -7
- package/node_modules/hono/dist/types/helper/proxy/index.d.ts +20 -22
- package/node_modules/hono/dist/types/helper/route/index.d.ts +6 -4
- package/node_modules/hono/dist/types/helper/ssg/index.d.ts +4 -7
- package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +8 -6
- package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +3 -1
- package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +44 -37
- package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +5 -3
- package/node_modules/hono/dist/types/helper/streaming/index.d.ts +4 -8
- package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +10 -8
- package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +4 -2
- package/node_modules/hono/dist/types/helper/streaming/text.d.ts +4 -2
- package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/helper/testing/index.d.ts +8 -9
- package/node_modules/hono/dist/types/helper/websocket/index.d.ts +30 -33
- package/node_modules/hono/dist/types/hono-base.d.ts +225 -210
- package/node_modules/hono/dist/types/hono.d.ts +11 -10
- package/node_modules/hono/dist/types/http-exception.d.ts +20 -22
- package/node_modules/hono/dist/types/index.d.ts +6 -36
- package/node_modules/hono/dist/types/jsx/base.d.ts +45 -38
- package/node_modules/hono/dist/types/jsx/children.d.ts +8 -6
- package/node_modules/hono/dist/types/jsx/components.d.ts +8 -5
- package/node_modules/hono/dist/types/jsx/constants.d.ts +3 -0
- package/node_modules/hono/dist/types/jsx/context.d.ts +48 -6
- package/node_modules/hono/dist/types/jsx/dom/client.d.ts +9 -10
- package/node_modules/hono/dist/types/jsx/dom/components.d.ts +9 -6
- package/node_modules/hono/dist/types/jsx/dom/context.d.ts +3 -1
- package/node_modules/hono/dist/types/jsx/dom/css.d.ts +27 -30
- package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +11 -12
- package/node_modules/hono/dist/types/jsx/dom/index.d.ts +79 -83
- package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +10 -6
- package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +4 -6
- package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +3 -7
- package/node_modules/hono/dist/types/jsx/dom/render.d.ts +32 -50
- package/node_modules/hono/dist/types/jsx/dom/server.d.ts +87 -85
- package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +22 -20
- package/node_modules/hono/dist/types/jsx/index.d.ts +71 -73
- package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +3 -1
- package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +7 -4
- package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +708 -708
- package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +4 -7
- package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +8 -10
- package/node_modules/hono/dist/types/jsx/streaming.d.ts +10 -10
- package/node_modules/hono/dist/types/jsx/types.d.ts +12 -13
- package/node_modules/hono/dist/types/jsx/utils.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +17 -19
- package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +52 -52
- package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +6 -8
- package/node_modules/hono/dist/types/middleware/cache/index.d.ts +18 -18
- package/node_modules/hono/dist/types/middleware/combine/index.d.ts +8 -8
- package/node_modules/hono/dist/types/middleware/compress/index.d.ts +17 -7
- package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +6 -8
- package/node_modules/hono/dist/types/middleware/cors/index.d.ts +11 -13
- package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +6 -8
- package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/etag/index.d.ts +6 -8
- package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +11 -12
- package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +13 -13
- package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +2 -1
- package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +21 -22
- package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +7 -6
- package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +29 -29
- package/node_modules/hono/dist/types/middleware/language/index.d.ts +6 -5
- package/node_modules/hono/dist/types/middleware/language/language.d.ts +60 -44
- package/node_modules/hono/dist/types/middleware/logger/index.d.ts +3 -5
- package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +47 -0
- package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +14 -16
- package/node_modules/hono/dist/types/middleware/mount/index.d.ts +48 -0
- package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +8 -10
- package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +18 -20
- package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +6 -5
- package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +9 -11
- package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +6 -6
- package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +5 -3
- package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +55 -57
- package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +24 -24
- package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +2 -0
- package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +5 -7
- package/node_modules/hono/dist/types/middleware/timing/index.d.ts +6 -5
- package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +17 -20
- package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +35 -37
- package/node_modules/hono/dist/types/preset/quick.d.ts +6 -9
- package/node_modules/hono/dist/types/preset/tiny.d.ts +6 -9
- package/node_modules/hono/dist/types/request/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/request.d.ts +288 -273
- package/node_modules/hono/dist/types/router/linear-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/linear-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +7 -5
- package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +3 -6
- package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +3 -1
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +9 -4
- package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +11 -10
- package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +10 -9
- package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +7 -4
- package/node_modules/hono/dist/types/router/smart-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/smart-router/router.d.ts +11 -9
- package/node_modules/hono/dist/types/router/trie-router/index.d.ts +2 -5
- package/node_modules/hono/dist/types/router/trie-router/node.d.ts +6 -5
- package/node_modules/hono/dist/types/router/trie-router/router.d.ts +7 -6
- package/node_modules/hono/dist/types/router/utils.d.ts +3 -0
- package/node_modules/hono/dist/types/router.d.ts +24 -23
- package/node_modules/hono/dist/types/types.d.ts +146 -505
- package/node_modules/hono/dist/types/utils/accept.d.ts +5 -3
- package/node_modules/hono/dist/types/utils/basic-auth.d.ts +4 -2
- package/node_modules/hono/dist/types/utils/body.d.ts +46 -50
- package/node_modules/hono/dist/types/utils/buffer.d.ts +7 -5
- package/node_modules/hono/dist/types/utils/color.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/compress.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/concurrent.d.ts +6 -4
- package/node_modules/hono/dist/types/utils/constants.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/cookie.d.ts +21 -19
- package/node_modules/hono/dist/types/utils/crypto.d.ts +5 -7
- package/node_modules/hono/dist/types/utils/encode.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/filepath.d.ts +5 -3
- package/node_modules/hono/dist/types/utils/handler.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/headers.d.ts +4 -2
- package/node_modules/hono/dist/types/utils/html.d.ts +11 -9
- package/node_modules/hono/dist/types/utils/http-status.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/ipaddr.d.ts +7 -5
- package/node_modules/hono/dist/types/utils/jwt/index.d.ts +18 -12
- package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +15 -13
- package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +4 -7
- package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +26 -29
- package/node_modules/hono/dist/types/utils/jwt/types.d.ts +48 -45
- package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +2 -0
- package/node_modules/hono/dist/types/utils/mime.d.ts +60 -57
- package/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
- package/node_modules/hono/dist/types/utils/stream.d.ts +27 -25
- package/node_modules/hono/dist/types/utils/types.d.ts +15 -27
- package/node_modules/hono/dist/types/utils/url.d.ts +7 -0
- package/node_modules/hono/dist/types/validator/index.d.ts +3 -7
- package/node_modules/hono/dist/types/validator/utils.d.ts +6 -8
- package/node_modules/hono/dist/types/validator/validator.d.ts +11 -9
- package/node_modules/hono/dist/types.js +4 -6
- package/node_modules/hono/dist/utils/accept.js +185 -215
- package/node_modules/hono/dist/utils/basic-auth.js +18 -21
- package/node_modules/hono/dist/utils/body.js +88 -67
- package/node_modules/hono/dist/utils/buffer.js +44 -70
- package/node_modules/hono/dist/utils/color.js +33 -21
- package/node_modules/hono/dist/utils/compress.js +11 -5
- package/node_modules/hono/dist/utils/concurrent.js +29 -38
- package/node_modules/hono/dist/utils/constants.js +7 -5
- package/node_modules/hono/dist/utils/cookie.js +115 -163
- package/node_modules/hono/dist/utils/crypto.js +30 -40
- package/node_modules/hono/dist/utils/encode.js +30 -26
- package/node_modules/hono/dist/utils/filepath.js +23 -33
- package/node_modules/hono/dist/utils/handler.js +10 -11
- package/node_modules/hono/dist/utils/headers.js +1 -0
- package/node_modules/hono/dist/utils/html.js +97 -117
- package/node_modules/hono/dist/utils/http-status.js +1 -0
- package/node_modules/hono/dist/utils/ipaddr.js +231 -99
- package/node_modules/hono/dist/utils/jwt/index.js +12 -4
- package/node_modules/hono/dist/utils/jwt/jwa.js +24 -20
- package/node_modules/hono/dist/utils/jwt/jws.js +115 -174
- package/node_modules/hono/dist/utils/jwt/jwt.js +121 -197
- package/node_modules/hono/dist/utils/jwt/types.js +79 -95
- package/node_modules/hono/dist/utils/jwt/utf8.js +9 -7
- package/node_modules/hono/dist/utils/mime.js +74 -81
- package/node_modules/hono/dist/utils/mount.js +50 -0
- package/node_modules/hono/dist/utils/stream.js +86 -77
- package/node_modules/hono/dist/utils/types.js +1 -0
- package/node_modules/hono/dist/utils/url.js +199 -208
- package/node_modules/hono/dist/validator/index.js +1 -4
- package/node_modules/hono/dist/validator/utils.js +1 -0
- package/node_modules/hono/dist/validator/validator.js +61 -83
- package/node_modules/hono/package.json +69 -47
- package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
- package/node_modules/iconv-lite/encodings/utf32.js +10 -3
- package/node_modules/iconv-lite/package.json +2 -2
- package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
- package/node_modules/ip-address/README.md +173 -143
- package/node_modules/ip-address/dist/address-error.d.ts +11 -0
- package/node_modules/ip-address/dist/address-error.js.map +1 -1
- package/node_modules/ip-address/dist/common.d.ts +54 -0
- package/node_modules/ip-address/dist/common.js +93 -6
- package/node_modules/ip-address/dist/common.js.map +1 -1
- package/node_modules/ip-address/dist/ipv4.d.ts +88 -8
- package/node_modules/ip-address/dist/ipv4.js +146 -29
- package/node_modules/ip-address/dist/ipv4.js.map +1 -1
- package/node_modules/ip-address/dist/ipv6.d.ts +156 -11
- package/node_modules/ip-address/dist/ipv6.js +340 -96
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
- package/node_modules/ip-address/dist/v4/constants.js +45 -2
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +17 -0
- package/node_modules/ip-address/dist/v6/constants.js +53 -3
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +8 -5
- package/node_modules/proxy-addr/HISTORY.md +60 -54
- package/node_modules/proxy-addr/README.md +1 -1
- package/node_modules/proxy-addr/index.js +32 -0
- package/node_modules/proxy-addr/package.json +8 -4
- package/node_modules/qs/.editorconfig +1 -1
- package/node_modules/qs/.github/THREAT_MODEL.md +6 -4
- package/node_modules/qs/CHANGELOG.md +125 -0
- package/node_modules/qs/README.md +108 -9
- package/node_modules/qs/dist/qs.js +27 -27
- package/node_modules/qs/eslint.config.mjs +61 -49
- package/node_modules/qs/lib/formats.js +7 -2
- package/node_modules/qs/lib/parse.js +188 -39
- package/node_modules/qs/lib/stringify.js +42 -18
- package/node_modules/qs/lib/utils.js +213 -24
- package/node_modules/qs/package.json +11 -10
- package/node_modules/qs/test/parse.js +977 -2
- package/node_modules/qs/test/stringify.js +898 -0
- package/node_modules/qs/test/utils.js +450 -2
- package/node_modules/side-channel/CHANGELOG.md +10 -0
- package/node_modules/side-channel/README.md +1 -1
- package/node_modules/side-channel/index.js +5 -2
- package/node_modules/side-channel/package.json +10 -10
- package/node_modules/side-channel/test/index.js +16 -0
- package/node_modules/type-is/index.js +8 -18
- package/node_modules/type-is/node_modules/content-type/LICENSE +22 -0
- package/node_modules/type-is/node_modules/content-type/README.md +71 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/type-is/node_modules/content-type/package.json +52 -0
- package/node_modules/type-is/package.json +9 -5
- package/package.json +1 -1
- package/node_modules/@hono/node-server/dist/conninfo.js +0 -42
- package/node_modules/@hono/node-server/dist/globals.d.mts +0 -2
- package/node_modules/@hono/node-server/dist/globals.d.ts +0 -2
- package/node_modules/@hono/node-server/dist/globals.js +0 -29
- package/node_modules/@hono/node-server/dist/globals.mjs +0 -5
- package/node_modules/@hono/node-server/dist/index.d.ts +0 -8
- package/node_modules/@hono/node-server/dist/index.js +0 -680
- package/node_modules/@hono/node-server/dist/listener.d.mts +0 -13
- package/node_modules/@hono/node-server/dist/listener.d.ts +0 -13
- package/node_modules/@hono/node-server/dist/listener.js +0 -648
- package/node_modules/@hono/node-server/dist/listener.mjs +0 -613
- package/node_modules/@hono/node-server/dist/request.d.mts +0 -25
- package/node_modules/@hono/node-server/dist/request.d.ts +0 -25
- package/node_modules/@hono/node-server/dist/request.js +0 -227
- package/node_modules/@hono/node-server/dist/request.mjs +0 -195
- package/node_modules/@hono/node-server/dist/response.d.mts +0 -26
- package/node_modules/@hono/node-server/dist/response.d.ts +0 -26
- package/node_modules/@hono/node-server/dist/response.js +0 -101
- package/node_modules/@hono/node-server/dist/response.mjs +0 -74
- package/node_modules/@hono/node-server/dist/serve-static.d.ts +0 -17
- package/node_modules/@hono/node-server/dist/serve-static.js +0 -177
- package/node_modules/@hono/node-server/dist/server.d.mts +0 -10
- package/node_modules/@hono/node-server/dist/server.d.ts +0 -10
- package/node_modules/@hono/node-server/dist/server.js +0 -674
- package/node_modules/@hono/node-server/dist/server.mjs +0 -638
- package/node_modules/@hono/node-server/dist/types.d.mts +0 -44
- package/node_modules/@hono/node-server/dist/types.d.ts +0 -44
- package/node_modules/@hono/node-server/dist/types.js +0 -18
- package/node_modules/@hono/node-server/dist/types.mjs +0 -0
- package/node_modules/@hono/node-server/dist/utils/response/constants.d.mts +0 -3
- package/node_modules/@hono/node-server/dist/utils/response/constants.d.ts +0 -3
- package/node_modules/@hono/node-server/dist/utils/response/constants.js +0 -30
- package/node_modules/@hono/node-server/dist/utils/response/constants.mjs +0 -5
- package/node_modules/@hono/node-server/dist/utils/response.d.ts +0 -3
- package/node_modules/@hono/node-server/dist/utils/response.js +0 -37
- package/node_modules/@hono/node-server/dist/utils.d.mts +0 -9
- package/node_modules/@hono/node-server/dist/utils.d.ts +0 -9
- package/node_modules/@hono/node-server/dist/utils.js +0 -99
- package/node_modules/@hono/node-server/dist/utils.mjs +0 -71
- package/node_modules/@hono/node-server/dist/vercel.d.mts +0 -7
- package/node_modules/@hono/node-server/dist/vercel.d.ts +0 -7
- package/node_modules/@hono/node-server/dist/vercel.js +0 -655
- package/node_modules/@hono/node-server/dist/vercel.mjs +0 -618
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,12 +17,24 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// source/index.ts
|
|
21
31
|
var index_exports = {};
|
|
22
32
|
__export(index_exports, {
|
|
33
|
+
DAY: () => DAY,
|
|
34
|
+
HOUR: () => HOUR,
|
|
35
|
+
MINUTE: () => MINUTE,
|
|
23
36
|
MemoryStore: () => MemoryStore,
|
|
37
|
+
SECOND: () => SECOND,
|
|
24
38
|
default: () => rate_limit_default,
|
|
25
39
|
ipKeyGenerator: () => ipKeyGenerator,
|
|
26
40
|
rateLimit: () => rate_limit_default
|
|
@@ -30,13 +44,18 @@ module.exports = __toCommonJS(index_exports);
|
|
|
30
44
|
// source/ip-key-generator.ts
|
|
31
45
|
var import_node_net = require("node:net");
|
|
32
46
|
var import_ip_address = require("ip-address");
|
|
47
|
+
var ipv4CompatibleSubnet = new import_ip_address.Address6("::/96");
|
|
33
48
|
function ipKeyGenerator(ip, ipv6Subnet = 56) {
|
|
34
49
|
if ((0, import_node_net.isIPv6)(ip)) {
|
|
35
50
|
const address = new import_ip_address.Address6(ip);
|
|
36
|
-
if (address.
|
|
51
|
+
if (address.isMapped4() || // The deprecated IPv4-compatible notation keeps its existing behavior.
|
|
52
|
+
// Its range is shared with addresses that embed no IPv4 address at all
|
|
53
|
+
// (`::`, `::1`), so here the notation is what tells them apart.
|
|
54
|
+
address.is4() && address.isInSubnet(ipv4CompatibleSubnet))
|
|
55
|
+
return address.to4().correctForm();
|
|
37
56
|
if (ipv6Subnet) {
|
|
38
57
|
const subnet = new import_ip_address.Address6(`${ip}/${ipv6Subnet}`);
|
|
39
|
-
return
|
|
58
|
+
return subnet.networkForm();
|
|
40
59
|
}
|
|
41
60
|
}
|
|
42
61
|
return ip;
|
|
@@ -163,7 +182,7 @@ var MemoryStore = class {
|
|
|
163
182
|
*/
|
|
164
183
|
resetClient(client, now = Date.now()) {
|
|
165
184
|
client.totalHits = 0;
|
|
166
|
-
client.resetTime
|
|
185
|
+
client.resetTime = new Date(now + this.windowMs);
|
|
167
186
|
return client;
|
|
168
187
|
}
|
|
169
188
|
/**
|
|
@@ -200,6 +219,17 @@ var MemoryStore = class {
|
|
|
200
219
|
|
|
201
220
|
// source/rate-limit.ts
|
|
202
221
|
var import_node_net3 = require("node:net");
|
|
222
|
+
var import_debug = __toESM(require("debug"), 1);
|
|
223
|
+
|
|
224
|
+
// source/console-logger.ts
|
|
225
|
+
var ConsoleLogger = {
|
|
226
|
+
warn(...args) {
|
|
227
|
+
console.warn(...args.reverse());
|
|
228
|
+
},
|
|
229
|
+
error(...args) {
|
|
230
|
+
console.error(...args.reverse());
|
|
231
|
+
}
|
|
232
|
+
};
|
|
203
233
|
|
|
204
234
|
// source/headers.ts
|
|
205
235
|
var import_node_buffer = require("node:buffer");
|
|
@@ -267,9 +297,9 @@ var setDraft8Headers = (response, info, windowMs, name, key) => {
|
|
|
267
297
|
response.append("RateLimit", `"${name}"; ${header}`);
|
|
268
298
|
response.append("RateLimit-Policy", `"${name}"; ${policy}`);
|
|
269
299
|
};
|
|
270
|
-
var setRetryAfterHeader = (response, info, windowMs) => {
|
|
300
|
+
var setRetryAfterHeader = (response, info, windowMs, retryAfter) => {
|
|
271
301
|
if (response.headersSent) return;
|
|
272
|
-
const resetSeconds = getResetSeconds(windowMs, info.resetTime);
|
|
302
|
+
const resetSeconds = retryAfter ?? getResetSeconds(windowMs, info.resetTime);
|
|
273
303
|
response.setHeader("Retry-After", resetSeconds.toString());
|
|
274
304
|
};
|
|
275
305
|
|
|
@@ -536,6 +566,7 @@ var validations = {
|
|
|
536
566
|
legacyHeaders: true,
|
|
537
567
|
standardHeaders: true,
|
|
538
568
|
identifier: true,
|
|
569
|
+
retryAfter: true,
|
|
539
570
|
requestPropertyName: true,
|
|
540
571
|
skipFailedRequests: true,
|
|
541
572
|
skipSuccessfulRequests: true,
|
|
@@ -548,7 +579,8 @@ var validations = {
|
|
|
548
579
|
validate: true,
|
|
549
580
|
headers: true,
|
|
550
581
|
max: true,
|
|
551
|
-
passOnStoreError: true
|
|
582
|
+
passOnStoreError: true,
|
|
583
|
+
logger: true
|
|
552
584
|
};
|
|
553
585
|
const validOptions = Object.keys(optionsMap).concat(
|
|
554
586
|
"draft_polli_ratelimit_headers",
|
|
@@ -661,7 +693,15 @@ var validations = {
|
|
|
661
693
|
}
|
|
662
694
|
}
|
|
663
695
|
};
|
|
664
|
-
|
|
696
|
+
function validateLogger(logger) {
|
|
697
|
+
if (typeof logger !== "object" || typeof logger.error !== "function" || typeof logger.warn !== "function") {
|
|
698
|
+
throw new TypeError(
|
|
699
|
+
"Provided logger does not implement the Logger interface"
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
var getValidations = (_enabled, logger) => {
|
|
704
|
+
validateLogger(logger);
|
|
665
705
|
let enabled;
|
|
666
706
|
if (typeof _enabled === "boolean") {
|
|
667
707
|
enabled = {
|
|
@@ -680,6 +720,7 @@ var getValidations = (_enabled) => {
|
|
|
680
720
|
if (!(enabled[name] ?? enabled.default)) {
|
|
681
721
|
return;
|
|
682
722
|
}
|
|
723
|
+
enabled[name] = false;
|
|
683
724
|
try {
|
|
684
725
|
;
|
|
685
726
|
validation.apply(
|
|
@@ -687,11 +728,14 @@ var getValidations = (_enabled) => {
|
|
|
687
728
|
args
|
|
688
729
|
);
|
|
689
730
|
} catch (error) {
|
|
690
|
-
if (error instanceof ChangeWarning)
|
|
691
|
-
else
|
|
731
|
+
if (error instanceof ChangeWarning) logger.warn(error);
|
|
732
|
+
else logger.error(error);
|
|
692
733
|
}
|
|
693
734
|
};
|
|
694
735
|
}
|
|
736
|
+
const inspect = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
737
|
+
if (inspect)
|
|
738
|
+
wrappedValidations[inspect] = () => wrappedValidations.enabled;
|
|
695
739
|
return wrappedValidations;
|
|
696
740
|
};
|
|
697
741
|
|
|
@@ -741,7 +785,11 @@ var getOptionsFromConfig = (config) => {
|
|
|
741
785
|
};
|
|
742
786
|
var parseOptions = (passedOptions) => {
|
|
743
787
|
const notUndefinedOptions = omitUndefinedProperties(passedOptions);
|
|
744
|
-
const
|
|
788
|
+
const logger = passedOptions.logger ?? ConsoleLogger;
|
|
789
|
+
const validations2 = getValidations(
|
|
790
|
+
notUndefinedOptions?.validate ?? true,
|
|
791
|
+
logger
|
|
792
|
+
);
|
|
745
793
|
validations2.validationsConfig();
|
|
746
794
|
validations2.knownOptions(passedOptions);
|
|
747
795
|
validations2.draftPolliHeaders(
|
|
@@ -816,7 +864,8 @@ var parseOptions = (passedOptions) => {
|
|
|
816
864
|
notUndefinedOptions.store ?? new MemoryStore(validations2)
|
|
817
865
|
),
|
|
818
866
|
// Print an error to the console if a few known misconfigurations are detected.
|
|
819
|
-
validations: validations2
|
|
867
|
+
validations: validations2,
|
|
868
|
+
logger
|
|
820
869
|
};
|
|
821
870
|
if (typeof config.store.increment !== "function" || typeof config.store.decrement !== "function" || typeof config.store.resetKey !== "function" || config.store.resetAll !== void 0 && typeof config.store.resetAll !== "function" || config.store.init !== void 0 && typeof config.store.init !== "function") {
|
|
822
871
|
throw new TypeError(
|
|
@@ -835,32 +884,63 @@ var handleAsyncErrors = (fn) => async (request, response, next) => {
|
|
|
835
884
|
var rateLimit = (passedOptions) => {
|
|
836
885
|
const config = parseOptions(passedOptions ?? {});
|
|
837
886
|
const options = getOptionsFromConfig(config);
|
|
887
|
+
const debug = (0, import_debug.default)("express-rate-limit");
|
|
888
|
+
debug("creating new rate limiter with %o", config.store.constructor.name);
|
|
889
|
+
for (const [key, val] of Object.entries(config))
|
|
890
|
+
debug("set %s to %o", key, val);
|
|
838
891
|
config.validations.creationStack(config.store);
|
|
839
892
|
config.validations.unsharedStore(config.store);
|
|
840
|
-
if (typeof config.store.init === "function")
|
|
893
|
+
if (typeof config.store.init === "function") {
|
|
894
|
+
debug("executing init for store");
|
|
895
|
+
try {
|
|
896
|
+
const storeInit = config.store.init(options);
|
|
897
|
+
if (storeInit instanceof Promise) {
|
|
898
|
+
storeInit.catch(
|
|
899
|
+
(error) => config.logger.error(
|
|
900
|
+
error,
|
|
901
|
+
"express-rate-limit: async error during store initialization."
|
|
902
|
+
)
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
} catch (error) {
|
|
906
|
+
config.logger.error(
|
|
907
|
+
error,
|
|
908
|
+
"express-rate-limit: error during store initialization."
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
841
912
|
const middleware = handleAsyncErrors(
|
|
842
913
|
async (request, response, next) => {
|
|
843
914
|
const closePromise = config.skipFailedRequests && new Promise((resolve) => response.once("close", resolve));
|
|
844
915
|
const finishPromise = (config.skipFailedRequests || config.skipSuccessfulRequests) && new Promise((resolve) => response.once("finish", resolve));
|
|
845
916
|
const errorPromise = config.skipFailedRequests && new Promise((resolve) => response.once("error", resolve));
|
|
917
|
+
debug("requested %o", request.originalUrl);
|
|
918
|
+
debug("request from ip %o", request.ip);
|
|
846
919
|
const skip = await config.skip(request, response);
|
|
847
920
|
if (skip) {
|
|
921
|
+
debug("skipping request");
|
|
848
922
|
next();
|
|
849
923
|
return;
|
|
850
924
|
}
|
|
851
925
|
const augmentedRequest = request;
|
|
852
926
|
const key = await config.keyGenerator(request, response);
|
|
927
|
+
debug("computed key %o", key);
|
|
928
|
+
debug("incrementing count");
|
|
853
929
|
let totalHits = 0;
|
|
854
930
|
let resetTime;
|
|
855
931
|
try {
|
|
856
932
|
const incrementResult = await config.store.increment(key);
|
|
857
933
|
totalHits = incrementResult.totalHits;
|
|
858
|
-
resetTime
|
|
934
|
+
if (incrementResult.resetTime && (config.skipFailedRequests || config.skipSuccessfulRequests)) {
|
|
935
|
+
resetTime = new Date(incrementResult.resetTime.getTime());
|
|
936
|
+
} else {
|
|
937
|
+
resetTime = incrementResult.resetTime;
|
|
938
|
+
}
|
|
859
939
|
} catch (error) {
|
|
860
940
|
if (config.passOnStoreError) {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
error
|
|
941
|
+
config.logger.error(
|
|
942
|
+
error,
|
|
943
|
+
"express-rate-limit: error from store, allowing request without rate-limiting."
|
|
864
944
|
);
|
|
865
945
|
next();
|
|
866
946
|
return;
|
|
@@ -879,6 +959,15 @@ var rateLimit = (passedOptions) => {
|
|
|
879
959
|
resetTime,
|
|
880
960
|
key
|
|
881
961
|
};
|
|
962
|
+
if (debug.enabled) {
|
|
963
|
+
for (const [key2, val] of Object.entries(info))
|
|
964
|
+
debug(
|
|
965
|
+
"set request.%s.%s to be %o",
|
|
966
|
+
config.requestPropertyName,
|
|
967
|
+
key2,
|
|
968
|
+
val
|
|
969
|
+
);
|
|
970
|
+
}
|
|
882
971
|
Object.defineProperty(info, "current", {
|
|
883
972
|
configurable: false,
|
|
884
973
|
enumerable: false,
|
|
@@ -886,15 +975,18 @@ var rateLimit = (passedOptions) => {
|
|
|
886
975
|
});
|
|
887
976
|
augmentedRequest[config.requestPropertyName] = info;
|
|
888
977
|
if (config.legacyHeaders && !response.headersSent) {
|
|
978
|
+
debug("set legacy headers");
|
|
889
979
|
setLegacyHeaders(response, info);
|
|
890
980
|
}
|
|
891
981
|
if (config.standardHeaders && !response.headersSent) {
|
|
892
982
|
switch (config.standardHeaders) {
|
|
893
983
|
case "draft-6": {
|
|
984
|
+
debug("set ietf draft 6 headers");
|
|
894
985
|
setDraft6Headers(response, info, config.windowMs);
|
|
895
986
|
break;
|
|
896
987
|
}
|
|
897
988
|
case "draft-7": {
|
|
989
|
+
debug("set ietf draft 7 headers");
|
|
898
990
|
config.validations.headersResetTime(info.resetTime);
|
|
899
991
|
setDraft7Headers(response, info, config.windowMs);
|
|
900
992
|
break;
|
|
@@ -902,6 +994,8 @@ var rateLimit = (passedOptions) => {
|
|
|
902
994
|
case "draft-8": {
|
|
903
995
|
const retrieveName = typeof config.identifier === "function" ? config.identifier(request, response) : config.identifier;
|
|
904
996
|
const name = await retrieveName;
|
|
997
|
+
debug("set ietf draft 8 headers");
|
|
998
|
+
debug("set name to %o", name);
|
|
905
999
|
config.validations.headersResetTime(info.resetTime);
|
|
906
1000
|
setDraft8Headers(response, info, config.windowMs, name, key);
|
|
907
1001
|
break;
|
|
@@ -916,6 +1010,10 @@ var rateLimit = (passedOptions) => {
|
|
|
916
1010
|
let decremented = false;
|
|
917
1011
|
const decrementKey = async () => {
|
|
918
1012
|
if (!decremented) {
|
|
1013
|
+
if (resetTime && Date.now() >= resetTime.getTime()) {
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
debug("decrementing count");
|
|
919
1017
|
await config.store.decrement(key);
|
|
920
1018
|
decremented = true;
|
|
921
1019
|
}
|
|
@@ -923,8 +1021,12 @@ var rateLimit = (passedOptions) => {
|
|
|
923
1021
|
if (config.skipFailedRequests) {
|
|
924
1022
|
if (finishPromise) {
|
|
925
1023
|
void finishPromise.then(async () => {
|
|
926
|
-
|
|
927
|
-
|
|
1024
|
+
const success = await config.requestWasSuccessful(
|
|
1025
|
+
request,
|
|
1026
|
+
response
|
|
1027
|
+
);
|
|
1028
|
+
debug("computed requestWasSuccessful as %o", success);
|
|
1029
|
+
if (!success) await decrementKey();
|
|
928
1030
|
});
|
|
929
1031
|
}
|
|
930
1032
|
if (closePromise) {
|
|
@@ -941,18 +1043,25 @@ var rateLimit = (passedOptions) => {
|
|
|
941
1043
|
if (config.skipSuccessfulRequests) {
|
|
942
1044
|
if (finishPromise) {
|
|
943
1045
|
void finishPromise.then(async () => {
|
|
944
|
-
|
|
945
|
-
|
|
1046
|
+
const success = await config.requestWasSuccessful(
|
|
1047
|
+
request,
|
|
1048
|
+
response
|
|
1049
|
+
);
|
|
1050
|
+
debug("computed requestWasSuccessful as %o", success);
|
|
1051
|
+
if (success) await decrementKey();
|
|
946
1052
|
});
|
|
947
1053
|
}
|
|
948
1054
|
}
|
|
949
1055
|
}
|
|
950
|
-
config.validations.disable();
|
|
951
1056
|
if (totalHits > limit) {
|
|
1057
|
+
debug("limit exceeded");
|
|
952
1058
|
if (config.legacyHeaders || config.standardHeaders) {
|
|
953
|
-
|
|
1059
|
+
debug("set retry-after header");
|
|
1060
|
+
const retrieveRetryAfter = typeof config.retryAfter === "function" ? config.retryAfter(request, response) : config.retryAfter;
|
|
1061
|
+
const retryAfter = await retrieveRetryAfter;
|
|
1062
|
+
setRetryAfterHeader(response, info, config.windowMs, retryAfter);
|
|
954
1063
|
}
|
|
955
|
-
config.handler(request, response, next, options);
|
|
1064
|
+
await config.handler(request, response, next, options);
|
|
956
1065
|
return;
|
|
957
1066
|
}
|
|
958
1067
|
next();
|
|
@@ -966,9 +1075,19 @@ var rateLimit = (passedOptions) => {
|
|
|
966
1075
|
return middleware;
|
|
967
1076
|
};
|
|
968
1077
|
var rate_limit_default = rateLimit;
|
|
1078
|
+
|
|
1079
|
+
// source/time-constants.ts
|
|
1080
|
+
var SECOND = 1e3;
|
|
1081
|
+
var MINUTE = 60 * SECOND;
|
|
1082
|
+
var HOUR = 60 * MINUTE;
|
|
1083
|
+
var DAY = 24 * HOUR;
|
|
969
1084
|
// Annotate the CommonJS export names for ESM import in node:
|
|
970
1085
|
0 && (module.exports = {
|
|
1086
|
+
DAY,
|
|
1087
|
+
HOUR,
|
|
1088
|
+
MINUTE,
|
|
971
1089
|
MemoryStore,
|
|
1090
|
+
SECOND,
|
|
972
1091
|
ipKeyGenerator,
|
|
973
1092
|
rateLimit
|
|
974
1093
|
});
|
|
@@ -159,6 +159,26 @@ declare const validations: {
|
|
|
159
159
|
windowMs(windowMs: number): void;
|
|
160
160
|
};
|
|
161
161
|
export type Validations = typeof validations;
|
|
162
|
+
/**
|
|
163
|
+
* Basic logging function
|
|
164
|
+
*
|
|
165
|
+
* @param error {unknown} - The error to log
|
|
166
|
+
* @param message {string | undefined} - Additional details about the error
|
|
167
|
+
*/
|
|
168
|
+
export type LoggerFn = (error: unknown, message?: string) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Minimal interface for logging warnings and errors
|
|
171
|
+
*/
|
|
172
|
+
export type Logger = {
|
|
173
|
+
/**
|
|
174
|
+
* Function to log an error
|
|
175
|
+
*/
|
|
176
|
+
error: LoggerFn;
|
|
177
|
+
/**
|
|
178
|
+
* Function to log a warning
|
|
179
|
+
*/
|
|
180
|
+
warn: LoggerFn;
|
|
181
|
+
};
|
|
162
182
|
/**
|
|
163
183
|
* Callback that fires when a client's hit counter is incremented.
|
|
164
184
|
*
|
|
@@ -265,9 +285,15 @@ export type Store = {
|
|
|
265
285
|
* Method that initializes the store, and has access to the options passed to
|
|
266
286
|
* the middleware too.
|
|
267
287
|
*
|
|
288
|
+
* Called once during initialization.
|
|
289
|
+
*
|
|
290
|
+
* Errors / promise rejections will be caught and logged.
|
|
291
|
+
*
|
|
292
|
+
* Note that the result is not awaited - other store methods (such as increment) may be called before init returns and/or after it throws/rejects.
|
|
293
|
+
*
|
|
268
294
|
* @param options {Options} - The options used to setup the middleware.
|
|
269
295
|
*/
|
|
270
|
-
init?: (options: Options) => void
|
|
296
|
+
init?: (options: Options) => void | Promise<void>;
|
|
271
297
|
/**
|
|
272
298
|
* Method to fetch a client's hit count and reset time.
|
|
273
299
|
*
|
|
@@ -382,6 +408,17 @@ export type Options = {
|
|
|
382
408
|
* Defaults to `{limit}-in-{window}`.
|
|
383
409
|
*/
|
|
384
410
|
identifier: string | ValueDeterminingMiddleware<string>;
|
|
411
|
+
/**
|
|
412
|
+
* Method to generate a custom `Retry-After` header value (in seconds) when
|
|
413
|
+
* a client is rate limited.
|
|
414
|
+
*
|
|
415
|
+
* This is advisory only, it customizes what the header says, it does not
|
|
416
|
+
* change how long the limiter actually keeps blocking the client for.
|
|
417
|
+
* That is still controlled by `windowMs`.
|
|
418
|
+
*
|
|
419
|
+
* By default, the number of seconds remaining until the window resets.
|
|
420
|
+
*/
|
|
421
|
+
retryAfter?: number | ValueDeterminingMiddleware<number>;
|
|
385
422
|
/**
|
|
386
423
|
* The name of the property on the request object to store the rate limit info.
|
|
387
424
|
*
|
|
@@ -477,6 +514,10 @@ export type Options = {
|
|
|
477
514
|
* If the Store generates an error, allow the request to pass.
|
|
478
515
|
*/
|
|
479
516
|
passOnStoreError: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* The logger to use to log errors. If absent, logs to the console.
|
|
519
|
+
*/
|
|
520
|
+
logger: Logger;
|
|
480
521
|
};
|
|
481
522
|
/**
|
|
482
523
|
* The extended request object that includes information about the client's
|
|
@@ -634,6 +675,22 @@ export declare class MemoryStore implements Store {
|
|
|
634
675
|
* @public
|
|
635
676
|
*/
|
|
636
677
|
export declare const rateLimit: (passedOptions?: Partial<Options>) => RateLimitRequestHandler;
|
|
678
|
+
/**
|
|
679
|
+
* @deprecated these are being replaced in the next major version
|
|
680
|
+
*/
|
|
681
|
+
export declare const SECOND: number;
|
|
682
|
+
/**
|
|
683
|
+
* @deprecated these are being replaced in the next major version
|
|
684
|
+
*/
|
|
685
|
+
export declare const MINUTE: number;
|
|
686
|
+
/**
|
|
687
|
+
* @deprecated these are being replaced in the next major version
|
|
688
|
+
*/
|
|
689
|
+
export declare const HOUR: number;
|
|
690
|
+
/**
|
|
691
|
+
* @deprecated these are being replaced in the next major version
|
|
692
|
+
*/
|
|
693
|
+
export declare const DAY: number;
|
|
637
694
|
|
|
638
695
|
export {
|
|
639
696
|
rateLimit as default,
|
|
@@ -159,6 +159,26 @@ declare const validations: {
|
|
|
159
159
|
windowMs(windowMs: number): void;
|
|
160
160
|
};
|
|
161
161
|
export type Validations = typeof validations;
|
|
162
|
+
/**
|
|
163
|
+
* Basic logging function
|
|
164
|
+
*
|
|
165
|
+
* @param error {unknown} - The error to log
|
|
166
|
+
* @param message {string | undefined} - Additional details about the error
|
|
167
|
+
*/
|
|
168
|
+
export type LoggerFn = (error: unknown, message?: string) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Minimal interface for logging warnings and errors
|
|
171
|
+
*/
|
|
172
|
+
export type Logger = {
|
|
173
|
+
/**
|
|
174
|
+
* Function to log an error
|
|
175
|
+
*/
|
|
176
|
+
error: LoggerFn;
|
|
177
|
+
/**
|
|
178
|
+
* Function to log a warning
|
|
179
|
+
*/
|
|
180
|
+
warn: LoggerFn;
|
|
181
|
+
};
|
|
162
182
|
/**
|
|
163
183
|
* Callback that fires when a client's hit counter is incremented.
|
|
164
184
|
*
|
|
@@ -265,9 +285,15 @@ export type Store = {
|
|
|
265
285
|
* Method that initializes the store, and has access to the options passed to
|
|
266
286
|
* the middleware too.
|
|
267
287
|
*
|
|
288
|
+
* Called once during initialization.
|
|
289
|
+
*
|
|
290
|
+
* Errors / promise rejections will be caught and logged.
|
|
291
|
+
*
|
|
292
|
+
* Note that the result is not awaited - other store methods (such as increment) may be called before init returns and/or after it throws/rejects.
|
|
293
|
+
*
|
|
268
294
|
* @param options {Options} - The options used to setup the middleware.
|
|
269
295
|
*/
|
|
270
|
-
init?: (options: Options) => void
|
|
296
|
+
init?: (options: Options) => void | Promise<void>;
|
|
271
297
|
/**
|
|
272
298
|
* Method to fetch a client's hit count and reset time.
|
|
273
299
|
*
|
|
@@ -382,6 +408,17 @@ export type Options = {
|
|
|
382
408
|
* Defaults to `{limit}-in-{window}`.
|
|
383
409
|
*/
|
|
384
410
|
identifier: string | ValueDeterminingMiddleware<string>;
|
|
411
|
+
/**
|
|
412
|
+
* Method to generate a custom `Retry-After` header value (in seconds) when
|
|
413
|
+
* a client is rate limited.
|
|
414
|
+
*
|
|
415
|
+
* This is advisory only, it customizes what the header says, it does not
|
|
416
|
+
* change how long the limiter actually keeps blocking the client for.
|
|
417
|
+
* That is still controlled by `windowMs`.
|
|
418
|
+
*
|
|
419
|
+
* By default, the number of seconds remaining until the window resets.
|
|
420
|
+
*/
|
|
421
|
+
retryAfter?: number | ValueDeterminingMiddleware<number>;
|
|
385
422
|
/**
|
|
386
423
|
* The name of the property on the request object to store the rate limit info.
|
|
387
424
|
*
|
|
@@ -477,6 +514,10 @@ export type Options = {
|
|
|
477
514
|
* If the Store generates an error, allow the request to pass.
|
|
478
515
|
*/
|
|
479
516
|
passOnStoreError: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* The logger to use to log errors. If absent, logs to the console.
|
|
519
|
+
*/
|
|
520
|
+
logger: Logger;
|
|
480
521
|
};
|
|
481
522
|
/**
|
|
482
523
|
* The extended request object that includes information about the client's
|
|
@@ -634,6 +675,22 @@ export declare class MemoryStore implements Store {
|
|
|
634
675
|
* @public
|
|
635
676
|
*/
|
|
636
677
|
export declare const rateLimit: (passedOptions?: Partial<Options>) => RateLimitRequestHandler;
|
|
678
|
+
/**
|
|
679
|
+
* @deprecated these are being replaced in the next major version
|
|
680
|
+
*/
|
|
681
|
+
export declare const SECOND: number;
|
|
682
|
+
/**
|
|
683
|
+
* @deprecated these are being replaced in the next major version
|
|
684
|
+
*/
|
|
685
|
+
export declare const MINUTE: number;
|
|
686
|
+
/**
|
|
687
|
+
* @deprecated these are being replaced in the next major version
|
|
688
|
+
*/
|
|
689
|
+
export declare const HOUR: number;
|
|
690
|
+
/**
|
|
691
|
+
* @deprecated these are being replaced in the next major version
|
|
692
|
+
*/
|
|
693
|
+
export declare const DAY: number;
|
|
637
694
|
|
|
638
695
|
export {
|
|
639
696
|
rateLimit as default,
|
|
@@ -159,6 +159,26 @@ declare const validations: {
|
|
|
159
159
|
windowMs(windowMs: number): void;
|
|
160
160
|
};
|
|
161
161
|
export type Validations = typeof validations;
|
|
162
|
+
/**
|
|
163
|
+
* Basic logging function
|
|
164
|
+
*
|
|
165
|
+
* @param error {unknown} - The error to log
|
|
166
|
+
* @param message {string | undefined} - Additional details about the error
|
|
167
|
+
*/
|
|
168
|
+
export type LoggerFn = (error: unknown, message?: string) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Minimal interface for logging warnings and errors
|
|
171
|
+
*/
|
|
172
|
+
export type Logger = {
|
|
173
|
+
/**
|
|
174
|
+
* Function to log an error
|
|
175
|
+
*/
|
|
176
|
+
error: LoggerFn;
|
|
177
|
+
/**
|
|
178
|
+
* Function to log a warning
|
|
179
|
+
*/
|
|
180
|
+
warn: LoggerFn;
|
|
181
|
+
};
|
|
162
182
|
/**
|
|
163
183
|
* Callback that fires when a client's hit counter is incremented.
|
|
164
184
|
*
|
|
@@ -265,9 +285,15 @@ export type Store = {
|
|
|
265
285
|
* Method that initializes the store, and has access to the options passed to
|
|
266
286
|
* the middleware too.
|
|
267
287
|
*
|
|
288
|
+
* Called once during initialization.
|
|
289
|
+
*
|
|
290
|
+
* Errors / promise rejections will be caught and logged.
|
|
291
|
+
*
|
|
292
|
+
* Note that the result is not awaited - other store methods (such as increment) may be called before init returns and/or after it throws/rejects.
|
|
293
|
+
*
|
|
268
294
|
* @param options {Options} - The options used to setup the middleware.
|
|
269
295
|
*/
|
|
270
|
-
init?: (options: Options) => void
|
|
296
|
+
init?: (options: Options) => void | Promise<void>;
|
|
271
297
|
/**
|
|
272
298
|
* Method to fetch a client's hit count and reset time.
|
|
273
299
|
*
|
|
@@ -382,6 +408,17 @@ export type Options = {
|
|
|
382
408
|
* Defaults to `{limit}-in-{window}`.
|
|
383
409
|
*/
|
|
384
410
|
identifier: string | ValueDeterminingMiddleware<string>;
|
|
411
|
+
/**
|
|
412
|
+
* Method to generate a custom `Retry-After` header value (in seconds) when
|
|
413
|
+
* a client is rate limited.
|
|
414
|
+
*
|
|
415
|
+
* This is advisory only, it customizes what the header says, it does not
|
|
416
|
+
* change how long the limiter actually keeps blocking the client for.
|
|
417
|
+
* That is still controlled by `windowMs`.
|
|
418
|
+
*
|
|
419
|
+
* By default, the number of seconds remaining until the window resets.
|
|
420
|
+
*/
|
|
421
|
+
retryAfter?: number | ValueDeterminingMiddleware<number>;
|
|
385
422
|
/**
|
|
386
423
|
* The name of the property on the request object to store the rate limit info.
|
|
387
424
|
*
|
|
@@ -477,6 +514,10 @@ export type Options = {
|
|
|
477
514
|
* If the Store generates an error, allow the request to pass.
|
|
478
515
|
*/
|
|
479
516
|
passOnStoreError: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* The logger to use to log errors. If absent, logs to the console.
|
|
519
|
+
*/
|
|
520
|
+
logger: Logger;
|
|
480
521
|
};
|
|
481
522
|
/**
|
|
482
523
|
* The extended request object that includes information about the client's
|
|
@@ -634,6 +675,22 @@ export declare class MemoryStore implements Store {
|
|
|
634
675
|
* @public
|
|
635
676
|
*/
|
|
636
677
|
export declare const rateLimit: (passedOptions?: Partial<Options>) => RateLimitRequestHandler;
|
|
678
|
+
/**
|
|
679
|
+
* @deprecated these are being replaced in the next major version
|
|
680
|
+
*/
|
|
681
|
+
export declare const SECOND: number;
|
|
682
|
+
/**
|
|
683
|
+
* @deprecated these are being replaced in the next major version
|
|
684
|
+
*/
|
|
685
|
+
export declare const MINUTE: number;
|
|
686
|
+
/**
|
|
687
|
+
* @deprecated these are being replaced in the next major version
|
|
688
|
+
*/
|
|
689
|
+
export declare const HOUR: number;
|
|
690
|
+
/**
|
|
691
|
+
* @deprecated these are being replaced in the next major version
|
|
692
|
+
*/
|
|
693
|
+
export declare const DAY: number;
|
|
637
694
|
|
|
638
695
|
export {
|
|
639
696
|
rateLimit as default,
|