@mindstone/mcp-server-xero 0.1.3 → 0.2.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 -6
- package/dist/auth/token-grant.js +10 -8
- package/dist/bridge-reader.js +35 -78
- package/dist/clients/sdk-axios.js +30 -0
- package/dist/clients/xero-client.js +14 -8
- package/dist/handlers/create-xero-bank-transaction.handler.js +2 -1
- package/dist/handlers/create-xero-contact.handler.js +2 -1
- package/dist/handlers/create-xero-credit-note.handler.js +2 -1
- package/dist/handlers/create-xero-invoice.handler.js +2 -1
- package/dist/handlers/create-xero-manual-journal.handler.js +2 -1
- package/dist/handlers/create-xero-payment.handler.js +2 -1
- package/dist/handlers/create-xero-purchase-order.handler.js +2 -1
- package/dist/handlers/create-xero-quote.handler.js +2 -1
- package/dist/handlers/create-xero-tracking-category.handler.js +2 -1
- package/dist/handlers/history-handler-factory.js +2 -1
- package/dist/handlers/list-xero-accounts.handler.js +5 -5
- package/dist/handlers/list-xero-bank-transactions.handler.js +16 -9
- package/dist/handlers/list-xero-credit-notes.handler.js +14 -9
- package/dist/handlers/list-xero-invoices.handler.js +11 -18
- package/dist/handlers/list-xero-items.handler.js +6 -5
- package/dist/handlers/list-xero-manual-journals.handler.js +1 -1
- package/dist/handlers/list-xero-organisation-details.handler.js +2 -1
- package/dist/handlers/list-xero-payments.handler.js +1 -1
- package/dist/handlers/list-xero-payroll-employee-leave-balances.handler.js +2 -1
- package/dist/handlers/list-xero-payroll-employee-leave-types.handler.js +2 -1
- package/dist/handlers/list-xero-payroll-employee-leave.handler.js +2 -1
- package/dist/handlers/list-xero-payroll-leave-periods.handler.js +2 -1
- package/dist/handlers/list-xero-profit-and-loss.handler.js +8 -12
- package/dist/handlers/summarise-xero-totals.handler.js +195 -0
- package/dist/handlers/update-xero-bank-transaction.handler.js +3 -2
- package/dist/handlers/update-xero-contact.handler.js +2 -1
- package/dist/handlers/update-xero-credit-note.handler.js +2 -1
- package/dist/handlers/update-xero-invoice.handler.js +2 -1
- package/dist/handlers/update-xero-manual-journal.handler.js +2 -1
- package/dist/handlers/update-xero-quote.handler.js +2 -1
- package/dist/handlers/update-xero-tracking-category.handler.js +3 -2
- package/dist/handlers/update-xero-tracking-options.handler.js +3 -2
- package/dist/hardened-json-file.js +91 -0
- package/dist/helpers/connector-error.js +11 -0
- package/dist/helpers/contact-totals-tool.js +107 -0
- package/dist/helpers/format-error.js +41 -14
- package/dist/helpers/format-line-item.js +20 -13
- package/dist/helpers/format-report.js +28 -0
- package/dist/helpers/format-token-error.js +4 -0
- package/dist/helpers/page-note.js +6 -0
- package/dist/helpers/xero-currencies.js +2 -1
- package/dist/helpers/xero-date-where.js +27 -0
- package/dist/tools/list/index.js +5 -1
- package/dist/tools/list/list-accounts.tool.js +9 -2
- package/dist/tools/list/list-aged-payables-by-contact.tool.js +5 -18
- package/dist/tools/list/list-aged-receivables-by-contact.tool.js +5 -18
- package/dist/tools/list/list-bank-summary.tool.js +2 -8
- package/dist/tools/list/list-bank-transactions.tool.js +60 -16
- package/dist/tools/list/list-budget-summary.tool.js +2 -8
- package/dist/tools/list/list-credit-notes.tool.js +47 -12
- package/dist/tools/list/list-executive-summary.tool.js +2 -8
- package/dist/tools/list/list-invoices.tool.js +20 -20
- package/dist/tools/list/list-items.tool.js +3 -6
- package/dist/tools/list/list-manual-journals.tool.js +1 -3
- package/dist/tools/list/list-organisation-details.tool.js +15 -15
- package/dist/tools/list/list-payments.tool.js +1 -2
- package/dist/tools/list/list-payroll-employees.tool.js +1 -1
- package/dist/tools/list/list-profit-and-loss.tool.js +23 -24
- package/dist/tools/list/list-quotes.tool.js +2 -3
- package/dist/tools/list/list-report-balance-sheet.tool.js +2 -8
- package/dist/tools/list/list-trial-balance.tool.js +2 -16
- package/dist/tools/list/summarise-sales-by-customer.tool.js +9 -0
- package/dist/tools/list/summarise-spend-by-supplier.tool.js +10 -0
- package/dist/tools/sign-in.tool.js +1 -1
- 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 +1335 -637
- 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/axios/CHANGELOG.md +214 -1
- package/node_modules/axios/README.md +471 -82
- package/node_modules/axios/dist/axios.js +2009 -516
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +2174 -487
- package/node_modules/axios/dist/esm/axios.js +2174 -487
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +2410 -515
- package/node_modules/axios/index.d.cts +150 -75
- package/node_modules/axios/index.d.ts +144 -69
- package/node_modules/axios/lib/adapters/adapters.js +1 -1
- package/node_modules/axios/lib/adapters/fetch.js +272 -75
- package/node_modules/axios/lib/adapters/http.js +475 -122
- package/node_modules/axios/lib/adapters/xhr.js +173 -16
- package/node_modules/axios/lib/core/Axios.js +114 -35
- package/node_modules/axios/lib/core/AxiosError.js +105 -3
- package/node_modules/axios/lib/core/AxiosHeaders.js +151 -12
- package/node_modules/axios/lib/core/InterceptorManager.js +118 -8
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/buildFullPath.js +55 -1
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +45 -2
- package/node_modules/axios/lib/core/mergeConfig.js +203 -90
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/axios/lib/defaults/transitional.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -3
- package/node_modules/axios/lib/helpers/Http2Sessions.js +4 -1
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +12 -1
- package/node_modules/axios/lib/helpers/buildURL.js +6 -3
- package/node_modules/axios/lib/helpers/combineURLs.js +11 -3
- package/node_modules/axios/lib/helpers/composeSignals.js +18 -4
- package/node_modules/axios/lib/helpers/cookies.js +30 -2
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +156 -63
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +60 -8
- package/node_modules/axios/lib/helpers/fromDataURI.js +12 -3
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +7 -4
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/progressEventReducer.js +4 -4
- package/node_modules/axios/lib/helpers/resolveConfig.js +33 -25
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +345 -3
- package/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/axios/lib/helpers/toFormData.js +60 -30
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/utils.js +271 -23
- package/node_modules/axios/package.json +31 -30
- 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/cross-spawn/README.md +19 -3
- package/node_modules/cross-spawn/lib/parse.js +38 -10
- package/node_modules/cross-spawn/lib/util/escape.js +84 -25
- package/node_modules/cross-spawn/lib/util/readShebang.js +8 -2
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +8 -1
- package/node_modules/cross-spawn/package.json +21 -24
- 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 +90 -12
- package/node_modules/express-rate-limit/dist/index.d.cts +27 -0
- package/node_modules/express-rate-limit/dist/index.d.mts +27 -0
- package/node_modules/express-rate-limit/dist/index.d.ts +27 -0
- package/node_modules/express-rate-limit/dist/index.mjs +76 -12
- package/node_modules/express-rate-limit/{license.md → license} +7 -6
- package/node_modules/express-rate-limit/package.json +19 -16
- package/node_modules/express-rate-limit/readme.md +1 -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/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +12 -6
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/form-data/CHANGELOG.md +29 -2
- package/node_modules/form-data/README.md +4 -4
- package/node_modules/form-data/lib/form_data.js +14 -2
- package/node_modules/form-data/package.json +7 -7
- package/node_modules/hasown/CHANGELOG.md +18 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/package.json +13 -14
- 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 -30
- 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 +29 -50
- 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 +27 -42
- 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 +33 -59
- package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +27 -37
- package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +32 -53
- 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 -401
- 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 -30
- 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 +166 -117
- package/node_modules/hono/dist/cjs/middleware/combine/index.js +135 -95
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +74 -83
- 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 +161 -169
- 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 -336
- 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 +11 -26
- 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 +213 -279
- 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 -101
- package/node_modules/hono/dist/cjs/utils/mount.js +51 -0
- package/node_modules/hono/dist/cjs/utils/stream.js +88 -102
- 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 -377
- 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 -6
- 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 -99
- package/node_modules/hono/dist/middleware/combine/index.js +134 -73
- package/node_modules/hono/dist/middleware/compress/index.js +75 -63
- 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 -158
- 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 -310
- 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 +7 -2
- 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 +10 -5
- 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 +7 -2
- 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 -37
- package/node_modules/hono/dist/types/jsx/base.d.ts +43 -36
- 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 +48 -49
- 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 +17 -17
- package/node_modules/hono/dist/types/middleware/combine/index.d.ts +8 -8
- package/node_modules/hono/dist/types/middleware/compress/index.d.ts +9 -10
- 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 -286
- 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 +4 -6
- 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 +227 -272
- 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 -79
- package/node_modules/hono/dist/utils/mount.js +50 -0
- package/node_modules/hono/dist/utils/stream.js +86 -79
- 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 +116 -1
- package/node_modules/qs/README.md +107 -8
- package/node_modules/qs/dist/qs.js +28 -28
- package/node_modules/qs/eslint.config.mjs +61 -50
- package/node_modules/qs/lib/formats.js +7 -2
- package/node_modules/qs/lib/parse.js +137 -18
- package/node_modules/qs/lib/stringify.js +32 -15
- package/node_modules/qs/lib/utils.js +213 -24
- package/node_modules/qs/package.json +11 -10
- package/node_modules/qs/test/parse.js +928 -2
- package/node_modules/qs/test/stringify.js +769 -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/side-channel-list/CHANGELOG.md +25 -4
- package/node_modules/side-channel-list/index.js +1 -3
- package/node_modules/side-channel-list/package.json +8 -8
- package/node_modules/side-channel-list/test/index.js +50 -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 -702
- 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 -670
- package/node_modules/@hono/node-server/dist/listener.mjs +0 -635
- 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 -238
- package/node_modules/@hono/node-server/dist/request.mjs +0 -206
- 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 -112
- package/node_modules/@hono/node-server/dist/response.mjs +0 -85
- 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 -696
- package/node_modules/@hono/node-server/dist/server.mjs +0 -660
- 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 -677
- package/node_modules/@hono/node-server/dist/vercel.mjs +0 -640
- package/node_modules/hasown/.eslintrc +0 -5
- package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -19,6 +19,7 @@ import platform from '../platform/index.js';
|
|
|
19
19
|
import fromDataURI from '../helpers/fromDataURI.js';
|
|
20
20
|
import stream from 'stream';
|
|
21
21
|
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
22
|
+
import setFormDataHeaders from '../core/setFormDataHeaders.js';
|
|
22
23
|
import AxiosTransformStream from '../helpers/AxiosTransformStream.js';
|
|
23
24
|
import { EventEmitter } from 'events';
|
|
24
25
|
import formDataToStream from '../helpers/formDataToStream.js';
|
|
@@ -27,13 +28,14 @@ import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
|
|
|
27
28
|
import Http2Sessions from '../helpers/Http2Sessions.js';
|
|
28
29
|
import callbackify from '../helpers/callbackify.js';
|
|
29
30
|
import shouldBypassProxy from '../helpers/shouldBypassProxy.js';
|
|
31
|
+
import bind from '../helpers/bind.js';
|
|
30
32
|
import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';
|
|
31
33
|
import {
|
|
32
34
|
progressEventReducer,
|
|
33
35
|
progressEventDecorator,
|
|
34
36
|
asyncDecorator,
|
|
35
37
|
} from '../helpers/progressEventReducer.js';
|
|
36
|
-
import
|
|
38
|
+
import { estimateDataURLBufferAllocation } from '../helpers/estimateDataURLDecodedBytes.js';
|
|
37
39
|
|
|
38
40
|
const zlibOptions = {
|
|
39
41
|
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
@@ -54,30 +56,27 @@ const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
|
|
|
54
56
|
const isZstdSupported = utils.isFunction(zlib.createZstdDecompress);
|
|
55
57
|
const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : '');
|
|
56
58
|
const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : '');
|
|
59
|
+
const scheduleProgress =
|
|
60
|
+
typeof process !== 'undefined' && process.nextTick ? process.nextTick.bind(process) : utils.asap;
|
|
57
61
|
|
|
58
62
|
const { http: httpFollow, https: httpsFollow } = followRedirects;
|
|
59
63
|
|
|
60
64
|
const isHttps = /https:?/;
|
|
61
|
-
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
62
|
-
|
|
63
|
-
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
64
|
-
if (policy !== 'content-only') {
|
|
65
|
-
headers.set(formHeaders);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
70
|
-
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
71
|
-
headers.set(key, val);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
65
|
|
|
76
66
|
// Symbols used to bind a single 'error' listener to a pooled socket and track
|
|
77
67
|
// the request currently owning that socket across keep-alive reuse (issue #10780).
|
|
78
68
|
const kAxiosSocketListener = Symbol('axios.http.socketListener');
|
|
79
69
|
const kAxiosCurrentReq = Symbol('axios.http.currentReq');
|
|
80
70
|
|
|
71
|
+
// A shared listener avoids retaining an adapter context for the lifetime of a
|
|
72
|
+
// pooled socket. EventEmitter invokes listeners with `this` set to the emitter.
|
|
73
|
+
function handleSocketError(err) {
|
|
74
|
+
const current = this[kAxiosCurrentReq];
|
|
75
|
+
if (current && !current.destroyed) {
|
|
76
|
+
current.destroy(err);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
81
80
|
// Tags HttpsProxyAgent instances installed by setProxy() so the redirect path
|
|
82
81
|
// can strip them without clobbering a user-supplied agent that happens to be
|
|
83
82
|
// an HttpsProxyAgent.
|
|
@@ -89,6 +88,140 @@ const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel');
|
|
|
89
88
|
// so unbounded growth is not a concern in practice.
|
|
90
89
|
const tunnelingAgentCache = new Map();
|
|
91
90
|
const tunnelingAgentCacheUser = new WeakMap();
|
|
91
|
+
const directAgents = new WeakMap();
|
|
92
|
+
const directAgentHooks = ['createConnection', 'getName'];
|
|
93
|
+
const nativeAgentPoolHooks = [
|
|
94
|
+
'addRequest',
|
|
95
|
+
'createSocket',
|
|
96
|
+
'removeSocket',
|
|
97
|
+
'keepSocketAlive',
|
|
98
|
+
'reuseSocket',
|
|
99
|
+
'_getSession',
|
|
100
|
+
'_cacheSession',
|
|
101
|
+
'_evictSession',
|
|
102
|
+
];
|
|
103
|
+
// Minimum minor versions where Node's HTTP Agent supports native proxyEnv
|
|
104
|
+
// handling. Checking the selected agent below also covers startup modes such
|
|
105
|
+
// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.
|
|
106
|
+
const NODE_NATIVE_ENV_PROXY_SUPPORT = {
|
|
107
|
+
22: 21,
|
|
108
|
+
24: 5,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {
|
|
112
|
+
if (!nodeVersion) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const [major, minor] = nodeVersion.split('.').map((part) => Number(part));
|
|
117
|
+
|
|
118
|
+
if (!Number.isInteger(major) || !Number.isInteger(minor)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (major > 24) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major]
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {
|
|
132
|
+
if (!isNodeNativeEnvProxySupported(nodeVersion)) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const agentOptions = agent && agent.options;
|
|
137
|
+
|
|
138
|
+
return Boolean(
|
|
139
|
+
agentOptions && utils.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
|
|
144
|
+
return isHttps.test(options.protocol)
|
|
145
|
+
? configHttpsAgent || https.globalAgent
|
|
146
|
+
: configHttpAgent || http.globalAgent;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function getDirectAgent(configuredAgent, transport) {
|
|
150
|
+
if (
|
|
151
|
+
!process.allowedNodeEnvironmentFlags ||
|
|
152
|
+
!process.allowedNodeEnvironmentFlags.has('--use-env-proxy')
|
|
153
|
+
) {
|
|
154
|
+
return configuredAgent;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const agent = configuredAgent || transport.globalAgent;
|
|
158
|
+
const options = agent && agent.options;
|
|
159
|
+
if (
|
|
160
|
+
!(agent instanceof transport.Agent) ||
|
|
161
|
+
agent.protocol !== transport.globalAgent.protocol ||
|
|
162
|
+
!options ||
|
|
163
|
+
!utils.hasOwnProp(options, 'proxyEnv') ||
|
|
164
|
+
typeof options.proxyEnv !== 'object' ||
|
|
165
|
+
options.proxyEnv === null
|
|
166
|
+
) {
|
|
167
|
+
return configuredAgent;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// These hooks own pool queues or TLS session state. Neither binding them to
|
|
171
|
+
// the source agent nor copying them without subclass state preserves their
|
|
172
|
+
// behavior on a separate direct pool.
|
|
173
|
+
for (const hook of nativeAgentPoolHooks) {
|
|
174
|
+
if (
|
|
175
|
+
utils.isFunction(transport.Agent.prototype[hook]) &&
|
|
176
|
+
agent[hook] !== transport.Agent.prototype[hook]
|
|
177
|
+
) {
|
|
178
|
+
throw new AxiosError(
|
|
179
|
+
'proxy: false cannot adapt an agent overriding ' +
|
|
180
|
+
hook +
|
|
181
|
+
'; use an agent constructed without proxyEnv',
|
|
182
|
+
AxiosError.ERR_BAD_OPTION_VALUE
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Node snapshots proxyEnv when constructing the agent. Keep this check
|
|
188
|
+
// conservative even when the caller later removes protocol-specific entries.
|
|
189
|
+
let direct = directAgents.get(agent);
|
|
190
|
+
if (!direct) {
|
|
191
|
+
direct = new transport.Agent({ ...options, proxyEnv: undefined });
|
|
192
|
+
|
|
193
|
+
// Agent.destroy() does not emit an event. Keep the associated pool under
|
|
194
|
+
// the configured agent's lifetime, including agents reused after destroy().
|
|
195
|
+
const destroy = agent.destroy;
|
|
196
|
+
agent.destroy = function destroyWithDirectAgent() {
|
|
197
|
+
try {
|
|
198
|
+
return destroy.apply(this, arguments);
|
|
199
|
+
} finally {
|
|
200
|
+
direct.destroy();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
directAgents.set(agent, direct);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Connections and pool keys do not own the direct pool's queues. Preserve
|
|
207
|
+
// their configured receiver and refresh hooks that change between requests.
|
|
208
|
+
for (const hook of directAgentHooks) {
|
|
209
|
+
direct[hook] =
|
|
210
|
+
agent[hook] === transport.Agent.prototype[hook]
|
|
211
|
+
? transport.Agent.prototype[hook]
|
|
212
|
+
: bind(agent[hook], agent);
|
|
213
|
+
}
|
|
214
|
+
return direct;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function setDirectAgent(options, configHttpAgent, configHttpsAgent) {
|
|
218
|
+
const secure = isHttps.test(options.protocol);
|
|
219
|
+
const agent = getDirectAgent(secure ? configHttpsAgent : configHttpAgent, secure ? https : http);
|
|
220
|
+
options.agent = agent;
|
|
221
|
+
if (options.agents) {
|
|
222
|
+
options.agents[secure ? 'https' : 'http'] = agent;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
92
225
|
|
|
93
226
|
function getTunnelingAgent(agentOptions, userHttpsAgent) {
|
|
94
227
|
const key =
|
|
@@ -100,26 +233,29 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
|
|
|
100
233
|
'#' +
|
|
101
234
|
(agentOptions.auth || '');
|
|
102
235
|
const cache = userHttpsAgent
|
|
103
|
-
?
|
|
104
|
-
|
|
236
|
+
? tunnelingAgentCacheUser.get(userHttpsAgent) ||
|
|
237
|
+
tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent)
|
|
105
238
|
: tunnelingAgentCache;
|
|
106
239
|
let agent = cache.get(key);
|
|
107
240
|
if (agent) return agent;
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
const merged =
|
|
112
|
-
|
|
113
|
-
|
|
241
|
+
// Preserve per-request TLS options for the proxy connection, with our proxy
|
|
242
|
+
// fields taking precedence. Global-agent options belong only to the origin
|
|
243
|
+
// TLS upgrade in the callback below.
|
|
244
|
+
const merged =
|
|
245
|
+
userHttpsAgent && userHttpsAgent.options
|
|
246
|
+
? { ...userHttpsAgent.options, ...agentOptions }
|
|
247
|
+
: agentOptions;
|
|
114
248
|
agent = new HttpsProxyAgent(merged);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
249
|
+
const callback = agent.callback;
|
|
250
|
+
agent.callback = function axiosTunnelingAgentCallback(req, opts) {
|
|
251
|
+
// Without a proxy the origin TLS connection would be made by https.globalAgent,
|
|
252
|
+
// so its options have to reach the tunneled origin too. Resolved per request
|
|
253
|
+
// because the tunneling agent outlives any one of them.
|
|
254
|
+
const originTLSAgent = userHttpsAgent || https.globalAgent;
|
|
255
|
+
const originTLSOptions = originTLSAgent && originTLSAgent.options;
|
|
256
|
+
// HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
|
|
257
|
+
return callback.call(this, req, { ...originTLSOptions, ...opts });
|
|
258
|
+
};
|
|
123
259
|
agent[kAxiosInstalledTunnel] = true;
|
|
124
260
|
cache.set(key, agent);
|
|
125
261
|
return agent;
|
|
@@ -154,37 +290,82 @@ const flushOnFinish = (stream, [throttled, flush]) => {
|
|
|
154
290
|
const http2Sessions = new Http2Sessions();
|
|
155
291
|
|
|
156
292
|
/**
|
|
157
|
-
* If the proxy, auth, or config beforeRedirects functions are defined,
|
|
158
|
-
* with the options object.
|
|
293
|
+
* If the proxy, auth, sensitive header, or config beforeRedirects functions are defined,
|
|
294
|
+
* call them with the options object.
|
|
159
295
|
*
|
|
160
296
|
* @param {Object<string, any>} options - The options object that was passed to the request.
|
|
161
297
|
*
|
|
162
298
|
* @returns {Object<string, any>}
|
|
163
299
|
*/
|
|
164
300
|
function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
|
|
301
|
+
if (!isSameOriginRedirect(options, requestDetails)) {
|
|
302
|
+
stripMatchingHeaders(options.headers, new Set(['authorization', 'cookie']));
|
|
303
|
+
delete options.auth;
|
|
304
|
+
}
|
|
165
305
|
if (options.beforeRedirects.proxy) {
|
|
166
306
|
options.beforeRedirects.proxy(options);
|
|
167
307
|
}
|
|
168
308
|
if (options.beforeRedirects.auth) {
|
|
169
309
|
options.beforeRedirects.auth(options);
|
|
170
310
|
}
|
|
311
|
+
if (options.beforeRedirects.sensitiveHeaders) {
|
|
312
|
+
options.beforeRedirects.sensitiveHeaders(options, requestDetails);
|
|
313
|
+
}
|
|
314
|
+
if (options.beforeRedirects.direct) {
|
|
315
|
+
options.beforeRedirects.direct(options);
|
|
316
|
+
}
|
|
171
317
|
if (options.beforeRedirects.config) {
|
|
172
318
|
options.beforeRedirects.config(options, responseDetails, requestDetails);
|
|
173
319
|
}
|
|
174
320
|
}
|
|
175
321
|
|
|
322
|
+
function stripMatchingHeaders(headers, sensitiveSet) {
|
|
323
|
+
if (!headers) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
Object.keys(headers).forEach((header) => {
|
|
328
|
+
if (sensitiveSet.has(header.toLowerCase())) {
|
|
329
|
+
delete headers[header];
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function isSameOriginRedirect(redirectOptions, requestDetails) {
|
|
335
|
+
if (!requestDetails) {
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
try {
|
|
340
|
+
return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
|
|
341
|
+
} catch (e) {
|
|
342
|
+
// If origin comparison fails, treat the redirect as unsafe.
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
176
347
|
/**
|
|
177
348
|
* If the proxy or config afterRedirects functions are defined, call them with the options
|
|
178
349
|
*
|
|
179
350
|
* @param {http.ClientRequestArgs} options
|
|
180
351
|
* @param {AxiosProxyConfig} configProxy configuration from Axios options object
|
|
181
352
|
* @param {string} location
|
|
353
|
+
* @param {boolean} [allowEnvProxy=true] whether environment proxy configuration can be used
|
|
182
354
|
*
|
|
183
|
-
* @returns {
|
|
355
|
+
* @returns {boolean} whether a proxy applies to the selected transport
|
|
184
356
|
*/
|
|
185
|
-
function setProxy(
|
|
357
|
+
function setProxy(
|
|
358
|
+
options,
|
|
359
|
+
configProxy,
|
|
360
|
+
location,
|
|
361
|
+
isRedirect,
|
|
362
|
+
configHttpsAgent,
|
|
363
|
+
configHttpAgent,
|
|
364
|
+
allowEnvProxy = true
|
|
365
|
+
) {
|
|
186
366
|
let proxy = configProxy;
|
|
187
|
-
|
|
367
|
+
const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
|
|
368
|
+
if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
|
|
188
369
|
const proxyUrl = getProxyForUrl(location);
|
|
189
370
|
if (proxyUrl) {
|
|
190
371
|
if (!shouldBypassProxy(location)) {
|
|
@@ -210,6 +391,14 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
|
|
|
210
391
|
if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
|
|
211
392
|
options.agent = undefined;
|
|
212
393
|
}
|
|
394
|
+
if (
|
|
395
|
+
isRedirect &&
|
|
396
|
+
options.agents &&
|
|
397
|
+
options.agents.https &&
|
|
398
|
+
options.agents.https[kAxiosInstalledTunnel]
|
|
399
|
+
) {
|
|
400
|
+
options.agents.https = configHttpsAgent;
|
|
401
|
+
}
|
|
213
402
|
if (proxy) {
|
|
214
403
|
// Read proxy fields without traversing the prototype chain. URL instances expose
|
|
215
404
|
// username/password/hostname/host/port/protocol via getters on URL.prototype (so
|
|
@@ -290,7 +479,7 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
|
|
|
290
479
|
}
|
|
291
480
|
const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent);
|
|
292
481
|
// Set both: `options.agent` is consumed by the native https.request path
|
|
293
|
-
// (
|
|
482
|
+
// (maxRedirects === 0); `options.agents.https` is consumed by
|
|
294
483
|
// follow-redirects, which ignores `options.agent` when `options.agents`
|
|
295
484
|
// is present.
|
|
296
485
|
options.agent = tunnelingAgent;
|
|
@@ -335,8 +524,20 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent)
|
|
|
335
524
|
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
336
525
|
// Configure proxy for redirected request, passing the original config proxy to apply
|
|
337
526
|
// the exact same logic as if the redirected request was performed by axios directly.
|
|
338
|
-
setProxy(
|
|
527
|
+
setProxy(
|
|
528
|
+
redirectOptions,
|
|
529
|
+
configProxy,
|
|
530
|
+
redirectOptions.href,
|
|
531
|
+
true,
|
|
532
|
+
configHttpsAgent,
|
|
533
|
+
configHttpAgent,
|
|
534
|
+
allowEnvProxy
|
|
535
|
+
);
|
|
339
536
|
};
|
|
537
|
+
|
|
538
|
+
return Boolean(
|
|
539
|
+
proxy || (configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent))
|
|
540
|
+
);
|
|
340
541
|
}
|
|
341
542
|
|
|
342
543
|
const isHttpAdapterSupported =
|
|
@@ -371,7 +572,7 @@ const wrapAsync = (asyncExecutor) => {
|
|
|
371
572
|
|
|
372
573
|
const resolveFamily = ({ address, family }) => {
|
|
373
574
|
if (!utils.isString(address)) {
|
|
374
|
-
throw
|
|
575
|
+
throw new AxiosError('address must be a string', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
375
576
|
}
|
|
376
577
|
return {
|
|
377
578
|
address,
|
|
@@ -382,6 +583,43 @@ const resolveFamily = ({ address, family }) => {
|
|
|
382
583
|
const buildAddressEntry = (address, family) =>
|
|
383
584
|
resolveFamily(utils.isObject(address) ? address : { address, family });
|
|
384
585
|
|
|
586
|
+
const normalizedLookupCache = new WeakMap();
|
|
587
|
+
|
|
588
|
+
const normalizeLookup = (lookup) => {
|
|
589
|
+
let normalized = normalizedLookupCache.get(lookup);
|
|
590
|
+
|
|
591
|
+
if (normalized) {
|
|
592
|
+
return normalized;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
const callbackLookup = callbackify(lookup, (value) => (utils.isArray(value) ? value : [value]));
|
|
596
|
+
|
|
597
|
+
// Support opt.all, which is required by current Node.js releases.
|
|
598
|
+
normalized = (hostname, opt, cb) => {
|
|
599
|
+
callbackLookup(hostname, opt, (err, arg0, arg1) => {
|
|
600
|
+
if (err) {
|
|
601
|
+
return cb(err);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
let addresses;
|
|
605
|
+
|
|
606
|
+
try {
|
|
607
|
+
addresses = utils.isArray(arg0)
|
|
608
|
+
? arg0.map((addr) => buildAddressEntry(addr))
|
|
609
|
+
: [buildAddressEntry(arg0, arg1)];
|
|
610
|
+
} catch (error) {
|
|
611
|
+
return cb(error);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
615
|
+
});
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
normalizedLookupCache.set(lookup, normalized);
|
|
619
|
+
|
|
620
|
+
return normalized;
|
|
621
|
+
};
|
|
622
|
+
|
|
385
623
|
const http2Transport = {
|
|
386
624
|
request(options, cb) {
|
|
387
625
|
const authority =
|
|
@@ -434,50 +672,66 @@ const http2Transport = {
|
|
|
434
672
|
export default isHttpAdapterSupported &&
|
|
435
673
|
function httpAdapter(config) {
|
|
436
674
|
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
437
|
-
|
|
675
|
+
// Read config pollution-safely: own properties and members inherited from
|
|
676
|
+
// a non-Object.prototype source (e.g. an Object.create(defaults) template)
|
|
677
|
+
// are honored, but values injected onto a polluted Object.prototype are
|
|
678
|
+
// ignored. All behavior-affecting reads in this adapter go through own()
|
|
679
|
+
// so the protection boundary stays consistent.
|
|
680
|
+
const own = (key) => utils.getSafeProp(config, key);
|
|
438
681
|
const transitional = own('transitional') || transitionalDefaults;
|
|
439
682
|
let data = own('data');
|
|
440
683
|
let lookup = own('lookup');
|
|
441
684
|
let family = own('family');
|
|
442
685
|
let httpVersion = own('httpVersion');
|
|
443
686
|
if (httpVersion === undefined) httpVersion = 1;
|
|
687
|
+
const rawHttpVersion = httpVersion;
|
|
444
688
|
let http2Options = own('http2Options');
|
|
689
|
+
const configProxy = own('proxy');
|
|
690
|
+
const httpAgent = own('httpAgent');
|
|
691
|
+
const httpsAgent = own('httpsAgent');
|
|
445
692
|
const responseType = own('responseType');
|
|
446
693
|
const responseEncoding = own('responseEncoding');
|
|
447
|
-
const
|
|
694
|
+
const socketPath = own('socketPath');
|
|
695
|
+
const method = own('method').toUpperCase();
|
|
696
|
+
const maxRedirects = own('maxRedirects');
|
|
697
|
+
const maxBodyLength = own('maxBodyLength');
|
|
698
|
+
const maxContentLength = own('maxContentLength');
|
|
699
|
+
const decompress = own('decompress');
|
|
448
700
|
let isDone;
|
|
449
701
|
let rejected = false;
|
|
450
702
|
let req;
|
|
451
703
|
let connectPhaseTimer;
|
|
452
704
|
|
|
453
|
-
|
|
705
|
+
try {
|
|
706
|
+
httpVersion = +httpVersion;
|
|
707
|
+
} catch (err) {
|
|
708
|
+
throw new AxiosError(
|
|
709
|
+
'Invalid protocol version: value is not a number',
|
|
710
|
+
AxiosError.ERR_BAD_OPTION_VALUE,
|
|
711
|
+
config
|
|
712
|
+
);
|
|
713
|
+
}
|
|
454
714
|
|
|
455
715
|
if (Number.isNaN(httpVersion)) {
|
|
456
|
-
throw
|
|
716
|
+
throw new AxiosError(
|
|
717
|
+
`Invalid protocol version: '${rawHttpVersion}' is not a number`,
|
|
718
|
+
AxiosError.ERR_BAD_OPTION_VALUE,
|
|
719
|
+
config
|
|
720
|
+
);
|
|
457
721
|
}
|
|
458
722
|
|
|
459
723
|
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
460
|
-
throw
|
|
724
|
+
throw new AxiosError(
|
|
725
|
+
`Unsupported protocol version '${httpVersion}'`,
|
|
726
|
+
AxiosError.ERR_BAD_OPTION_VALUE,
|
|
727
|
+
config
|
|
728
|
+
);
|
|
461
729
|
}
|
|
462
730
|
|
|
463
731
|
const isHttp2 = httpVersion === 2;
|
|
464
732
|
|
|
465
733
|
if (lookup) {
|
|
466
|
-
|
|
467
|
-
// hotfix to support opt.all option which is required for node 20.x
|
|
468
|
-
lookup = (hostname, opt, cb) => {
|
|
469
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
470
|
-
if (err) {
|
|
471
|
-
return cb(err);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
const addresses = utils.isArray(arg0)
|
|
475
|
-
? arg0.map((addr) => buildAddressEntry(addr))
|
|
476
|
-
: [buildAddressEntry(arg0, arg1)];
|
|
477
|
-
|
|
478
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
479
|
-
});
|
|
480
|
-
};
|
|
734
|
+
lookup = normalizeLookup(lookup);
|
|
481
735
|
}
|
|
482
736
|
|
|
483
737
|
const abortEmitter = new EventEmitter();
|
|
@@ -501,11 +755,13 @@ export default isHttpAdapterSupported &&
|
|
|
501
755
|
}
|
|
502
756
|
|
|
503
757
|
function createTimeoutError() {
|
|
504
|
-
|
|
505
|
-
|
|
758
|
+
const configTimeout = own('timeout');
|
|
759
|
+
let timeoutErrorMessage = configTimeout
|
|
760
|
+
? 'timeout of ' + configTimeout + 'ms exceeded'
|
|
506
761
|
: 'timeout exceeded';
|
|
507
|
-
|
|
508
|
-
|
|
762
|
+
const configTimeoutErrorMessage = own('timeoutErrorMessage');
|
|
763
|
+
if (configTimeoutErrorMessage) {
|
|
764
|
+
timeoutErrorMessage = configTimeoutErrorMessage;
|
|
509
765
|
}
|
|
510
766
|
return new AxiosError(
|
|
511
767
|
timeoutErrorMessage,
|
|
@@ -561,21 +817,30 @@ export default isHttpAdapterSupported &&
|
|
|
561
817
|
});
|
|
562
818
|
|
|
563
819
|
// Parse url
|
|
564
|
-
const fullPath = buildFullPath(
|
|
565
|
-
|
|
820
|
+
const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config);
|
|
821
|
+
// Unix-socket requests (own socketPath) commonly pass a path-only url
|
|
822
|
+
// like '/foo'; supply a synthetic base so new URL() can still parse it.
|
|
823
|
+
// Use the own-property value (not config.socketPath) so a polluted
|
|
824
|
+
// prototype cannot influence URL base selection.
|
|
825
|
+
const urlBase = socketPath
|
|
826
|
+
? 'http://localhost'
|
|
827
|
+
: platform.hasBrowserEnv
|
|
828
|
+
? platform.origin
|
|
829
|
+
: undefined;
|
|
830
|
+
const parsed = new URL(fullPath, urlBase);
|
|
566
831
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
567
832
|
|
|
568
833
|
if (protocol === 'data:') {
|
|
569
834
|
// Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
|
|
570
|
-
if (
|
|
571
|
-
// Use the exact string passed to fromDataURI (
|
|
572
|
-
const dataUrl = String(
|
|
573
|
-
const estimated =
|
|
835
|
+
if (maxContentLength > -1) {
|
|
836
|
+
// Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed.
|
|
837
|
+
const dataUrl = String(own('url') || fullPath || '');
|
|
838
|
+
const estimated = estimateDataURLBufferAllocation(dataUrl);
|
|
574
839
|
|
|
575
|
-
if (estimated >
|
|
840
|
+
if (estimated > maxContentLength) {
|
|
576
841
|
return reject(
|
|
577
842
|
new AxiosError(
|
|
578
|
-
'maxContentLength size of ' +
|
|
843
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
579
844
|
AxiosError.ERR_BAD_RESPONSE,
|
|
580
845
|
config
|
|
581
846
|
)
|
|
@@ -595,13 +860,27 @@ export default isHttpAdapterSupported &&
|
|
|
595
860
|
}
|
|
596
861
|
|
|
597
862
|
try {
|
|
598
|
-
convertedData = fromDataURI(
|
|
863
|
+
convertedData = fromDataURI(own('url'), responseType === 'blob', {
|
|
599
864
|
Blob: config.env && config.env.Blob,
|
|
600
865
|
});
|
|
601
866
|
} catch (err) {
|
|
602
867
|
throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
|
|
603
868
|
}
|
|
604
869
|
|
|
870
|
+
// Check bytes before converting the result to text or a stream.
|
|
871
|
+
if (
|
|
872
|
+
maxContentLength > -1 &&
|
|
873
|
+
(responseType === 'blob' ? convertedData.size : convertedData.length) > maxContentLength
|
|
874
|
+
) {
|
|
875
|
+
return reject(
|
|
876
|
+
new AxiosError(
|
|
877
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
878
|
+
AxiosError.ERR_BAD_RESPONSE,
|
|
879
|
+
config
|
|
880
|
+
)
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
|
|
605
884
|
if (responseType === 'text') {
|
|
606
885
|
convertedData = convertedData.toString(responseEncoding);
|
|
607
886
|
|
|
@@ -695,7 +974,7 @@ export default isHttpAdapterSupported &&
|
|
|
695
974
|
// Add Content-Length header if data exists
|
|
696
975
|
headers.setContentLength(data.length, false);
|
|
697
976
|
|
|
698
|
-
if (
|
|
977
|
+
if (maxBodyLength > -1 && data.length > maxBodyLength) {
|
|
699
978
|
return reject(
|
|
700
979
|
new AxiosError(
|
|
701
980
|
'Request body larger than maxBodyLength limit',
|
|
@@ -737,7 +1016,7 @@ export default isHttpAdapterSupported &&
|
|
|
737
1016
|
data,
|
|
738
1017
|
progressEventDecorator(
|
|
739
1018
|
contentLength,
|
|
740
|
-
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
1019
|
+
progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3)
|
|
741
1020
|
)
|
|
742
1021
|
)
|
|
743
1022
|
);
|
|
@@ -747,8 +1026,8 @@ export default isHttpAdapterSupported &&
|
|
|
747
1026
|
let auth = undefined;
|
|
748
1027
|
const configAuth = own('auth');
|
|
749
1028
|
if (configAuth) {
|
|
750
|
-
const username = configAuth
|
|
751
|
-
const password = configAuth
|
|
1029
|
+
const username = utils.getSafeProp(configAuth, 'username') || '';
|
|
1030
|
+
const password = utils.getSafeProp(configAuth, 'password') || '';
|
|
752
1031
|
auth = username + ':' + password;
|
|
753
1032
|
}
|
|
754
1033
|
|
|
@@ -765,43 +1044,52 @@ export default isHttpAdapterSupported &&
|
|
|
765
1044
|
try {
|
|
766
1045
|
path = buildURL(
|
|
767
1046
|
parsed.pathname + parsed.search,
|
|
768
|
-
|
|
769
|
-
|
|
1047
|
+
own('params'),
|
|
1048
|
+
own('paramsSerializer')
|
|
770
1049
|
).replace(/^\?/, '');
|
|
771
1050
|
} catch (err) {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1051
|
+
return reject(
|
|
1052
|
+
AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {
|
|
1053
|
+
url: own('url'),
|
|
1054
|
+
exists: true,
|
|
1055
|
+
})
|
|
1056
|
+
);
|
|
777
1057
|
}
|
|
778
1058
|
|
|
779
1059
|
headers.set(
|
|
780
1060
|
'Accept-Encoding',
|
|
781
1061
|
utils.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') &&
|
|
782
|
-
|
|
1062
|
+
transitional.advertiseZstdAcceptEncoding === true
|
|
1063
|
+
? ACCEPT_ENCODING_WITH_ZSTD
|
|
1064
|
+
: ACCEPT_ENCODING,
|
|
783
1065
|
false
|
|
784
1066
|
);
|
|
785
1067
|
|
|
1068
|
+
if (isHttp2 && lookup) {
|
|
1069
|
+
http2Options = Object.assign(Object.create(null), http2Options, { lookup });
|
|
1070
|
+
}
|
|
1071
|
+
|
|
786
1072
|
// Null-prototype to block prototype pollution gadgets on properties read
|
|
787
1073
|
// directly by Node's http.request (e.g. insecureHTTPParser, lookup).
|
|
788
1074
|
const options = Object.assign(Object.create(null), {
|
|
789
1075
|
path,
|
|
790
1076
|
method: method,
|
|
791
1077
|
headers: toByteStringHeaderObject(headers),
|
|
792
|
-
agents: { http:
|
|
1078
|
+
agents: { http: httpAgent, https: httpsAgent },
|
|
793
1079
|
auth,
|
|
794
1080
|
protocol,
|
|
795
1081
|
family,
|
|
796
1082
|
beforeRedirect: dispatchBeforeRedirect,
|
|
797
1083
|
beforeRedirects: Object.create(null),
|
|
798
1084
|
http2Options,
|
|
1085
|
+
createConnection: undefined,
|
|
799
1086
|
});
|
|
800
1087
|
|
|
801
1088
|
// cacheable-lookup integration hotfix
|
|
802
1089
|
!utils.isUndefined(lookup) && (options.lookup = lookup);
|
|
803
1090
|
|
|
804
|
-
|
|
1091
|
+
let proxyApplied = false;
|
|
1092
|
+
|
|
805
1093
|
if (socketPath) {
|
|
806
1094
|
if (typeof socketPath !== 'string') {
|
|
807
1095
|
return reject(
|
|
@@ -837,12 +1125,17 @@ export default isHttpAdapterSupported &&
|
|
|
837
1125
|
? parsed.hostname.slice(1, -1)
|
|
838
1126
|
: parsed.hostname;
|
|
839
1127
|
options.port = parsed.port;
|
|
840
|
-
setProxy(
|
|
1128
|
+
proxyApplied = setProxy(
|
|
841
1129
|
options,
|
|
842
|
-
|
|
1130
|
+
configProxy,
|
|
843
1131
|
protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path,
|
|
844
1132
|
false,
|
|
845
|
-
|
|
1133
|
+
httpsAgent,
|
|
1134
|
+
httpAgent,
|
|
1135
|
+
// The HTTP/2 transport connects independently of HTTP/1 agents, so it
|
|
1136
|
+
// cannot apply either axios-resolved or agent-local environment proxies.
|
|
1137
|
+
// Explicit proxy config is still processed and rejected below.
|
|
1138
|
+
!isHttp2
|
|
846
1139
|
);
|
|
847
1140
|
}
|
|
848
1141
|
let transport;
|
|
@@ -850,22 +1143,38 @@ export default isHttpAdapterSupported &&
|
|
|
850
1143
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
851
1144
|
// Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
|
|
852
1145
|
// HTTPS target.
|
|
853
|
-
if (
|
|
854
|
-
options
|
|
1146
|
+
if (!isHttp2 && configProxy === false) {
|
|
1147
|
+
setDirectAgent(options, httpAgent, httpsAgent);
|
|
1148
|
+
options.beforeRedirects.direct = (redirectOptions) => {
|
|
1149
|
+
setDirectAgent(redirectOptions, httpAgent, httpsAgent);
|
|
1150
|
+
};
|
|
1151
|
+
} else if (options.agent == null) {
|
|
1152
|
+
options.agent = isHttpsRequest ? httpsAgent : httpAgent;
|
|
855
1153
|
}
|
|
856
1154
|
|
|
857
1155
|
if (isHttp2) {
|
|
1156
|
+
if (proxyApplied) {
|
|
1157
|
+
return reject(
|
|
1158
|
+
new AxiosError(
|
|
1159
|
+
'HTTP/2 requests with a proxy are not supported',
|
|
1160
|
+
AxiosError.ERR_NOT_SUPPORT,
|
|
1161
|
+
config
|
|
1162
|
+
)
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
858
1166
|
transport = http2Transport;
|
|
859
1167
|
} else {
|
|
860
1168
|
const configTransport = own('transport');
|
|
861
1169
|
if (configTransport) {
|
|
862
1170
|
transport = configTransport;
|
|
863
|
-
} else if (
|
|
1171
|
+
} else if (maxRedirects === 0) {
|
|
864
1172
|
transport = isHttpsRequest ? https : http;
|
|
865
1173
|
isNativeTransport = true;
|
|
866
1174
|
} else {
|
|
867
|
-
|
|
868
|
-
|
|
1175
|
+
options.sensitiveHeaders = [];
|
|
1176
|
+
if (maxRedirects) {
|
|
1177
|
+
options.maxRedirects = maxRedirects;
|
|
869
1178
|
}
|
|
870
1179
|
const configBeforeRedirect = own('beforeRedirect');
|
|
871
1180
|
if (configBeforeRedirect) {
|
|
@@ -888,14 +1197,55 @@ export default isHttpAdapterSupported &&
|
|
|
888
1197
|
}
|
|
889
1198
|
};
|
|
890
1199
|
}
|
|
1200
|
+
const sensitiveHeaders = own('sensitiveHeaders');
|
|
1201
|
+
if (sensitiveHeaders != null) {
|
|
1202
|
+
if (!utils.isArray(sensitiveHeaders)) {
|
|
1203
|
+
return reject(
|
|
1204
|
+
new AxiosError(
|
|
1205
|
+
'sensitiveHeaders must be an array of strings',
|
|
1206
|
+
AxiosError.ERR_BAD_OPTION_VALUE,
|
|
1207
|
+
config
|
|
1208
|
+
)
|
|
1209
|
+
);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
const sensitiveSet = new Set();
|
|
1213
|
+
for (const header of sensitiveHeaders) {
|
|
1214
|
+
if (!utils.isString(header)) {
|
|
1215
|
+
return reject(
|
|
1216
|
+
new AxiosError(
|
|
1217
|
+
'sensitiveHeaders must be an array of strings',
|
|
1218
|
+
AxiosError.ERR_BAD_OPTION_VALUE,
|
|
1219
|
+
config
|
|
1220
|
+
)
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
sensitiveSet.add(header.toLowerCase());
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
if (sensitiveSet.size) {
|
|
1228
|
+
options.sensitiveHeaders = Array.from(sensitiveSet);
|
|
1229
|
+
options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(
|
|
1230
|
+
redirectOptions,
|
|
1231
|
+
requestDetails
|
|
1232
|
+
) {
|
|
1233
|
+
if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
|
|
1234
|
+
stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
|
|
1235
|
+
}
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
891
1239
|
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
892
1240
|
}
|
|
893
1241
|
}
|
|
894
1242
|
|
|
895
|
-
|
|
896
|
-
|
|
1243
|
+
// Set an explicit maxBodyLength option for transports that inspect it.
|
|
1244
|
+
// When maxBodyLength is -1 (default/unlimited), use Infinity so
|
|
1245
|
+
// follow-redirects does not fall back to its own 10MB default.
|
|
1246
|
+
if (maxBodyLength > -1) {
|
|
1247
|
+
options.maxBodyLength = maxBodyLength;
|
|
897
1248
|
} else {
|
|
898
|
-
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
|
|
899
1249
|
options.maxBodyLength = Infinity;
|
|
900
1250
|
}
|
|
901
1251
|
|
|
@@ -926,7 +1276,11 @@ export default isHttpAdapterSupported &&
|
|
|
926
1276
|
transformStream,
|
|
927
1277
|
progressEventDecorator(
|
|
928
1278
|
responseLength,
|
|
929
|
-
progressEventReducer(
|
|
1279
|
+
progressEventReducer(
|
|
1280
|
+
asyncDecorator(onDownloadProgress, scheduleProgress),
|
|
1281
|
+
true,
|
|
1282
|
+
3
|
|
1283
|
+
)
|
|
930
1284
|
)
|
|
931
1285
|
)
|
|
932
1286
|
);
|
|
@@ -941,7 +1295,7 @@ export default isHttpAdapterSupported &&
|
|
|
941
1295
|
const lastRequest = res.req || req;
|
|
942
1296
|
|
|
943
1297
|
// if decompress disabled we should not decompress
|
|
944
|
-
if (
|
|
1298
|
+
if (decompress !== false && res.headers['content-encoding']) {
|
|
945
1299
|
// if no content, but headers still say that it is encoded,
|
|
946
1300
|
// remove the header not confuse downstream operations
|
|
947
1301
|
if (method === 'HEAD' || res.statusCode === 204) {
|
|
@@ -997,8 +1351,8 @@ export default isHttpAdapterSupported &&
|
|
|
997
1351
|
if (responseType === 'stream') {
|
|
998
1352
|
// Enforce maxContentLength on streamed responses; previously this
|
|
999
1353
|
// was applied only to buffered responses.
|
|
1000
|
-
if (
|
|
1001
|
-
const limit =
|
|
1354
|
+
if (maxContentLength > -1) {
|
|
1355
|
+
const limit = maxContentLength;
|
|
1002
1356
|
const source = responseStream;
|
|
1003
1357
|
async function* enforceMaxContentLength() {
|
|
1004
1358
|
let totalResponseBytes = 0;
|
|
@@ -1030,13 +1384,13 @@ export default isHttpAdapterSupported &&
|
|
|
1030
1384
|
totalResponseBytes += chunk.length;
|
|
1031
1385
|
|
|
1032
1386
|
// make sure the content length is not over the maxContentLength if specified
|
|
1033
|
-
if (
|
|
1387
|
+
if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
|
|
1034
1388
|
// stream.destroy() emit aborted event before calling reject() on Node.js v16
|
|
1035
1389
|
rejected = true;
|
|
1036
1390
|
responseStream.destroy();
|
|
1037
1391
|
abort(
|
|
1038
1392
|
new AxiosError(
|
|
1039
|
-
'maxContentLength size of ' +
|
|
1393
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
1040
1394
|
AxiosError.ERR_BAD_RESPONSE,
|
|
1041
1395
|
config,
|
|
1042
1396
|
lastRequest
|
|
@@ -1118,20 +1472,16 @@ export default isHttpAdapterSupported &&
|
|
|
1118
1472
|
|
|
1119
1473
|
req.on('socket', function handleRequestSocket(socket) {
|
|
1120
1474
|
// default interval of sending ack packet is 1 minute
|
|
1121
|
-
|
|
1475
|
+
// proxy agents (e.g. agent-base) may return a generic Duplex stream
|
|
1476
|
+
// that doesn't have setKeepAlive, so guard before calling
|
|
1477
|
+
if (typeof socket.setKeepAlive === 'function') {
|
|
1478
|
+
socket.setKeepAlive(true, 1000 * 60);
|
|
1479
|
+
}
|
|
1122
1480
|
|
|
1123
|
-
// Install
|
|
1124
|
-
//
|
|
1125
|
-
// to new requests before the previous request's 'close' fires (issue #10780).
|
|
1126
|
-
// The listener is bound to the socket's currently-active request via a
|
|
1127
|
-
// symbol, which is swapped as the socket is reassigned.
|
|
1481
|
+
// Install one shared 'error' listener per socket. The symbol follows the
|
|
1482
|
+
// currently-active request as pooled sockets are reassigned (issue #10780).
|
|
1128
1483
|
if (!socket[kAxiosSocketListener]) {
|
|
1129
|
-
socket.on('error',
|
|
1130
|
-
const current = socket[kAxiosCurrentReq];
|
|
1131
|
-
if (current && !current.destroyed) {
|
|
1132
|
-
current.destroy(err);
|
|
1133
|
-
}
|
|
1134
|
-
});
|
|
1484
|
+
socket.on('error', handleSocketError);
|
|
1135
1485
|
socket[kAxiosSocketListener] = true;
|
|
1136
1486
|
}
|
|
1137
1487
|
|
|
@@ -1151,9 +1501,9 @@ export default isHttpAdapterSupported &&
|
|
|
1151
1501
|
});
|
|
1152
1502
|
|
|
1153
1503
|
// Handle request timeout
|
|
1154
|
-
if (
|
|
1504
|
+
if (own('timeout')) {
|
|
1155
1505
|
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
1156
|
-
const timeout = parseInt(
|
|
1506
|
+
const timeout = parseInt(own('timeout'), 10);
|
|
1157
1507
|
|
|
1158
1508
|
if (Number.isNaN(timeout)) {
|
|
1159
1509
|
abort(
|
|
@@ -1211,12 +1561,11 @@ export default isHttpAdapterSupported &&
|
|
|
1211
1561
|
}
|
|
1212
1562
|
});
|
|
1213
1563
|
|
|
1214
|
-
//
|
|
1215
|
-
// transport
|
|
1216
|
-
// other path.
|
|
1564
|
+
// Transform decodes string chunks to Buffers before counting, so every
|
|
1565
|
+
// transport receives at most maxBodyLength encoded bytes.
|
|
1217
1566
|
let uploadStream = data;
|
|
1218
|
-
if (
|
|
1219
|
-
const limit =
|
|
1567
|
+
if (maxBodyLength > -1) {
|
|
1568
|
+
const limit = maxBodyLength;
|
|
1220
1569
|
let bytesSent = 0;
|
|
1221
1570
|
uploadStream = stream.pipeline(
|
|
1222
1571
|
[
|
|
@@ -1254,3 +1603,7 @@ export default isHttpAdapterSupported &&
|
|
|
1254
1603
|
};
|
|
1255
1604
|
|
|
1256
1605
|
export const __setProxy = setProxy;
|
|
1606
|
+
export const __getDirectAgent = getDirectAgent;
|
|
1607
|
+
export const __isNodeNativeEnvProxySupported = isNodeNativeEnvProxySupported;
|
|
1608
|
+
export const __isNodeEnvProxyEnabled = isNodeEnvProxyEnabled;
|
|
1609
|
+
export const __isSameOriginRedirect = isSameOriginRedirect;
|