@mindstone/mcp-server-xero 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-organisation-details.handler.js +2 -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 +1 -1
- 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/format-error.js +41 -14
- package/dist/helpers/format-token-error.js +4 -0
- package/dist/helpers/xero-currencies.js +2 -1
- 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/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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Axios v1.
|
|
1
|
+
/*! Axios v1.21.1 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -427,15 +427,15 @@
|
|
|
427
427
|
function _toConsumableArray(r) {
|
|
428
428
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
429
429
|
}
|
|
430
|
-
function _toPrimitive(t,
|
|
430
|
+
function _toPrimitive(t, e) {
|
|
431
431
|
if ("object" != typeof t || !t) return t;
|
|
432
|
-
var
|
|
433
|
-
if (void 0 !==
|
|
434
|
-
var i =
|
|
432
|
+
var r;
|
|
433
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
434
|
+
var i = r.call(t, e);
|
|
435
435
|
if ("object" != typeof i) return i;
|
|
436
436
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
437
437
|
}
|
|
438
|
-
return ("string" ===
|
|
438
|
+
return ("string" === e ? String : Number)(t);
|
|
439
439
|
}
|
|
440
440
|
function _toPropertyKey(t) {
|
|
441
441
|
var i = _toPrimitive(t, "string");
|
|
@@ -463,55 +463,42 @@
|
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
465
|
function AsyncGenerator(e) {
|
|
466
|
-
var
|
|
467
|
-
function resume(
|
|
466
|
+
var t, n;
|
|
467
|
+
function resume(t, n) {
|
|
468
468
|
try {
|
|
469
|
-
var
|
|
470
|
-
o =
|
|
469
|
+
var r = e[t](n),
|
|
470
|
+
o = r.value,
|
|
471
471
|
u = o instanceof _OverloadYield;
|
|
472
|
-
Promise.resolve(u ? o.v : o).then(function (
|
|
472
|
+
Promise.resolve(u ? o.v : o).then(function (n) {
|
|
473
473
|
if (u) {
|
|
474
|
-
var i = "return" ===
|
|
475
|
-
if (!o.k ||
|
|
476
|
-
|
|
474
|
+
var i = "return" === t && o.k ? t : "next";
|
|
475
|
+
if (!o.k || n.done) return resume(i, n);
|
|
476
|
+
n = e[i](n).value;
|
|
477
477
|
}
|
|
478
|
-
settle(
|
|
478
|
+
settle(!!r.done, n);
|
|
479
479
|
}, function (e) {
|
|
480
480
|
resume("throw", e);
|
|
481
481
|
});
|
|
482
482
|
} catch (e) {
|
|
483
|
-
settle(
|
|
483
|
+
settle(2, e);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function settle(e,
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
done: true
|
|
492
|
-
});
|
|
493
|
-
break;
|
|
494
|
-
case "throw":
|
|
495
|
-
r.reject(n);
|
|
496
|
-
break;
|
|
497
|
-
default:
|
|
498
|
-
r.resolve({
|
|
499
|
-
value: n,
|
|
500
|
-
done: false
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
486
|
+
function settle(e, r) {
|
|
487
|
+
2 === e ? t.reject(r) : t.resolve({
|
|
488
|
+
value: r,
|
|
489
|
+
done: e
|
|
490
|
+
}), (t = t.next) ? resume(t.key, t.arg) : n = null;
|
|
504
491
|
}
|
|
505
|
-
this._invoke = function (e,
|
|
492
|
+
this._invoke = function (e, r) {
|
|
506
493
|
return new Promise(function (o, u) {
|
|
507
494
|
var i = {
|
|
508
495
|
key: e,
|
|
509
|
-
arg:
|
|
496
|
+
arg: r,
|
|
510
497
|
resolve: o,
|
|
511
498
|
reject: u,
|
|
512
499
|
next: null
|
|
513
500
|
};
|
|
514
|
-
|
|
501
|
+
n ? n = n.next = i : (t = n = i, resume(e, r));
|
|
515
502
|
});
|
|
516
503
|
}, "function" != typeof e.return && (this.return = void 0);
|
|
517
504
|
}
|
|
@@ -566,6 +553,168 @@
|
|
|
566
553
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
567
554
|
var iterator = Symbol.iterator,
|
|
568
555
|
toStringTag = Symbol.toStringTag;
|
|
556
|
+
|
|
557
|
+
/* Creating a function that will check if an object has a property. */
|
|
558
|
+
var hasOwnProperty = function (_ref) {
|
|
559
|
+
var hasOwnProperty = _ref.hasOwnProperty;
|
|
560
|
+
return function (obj, prop) {
|
|
561
|
+
return hasOwnProperty.call(obj, prop);
|
|
562
|
+
};
|
|
563
|
+
}(Object.prototype);
|
|
564
|
+
var isUnsafeObjectKey = function isUnsafeObjectKey(prop) {
|
|
565
|
+
return typeof prop === 'string' && (prop === '__proto__' || prop === 'constructor' || prop === 'prototype');
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Determine whether an inherited object must be treated as a shared-prototype
|
|
570
|
+
* boundary. Cross-realm Object.prototype objects cannot be distinguished
|
|
571
|
+
* reliably from application-created null-prototype objects because their
|
|
572
|
+
* properties are mutable, so all inherited terminal prototypes are excluded
|
|
573
|
+
* as a fail-closed boundary. A null-prototype source still keeps its own
|
|
574
|
+
* properties, as produced by mergeConfig and other safe materialization paths.
|
|
575
|
+
*
|
|
576
|
+
* @param {*} obj The object to inspect
|
|
577
|
+
* @param {*} prototype The object's prototype
|
|
578
|
+
* @param {boolean} source Whether obj is the original traversal source
|
|
579
|
+
*
|
|
580
|
+
* @returns {boolean} True when obj is a safe prototype traversal boundary
|
|
581
|
+
*/
|
|
582
|
+
var isPrototypeBoundary = function isPrototypeBoundary(obj, prototype, source) {
|
|
583
|
+
return obj === Object.prototype || !source && prototype === null;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Determine whether an object can retain its identity through code paths that
|
|
588
|
+
* add, replace, and remove config properties without bypassing unsafe-key
|
|
589
|
+
* filtering. Immutable objects, unsafe-key-bearing objects, and objects with
|
|
590
|
+
* accessor or restricted data properties must be materialized instead.
|
|
591
|
+
*
|
|
592
|
+
* @param {*} obj The object to inspect
|
|
593
|
+
*
|
|
594
|
+
* @returns {boolean} True when every own property is safe and fully mutable
|
|
595
|
+
*/
|
|
596
|
+
var isSafeAndFullyMutable = function isSafeAndFullyMutable(obj) {
|
|
597
|
+
if (!Object.isExtensible(obj)) {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
var props = Object.getOwnPropertyNames(obj);
|
|
601
|
+
if (Object.getOwnPropertySymbols) {
|
|
602
|
+
props.push.apply(props, _toConsumableArray(Object.getOwnPropertySymbols(obj)));
|
|
603
|
+
}
|
|
604
|
+
return props.every(function (prop) {
|
|
605
|
+
if (isUnsafeObjectKey(prop)) {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
609
|
+
return !!descriptor && descriptor.configurable && descriptor.writable === true;
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Walk the prototype chain (excluding the source realm's Object.prototype)
|
|
615
|
+
* looking for an own `prop`. This distinguishes genuine own/inherited members
|
|
616
|
+
* — including class accessors and template prototypes — from members injected
|
|
617
|
+
* via Object.prototype pollution (e.g. `Object.prototype.username = '...'`),
|
|
618
|
+
* which live on Object.prototype itself and are therefore never matched.
|
|
619
|
+
*
|
|
620
|
+
* @param {*} thing The value whose chain to inspect
|
|
621
|
+
* @param {string|symbol} prop The property key to look for
|
|
622
|
+
*
|
|
623
|
+
* @returns {boolean} True when `prop` is owned below Object.prototype
|
|
624
|
+
*/
|
|
625
|
+
var hasOwnInPrototypeChain = function hasOwnInPrototypeChain(thing, prop) {
|
|
626
|
+
var obj = thing;
|
|
627
|
+
var seen = [];
|
|
628
|
+
while (obj != null) {
|
|
629
|
+
if (seen.indexOf(obj) !== -1) {
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
seen.push(obj);
|
|
633
|
+
var prototype = getPrototypeOf(obj);
|
|
634
|
+
if (isPrototypeBoundary(obj, prototype, obj === thing)) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
if (hasOwnProperty(obj, prop)) {
|
|
638
|
+
return true;
|
|
639
|
+
}
|
|
640
|
+
obj = prototype;
|
|
641
|
+
}
|
|
642
|
+
return false;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
|
|
647
|
+
* properties and members inherited from a non-Object.prototype source (a class
|
|
648
|
+
* instance or template object) are honored; a value reachable only through a
|
|
649
|
+
* polluted Object.prototype is ignored and `undefined` is returned.
|
|
650
|
+
*
|
|
651
|
+
* @param {*} obj The source object
|
|
652
|
+
* @param {string|symbol} prop The property key to read
|
|
653
|
+
*
|
|
654
|
+
* @returns {*} The resolved value, or undefined when unsafe/absent
|
|
655
|
+
*/
|
|
656
|
+
var getSafeProp = function getSafeProp(obj, prop) {
|
|
657
|
+
return obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Flatten an object and its application-defined prototype chain into a
|
|
662
|
+
* null-prototype object. Members inherited only from the source realm's
|
|
663
|
+
* Object.prototype are deliberately excluded, while class/template members
|
|
664
|
+
* below that boundary are preserved.
|
|
665
|
+
*
|
|
666
|
+
* @param {*} thing The value to flatten
|
|
667
|
+
*
|
|
668
|
+
* @returns {*} A null-prototype copy, or the original value when it is already
|
|
669
|
+
* structurally safe or is not an object
|
|
670
|
+
*/
|
|
671
|
+
var toSafeFlatObject = function toSafeFlatObject(thing) {
|
|
672
|
+
if (thing == null || _typeof(thing) !== 'object' && typeof thing !== 'function') {
|
|
673
|
+
return thing;
|
|
674
|
+
}
|
|
675
|
+
var sourcePrototype = getPrototypeOf(thing);
|
|
676
|
+
if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {
|
|
677
|
+
return thing;
|
|
678
|
+
}
|
|
679
|
+
var result = Object.create(null);
|
|
680
|
+
var merged = Object.create(null);
|
|
681
|
+
var seen = [];
|
|
682
|
+
var current = thing;
|
|
683
|
+
while (current != null) {
|
|
684
|
+
if (seen.indexOf(current) !== -1) {
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
seen.push(current);
|
|
688
|
+
var prototype = current === thing ? sourcePrototype : getPrototypeOf(current);
|
|
689
|
+
if (isPrototypeBoundary(current, prototype, current === thing)) {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
var props = Object.getOwnPropertyNames(current);
|
|
693
|
+
if (Object.getOwnPropertySymbols) {
|
|
694
|
+
props.push.apply(props, _toConsumableArray(Object.getOwnPropertySymbols(current)));
|
|
695
|
+
}
|
|
696
|
+
var _iterator2 = _createForOfIteratorHelper(props),
|
|
697
|
+
_step;
|
|
698
|
+
try {
|
|
699
|
+
for (_iterator2.s(); !(_step = _iterator2.n()).done;) {
|
|
700
|
+
var prop = _step.value;
|
|
701
|
+
if (isUnsafeObjectKey(prop)) {
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
if (!hasOwnProperty(merged, prop)) {
|
|
705
|
+
result[prop] = thing[prop];
|
|
706
|
+
merged[prop] = true;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
} catch (err) {
|
|
710
|
+
_iterator2.e(err);
|
|
711
|
+
} finally {
|
|
712
|
+
_iterator2.f();
|
|
713
|
+
}
|
|
714
|
+
current = prototype;
|
|
715
|
+
}
|
|
716
|
+
return result;
|
|
717
|
+
};
|
|
569
718
|
var kindOf = function (cache) {
|
|
570
719
|
return function (thing) {
|
|
571
720
|
var str = toString.call(thing);
|
|
@@ -694,11 +843,21 @@
|
|
|
694
843
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
695
844
|
*/
|
|
696
845
|
var isPlainObject = function isPlainObject(val) {
|
|
697
|
-
if (
|
|
846
|
+
if (!isObject(val)) {
|
|
698
847
|
return false;
|
|
699
848
|
}
|
|
700
849
|
var prototype = getPrototypeOf(val);
|
|
701
|
-
return (prototype === null || prototype === Object.prototype ||
|
|
850
|
+
return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && (
|
|
851
|
+
// Treat own Symbol.toStringTag or Symbol.iterator members as evidence the
|
|
852
|
+
// value is tagged/iterable, ignoring members reachable only through shared
|
|
853
|
+
// or terminal prototype boundaries. This is exactly what
|
|
854
|
+
// hasOwnInPrototypeChain(val, prop) computes here: every prototype admitted
|
|
855
|
+
// above (null, Object.prototype, or a terminal null-prototype template) is
|
|
856
|
+
// a boundary, so the walk never inspects anything but `val`'s own members,
|
|
857
|
+
// and stops before even those when `val` is itself the boundary
|
|
858
|
+
// Object.prototype. Checking that inline avoids allocating the walker's
|
|
859
|
+
// `seen` list twice per call on the mergeConfig / merge hot path.
|
|
860
|
+
isPrototypeBoundary(val, prototype, true) || !hasOwnProperty(val, toStringTag) && !hasOwnProperty(val, iterator));
|
|
702
861
|
};
|
|
703
862
|
|
|
704
863
|
/**
|
|
@@ -783,6 +942,7 @@
|
|
|
783
942
|
* @returns {boolean} True if value is a FileList, otherwise false
|
|
784
943
|
*/
|
|
785
944
|
var isFileList = kindOfTest('FileList');
|
|
945
|
+
var isSet = kindOfTest('Set');
|
|
786
946
|
|
|
787
947
|
/**
|
|
788
948
|
* Determine if a value is a Stream
|
|
@@ -866,9 +1026,9 @@
|
|
|
866
1026
|
* @returns {any}
|
|
867
1027
|
*/
|
|
868
1028
|
function forEach(obj, fn) {
|
|
869
|
-
var
|
|
870
|
-
|
|
871
|
-
allOwnKeys =
|
|
1029
|
+
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
1030
|
+
_ref2$allOwnKeys = _ref2.allOwnKeys,
|
|
1031
|
+
allOwnKeys = _ref2$allOwnKeys === void 0 ? false : _ref2$allOwnKeys;
|
|
872
1032
|
// Don't bother if no value provided
|
|
873
1033
|
if (obj === null || typeof obj === 'undefined') {
|
|
874
1034
|
return;
|
|
@@ -955,19 +1115,33 @@
|
|
|
955
1115
|
* @returns {Object} Result of all merge properties
|
|
956
1116
|
*/
|
|
957
1117
|
function merge() {
|
|
958
|
-
var
|
|
959
|
-
caseless =
|
|
960
|
-
skipUndefined =
|
|
1118
|
+
var _ref3 = isContextDefined(this) && this || {},
|
|
1119
|
+
caseless = _ref3.caseless,
|
|
1120
|
+
skipUndefined = _ref3.skipUndefined;
|
|
961
1121
|
var result = {};
|
|
1122
|
+
// Caseless lookup only applies to string keys — symbol keys are
|
|
1123
|
+
// identity-matched. Every string key that reaches `result` passes through
|
|
1124
|
+
// this index first, so it can never hold two case variants of one key and a
|
|
1125
|
+
// lowercase -> key map is exactly what findKey(result, key) would rescan
|
|
1126
|
+
// Object.keys(result) for on each assignment.
|
|
1127
|
+
var lowerCaseKeys = caseless ? Object.create(null) : null;
|
|
962
1128
|
var assignValue = function assignValue(val, key) {
|
|
963
1129
|
// Skip dangerous property names to prevent prototype pollution
|
|
964
1130
|
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
965
1131
|
return;
|
|
966
1132
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1133
|
+
var targetKey = key;
|
|
1134
|
+
if (lowerCaseKeys && typeof key === 'string') {
|
|
1135
|
+
var lowerKey = key.toLowerCase();
|
|
1136
|
+
var knownKey = lowerCaseKeys[lowerKey];
|
|
1137
|
+
// A key recorded but absent from `result` was skipped by skipUndefined;
|
|
1138
|
+
// the later spelling wins then, as it does for findKey.
|
|
1139
|
+
if (knownKey !== undefined && hasOwnProperty(result, knownKey)) {
|
|
1140
|
+
targetKey = knownKey;
|
|
1141
|
+
} else {
|
|
1142
|
+
lowerCaseKeys[lowerKey] = key;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
971
1145
|
// Read via own-prop only — a bare `result[targetKey]` walks the prototype
|
|
972
1146
|
// chain, so a polluted Object.prototype value could surface here and get
|
|
973
1147
|
// copied into the merged result.
|
|
@@ -988,7 +1162,7 @@
|
|
|
988
1162
|
continue;
|
|
989
1163
|
}
|
|
990
1164
|
forEach(source, assignValue);
|
|
991
|
-
if (_typeof(source) !== 'object' || isArray(source)) {
|
|
1165
|
+
if (_typeof(source) !== 'object' || isArray(source) || !Object.getOwnPropertySymbols) {
|
|
992
1166
|
continue;
|
|
993
1167
|
}
|
|
994
1168
|
var symbols = Object.getOwnPropertySymbols(source);
|
|
@@ -1014,8 +1188,8 @@
|
|
|
1014
1188
|
* @returns {Object} The resulting value of object a
|
|
1015
1189
|
*/
|
|
1016
1190
|
var extend = function extend(a, b, thisArg) {
|
|
1017
|
-
var
|
|
1018
|
-
allOwnKeys =
|
|
1191
|
+
var _ref4 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
|
1192
|
+
allOwnKeys = _ref4.allOwnKeys;
|
|
1019
1193
|
forEach(b, function (val, key) {
|
|
1020
1194
|
if (thisArg && isFunction$1(val)) {
|
|
1021
1195
|
Object.defineProperty(a, key, {
|
|
@@ -1143,7 +1317,27 @@
|
|
|
1143
1317
|
if (!thing) return null;
|
|
1144
1318
|
if (isArray(thing)) return thing;
|
|
1145
1319
|
var i = thing.length;
|
|
1146
|
-
if (!
|
|
1320
|
+
if (!Number.isSafeInteger(i) || i < 0 || i > 0xffffffff) return null;
|
|
1321
|
+
|
|
1322
|
+
// Bound the copy by actual indexed properties, including hidden and inherited
|
|
1323
|
+
// members of array-like collections, rather than by the declared length alone.
|
|
1324
|
+
var indexes = new Set();
|
|
1325
|
+
var seen = new Set();
|
|
1326
|
+
var source = thing;
|
|
1327
|
+
while (source != null && indexes.size < i) {
|
|
1328
|
+
if (seen.has(source)) return null;
|
|
1329
|
+
seen.add(source);
|
|
1330
|
+
var prototype = getPrototypeOf(source);
|
|
1331
|
+
if (isPrototypeBoundary(source, prototype, source === thing)) break;
|
|
1332
|
+
Object.getOwnPropertyNames(source).forEach(function (key) {
|
|
1333
|
+
var index = +key;
|
|
1334
|
+
if (Number.isInteger(index) && index >= 0 && index < i && String(index) === key && hasOwnProperty(source, key)) {
|
|
1335
|
+
indexes.add(index);
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1338
|
+
source = prototype;
|
|
1339
|
+
}
|
|
1340
|
+
if (indexes.size !== i) return null;
|
|
1147
1341
|
var arr = new Array(i);
|
|
1148
1342
|
while (i-- > 0) {
|
|
1149
1343
|
arr[i] = thing[i];
|
|
@@ -1209,14 +1403,6 @@
|
|
|
1209
1403
|
return p1.toUpperCase() + p2;
|
|
1210
1404
|
});
|
|
1211
1405
|
};
|
|
1212
|
-
|
|
1213
|
-
/* Creating a function that will check if an object has a property. */
|
|
1214
|
-
var hasOwnProperty = function (_ref4) {
|
|
1215
|
-
var hasOwnProperty = _ref4.hasOwnProperty;
|
|
1216
|
-
return function (obj, prop) {
|
|
1217
|
-
return hasOwnProperty.call(obj, prop);
|
|
1218
|
-
};
|
|
1219
|
-
}(Object.prototype);
|
|
1220
1406
|
var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1221
1407
|
|
|
1222
1408
|
/**
|
|
@@ -1320,11 +1506,29 @@
|
|
|
1320
1506
|
if (!('toJSON' in source)) {
|
|
1321
1507
|
// add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
|
|
1322
1508
|
visited.add(source);
|
|
1323
|
-
var target
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1509
|
+
var target;
|
|
1510
|
+
if (isSet(source)) {
|
|
1511
|
+
target = [];
|
|
1512
|
+
var _iterator3 = _createForOfIteratorHelper(source),
|
|
1513
|
+
_step2;
|
|
1514
|
+
try {
|
|
1515
|
+
for (_iterator3.s(); !(_step2 = _iterator3.n()).done;) {
|
|
1516
|
+
var value = _step2.value;
|
|
1517
|
+
var reducedValue = _visit(value);
|
|
1518
|
+
!isUndefined(reducedValue) && target.push(reducedValue);
|
|
1519
|
+
}
|
|
1520
|
+
} catch (err) {
|
|
1521
|
+
_iterator3.e(err);
|
|
1522
|
+
} finally {
|
|
1523
|
+
_iterator3.f();
|
|
1524
|
+
}
|
|
1525
|
+
} else {
|
|
1526
|
+
target = isArray(source) ? [] : {};
|
|
1527
|
+
forEach(source, function (value, key) {
|
|
1528
|
+
var reducedValue = _visit(value);
|
|
1529
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1328
1532
|
visited["delete"](source);
|
|
1329
1533
|
return target;
|
|
1330
1534
|
}
|
|
@@ -1397,6 +1601,21 @@
|
|
|
1397
1601
|
var isIterable = function isIterable(thing) {
|
|
1398
1602
|
return thing != null && isFunction$1(thing[iterator]);
|
|
1399
1603
|
};
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* Determine if a value is iterable via an iterator that is NOT sourced solely
|
|
1607
|
+
* from a polluted Object.prototype. Use this instead of `isIterable` whenever
|
|
1608
|
+
* the iterable comes from untrusted input (e.g. user-supplied header sources),
|
|
1609
|
+
* so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
|
|
1610
|
+
* into an attacker-controlled entries iterator.
|
|
1611
|
+
*
|
|
1612
|
+
* @param {*} thing The value to test
|
|
1613
|
+
*
|
|
1614
|
+
* @returns {boolean} True if value has a non-polluted iterator
|
|
1615
|
+
*/
|
|
1616
|
+
var isSafeIterable = function isSafeIterable(thing) {
|
|
1617
|
+
return thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
|
|
1618
|
+
};
|
|
1400
1619
|
var utils$1 = {
|
|
1401
1620
|
isArray: isArray,
|
|
1402
1621
|
isArrayBuffer: isArrayBuffer,
|
|
@@ -1442,6 +1661,9 @@
|
|
|
1442
1661
|
hasOwnProperty: hasOwnProperty,
|
|
1443
1662
|
hasOwnProp: hasOwnProperty,
|
|
1444
1663
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1664
|
+
hasOwnInPrototypeChain: hasOwnInPrototypeChain,
|
|
1665
|
+
getSafeProp: getSafeProp,
|
|
1666
|
+
toSafeFlatObject: toSafeFlatObject,
|
|
1445
1667
|
reduceDescriptors: reduceDescriptors,
|
|
1446
1668
|
freezeMethods: freezeMethods,
|
|
1447
1669
|
toObjectSet: toObjectSet,
|
|
@@ -1457,7 +1679,8 @@
|
|
|
1457
1679
|
isThenable: isThenable,
|
|
1458
1680
|
setImmediate: _setImmediate,
|
|
1459
1681
|
asap: asap,
|
|
1460
|
-
isIterable: isIterable
|
|
1682
|
+
isIterable: isIterable,
|
|
1683
|
+
isSafeIterable: isSafeIterable
|
|
1461
1684
|
};
|
|
1462
1685
|
|
|
1463
1686
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
@@ -1479,7 +1702,8 @@
|
|
|
1479
1702
|
* @returns {Object} Headers parsed into an object
|
|
1480
1703
|
*/
|
|
1481
1704
|
var parseHeaders = (function (rawHeaders) {
|
|
1482
|
-
|
|
1705
|
+
// Header names are data, including __proto__; avoid inherited setters.
|
|
1706
|
+
var parsed = Object.create(null);
|
|
1483
1707
|
var key;
|
|
1484
1708
|
var val;
|
|
1485
1709
|
var i;
|
|
@@ -1487,17 +1711,18 @@
|
|
|
1487
1711
|
i = line.indexOf(':');
|
|
1488
1712
|
key = line.substring(0, i).trim().toLowerCase();
|
|
1489
1713
|
val = line.substring(i + 1).trim();
|
|
1490
|
-
|
|
1714
|
+
var hasKey = utils$1.hasOwnProp(parsed, key);
|
|
1715
|
+
if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) {
|
|
1491
1716
|
return;
|
|
1492
1717
|
}
|
|
1493
1718
|
if (key === 'set-cookie') {
|
|
1494
|
-
if (
|
|
1719
|
+
if (hasKey) {
|
|
1495
1720
|
parsed[key].push(val);
|
|
1496
1721
|
} else {
|
|
1497
1722
|
parsed[key] = [val];
|
|
1498
1723
|
}
|
|
1499
1724
|
} else {
|
|
1500
|
-
parsed[key] =
|
|
1725
|
+
parsed[key] = hasKey ? parsed[key] + ', ' + val : val;
|
|
1501
1726
|
}
|
|
1502
1727
|
});
|
|
1503
1728
|
return parsed;
|
|
@@ -1550,7 +1775,7 @@
|
|
|
1550
1775
|
return byteStringHeaders;
|
|
1551
1776
|
}
|
|
1552
1777
|
|
|
1553
|
-
var $internals = Symbol('internals');
|
|
1778
|
+
var $internals$1 = Symbol('internals');
|
|
1554
1779
|
function normalizeHeader(header) {
|
|
1555
1780
|
return header && String(header).trim().toLowerCase();
|
|
1556
1781
|
}
|
|
@@ -1569,12 +1794,110 @@
|
|
|
1569
1794
|
}
|
|
1570
1795
|
return tokens;
|
|
1571
1796
|
}
|
|
1797
|
+
var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
1798
|
+
function trimOWS(value) {
|
|
1799
|
+
var start = 0;
|
|
1800
|
+
var end = value.length;
|
|
1801
|
+
while (start < end) {
|
|
1802
|
+
var code = value.charCodeAt(start);
|
|
1803
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
start += 1;
|
|
1807
|
+
}
|
|
1808
|
+
while (end > start) {
|
|
1809
|
+
var _code = value.charCodeAt(end - 1);
|
|
1810
|
+
if (_code !== 0x09 && _code !== 0x20) {
|
|
1811
|
+
break;
|
|
1812
|
+
}
|
|
1813
|
+
end -= 1;
|
|
1814
|
+
}
|
|
1815
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
1816
|
+
}
|
|
1817
|
+
function decodeQuotedString(value) {
|
|
1818
|
+
var last = value.length - 1;
|
|
1819
|
+
if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {
|
|
1820
|
+
return value;
|
|
1821
|
+
}
|
|
1822
|
+
var decoded = '';
|
|
1823
|
+
for (var i = 1; i < last; i++) {
|
|
1824
|
+
var code = value.charCodeAt(i);
|
|
1825
|
+
if (code === 0x22) {
|
|
1826
|
+
return value;
|
|
1827
|
+
}
|
|
1828
|
+
if (code === 0x5c) {
|
|
1829
|
+
i += 1;
|
|
1830
|
+
if (i >= last) {
|
|
1831
|
+
return value;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
decoded += value[i];
|
|
1835
|
+
}
|
|
1836
|
+
return decoded;
|
|
1837
|
+
}
|
|
1838
|
+
function _parseParameters(value) {
|
|
1839
|
+
var parameters = Object.create(null);
|
|
1840
|
+
var str = String(value);
|
|
1841
|
+
var start = 0;
|
|
1842
|
+
var quoted = false;
|
|
1843
|
+
var escaped = false;
|
|
1844
|
+
function parseParameter(end) {
|
|
1845
|
+
var part = trimOWS(str.slice(start, end));
|
|
1846
|
+
var equals = part.indexOf('=');
|
|
1847
|
+
if (equals < 1) {
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
var name = trimOWS(part.slice(0, equals));
|
|
1851
|
+
if (!parameterNameRE.test(name)) {
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
var normalizedName = name.toLowerCase();
|
|
1855
|
+
if (normalizedName === '__proto__' || normalizedName === 'constructor' || normalizedName === 'prototype') {
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
var parameterValue = trimOWS(part.slice(equals + 1));
|
|
1859
|
+
parameters[normalizedName] = decodeQuotedString(parameterValue);
|
|
1860
|
+
}
|
|
1861
|
+
for (var i = 0; i < str.length; i++) {
|
|
1862
|
+
var code = str.charCodeAt(i);
|
|
1863
|
+
if (quoted) {
|
|
1864
|
+
if (escaped) {
|
|
1865
|
+
escaped = false;
|
|
1866
|
+
} else if (code === 0x5c) {
|
|
1867
|
+
escaped = true;
|
|
1868
|
+
} else if (code === 0x22) {
|
|
1869
|
+
quoted = false;
|
|
1870
|
+
}
|
|
1871
|
+
} else if (code === 0x22) {
|
|
1872
|
+
quoted = true;
|
|
1873
|
+
} else if (code === 0x2c || code === 0x3b) {
|
|
1874
|
+
parseParameter(i);
|
|
1875
|
+
start = i + 1;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
parseParameter(str.length);
|
|
1879
|
+
return parameters;
|
|
1880
|
+
}
|
|
1572
1881
|
var isValidHeaderName = function isValidHeaderName(str) {
|
|
1573
1882
|
return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
1574
1883
|
};
|
|
1884
|
+
|
|
1885
|
+
// `__proto__` is a valid field name, and the one name the uppercase mapping at
|
|
1886
|
+
// the bottom of this file cannot reach: it is inherited from Object.prototype
|
|
1887
|
+
// instead of being declared on AxiosHeaders.prototype, so `self.__proto__ = v`
|
|
1888
|
+
// runs the inherited setter. That silently discards the header, and an array
|
|
1889
|
+
// value replaces the instance prototype, taking every method with it.
|
|
1890
|
+
// Store it under the same kind of case variant that mapping uses for `set` and
|
|
1891
|
+
// `constructor`. Header lookup is caseless, so it reads back under either
|
|
1892
|
+
// spelling, and no own `__proto__` slot is ever created for a later
|
|
1893
|
+
// `Object.assign` to copy onto a plain object through the same setter.
|
|
1894
|
+
var PROTO_HEADER_SLOT = '__Proto__';
|
|
1895
|
+
var headerSlot = function headerSlot(name) {
|
|
1896
|
+
return name === '__proto__' ? PROTO_HEADER_SLOT : name;
|
|
1897
|
+
};
|
|
1575
1898
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1576
1899
|
if (utils$1.isFunction(filter)) {
|
|
1577
|
-
return filter.call(
|
|
1900
|
+
return filter.call(context, value, header);
|
|
1578
1901
|
}
|
|
1579
1902
|
if (isHeaderNameFilter) {
|
|
1580
1903
|
value = header;
|
|
@@ -1622,7 +1945,7 @@
|
|
|
1622
1945
|
}
|
|
1623
1946
|
var key = utils$1.findKey(self, lHeader);
|
|
1624
1947
|
if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
|
|
1625
|
-
self[key || _header] = normalizeValue(_value);
|
|
1948
|
+
self[headerSlot(key || _header)] = normalizeValue(_value);
|
|
1626
1949
|
}
|
|
1627
1950
|
}
|
|
1628
1951
|
var setHeaders = function setHeaders(headers, _rewrite) {
|
|
@@ -1634,8 +1957,8 @@
|
|
|
1634
1957
|
setHeaders(header, valueOrRewrite);
|
|
1635
1958
|
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1636
1959
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1637
|
-
} else if (utils$1.isObject(header) && utils$1.
|
|
1638
|
-
var obj =
|
|
1960
|
+
} else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
|
|
1961
|
+
var obj = Object.create(null),
|
|
1639
1962
|
dest,
|
|
1640
1963
|
key;
|
|
1641
1964
|
var _iterator = _createForOfIteratorHelper(header),
|
|
@@ -1646,7 +1969,13 @@
|
|
|
1646
1969
|
if (!utils$1.isArray(entry)) {
|
|
1647
1970
|
throw new TypeError('Object iterator must return a key-value pair');
|
|
1648
1971
|
}
|
|
1649
|
-
|
|
1972
|
+
key = entry[0];
|
|
1973
|
+
if (utils$1.hasOwnProp(obj, key)) {
|
|
1974
|
+
dest = obj[key];
|
|
1975
|
+
obj[key] = utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]];
|
|
1976
|
+
} else {
|
|
1977
|
+
obj[key] = entry[1];
|
|
1978
|
+
}
|
|
1650
1979
|
}
|
|
1651
1980
|
} catch (err) {
|
|
1652
1981
|
_iterator.e(err);
|
|
@@ -1734,7 +2063,7 @@
|
|
|
1734
2063
|
key: "normalize",
|
|
1735
2064
|
value: function normalize(format) {
|
|
1736
2065
|
var self = this;
|
|
1737
|
-
var headers =
|
|
2066
|
+
var headers = Object.create(null);
|
|
1738
2067
|
utils$1.forEach(this, function (value, header) {
|
|
1739
2068
|
var key = utils$1.findKey(headers, header);
|
|
1740
2069
|
if (key) {
|
|
@@ -1742,7 +2071,7 @@
|
|
|
1742
2071
|
delete self[header];
|
|
1743
2072
|
return;
|
|
1744
2073
|
}
|
|
1745
|
-
var normalized = format ? formatHeader(header) : String(header).trim();
|
|
2074
|
+
var normalized = headerSlot(format ? formatHeader(header) : String(header).trim());
|
|
1746
2075
|
if (normalized !== header) {
|
|
1747
2076
|
delete self[header];
|
|
1748
2077
|
}
|
|
@@ -1787,7 +2116,8 @@
|
|
|
1787
2116
|
}, {
|
|
1788
2117
|
key: "getSetCookie",
|
|
1789
2118
|
value: function getSetCookie() {
|
|
1790
|
-
|
|
2119
|
+
var value = this.get('set-cookie');
|
|
2120
|
+
return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value];
|
|
1791
2121
|
}
|
|
1792
2122
|
}, {
|
|
1793
2123
|
key: Symbol.toStringTag,
|
|
@@ -1799,6 +2129,11 @@
|
|
|
1799
2129
|
value: function from(thing) {
|
|
1800
2130
|
return thing instanceof this ? thing : new this(thing);
|
|
1801
2131
|
}
|
|
2132
|
+
}, {
|
|
2133
|
+
key: "parseParameters",
|
|
2134
|
+
value: function parseParameters(value) {
|
|
2135
|
+
return _parseParameters(value);
|
|
2136
|
+
}
|
|
1802
2137
|
}, {
|
|
1803
2138
|
key: "concat",
|
|
1804
2139
|
value: function concat(first) {
|
|
@@ -1814,7 +2149,7 @@
|
|
|
1814
2149
|
}, {
|
|
1815
2150
|
key: "accessor",
|
|
1816
2151
|
value: function accessor(header) {
|
|
1817
|
-
var internals = this[$internals] = this[$internals] = {
|
|
2152
|
+
var internals = this[$internals$1] = this[$internals$1] = {
|
|
1818
2153
|
accessors: {}
|
|
1819
2154
|
};
|
|
1820
2155
|
var accessors = internals.accessors;
|
|
@@ -1909,6 +2244,77 @@
|
|
|
1909
2244
|
};
|
|
1910
2245
|
return _visit(config);
|
|
1911
2246
|
}
|
|
2247
|
+
function stringifySafely$1(value) {
|
|
2248
|
+
try {
|
|
2249
|
+
return String(value);
|
|
2250
|
+
} catch (err) {
|
|
2251
|
+
return '';
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
function aggregateErrorMessage(error) {
|
|
2255
|
+
var message = error.errors.map(function (entry) {
|
|
2256
|
+
try {
|
|
2257
|
+
return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry);
|
|
2258
|
+
} catch (err) {
|
|
2259
|
+
return '';
|
|
2260
|
+
}
|
|
2261
|
+
}).filter(Boolean).join('; ');
|
|
2262
|
+
return message || error.name || 'AggregateError';
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
// Shared with `Axios.prototype.request`, which splices the reconstructed
|
|
2266
|
+
// caller frames in ahead of this marker.
|
|
2267
|
+
var CAUSED_BY_SEPARATOR = '\nCaused by: ';
|
|
2268
|
+
var $causeStack = Symbol('causeStack');
|
|
2269
|
+
|
|
2270
|
+
// Match the section we appended, not marker-like text in an error message or
|
|
2271
|
+
// a replacement stack supplied by the caller. Do not re-read the cause's stack.
|
|
2272
|
+
function getCauseStackIndex(error, stack) {
|
|
2273
|
+
var causeStack = utils$1.hasOwnProp(error, $causeStack) && error[$causeStack];
|
|
2274
|
+
return causeStack && stack.endsWith(causeStack) ? stack.length - causeStack.length : -1;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
/**
|
|
2278
|
+
* Append the stack of a wrapped error to `target.stack`.
|
|
2279
|
+
*
|
|
2280
|
+
* `cause` already exposes the original error for tooling that walks the standard
|
|
2281
|
+
* cause chain, but many error reporters read `stack` and nothing else. Inlining
|
|
2282
|
+
* the wrapped stack there means those reporters surface the underlying failure
|
|
2283
|
+
* instead of the axios frames that normalized it (see #6670).
|
|
2284
|
+
*
|
|
2285
|
+
* Every read is defensive: a custom `Error.prepareStackTrace` hook, a runtime
|
|
2286
|
+
* without stack support, or a replaced `stack` property can leave the value
|
|
2287
|
+
* missing, non-string, or read-only, and normalizing an error must not throw
|
|
2288
|
+
* because of that.
|
|
2289
|
+
*
|
|
2290
|
+
* @param {Error} target The AxiosError being built.
|
|
2291
|
+
* @param {Error} source The error being wrapped.
|
|
2292
|
+
*
|
|
2293
|
+
* @returns {void}
|
|
2294
|
+
*/
|
|
2295
|
+
function appendCauseStack(target, source) {
|
|
2296
|
+
try {
|
|
2297
|
+
var sourceStack = source && source.stack;
|
|
2298
|
+
if (typeof sourceStack !== 'string' || !sourceStack) {
|
|
2299
|
+
return;
|
|
2300
|
+
}
|
|
2301
|
+
var targetStack = target.stack;
|
|
2302
|
+
if (typeof targetStack !== 'string' || !targetStack) {
|
|
2303
|
+
return;
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
// Each call to `from()` creates a fresh target. Re-wrapping includes the
|
|
2307
|
+
// previous stack verbatim, adding one cause section per wrap.
|
|
2308
|
+
var causeStack = CAUSED_BY_SEPARATOR + sourceStack;
|
|
2309
|
+
target.stack = targetStack + causeStack;
|
|
2310
|
+
Object.defineProperty(target, $causeStack, {
|
|
2311
|
+
__proto__: null,
|
|
2312
|
+
value: causeStack
|
|
2313
|
+
});
|
|
2314
|
+
} catch (e) {
|
|
2315
|
+
// Ignore failures from custom stack hooks or un-writable stack properties.
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
1912
2318
|
var AxiosError = /*#__PURE__*/function (_Error) {
|
|
1913
2319
|
/**
|
|
1914
2320
|
* Create an Error with the specified message, config, error code, request and response.
|
|
@@ -1981,10 +2387,33 @@
|
|
|
1981
2387
|
}], [{
|
|
1982
2388
|
key: "from",
|
|
1983
2389
|
value: function from(error, code, config, request, response, customProps) {
|
|
1984
|
-
|
|
1985
|
-
|
|
2390
|
+
// `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection
|
|
2391
|
+
// failures) has an empty `message`; its detail lives in `errors[]`. Without
|
|
2392
|
+
// this, the wrapped error surfaces with a blank message (see #6721).
|
|
2393
|
+
var message = error.message;
|
|
2394
|
+
if (!message && utils$1.isArray(error.errors) && error.errors.length) {
|
|
2395
|
+
message = aggregateErrorMessage(error);
|
|
2396
|
+
}
|
|
2397
|
+
var axiosError = new AxiosError(message, code || error.code, config, request, response);
|
|
2398
|
+
// Match native `Error` `cause` semantics: non-enumerable. The wrapped
|
|
2399
|
+
// error often carries circular internals (sockets, requests, agents), so
|
|
2400
|
+
// an enumerable `cause` makes structured loggers (pino/winston) and any
|
|
2401
|
+
// own-property walk throw "Converting circular structure to JSON".
|
|
2402
|
+
// Regression from #6982; see #7205. `__proto__: null` mirrors the
|
|
2403
|
+
// `message` descriptor below (prototype-pollution-safe descriptor).
|
|
2404
|
+
Object.defineProperty(axiosError, 'cause', {
|
|
2405
|
+
__proto__: null,
|
|
2406
|
+
value: error,
|
|
2407
|
+
writable: true,
|
|
2408
|
+
enumerable: false,
|
|
2409
|
+
configurable: true
|
|
2410
|
+
});
|
|
1986
2411
|
axiosError.name = error.name;
|
|
1987
2412
|
|
|
2413
|
+
// Inline the wrapped stack for reporters that read only `stack`; the `cause`
|
|
2414
|
+
// property above already covers cause-aware tooling.
|
|
2415
|
+
appendCauseStack(axiosError, error);
|
|
2416
|
+
|
|
1988
2417
|
// Preserve status from the original error if not already set from response
|
|
1989
2418
|
if (error.status != null && axiosError.status == null) {
|
|
1990
2419
|
axiosError.status = error.status;
|
|
@@ -2012,6 +2441,10 @@
|
|
|
2012
2441
|
// eslint-disable-next-line strict
|
|
2013
2442
|
var httpAdapter = null;
|
|
2014
2443
|
|
|
2444
|
+
// Default nesting limit shared with the inverse transform (formDataToJSON) so
|
|
2445
|
+
// the FormData <-> JSON round-trip stays symmetric.
|
|
2446
|
+
var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
|
|
2447
|
+
|
|
2015
2448
|
/**
|
|
2016
2449
|
* Determines if the given thing is a array or js object.
|
|
2017
2450
|
*
|
|
@@ -2096,24 +2529,19 @@
|
|
|
2096
2529
|
|
|
2097
2530
|
// eslint-disable-next-line no-param-reassign
|
|
2098
2531
|
formData = formData || new (FormData)();
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
indexes: false
|
|
2105
|
-
}, false, function defined(option, source) {
|
|
2106
|
-
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
2107
|
-
return !utils$1.isUndefined(source[option]);
|
|
2108
|
-
});
|
|
2109
|
-
var metaTokens = options.metaTokens;
|
|
2532
|
+
var option = function option(name, fallback) {
|
|
2533
|
+
var value = utils$1.getSafeProp(options, name);
|
|
2534
|
+
return utils$1.isUndefined(value) ? fallback : value;
|
|
2535
|
+
};
|
|
2536
|
+
var metaTokens = option('metaTokens', true);
|
|
2110
2537
|
// eslint-disable-next-line no-use-before-define
|
|
2111
|
-
var visitor =
|
|
2112
|
-
var dots =
|
|
2113
|
-
var indexes =
|
|
2114
|
-
var _Blob =
|
|
2115
|
-
var maxDepth =
|
|
2538
|
+
var visitor = option('visitor') || defaultVisitor;
|
|
2539
|
+
var dots = option('dots', false);
|
|
2540
|
+
var indexes = option('indexes', false);
|
|
2541
|
+
var _Blob = option('Blob') || typeof Blob !== 'undefined' && Blob;
|
|
2542
|
+
var maxDepth = option('maxDepth', DEFAULT_FORM_DATA_MAX_DEPTH);
|
|
2116
2543
|
var useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
2544
|
+
var stack = [];
|
|
2117
2545
|
if (!utils$1.isFunction(visitor)) {
|
|
2118
2546
|
throw new TypeError('visitor must be a function');
|
|
2119
2547
|
}
|
|
@@ -2129,10 +2557,35 @@
|
|
|
2129
2557
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
2130
2558
|
}
|
|
2131
2559
|
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
2132
|
-
|
|
2560
|
+
if (useBlob && typeof _Blob === 'function') {
|
|
2561
|
+
return new _Blob([value]);
|
|
2562
|
+
}
|
|
2563
|
+
throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);
|
|
2133
2564
|
}
|
|
2134
2565
|
return value;
|
|
2135
2566
|
}
|
|
2567
|
+
function throwIfMaxDepthExceeded(depth) {
|
|
2568
|
+
if (depth > maxDepth) {
|
|
2569
|
+
throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
function stringifyWithDepthLimit(value, depth) {
|
|
2573
|
+
if (maxDepth === Infinity) {
|
|
2574
|
+
return JSON.stringify(value);
|
|
2575
|
+
}
|
|
2576
|
+
var ancestors = [];
|
|
2577
|
+
return JSON.stringify(value, function limitDepth(_key, currentValue) {
|
|
2578
|
+
if (!utils$1.isObject(currentValue)) {
|
|
2579
|
+
return currentValue;
|
|
2580
|
+
}
|
|
2581
|
+
while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
|
|
2582
|
+
ancestors.pop();
|
|
2583
|
+
}
|
|
2584
|
+
ancestors.push(currentValue);
|
|
2585
|
+
throwIfMaxDepthExceeded(depth + ancestors.length - 1);
|
|
2586
|
+
return currentValue;
|
|
2587
|
+
});
|
|
2588
|
+
}
|
|
2136
2589
|
|
|
2137
2590
|
/**
|
|
2138
2591
|
* Default visitor.
|
|
@@ -2155,7 +2608,7 @@
|
|
|
2155
2608
|
// eslint-disable-next-line no-param-reassign
|
|
2156
2609
|
key = metaTokens ? key : key.slice(0, -2);
|
|
2157
2610
|
// eslint-disable-next-line no-param-reassign
|
|
2158
|
-
value =
|
|
2611
|
+
value = stringifyWithDepthLimit(value, 1);
|
|
2159
2612
|
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) {
|
|
2160
2613
|
// eslint-disable-next-line no-param-reassign
|
|
2161
2614
|
key = removeBrackets(key);
|
|
@@ -2173,7 +2626,6 @@
|
|
|
2173
2626
|
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
2174
2627
|
return false;
|
|
2175
2628
|
}
|
|
2176
|
-
var stack = [];
|
|
2177
2629
|
var exposedHelpers = Object.assign(predicates, {
|
|
2178
2630
|
defaultVisitor: defaultVisitor,
|
|
2179
2631
|
convertValue: convertValue,
|
|
@@ -2182,9 +2634,7 @@
|
|
|
2182
2634
|
function build(value, path) {
|
|
2183
2635
|
var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2184
2636
|
if (utils$1.isUndefined(value)) return;
|
|
2185
|
-
|
|
2186
|
-
throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
|
|
2187
|
-
}
|
|
2637
|
+
throwIfMaxDepthExceeded(depth);
|
|
2188
2638
|
if (stack.indexOf(value) !== -1) {
|
|
2189
2639
|
throw new Error('Circular reference detected in ' + path.join('.'));
|
|
2190
2640
|
}
|
|
@@ -2243,8 +2693,9 @@
|
|
|
2243
2693
|
this._pairs.push([name, value]);
|
|
2244
2694
|
};
|
|
2245
2695
|
prototype.toString = function toString(encoder) {
|
|
2696
|
+
var _this = this;
|
|
2246
2697
|
var _encode = encoder ? function (value) {
|
|
2247
|
-
return encoder.call(
|
|
2698
|
+
return encoder.call(_this, value, encode$1);
|
|
2248
2699
|
} : encode$1;
|
|
2249
2700
|
return this._pairs.map(function each(pair) {
|
|
2250
2701
|
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
@@ -2276,11 +2727,16 @@
|
|
|
2276
2727
|
if (!params) {
|
|
2277
2728
|
return url;
|
|
2278
2729
|
}
|
|
2279
|
-
|
|
2730
|
+
url = url || '';
|
|
2280
2731
|
var _options = utils$1.isFunction(options) ? {
|
|
2281
2732
|
serialize: options
|
|
2282
2733
|
} : options;
|
|
2283
|
-
|
|
2734
|
+
|
|
2735
|
+
// Read serializer options pollution-safely: own properties and methods on a
|
|
2736
|
+
// class/template prototype are honored, but values injected onto a polluted
|
|
2737
|
+
// Object.prototype are ignored.
|
|
2738
|
+
var _encode = utils$1.getSafeProp(_options, 'encode') || encode;
|
|
2739
|
+
var serializeFn = utils$1.getSafeProp(_options, 'serialize');
|
|
2284
2740
|
var serializedParams;
|
|
2285
2741
|
if (serializeFn) {
|
|
2286
2742
|
serializedParams = serializeFn(params, _options);
|
|
@@ -2297,10 +2753,61 @@
|
|
|
2297
2753
|
return url;
|
|
2298
2754
|
}
|
|
2299
2755
|
|
|
2756
|
+
var $internals = Symbol('internals');
|
|
2757
|
+
|
|
2758
|
+
// `handlers` is public and may be replaced with a nullish value by user code;
|
|
2759
|
+
// `clear()` has always tolerated that. Treat it as an empty stack rather than
|
|
2760
|
+
// dereferencing it.
|
|
2761
|
+
function countHandlers(handlers) {
|
|
2762
|
+
return handlers ? handlers.length : 0;
|
|
2763
|
+
}
|
|
2764
|
+
function trimHandlers(handlers) {
|
|
2765
|
+
if (!handlers) {
|
|
2766
|
+
return;
|
|
2767
|
+
}
|
|
2768
|
+
while (handlers.length && handlers[handlers.length - 1] === null) {
|
|
2769
|
+
handlers.pop();
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
// Preserve the array-key coercion used before IDs were stored in a Map, without
|
|
2774
|
+
// treating null, empty strings, or noncanonical numeric strings as ID zero.
|
|
2775
|
+
function normalizeHandlerId(id) {
|
|
2776
|
+
if (typeof id === 'string' && id !== '' && String(Number(id)) === id) {
|
|
2777
|
+
return Number(id);
|
|
2778
|
+
}
|
|
2779
|
+
return id;
|
|
2780
|
+
}
|
|
2781
|
+
function syncHandlerEntries(manager, internals) {
|
|
2782
|
+
var handlers = manager.handlers;
|
|
2783
|
+
var length = countHandlers(handlers);
|
|
2784
|
+
if (handlers !== internals.handlersRef) {
|
|
2785
|
+
internals.handlersRef = handlers;
|
|
2786
|
+
internals.handlerEntries.clear();
|
|
2787
|
+
} else if (length !== internals.handlersLength) {
|
|
2788
|
+
if (!length) {
|
|
2789
|
+
internals.handlerEntries.clear();
|
|
2790
|
+
} else {
|
|
2791
|
+
internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {
|
|
2792
|
+
if (handlers[entry.index] !== entry.handler) {
|
|
2793
|
+
internals.handlerEntries["delete"](id);
|
|
2794
|
+
}
|
|
2795
|
+
});
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
internals.handlersLength = length;
|
|
2799
|
+
}
|
|
2300
2800
|
var InterceptorManager = /*#__PURE__*/function () {
|
|
2301
2801
|
function InterceptorManager() {
|
|
2302
2802
|
_classCallCheck(this, InterceptorManager);
|
|
2303
2803
|
this.handlers = [];
|
|
2804
|
+
this[$internals] = {
|
|
2805
|
+
handlersRef: this.handlers,
|
|
2806
|
+
handlersLength: this.handlers.length,
|
|
2807
|
+
handlerEntries: new Map(),
|
|
2808
|
+
iterationDepth: 0,
|
|
2809
|
+
nextId: 0
|
|
2810
|
+
};
|
|
2304
2811
|
}
|
|
2305
2812
|
|
|
2306
2813
|
/**
|
|
@@ -2315,13 +2822,25 @@
|
|
|
2315
2822
|
return _createClass(InterceptorManager, [{
|
|
2316
2823
|
key: "use",
|
|
2317
2824
|
value: function use(fulfilled, rejected, options) {
|
|
2318
|
-
|
|
2825
|
+
var handler = {
|
|
2319
2826
|
fulfilled: fulfilled,
|
|
2320
2827
|
rejected: rejected,
|
|
2321
2828
|
synchronous: options ? options.synchronous : false,
|
|
2322
2829
|
runWhen: options ? options.runWhen : null
|
|
2830
|
+
};
|
|
2831
|
+
var internals = this[$internals];
|
|
2832
|
+
if (this.handlers == null) {
|
|
2833
|
+
this.handlers = [];
|
|
2834
|
+
}
|
|
2835
|
+
syncHandlerEntries(this, internals);
|
|
2836
|
+
var id = internals.nextId++;
|
|
2837
|
+
this.handlers.push(handler);
|
|
2838
|
+
internals.handlerEntries.set(id, {
|
|
2839
|
+
handler: handler,
|
|
2840
|
+
index: this.handlers.length - 1
|
|
2323
2841
|
});
|
|
2324
|
-
|
|
2842
|
+
internals.handlersLength = this.handlers.length;
|
|
2843
|
+
return id;
|
|
2325
2844
|
}
|
|
2326
2845
|
|
|
2327
2846
|
/**
|
|
@@ -2334,8 +2853,24 @@
|
|
|
2334
2853
|
}, {
|
|
2335
2854
|
key: "eject",
|
|
2336
2855
|
value: function eject(id) {
|
|
2337
|
-
|
|
2338
|
-
|
|
2856
|
+
var internals = this[$internals];
|
|
2857
|
+
syncHandlerEntries(this, internals);
|
|
2858
|
+
var handlerId = normalizeHandlerId(id);
|
|
2859
|
+
var entry = internals.handlerEntries.get(handlerId);
|
|
2860
|
+
if (entry) {
|
|
2861
|
+
internals.handlerEntries["delete"](handlerId);
|
|
2862
|
+
|
|
2863
|
+
// Ignore IDs invalidated by clear or direct replacement of handlers.
|
|
2864
|
+
if (this.handlers[entry.index] !== entry.handler) {
|
|
2865
|
+
return;
|
|
2866
|
+
}
|
|
2867
|
+
this.handlers[entry.index] = null;
|
|
2868
|
+
|
|
2869
|
+
// Do not reuse an index while forEach is walking its length snapshot.
|
|
2870
|
+
if (!internals.iterationDepth) {
|
|
2871
|
+
trimHandlers(this.handlers);
|
|
2872
|
+
internals.handlersLength = this.handlers.length;
|
|
2873
|
+
}
|
|
2339
2874
|
}
|
|
2340
2875
|
}
|
|
2341
2876
|
|
|
@@ -2349,6 +2884,7 @@
|
|
|
2349
2884
|
value: function clear() {
|
|
2350
2885
|
if (this.handlers) {
|
|
2351
2886
|
this.handlers = [];
|
|
2887
|
+
syncHandlerEntries(this, this[$internals]);
|
|
2352
2888
|
}
|
|
2353
2889
|
}
|
|
2354
2890
|
|
|
@@ -2365,11 +2901,22 @@
|
|
|
2365
2901
|
}, {
|
|
2366
2902
|
key: "forEach",
|
|
2367
2903
|
value: function forEach(fn) {
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2904
|
+
var internals = this[$internals];
|
|
2905
|
+
syncHandlerEntries(this, internals);
|
|
2906
|
+
internals.iterationDepth++;
|
|
2907
|
+
try {
|
|
2908
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
2909
|
+
if (h !== null) {
|
|
2910
|
+
fn(h);
|
|
2911
|
+
}
|
|
2912
|
+
});
|
|
2913
|
+
} finally {
|
|
2914
|
+
if (! --internals.iterationDepth) {
|
|
2915
|
+
syncHandlerEntries(this, internals);
|
|
2916
|
+
trimHandlers(this.handlers);
|
|
2917
|
+
internals.handlersLength = countHandlers(this.handlers);
|
|
2371
2918
|
}
|
|
2372
|
-
}
|
|
2919
|
+
}
|
|
2373
2920
|
}
|
|
2374
2921
|
}]);
|
|
2375
2922
|
}();
|
|
@@ -2379,7 +2926,9 @@
|
|
|
2379
2926
|
forcedJSONParsing: true,
|
|
2380
2927
|
clarifyTimeoutError: false,
|
|
2381
2928
|
legacyInterceptorReqResOrdering: true,
|
|
2382
|
-
advertiseZstdAcceptEncoding: false
|
|
2929
|
+
advertiseZstdAcceptEncoding: false,
|
|
2930
|
+
validateStatusUndefinedResolves: true,
|
|
2931
|
+
encodeBasicAuthUsername: false
|
|
2383
2932
|
};
|
|
2384
2933
|
|
|
2385
2934
|
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -2459,6 +3008,13 @@
|
|
|
2459
3008
|
}, options));
|
|
2460
3009
|
}
|
|
2461
3010
|
|
|
3011
|
+
var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
|
|
3012
|
+
function throwIfDepthExceeded(index) {
|
|
3013
|
+
if (index > MAX_DEPTH) {
|
|
3014
|
+
throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
|
|
2462
3018
|
/**
|
|
2463
3019
|
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
2464
3020
|
*
|
|
@@ -2467,13 +3023,24 @@
|
|
|
2467
3023
|
* @returns An array of strings.
|
|
2468
3024
|
*/
|
|
2469
3025
|
function parsePropPath(name) {
|
|
2470
|
-
// foo[x][y][z]
|
|
2471
|
-
// foo.x.y.z
|
|
2472
|
-
//
|
|
2473
|
-
//
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
3026
|
+
// foo[x][y][z] -> ['foo', 'x', 'y', 'z']
|
|
3027
|
+
// foo.x.y.z -> ['foo', 'x', 'y', 'z']
|
|
3028
|
+
// A path is split on `.` and on `[...]` groups. A segment — whether written
|
|
3029
|
+
// in dot notation or captured inside brackets — may contain any character
|
|
3030
|
+
// except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept
|
|
3031
|
+
// literal instead of being split (#5402). `.`, `[` and `]` keep their existing
|
|
3032
|
+
// meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.
|
|
3033
|
+
// Excluding `[` from the bracket group also makes the match fail fast at the
|
|
3034
|
+
// next `[`, so a malformed name cannot rescan to the end of the string from
|
|
3035
|
+
// every unmatched `[` — parsing stays linear in the length of the name.
|
|
3036
|
+
var path = [];
|
|
3037
|
+
var pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
|
|
3038
|
+
var match;
|
|
3039
|
+
while ((match = pattern.exec(name)) !== null) {
|
|
3040
|
+
throwIfDepthExceeded(path.length);
|
|
3041
|
+
path.push(match[0] === '[]' ? '' : match[1] || match[0]);
|
|
3042
|
+
}
|
|
3043
|
+
return path;
|
|
2477
3044
|
}
|
|
2478
3045
|
|
|
2479
3046
|
/**
|
|
@@ -2495,6 +3062,29 @@
|
|
|
2495
3062
|
}
|
|
2496
3063
|
return obj;
|
|
2497
3064
|
}
|
|
3065
|
+
function normalizeArray(value) {
|
|
3066
|
+
if (!utils$1.isArray(value)) return value;
|
|
3067
|
+
var keys = Object.keys(value);
|
|
3068
|
+
return keys.length !== value.length || keys.some(function (key, index) {
|
|
3069
|
+
return key !== String(index);
|
|
3070
|
+
}) ? arrayToObject(value) : value;
|
|
3071
|
+
}
|
|
3072
|
+
function normalizeArrays(obj) {
|
|
3073
|
+
var pending = [obj];
|
|
3074
|
+
var _loop = function _loop() {
|
|
3075
|
+
var target = pending.pop();
|
|
3076
|
+
Object.keys(target).forEach(function (key) {
|
|
3077
|
+
var value = target[key] = normalizeArray(target[key]);
|
|
3078
|
+
if (utils$1.isArray(value) || utils$1.isPlainObject(value)) {
|
|
3079
|
+
pending.push(value);
|
|
3080
|
+
}
|
|
3081
|
+
});
|
|
3082
|
+
};
|
|
3083
|
+
while (pending.length) {
|
|
3084
|
+
_loop();
|
|
3085
|
+
}
|
|
3086
|
+
return obj;
|
|
3087
|
+
}
|
|
2498
3088
|
|
|
2499
3089
|
/**
|
|
2500
3090
|
* It takes a FormData object and returns a JavaScript object
|
|
@@ -2505,6 +3095,7 @@
|
|
|
2505
3095
|
*/
|
|
2506
3096
|
function formDataToJSON(formData) {
|
|
2507
3097
|
function buildPath(path, value, target, index) {
|
|
3098
|
+
throwIfDepthExceeded(index);
|
|
2508
3099
|
var name = path[index++];
|
|
2509
3100
|
if (name === '__proto__') return true;
|
|
2510
3101
|
var isNumericKey = Number.isFinite(+name);
|
|
@@ -2512,6 +3103,7 @@
|
|
|
2512
3103
|
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
2513
3104
|
if (isLast) {
|
|
2514
3105
|
if (utils$1.hasOwnProp(target, name)) {
|
|
3106
|
+
target[name] = normalizeArray(target[name]);
|
|
2515
3107
|
target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
|
|
2516
3108
|
} else {
|
|
2517
3109
|
target[name] = value;
|
|
@@ -2532,11 +3124,13 @@
|
|
|
2532
3124
|
utils$1.forEachEntry(formData, function (name, value) {
|
|
2533
3125
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
2534
3126
|
});
|
|
2535
|
-
return obj;
|
|
3127
|
+
return normalizeArrays(obj);
|
|
2536
3128
|
}
|
|
2537
3129
|
return null;
|
|
2538
3130
|
}
|
|
2539
3131
|
|
|
3132
|
+
var methodList = Object.freeze(['get', 'delete', 'head', 'options', 'post', 'put', 'patch', 'purge', 'link', 'unlink', 'query']);
|
|
3133
|
+
|
|
2540
3134
|
var own = function own(obj, key) {
|
|
2541
3135
|
return obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined;
|
|
2542
3136
|
};
|
|
@@ -2655,7 +3249,7 @@
|
|
|
2655
3249
|
}
|
|
2656
3250
|
}
|
|
2657
3251
|
};
|
|
2658
|
-
utils$1.forEach(
|
|
3252
|
+
utils$1.forEach(methodList, function (method) {
|
|
2659
3253
|
defaults.headers[method] = {};
|
|
2660
3254
|
});
|
|
2661
3255
|
|
|
@@ -2723,15 +3317,137 @@
|
|
|
2723
3317
|
}
|
|
2724
3318
|
}
|
|
2725
3319
|
|
|
3320
|
+
var urlParserControlCharacters = /[\t\n\r]/g;
|
|
3321
|
+
|
|
3322
|
+
/**
|
|
3323
|
+
* Match WHATWG URL preprocessing before checking a URL's protocol.
|
|
3324
|
+
*
|
|
3325
|
+
* @param {string} url
|
|
3326
|
+
*
|
|
3327
|
+
* @returns {string}
|
|
3328
|
+
*/
|
|
3329
|
+
function normalizeURLForProtocolCheck(url) {
|
|
3330
|
+
if (typeof url !== 'string') {
|
|
3331
|
+
return url;
|
|
3332
|
+
}
|
|
3333
|
+
var start = 0;
|
|
3334
|
+
while (start < url.length && url.charCodeAt(start) <= 0x20) {
|
|
3335
|
+
start++;
|
|
3336
|
+
}
|
|
3337
|
+
return url.slice(start).replace(urlParserControlCharacters, '');
|
|
3338
|
+
}
|
|
3339
|
+
|
|
2726
3340
|
function parseProtocol(url) {
|
|
2727
3341
|
var match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
2728
|
-
return match && match[1] || '';
|
|
3342
|
+
return match && match[1].toLowerCase() || '';
|
|
2729
3343
|
}
|
|
2730
3344
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
3345
|
+
var decodeCookieValue = function decodeCookieValue(value) {
|
|
3346
|
+
try {
|
|
3347
|
+
return decodeURIComponent(value);
|
|
3348
|
+
} catch (e) {
|
|
3349
|
+
return value;
|
|
3350
|
+
}
|
|
3351
|
+
};
|
|
3352
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
|
3353
|
+
// Standard browser envs support document.cookie
|
|
3354
|
+
{
|
|
3355
|
+
write: function write(name, value, expires, path, domain, secure, sameSite) {
|
|
3356
|
+
if (typeof document === 'undefined') return;
|
|
3357
|
+
var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))];
|
|
3358
|
+
if (utils$1.isNumber(expires)) {
|
|
3359
|
+
cookie.push("expires=".concat(new Date(expires).toUTCString()));
|
|
3360
|
+
}
|
|
3361
|
+
if (utils$1.isString(path)) {
|
|
3362
|
+
cookie.push("path=".concat(path));
|
|
3363
|
+
}
|
|
3364
|
+
if (utils$1.isString(domain)) {
|
|
3365
|
+
cookie.push("domain=".concat(domain));
|
|
3366
|
+
}
|
|
3367
|
+
if (secure === true) {
|
|
3368
|
+
cookie.push('secure');
|
|
3369
|
+
}
|
|
3370
|
+
if (utils$1.isString(sameSite)) {
|
|
3371
|
+
cookie.push("SameSite=".concat(sameSite));
|
|
3372
|
+
}
|
|
3373
|
+
document.cookie = cookie.join('; ');
|
|
3374
|
+
},
|
|
3375
|
+
read: function read(name) {
|
|
3376
|
+
if (typeof document === 'undefined') return null;
|
|
3377
|
+
var cookieString = document.cookie;
|
|
3378
|
+
if (!cookieString) return null;
|
|
3379
|
+
// Match name=value by splitting on the semicolon separator instead of building a
|
|
3380
|
+
// RegExp from `name` — interpolating an unescaped string into a RegExp would let
|
|
3381
|
+
// metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
|
|
3382
|
+
// match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
|
|
3383
|
+
// "; ", so ignore optional whitespace before each cookie name.
|
|
3384
|
+
var cookies = cookieString.split(';');
|
|
3385
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
3386
|
+
var cookie = cookies[i].replace(/^\s+/, '');
|
|
3387
|
+
var eq = cookie.indexOf('=');
|
|
3388
|
+
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
3389
|
+
return decodeCookieValue(cookie.slice(eq + 1));
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
return null;
|
|
3393
|
+
},
|
|
3394
|
+
readAsync: function readAsync(name) {
|
|
3395
|
+
var _this = this;
|
|
3396
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
3397
|
+
var store, cookie;
|
|
3398
|
+
return _regenerator().w(function (_context) {
|
|
3399
|
+
while (1) switch (_context.p = _context.n) {
|
|
3400
|
+
case 0:
|
|
3401
|
+
_context.p = 0;
|
|
3402
|
+
store = typeof window !== 'undefined' && window.cookieStore;
|
|
3403
|
+
if (!(store && utils$1.isFunction(store.get))) {
|
|
3404
|
+
_context.n = 2;
|
|
3405
|
+
break;
|
|
3406
|
+
}
|
|
3407
|
+
_context.n = 1;
|
|
3408
|
+
return store.get(name);
|
|
3409
|
+
case 1:
|
|
3410
|
+
cookie = _context.v;
|
|
3411
|
+
return _context.a(2, cookie ? decodeCookieValue(cookie.value) : null);
|
|
3412
|
+
case 2:
|
|
3413
|
+
_context.n = 4;
|
|
3414
|
+
break;
|
|
3415
|
+
case 3:
|
|
3416
|
+
_context.p = 3;
|
|
3417
|
+
_context.v;
|
|
3418
|
+
case 4:
|
|
3419
|
+
return _context.a(2, _this.read(name));
|
|
3420
|
+
}
|
|
3421
|
+
}, _callee, null, [[0, 3]]);
|
|
3422
|
+
}))();
|
|
3423
|
+
},
|
|
3424
|
+
remove: function remove(name) {
|
|
3425
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
3426
|
+
}
|
|
3427
|
+
} :
|
|
3428
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
3429
|
+
{
|
|
3430
|
+
write: function write() {},
|
|
3431
|
+
read: function read() {
|
|
3432
|
+
return null;
|
|
3433
|
+
},
|
|
3434
|
+
readAsync: function readAsync() {
|
|
3435
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
3436
|
+
return _regenerator().w(function (_context2) {
|
|
3437
|
+
while (1) switch (_context2.n) {
|
|
3438
|
+
case 0:
|
|
3439
|
+
return _context2.a(2, null);
|
|
3440
|
+
}
|
|
3441
|
+
}, _callee2);
|
|
3442
|
+
}))();
|
|
3443
|
+
},
|
|
3444
|
+
remove: function remove() {}
|
|
3445
|
+
};
|
|
3446
|
+
|
|
3447
|
+
/**
|
|
3448
|
+
* Calculate data maxRate
|
|
3449
|
+
* @param {Number} [samplesCount= 10]
|
|
3450
|
+
* @param {Number} [min= 1000]
|
|
2735
3451
|
* @returns {Function}
|
|
2736
3452
|
*/
|
|
2737
3453
|
function speedometer(samplesCount, min) {
|
|
@@ -2772,7 +3488,7 @@
|
|
|
2772
3488
|
* Throttle decorator
|
|
2773
3489
|
* @param {Function} fn
|
|
2774
3490
|
* @param {Number} freq
|
|
2775
|
-
* @return {Function}
|
|
3491
|
+
* @return {Array<Function>}
|
|
2776
3492
|
*/
|
|
2777
3493
|
function throttle(fn, freq) {
|
|
2778
3494
|
var timestamp = 0;
|
|
@@ -2810,7 +3526,13 @@
|
|
|
2810
3526
|
var flush = function flush() {
|
|
2811
3527
|
return lastArgs && invoke(lastArgs);
|
|
2812
3528
|
};
|
|
2813
|
-
|
|
3529
|
+
var flushWith = function flushWith() {
|
|
3530
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
3531
|
+
args[_key2] = arguments[_key2];
|
|
3532
|
+
}
|
|
3533
|
+
return invoke(args);
|
|
3534
|
+
};
|
|
3535
|
+
return [throttled, flush, flushWith];
|
|
2814
3536
|
}
|
|
2815
3537
|
|
|
2816
3538
|
var progressEventReducer = function progressEventReducer(listener, isDownloadStream) {
|
|
@@ -2818,12 +3540,12 @@
|
|
|
2818
3540
|
var bytesNotified = 0;
|
|
2819
3541
|
var _speedometer = speedometer(50, 250);
|
|
2820
3542
|
return throttle(function (e) {
|
|
2821
|
-
if (!e ||
|
|
3543
|
+
if (!e || !utils$1.isNumber(e.loaded)) {
|
|
2822
3544
|
return;
|
|
2823
3545
|
}
|
|
2824
3546
|
var rawLoaded = e.loaded;
|
|
2825
3547
|
var total = e.lengthComputable ? e.total : undefined;
|
|
2826
|
-
var loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
3548
|
+
var loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
|
|
2827
3549
|
var progressBytes = Math.max(0, loaded - bytesNotified);
|
|
2828
3550
|
var rate = _speedometer(progressBytes);
|
|
2829
3551
|
bytesNotified = Math.max(bytesNotified, loaded);
|
|
@@ -2851,78 +3573,26 @@
|
|
|
2851
3573
|
}, throttled[1]];
|
|
2852
3574
|
};
|
|
2853
3575
|
var asyncDecorator = function asyncDecorator(fn) {
|
|
3576
|
+
var scheduler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : utils$1.asap;
|
|
2854
3577
|
return function () {
|
|
2855
3578
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2856
3579
|
args[_key] = arguments[_key];
|
|
2857
3580
|
}
|
|
2858
|
-
return
|
|
3581
|
+
return scheduler(function () {
|
|
2859
3582
|
return fn.apply(void 0, args);
|
|
2860
3583
|
});
|
|
2861
3584
|
};
|
|
2862
3585
|
};
|
|
2863
3586
|
|
|
2864
|
-
var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin
|
|
3587
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin) {
|
|
2865
3588
|
return function (url) {
|
|
2866
|
-
url = new URL(url, platform.origin);
|
|
2867
|
-
return origin.protocol === url.protocol && origin.host === url.host &&
|
|
3589
|
+
url = new URL(url, document.baseURI || platform.origin);
|
|
3590
|
+
return origin.protocol === url.protocol && origin.host === url.host && origin.port === url.port;
|
|
2868
3591
|
};
|
|
2869
|
-
}(new URL(platform.origin)
|
|
3592
|
+
}(new URL(platform.origin)) : function () {
|
|
2870
3593
|
return true;
|
|
2871
3594
|
};
|
|
2872
3595
|
|
|
2873
|
-
var cookies = platform.hasStandardBrowserEnv ?
|
|
2874
|
-
// Standard browser envs support document.cookie
|
|
2875
|
-
{
|
|
2876
|
-
write: function write(name, value, expires, path, domain, secure, sameSite) {
|
|
2877
|
-
if (typeof document === 'undefined') return;
|
|
2878
|
-
var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))];
|
|
2879
|
-
if (utils$1.isNumber(expires)) {
|
|
2880
|
-
cookie.push("expires=".concat(new Date(expires).toUTCString()));
|
|
2881
|
-
}
|
|
2882
|
-
if (utils$1.isString(path)) {
|
|
2883
|
-
cookie.push("path=".concat(path));
|
|
2884
|
-
}
|
|
2885
|
-
if (utils$1.isString(domain)) {
|
|
2886
|
-
cookie.push("domain=".concat(domain));
|
|
2887
|
-
}
|
|
2888
|
-
if (secure === true) {
|
|
2889
|
-
cookie.push('secure');
|
|
2890
|
-
}
|
|
2891
|
-
if (utils$1.isString(sameSite)) {
|
|
2892
|
-
cookie.push("SameSite=".concat(sameSite));
|
|
2893
|
-
}
|
|
2894
|
-
document.cookie = cookie.join('; ');
|
|
2895
|
-
},
|
|
2896
|
-
read: function read(name) {
|
|
2897
|
-
if (typeof document === 'undefined') return null;
|
|
2898
|
-
// Match name=value by splitting on the semicolon separator instead of building a
|
|
2899
|
-
// RegExp from `name` — interpolating an unescaped string into a RegExp would let
|
|
2900
|
-
// metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
|
|
2901
|
-
// match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
|
|
2902
|
-
// "; ", so ignore optional whitespace before each cookie name.
|
|
2903
|
-
var cookies = document.cookie.split(';');
|
|
2904
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
2905
|
-
var cookie = cookies[i].replace(/^\s+/, '');
|
|
2906
|
-
var eq = cookie.indexOf('=');
|
|
2907
|
-
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
2908
|
-
return decodeURIComponent(cookie.slice(eq + 1));
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
return null;
|
|
2912
|
-
},
|
|
2913
|
-
remove: function remove(name) {
|
|
2914
|
-
this.write(name, '', Date.now() - 86400000, '/');
|
|
2915
|
-
}
|
|
2916
|
-
} :
|
|
2917
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2918
|
-
{
|
|
2919
|
-
write: function write() {},
|
|
2920
|
-
read: function read() {
|
|
2921
|
-
return null;
|
|
2922
|
-
},
|
|
2923
|
-
remove: function remove() {}
|
|
2924
|
-
};
|
|
2925
|
-
|
|
2926
3596
|
/**
|
|
2927
3597
|
* Determines whether the specified URL is absolute
|
|
2928
3598
|
*
|
|
@@ -2949,7 +3619,52 @@
|
|
|
2949
3619
|
* @returns {string} The combined URL
|
|
2950
3620
|
*/
|
|
2951
3621
|
function combineURLs(baseURL, relativeURL) {
|
|
2952
|
-
|
|
3622
|
+
if (!relativeURL) {
|
|
3623
|
+
return baseURL;
|
|
3624
|
+
}
|
|
3625
|
+
var end = baseURL.length;
|
|
3626
|
+
while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
|
|
3627
|
+
end--;
|
|
3628
|
+
}
|
|
3629
|
+
return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, '');
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
var malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
3633
|
+
|
|
3634
|
+
// Redact the parts of a URL that can carry secrets before it is embedded in an
|
|
3635
|
+
// error message. AxiosError.toJSON() serializes `message` verbatim and errors
|
|
3636
|
+
// are commonly logged, while the opt-in `config.redact` model only cleans
|
|
3637
|
+
// config keys — it cannot reach the message. Redact only the genuinely
|
|
3638
|
+
// sensitive substrings — userinfo (credentials), query parameter values and
|
|
3639
|
+
// fragment contents — with the same REDACTED marker the config redaction uses,
|
|
3640
|
+
// while keeping the scheme, host, path and parameter names so the offending
|
|
3641
|
+
// request stays accurately identifiable.
|
|
3642
|
+
function redactFragment(fragment) {
|
|
3643
|
+
if (!fragment) {
|
|
3644
|
+
return fragment;
|
|
3645
|
+
}
|
|
3646
|
+
return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, function (match, separator) {
|
|
3647
|
+
var parameterName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
3648
|
+
return "".concat(separator).concat(parameterName).concat(REDACTED);
|
|
3649
|
+
});
|
|
3650
|
+
}
|
|
3651
|
+
function redactSensitiveURLParts(url) {
|
|
3652
|
+
var redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, "$1".concat(REDACTED, "@"));
|
|
3653
|
+
var fragmentIndex = redactedURL.indexOf('#');
|
|
3654
|
+
var urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
|
|
3655
|
+
var redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, "$1".concat(REDACTED));
|
|
3656
|
+
if (fragmentIndex === -1) {
|
|
3657
|
+
return redactedURLWithoutFragment;
|
|
3658
|
+
}
|
|
3659
|
+
return "".concat(redactedURLWithoutFragment, "#").concat(redactFragment(redactedURL.slice(fragmentIndex + 1)));
|
|
3660
|
+
}
|
|
3661
|
+
function assertValidHttpProtocolURL(url, config) {
|
|
3662
|
+
if (typeof url === 'string') {
|
|
3663
|
+
var normalizedURL = normalizeURLForProtocolCheck(url);
|
|
3664
|
+
if (malformedHttpProtocol.test(normalizedURL)) {
|
|
3665
|
+
throw new AxiosError("Invalid URL ".concat(JSON.stringify(redactSensitiveURLParts(normalizedURL)), ": missing \"//\" after protocol"), AxiosError.ERR_INVALID_URL, config);
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
2953
3668
|
}
|
|
2954
3669
|
|
|
2955
3670
|
/**
|
|
@@ -2962,17 +3677,246 @@
|
|
|
2962
3677
|
*
|
|
2963
3678
|
* @returns {string} The combined full path
|
|
2964
3679
|
*/
|
|
2965
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
3680
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
3681
|
+
assertValidHttpProtocolURL(requestedURL, config);
|
|
2966
3682
|
var isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2967
3683
|
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
3684
|
+
assertValidHttpProtocolURL(baseURL, config);
|
|
2968
3685
|
return combineURLs(baseURL, requestedURL);
|
|
2969
3686
|
}
|
|
2970
3687
|
return requestedURL;
|
|
2971
3688
|
}
|
|
2972
3689
|
|
|
3690
|
+
function assertParamsAcyclic(params) {
|
|
3691
|
+
var pending = [{
|
|
3692
|
+
value: params
|
|
3693
|
+
}];
|
|
3694
|
+
var active = new WeakSet();
|
|
3695
|
+
var visited = new WeakSet();
|
|
3696
|
+
var _loop = function _loop() {
|
|
3697
|
+
var _pending$pop = pending.pop(),
|
|
3698
|
+
value = _pending$pop.value,
|
|
3699
|
+
done = _pending$pop.done;
|
|
3700
|
+
if (!utils$1.isPlainObject(value) && !utils$1.isArray(value)) return 0; // continue
|
|
3701
|
+
if (done) {
|
|
3702
|
+
active["delete"](value);
|
|
3703
|
+
return 0; // continue
|
|
3704
|
+
}
|
|
3705
|
+
if (active.has(value)) {
|
|
3706
|
+
throw new AxiosError('Circular reference detected in params', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
3707
|
+
}
|
|
3708
|
+
if (visited.has(value)) return 0; // continue
|
|
3709
|
+
visited.add(value);
|
|
3710
|
+
active.add(value);
|
|
3711
|
+
pending.push({
|
|
3712
|
+
value: value,
|
|
3713
|
+
done: true
|
|
3714
|
+
});
|
|
3715
|
+
var keys = Object.keys(value);
|
|
3716
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
3717
|
+
Object.getOwnPropertySymbols(value).forEach(function (key) {
|
|
3718
|
+
var descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
3719
|
+
if (descriptor && descriptor.enumerable) keys.push(key);
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
// Shallow array elements retain fields filtered during plain-object merges.
|
|
3723
|
+
// Inspect reserved data properties without evaluating their accessors.
|
|
3724
|
+
keys.forEach(function (key) {
|
|
3725
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
3726
|
+
var descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
3727
|
+
if (descriptor && utils$1.hasOwnProp(descriptor, 'value')) {
|
|
3728
|
+
pending.push({
|
|
3729
|
+
value: descriptor.value
|
|
3730
|
+
});
|
|
3731
|
+
}
|
|
3732
|
+
} else {
|
|
3733
|
+
pending.push({
|
|
3734
|
+
value: value[key]
|
|
3735
|
+
});
|
|
3736
|
+
}
|
|
3737
|
+
});
|
|
3738
|
+
},
|
|
3739
|
+
_ret;
|
|
3740
|
+
while (pending.length) {
|
|
3741
|
+
_ret = _loop();
|
|
3742
|
+
if (_ret === 0) continue;
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
|
|
2973
3746
|
var headersToObject = function headersToObject(thing) {
|
|
2974
3747
|
return thing instanceof AxiosHeaders ? _objectSpread2({}, thing) : thing;
|
|
2975
3748
|
};
|
|
3749
|
+
var ownEnumerableKeys = function ownEnumerableKeys(thing) {
|
|
3750
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
3751
|
+
return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter(function (symbol) {
|
|
3752
|
+
var descriptor = Object.getOwnPropertyDescriptor(thing, symbol);
|
|
3753
|
+
return descriptor && descriptor.enumerable;
|
|
3754
|
+
}));
|
|
3755
|
+
}
|
|
3756
|
+
return Object.keys(thing);
|
|
3757
|
+
};
|
|
3758
|
+
|
|
3759
|
+
// Copy params without recursive merges so the serializer remains responsible
|
|
3760
|
+
// for its depth policy. Only visit defaults that contribute to the result.
|
|
3761
|
+
function mergeParams(a, b) {
|
|
3762
|
+
var pending = [];
|
|
3763
|
+
var copies = new WeakMap();
|
|
3764
|
+
var empty = {};
|
|
3765
|
+
function copy(target, source) {
|
|
3766
|
+
if (!utils$1.isPlainObject(source)) {
|
|
3767
|
+
return utils$1.isArray(source) ? source.slice() : source;
|
|
3768
|
+
}
|
|
3769
|
+
var base = utils$1.isPlainObject(target) ? target : empty;
|
|
3770
|
+
var bases = copies.get(source);
|
|
3771
|
+
if (!bases) {
|
|
3772
|
+
bases = new WeakMap();
|
|
3773
|
+
copies.set(source, bases);
|
|
3774
|
+
}
|
|
3775
|
+
if (bases.has(base)) return bases.get(base);
|
|
3776
|
+
var result = {};
|
|
3777
|
+
bases.set(base, result);
|
|
3778
|
+
pending.push({
|
|
3779
|
+
base: base,
|
|
3780
|
+
source: source,
|
|
3781
|
+
result: result
|
|
3782
|
+
});
|
|
3783
|
+
return result;
|
|
3784
|
+
}
|
|
3785
|
+
var result = utils$1.isUndefined(b) ? copy(undefined, a) : copy(a, b);
|
|
3786
|
+
var _loop = function _loop() {
|
|
3787
|
+
var _pending$pop = pending.pop(),
|
|
3788
|
+
base = _pending$pop.base,
|
|
3789
|
+
source = _pending$pop.source,
|
|
3790
|
+
target = _pending$pop.result;
|
|
3791
|
+
var baseKeys = new Set(ownEnumerableKeys(base));
|
|
3792
|
+
var sourceKeys = new Set(ownEnumerableKeys(source));
|
|
3793
|
+
var keys = new Set([].concat(_toConsumableArray(baseKeys), _toConsumableArray(sourceKeys)));
|
|
3794
|
+
keys.forEach(function (key) {
|
|
3795
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') return;
|
|
3796
|
+
var hasSource = sourceKeys.has(key);
|
|
3797
|
+
var value = hasSource ? source[key] : undefined;
|
|
3798
|
+
var previous = (!hasSource || utils$1.isPlainObject(value)) && baseKeys.has(key) ? base[key] : undefined;
|
|
3799
|
+
target[key] = hasSource ? copy(previous, value) : copy(undefined, previous);
|
|
3800
|
+
});
|
|
3801
|
+
};
|
|
3802
|
+
while (pending.length) {
|
|
3803
|
+
_loop();
|
|
3804
|
+
}
|
|
3805
|
+
assertParamsAcyclic(result);
|
|
3806
|
+
return result;
|
|
3807
|
+
}
|
|
3808
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
3809
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
3810
|
+
return utils$1.merge.call({
|
|
3811
|
+
caseless: caseless
|
|
3812
|
+
}, target, source);
|
|
3813
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
3814
|
+
return utils$1.merge({}, source);
|
|
3815
|
+
} else if (utils$1.isArray(source)) {
|
|
3816
|
+
return source.slice();
|
|
3817
|
+
}
|
|
3818
|
+
return source;
|
|
3819
|
+
}
|
|
3820
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
3821
|
+
if (!utils$1.isUndefined(b)) {
|
|
3822
|
+
return getMergedValue(a, b, prop, caseless);
|
|
3823
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
3824
|
+
return getMergedValue(undefined, a, prop, caseless);
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3828
|
+
// eslint-disable-next-line consistent-return
|
|
3829
|
+
function valueFromConfig2(a, b) {
|
|
3830
|
+
if (!utils$1.isUndefined(b)) {
|
|
3831
|
+
return getMergedValue(undefined, b);
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
// eslint-disable-next-line consistent-return
|
|
3836
|
+
function defaultToConfig2(a, b) {
|
|
3837
|
+
if (!utils$1.isUndefined(b)) {
|
|
3838
|
+
return getMergedValue(undefined, b);
|
|
3839
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
3840
|
+
return getMergedValue(undefined, a);
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
function getMergedTransitionalOption(config1, config2, prop) {
|
|
3844
|
+
var transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
|
|
3845
|
+
if (!utils$1.isUndefined(transitional2)) {
|
|
3846
|
+
if (utils$1.isPlainObject(transitional2)) {
|
|
3847
|
+
if (utils$1.hasOwnProp(transitional2, prop)) {
|
|
3848
|
+
return transitional2[prop];
|
|
3849
|
+
}
|
|
3850
|
+
} else {
|
|
3851
|
+
return undefined;
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3854
|
+
var transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
|
|
3855
|
+
if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
|
|
3856
|
+
return transitional1[prop];
|
|
3857
|
+
}
|
|
3858
|
+
return undefined;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
// eslint-disable-next-line consistent-return
|
|
3862
|
+
function mergeDirectKeys(a, b, prop, config1, config2) {
|
|
3863
|
+
if (utils$1.hasOwnProp(config2, prop)) {
|
|
3864
|
+
return getMergedValue(a, b);
|
|
3865
|
+
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
3866
|
+
return getMergedValue(undefined, a);
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
function mergeHeaders(a, b, prop) {
|
|
3870
|
+
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
|
3871
|
+
}
|
|
3872
|
+
|
|
3873
|
+
// Null-proto, frozen descriptor so a polluted Object.prototype.get cannot turn
|
|
3874
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
3875
|
+
// defineProperty only reads it, so one shared instance serves every call.
|
|
3876
|
+
var hasOwnPropertyDescriptor = Object.freeze({
|
|
3877
|
+
__proto__: null,
|
|
3878
|
+
value: Object.prototype.hasOwnProperty,
|
|
3879
|
+
enumerable: false,
|
|
3880
|
+
writable: true,
|
|
3881
|
+
configurable: true
|
|
3882
|
+
});
|
|
3883
|
+
|
|
3884
|
+
// The strategy table and the strategies above are stateless, so they are
|
|
3885
|
+
// built once at module load instead of on every call: mergeConfig runs at
|
|
3886
|
+
// most twice per request (once from a method alias, once from `_request`).
|
|
3887
|
+
var mergeMap = {
|
|
3888
|
+
url: valueFromConfig2,
|
|
3889
|
+
method: valueFromConfig2,
|
|
3890
|
+
data: valueFromConfig2,
|
|
3891
|
+
baseURL: defaultToConfig2,
|
|
3892
|
+
transformRequest: defaultToConfig2,
|
|
3893
|
+
transformResponse: defaultToConfig2,
|
|
3894
|
+
params: mergeParams,
|
|
3895
|
+
paramsSerializer: defaultToConfig2,
|
|
3896
|
+
timeout: defaultToConfig2,
|
|
3897
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
3898
|
+
withCredentials: defaultToConfig2,
|
|
3899
|
+
withXSRFToken: defaultToConfig2,
|
|
3900
|
+
adapter: defaultToConfig2,
|
|
3901
|
+
responseType: defaultToConfig2,
|
|
3902
|
+
xsrfCookieName: defaultToConfig2,
|
|
3903
|
+
xsrfHeaderName: defaultToConfig2,
|
|
3904
|
+
onUploadProgress: defaultToConfig2,
|
|
3905
|
+
onDownloadProgress: defaultToConfig2,
|
|
3906
|
+
decompress: defaultToConfig2,
|
|
3907
|
+
maxContentLength: defaultToConfig2,
|
|
3908
|
+
maxBodyLength: defaultToConfig2,
|
|
3909
|
+
beforeRedirect: defaultToConfig2,
|
|
3910
|
+
transport: defaultToConfig2,
|
|
3911
|
+
httpAgent: defaultToConfig2,
|
|
3912
|
+
httpsAgent: defaultToConfig2,
|
|
3913
|
+
cancelToken: defaultToConfig2,
|
|
3914
|
+
socketPath: defaultToConfig2,
|
|
3915
|
+
allowedSocketPaths: defaultToConfig2,
|
|
3916
|
+
responseEncoding: defaultToConfig2,
|
|
3917
|
+
validateStatus: mergeDirectKeys,
|
|
3918
|
+
headers: mergeHeaders
|
|
3919
|
+
};
|
|
2976
3920
|
|
|
2977
3921
|
/**
|
|
2978
3922
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -2985,6 +3929,7 @@
|
|
|
2985
3929
|
*/
|
|
2986
3930
|
function mergeConfig(config1, config2) {
|
|
2987
3931
|
// eslint-disable-next-line no-param-reassign
|
|
3932
|
+
config1 = config1 || {};
|
|
2988
3933
|
config2 = config2 || {};
|
|
2989
3934
|
|
|
2990
3935
|
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
@@ -2992,111 +3937,46 @@
|
|
|
2992
3937
|
// `hasOwnProperty` is restored as a non-enumerable own slot to preserve
|
|
2993
3938
|
// ergonomics for user code that relies on it.
|
|
2994
3939
|
var config = Object.create(null);
|
|
2995
|
-
Object.defineProperty(config, 'hasOwnProperty',
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
enumerable: false,
|
|
3001
|
-
writable: true,
|
|
3002
|
-
configurable: true
|
|
3003
|
-
});
|
|
3004
|
-
function getMergedValue(target, source, prop, caseless) {
|
|
3005
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
3006
|
-
return utils$1.merge.call({
|
|
3007
|
-
caseless: caseless
|
|
3008
|
-
}, target, source);
|
|
3009
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
3010
|
-
return utils$1.merge({}, source);
|
|
3011
|
-
} else if (utils$1.isArray(source)) {
|
|
3012
|
-
return source.slice();
|
|
3013
|
-
}
|
|
3014
|
-
return source;
|
|
3015
|
-
}
|
|
3016
|
-
function mergeDeepProperties(a, b, prop, caseless) {
|
|
3017
|
-
if (!utils$1.isUndefined(b)) {
|
|
3018
|
-
return getMergedValue(a, b, prop, caseless);
|
|
3019
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
3020
|
-
return getMergedValue(undefined, a, prop, caseless);
|
|
3021
|
-
}
|
|
3022
|
-
}
|
|
3023
|
-
|
|
3024
|
-
// eslint-disable-next-line consistent-return
|
|
3025
|
-
function valueFromConfig2(a, b) {
|
|
3026
|
-
if (!utils$1.isUndefined(b)) {
|
|
3027
|
-
return getMergedValue(undefined, b);
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
|
-
// eslint-disable-next-line consistent-return
|
|
3032
|
-
function defaultToConfig2(a, b) {
|
|
3033
|
-
if (!utils$1.isUndefined(b)) {
|
|
3034
|
-
return getMergedValue(undefined, b);
|
|
3035
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
3036
|
-
return getMergedValue(undefined, a);
|
|
3037
|
-
}
|
|
3038
|
-
}
|
|
3039
|
-
|
|
3040
|
-
// eslint-disable-next-line consistent-return
|
|
3041
|
-
function mergeDirectKeys(a, b, prop) {
|
|
3042
|
-
if (utils$1.hasOwnProp(config2, prop)) {
|
|
3043
|
-
return getMergedValue(a, b);
|
|
3044
|
-
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
3045
|
-
return getMergedValue(undefined, a);
|
|
3046
|
-
}
|
|
3047
|
-
}
|
|
3048
|
-
var mergeMap = {
|
|
3049
|
-
url: valueFromConfig2,
|
|
3050
|
-
method: valueFromConfig2,
|
|
3051
|
-
data: valueFromConfig2,
|
|
3052
|
-
baseURL: defaultToConfig2,
|
|
3053
|
-
transformRequest: defaultToConfig2,
|
|
3054
|
-
transformResponse: defaultToConfig2,
|
|
3055
|
-
paramsSerializer: defaultToConfig2,
|
|
3056
|
-
timeout: defaultToConfig2,
|
|
3057
|
-
timeoutMessage: defaultToConfig2,
|
|
3058
|
-
withCredentials: defaultToConfig2,
|
|
3059
|
-
withXSRFToken: defaultToConfig2,
|
|
3060
|
-
adapter: defaultToConfig2,
|
|
3061
|
-
responseType: defaultToConfig2,
|
|
3062
|
-
xsrfCookieName: defaultToConfig2,
|
|
3063
|
-
xsrfHeaderName: defaultToConfig2,
|
|
3064
|
-
onUploadProgress: defaultToConfig2,
|
|
3065
|
-
onDownloadProgress: defaultToConfig2,
|
|
3066
|
-
decompress: defaultToConfig2,
|
|
3067
|
-
maxContentLength: defaultToConfig2,
|
|
3068
|
-
maxBodyLength: defaultToConfig2,
|
|
3069
|
-
beforeRedirect: defaultToConfig2,
|
|
3070
|
-
transport: defaultToConfig2,
|
|
3071
|
-
httpAgent: defaultToConfig2,
|
|
3072
|
-
httpsAgent: defaultToConfig2,
|
|
3073
|
-
cancelToken: defaultToConfig2,
|
|
3074
|
-
socketPath: defaultToConfig2,
|
|
3075
|
-
allowedSocketPaths: defaultToConfig2,
|
|
3076
|
-
responseEncoding: defaultToConfig2,
|
|
3077
|
-
validateStatus: mergeDirectKeys,
|
|
3078
|
-
headers: function headers(a, b, prop) {
|
|
3079
|
-
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
|
3080
|
-
}
|
|
3081
|
-
};
|
|
3082
|
-
utils$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
|
|
3083
|
-
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
3940
|
+
Object.defineProperty(config, 'hasOwnProperty', hasOwnPropertyDescriptor);
|
|
3941
|
+
var keys = ownEnumerableKeys(_objectSpread2(_objectSpread2({}, config1), config2));
|
|
3942
|
+
for (var i = 0, len = keys.length; i < len; i++) {
|
|
3943
|
+
var prop = keys[i];
|
|
3944
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') continue;
|
|
3084
3945
|
var merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
3085
3946
|
var a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
3086
3947
|
var b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
3087
|
-
var configValue = merge(a, b, prop);
|
|
3948
|
+
var configValue = merge === mergeDirectKeys ? merge(a, b, prop, config1, config2) : merge(a, b, prop);
|
|
3088
3949
|
utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
|
3089
|
-
}
|
|
3950
|
+
}
|
|
3951
|
+
if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption(config1, config2, 'validateStatusUndefinedResolves') === false) {
|
|
3952
|
+
if (utils$1.hasOwnProp(config1, 'validateStatus')) {
|
|
3953
|
+
config.validateStatus = getMergedValue(undefined, config1.validateStatus);
|
|
3954
|
+
} else {
|
|
3955
|
+
delete config.validateStatus;
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3090
3958
|
return config;
|
|
3091
3959
|
}
|
|
3092
3960
|
|
|
3093
3961
|
var FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
3962
|
+
|
|
3963
|
+
/**
|
|
3964
|
+
* Apply the headers generated by a FormData implementation to the request headers,
|
|
3965
|
+
* honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the
|
|
3966
|
+
* content-* headers; otherwise merge all of them.
|
|
3967
|
+
*
|
|
3968
|
+
* @param {AxiosHeaders} headers - the request headers to mutate
|
|
3969
|
+
* @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation
|
|
3970
|
+
* @param {String} [policy] - the resolved `formDataHeaderPolicy` config value
|
|
3971
|
+
*
|
|
3972
|
+
* @returns {void}
|
|
3973
|
+
*/
|
|
3094
3974
|
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
3095
3975
|
if (policy !== 'content-only') {
|
|
3096
3976
|
headers.set(formHeaders);
|
|
3097
3977
|
return;
|
|
3098
3978
|
}
|
|
3099
|
-
Object.entries(formHeaders).forEach(function (_ref) {
|
|
3979
|
+
Object.entries(formHeaders || {}).forEach(function (_ref) {
|
|
3100
3980
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
3101
3981
|
key = _ref2[0],
|
|
3102
3982
|
val = _ref2[1];
|
|
@@ -3119,7 +3999,11 @@
|
|
|
3119
3999
|
return String.fromCharCode(parseInt(hex, 16));
|
|
3120
4000
|
});
|
|
3121
4001
|
};
|
|
4002
|
+
var readCookie = function readCookie(name) {
|
|
4003
|
+
return cookies.read(name);
|
|
4004
|
+
};
|
|
3122
4005
|
function resolveConfig(config) {
|
|
4006
|
+
var readXsrfCookie = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : readCookie;
|
|
3123
4007
|
var newConfig = mergeConfig({}, config);
|
|
3124
4008
|
|
|
3125
4009
|
// Read only own properties to prevent prototype pollution gadgets
|
|
@@ -3137,18 +4021,29 @@
|
|
|
3137
4021
|
var allowAbsoluteUrls = own('allowAbsoluteUrls');
|
|
3138
4022
|
var url = own('url');
|
|
3139
4023
|
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
3140
|
-
newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), own('params'), own('paramsSerializer'));
|
|
4024
|
+
newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer'));
|
|
3141
4025
|
|
|
3142
4026
|
// HTTP basic authentication
|
|
3143
4027
|
if (auth) {
|
|
3144
|
-
|
|
4028
|
+
var username = utils$1.getSafeProp(auth, 'username') || '';
|
|
4029
|
+
var password = utils$1.getSafeProp(auth, 'password') || '';
|
|
4030
|
+
var transitional = own('transitional');
|
|
4031
|
+
var encodeUsername = transitional && utils$1.hasOwnProp(transitional, 'encodeBasicAuthUsername') && transitional.encodeBasicAuthUsername === true;
|
|
4032
|
+
try {
|
|
4033
|
+
headers.set('Authorization',
|
|
4034
|
+
// Preserve legacy username bytes unless the caller opts in to UTF-8.
|
|
4035
|
+
'Basic ' + btoa((encodeUsername ? encodeUTF8$1(username) : username) + ':' + (password ? encodeUTF8$1(password) : '')));
|
|
4036
|
+
} catch (e) {
|
|
4037
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
4038
|
+
}
|
|
3145
4039
|
}
|
|
3146
4040
|
if (utils$1.isFormData(data)) {
|
|
4041
|
+
var getHeaders = utils$1.getSafeProp(data, 'getHeaders');
|
|
3147
4042
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
|
|
3148
4043
|
headers.setContentType(undefined); // browser/web worker/RN handles it
|
|
3149
|
-
} else if (utils$1.isFunction(
|
|
4044
|
+
} else if (utils$1.isFunction(getHeaders)) {
|
|
3150
4045
|
// Node.js FormData (like form-data package)
|
|
3151
|
-
setFormDataHeaders(headers,
|
|
4046
|
+
setFormDataHeaders(headers, getHeaders.call(data), own('formDataHeaderPolicy'));
|
|
3152
4047
|
}
|
|
3153
4048
|
}
|
|
3154
4049
|
|
|
@@ -3166,7 +4061,7 @@
|
|
|
3166
4061
|
// the XSRF token cross-origin.
|
|
3167
4062
|
var shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url);
|
|
3168
4063
|
if (shouldSendXSRF) {
|
|
3169
|
-
var xsrfValue = xsrfHeaderName && xsrfCookieName &&
|
|
4064
|
+
var xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
|
|
3170
4065
|
if (xsrfValue) {
|
|
3171
4066
|
headers.set(xsrfHeaderName, xsrfValue);
|
|
3172
4067
|
}
|
|
@@ -3178,19 +4073,55 @@
|
|
|
3178
4073
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
3179
4074
|
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
3180
4075
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3181
|
-
var
|
|
4076
|
+
var useAsyncXsrf;
|
|
4077
|
+
try {
|
|
4078
|
+
var store = platform.hasStandardBrowserEnv && typeof window !== 'undefined' && window.cookieStore;
|
|
4079
|
+
useAsyncXsrf = store && utils$1.isFunction(store.get);
|
|
4080
|
+
} catch (e) {
|
|
4081
|
+
// A restricted Cookie Store getter must retain the synchronous fallback.
|
|
4082
|
+
}
|
|
4083
|
+
var xsrfCookieName;
|
|
4084
|
+
var _config = resolveConfig(config, useAsyncXsrf ? function (name) {
|
|
4085
|
+
xsrfCookieName = name;
|
|
4086
|
+
return null;
|
|
4087
|
+
} : undefined);
|
|
3182
4088
|
var requestData = _config.data;
|
|
3183
4089
|
var requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
3184
4090
|
var responseType = _config.responseType,
|
|
3185
4091
|
onUploadProgress = _config.onUploadProgress,
|
|
3186
4092
|
onDownloadProgress = _config.onDownloadProgress;
|
|
3187
4093
|
var onCanceled;
|
|
4094
|
+
var timeoutId;
|
|
3188
4095
|
var uploadThrottled, downloadThrottled;
|
|
3189
|
-
var flushUpload, flushDownload;
|
|
4096
|
+
var flushUpload, flushDownload, flushDownloadWithEvent;
|
|
3190
4097
|
function done() {
|
|
3191
|
-
|
|
3192
|
-
|
|
4098
|
+
clearTimeout(timeoutId);
|
|
4099
|
+
// A final progress callback must not prevent the remaining cleanup.
|
|
4100
|
+
// Report errors asynchronously, as onloadend and the throttle timer do.
|
|
4101
|
+
try {
|
|
4102
|
+
flushUpload && flushUpload(); // flush events
|
|
4103
|
+
} catch (err) {
|
|
4104
|
+
setTimeout(function () {
|
|
4105
|
+
throw err;
|
|
4106
|
+
});
|
|
4107
|
+
}
|
|
4108
|
+
try {
|
|
4109
|
+
flushDownload && flushDownload(); // flush events
|
|
4110
|
+
} catch (err) {
|
|
4111
|
+
setTimeout(function () {
|
|
4112
|
+
throw err;
|
|
4113
|
+
});
|
|
4114
|
+
}
|
|
3193
4115
|
|
|
4116
|
+
// A flush can synchronously cancel the request and reenter done().
|
|
4117
|
+
// In that case the inner call has already detached these listeners.
|
|
4118
|
+
if (request) {
|
|
4119
|
+
downloadThrottled && request.removeEventListener('progress', downloadThrottled);
|
|
4120
|
+
if (request.upload) {
|
|
4121
|
+
uploadThrottled && request.upload.removeEventListener('progress', uploadThrottled);
|
|
4122
|
+
flushUpload && request.upload.removeEventListener('loadend', flushUpload);
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
3194
4125
|
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
3195
4126
|
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
3196
4127
|
}
|
|
@@ -3199,10 +4130,50 @@
|
|
|
3199
4130
|
|
|
3200
4131
|
// Set the request timeout in MS
|
|
3201
4132
|
request.timeout = _config.timeout;
|
|
3202
|
-
function onloadend() {
|
|
4133
|
+
function onloadend(event) {
|
|
4134
|
+
if (!request) {
|
|
4135
|
+
return;
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
// Status 0 means no response was received, which onerror and onabort normally
|
|
4139
|
+
// reject before this runs. Firefox 152 fires only readystatechange and loadend for
|
|
4140
|
+
// navigation-canceled requests (https://bugzilla.mozilla.org/show_bug.cgi?id=1505389),
|
|
4141
|
+
// leaving settle() to resolve them as an empty success. ECONNABORTED is the error
|
|
4142
|
+
// onabort raised on Firefox 151. Reads over file:, which some environments report as
|
|
4143
|
+
// status 0 on success, are excluded by the request URL's scheme after browser-style
|
|
4144
|
+
// preprocessing, by the page origin's scheme for relative URLs (which inherit it), or
|
|
4145
|
+
// by responseURL where implemented.
|
|
4146
|
+
if (request.status === 0 && (parseProtocol(normalizeURLForProtocolCheck(_config.url)) || parseProtocol(platform.origin)) !== 'file' && !(request.responseURL && request.responseURL.startsWith('file:'))) {
|
|
4147
|
+
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
4148
|
+
done();
|
|
4149
|
+
|
|
4150
|
+
// Clean up request
|
|
4151
|
+
request = null;
|
|
4152
|
+
return;
|
|
4153
|
+
}
|
|
4154
|
+
|
|
4155
|
+
// When loadend is still dispatching, flushing with it gives progress
|
|
4156
|
+
// listeners a final delivery whose event has a live target. The legacy
|
|
4157
|
+
// ready-state fallback has no event, so replay its pending progress.
|
|
4158
|
+
// A throwing listener must not block settlement; rethrow asynchronously,
|
|
4159
|
+
// matching how listener errors surface on the throttle timer path.
|
|
4160
|
+
try {
|
|
4161
|
+
if (event) {
|
|
4162
|
+
flushDownloadWithEvent && flushDownloadWithEvent(event);
|
|
4163
|
+
} else {
|
|
4164
|
+
flushDownload && flushDownload();
|
|
4165
|
+
}
|
|
4166
|
+
} catch (err) {
|
|
4167
|
+
setTimeout(function () {
|
|
4168
|
+
throw err;
|
|
4169
|
+
});
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4172
|
+
// A final progress callback can cancel the request synchronously.
|
|
3203
4173
|
if (!request) {
|
|
3204
4174
|
return;
|
|
3205
4175
|
}
|
|
4176
|
+
|
|
3206
4177
|
// Prepare the response
|
|
3207
4178
|
var responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
|
|
3208
4179
|
var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
|
|
@@ -3276,6 +4247,7 @@
|
|
|
3276
4247
|
|
|
3277
4248
|
// Handle timeout
|
|
3278
4249
|
request.ontimeout = function handleTimeout() {
|
|
4250
|
+
if (!request) return;
|
|
3279
4251
|
var timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
3280
4252
|
var transitional = _config.transitional || transitionalDefaults;
|
|
3281
4253
|
if (_config.timeoutErrorMessage) {
|
|
@@ -3291,13 +4263,6 @@
|
|
|
3291
4263
|
// Remove Content-Type if data is undefined
|
|
3292
4264
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
3293
4265
|
|
|
3294
|
-
// Add headers to the request
|
|
3295
|
-
if ('setRequestHeader' in request) {
|
|
3296
|
-
utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
|
|
3297
|
-
request.setRequestHeader(key, val);
|
|
3298
|
-
});
|
|
3299
|
-
}
|
|
3300
|
-
|
|
3301
4266
|
// Add withCredentials to request if needed
|
|
3302
4267
|
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
3303
4268
|
request.withCredentials = !!_config.withCredentials;
|
|
@@ -3311,9 +4276,10 @@
|
|
|
3311
4276
|
// Handle progress if needed
|
|
3312
4277
|
if (onDownloadProgress) {
|
|
3313
4278
|
var _progressEventReducer = progressEventReducer(onDownloadProgress, true);
|
|
3314
|
-
var _progressEventReducer2 = _slicedToArray(_progressEventReducer,
|
|
4279
|
+
var _progressEventReducer2 = _slicedToArray(_progressEventReducer, 3);
|
|
3315
4280
|
downloadThrottled = _progressEventReducer2[0];
|
|
3316
4281
|
flushDownload = _progressEventReducer2[1];
|
|
4282
|
+
flushDownloadWithEvent = _progressEventReducer2[2];
|
|
3317
4283
|
request.addEventListener('progress', downloadThrottled);
|
|
3318
4284
|
}
|
|
3319
4285
|
|
|
@@ -3334,23 +4300,81 @@
|
|
|
3334
4300
|
return;
|
|
3335
4301
|
}
|
|
3336
4302
|
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
3337
|
-
request
|
|
4303
|
+
var xhr = request;
|
|
3338
4304
|
done();
|
|
3339
4305
|
request = null;
|
|
4306
|
+
xhr.abort();
|
|
3340
4307
|
};
|
|
3341
4308
|
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
4309
|
+
if (!request) return;
|
|
3342
4310
|
if (_config.signal) {
|
|
3343
4311
|
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
3344
4312
|
}
|
|
3345
4313
|
}
|
|
4314
|
+
if (!request) return;
|
|
3346
4315
|
var protocol = parseProtocol(_config.url);
|
|
3347
4316
|
if (protocol && !platform.protocols.includes(protocol)) {
|
|
3348
4317
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
4318
|
+
done();
|
|
3349
4319
|
return;
|
|
3350
4320
|
}
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
4321
|
+
var sendRequest = function sendRequest() {
|
|
4322
|
+
if (!request) return;
|
|
4323
|
+
// Apply headers after an asynchronous XSRF read so existing headers are
|
|
4324
|
+
// replaced through AxiosHeaders rather than appended by the native XHR.
|
|
4325
|
+
if ('setRequestHeader' in request) {
|
|
4326
|
+
utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
|
|
4327
|
+
request.setRequestHeader(key, val);
|
|
4328
|
+
});
|
|
4329
|
+
}
|
|
4330
|
+
request.send(requestData || null);
|
|
4331
|
+
};
|
|
4332
|
+
if (xsrfCookieName) {
|
|
4333
|
+
// Native XHR timeout starts at send(). Cover cookie preparation and the
|
|
4334
|
+
// subsequent request with the same budget and existing timeout handler.
|
|
4335
|
+
var now = typeof performance !== 'undefined' && utils$1.isFunction(performance.now) ? function () {
|
|
4336
|
+
return performance.now();
|
|
4337
|
+
} : Date.now;
|
|
4338
|
+
var deadline = request.timeout > 0 ? now() + Number(request.timeout) : undefined;
|
|
4339
|
+
var abortOnTimeout = function abortOnTimeout() {
|
|
4340
|
+
if (!request) return;
|
|
4341
|
+
var xhr = request;
|
|
4342
|
+
xhr.ontimeout();
|
|
4343
|
+
xhr.abort();
|
|
4344
|
+
};
|
|
4345
|
+
if (deadline !== undefined) {
|
|
4346
|
+
var _scheduleTimeout = function scheduleTimeout() {
|
|
4347
|
+
var remaining = deadline - now();
|
|
4348
|
+
if (remaining > 0) {
|
|
4349
|
+
// Browser timers overflow above the signed 32-bit delay limit.
|
|
4350
|
+
timeoutId = setTimeout(_scheduleTimeout, Math.min(remaining, 0x7fffffff));
|
|
4351
|
+
} else {
|
|
4352
|
+
abortOnTimeout();
|
|
4353
|
+
}
|
|
4354
|
+
};
|
|
4355
|
+
_scheduleTimeout();
|
|
4356
|
+
}
|
|
4357
|
+
cookies.readAsync(xsrfCookieName).then(function (value) {
|
|
4358
|
+
if (!request) return;
|
|
4359
|
+
// Promise callbacks may run before an overdue timer after a busy task.
|
|
4360
|
+
if (deadline !== undefined && now() >= deadline) {
|
|
4361
|
+
abortOnTimeout();
|
|
4362
|
+
return;
|
|
4363
|
+
}
|
|
4364
|
+
if (value) {
|
|
4365
|
+
var headerName = utils$1.hasOwnProp(_config, 'xsrfHeaderName') && _config.xsrfHeaderName;
|
|
4366
|
+
requestHeaders.set(headerName, value);
|
|
4367
|
+
}
|
|
4368
|
+
sendRequest();
|
|
4369
|
+
})["catch"](function (error) {
|
|
4370
|
+
if (!request) return;
|
|
4371
|
+
reject(AxiosError.from(error, null, config, request));
|
|
4372
|
+
done();
|
|
4373
|
+
request = null;
|
|
4374
|
+
});
|
|
4375
|
+
} else {
|
|
4376
|
+
sendRequest();
|
|
4377
|
+
}
|
|
3354
4378
|
});
|
|
3355
4379
|
};
|
|
3356
4380
|
|
|
@@ -3380,12 +4404,22 @@
|
|
|
3380
4404
|
timer && clearTimeout(timer);
|
|
3381
4405
|
timer = null;
|
|
3382
4406
|
signals.forEach(function (signal) {
|
|
3383
|
-
|
|
4407
|
+
var unsubscribeSignal = utils$1.getSafeProp(signal, 'unsubscribe');
|
|
4408
|
+
utils$1.isFunction(unsubscribeSignal) ? unsubscribeSignal.call(signal, onabort) : signal.removeEventListener('abort', onabort);
|
|
3384
4409
|
});
|
|
3385
4410
|
signals = null;
|
|
3386
4411
|
};
|
|
3387
4412
|
signals.forEach(function (signal) {
|
|
3388
|
-
|
|
4413
|
+
if (aborted) {
|
|
4414
|
+
return;
|
|
4415
|
+
}
|
|
4416
|
+
if (signal.aborted) {
|
|
4417
|
+
onabort.call(signal);
|
|
4418
|
+
return;
|
|
4419
|
+
}
|
|
4420
|
+
signal.addEventListener('abort', onabort, {
|
|
4421
|
+
once: true
|
|
4422
|
+
});
|
|
3389
4423
|
});
|
|
3390
4424
|
var signal = controller.signal;
|
|
3391
4425
|
signal.unsubscribe = function () {
|
|
@@ -3597,88 +4631,263 @@
|
|
|
3597
4631
|
});
|
|
3598
4632
|
};
|
|
3599
4633
|
|
|
4634
|
+
var CRLF = '\r\n';
|
|
4635
|
+
var normalizeLines = function normalizeLines(value) {
|
|
4636
|
+
return String(value).replace(/\r\n|\r|\n/g, CRLF);
|
|
4637
|
+
};
|
|
4638
|
+
var escapeName = function escapeName(value) {
|
|
4639
|
+
return String(value).replace(/[\r\n"]/g, function (_char) {
|
|
4640
|
+
return _char === '\r' ? '%0D' : _char === '\n' ? '%0A' : '%22';
|
|
4641
|
+
});
|
|
4642
|
+
};
|
|
4643
|
+
|
|
4644
|
+
// Count UTF-8 bytes without allocating an encoded copy of a field. FormData
|
|
4645
|
+
// string values normalize line endings; Blob/File contents remain unchanged.
|
|
4646
|
+
var stringBytes = function stringBytes(value, normalize) {
|
|
4647
|
+
var length = 0;
|
|
4648
|
+
for (var i = 0; i < value.length; i++) {
|
|
4649
|
+
var code = value.charCodeAt(i);
|
|
4650
|
+
if (normalize && (code === 13 || code === 10)) {
|
|
4651
|
+
if (code === 13 && value.charCodeAt(i + 1) === 10) i++;
|
|
4652
|
+
length += 2;
|
|
4653
|
+
} else if (code < 0x80) {
|
|
4654
|
+
length++;
|
|
4655
|
+
} else if (code < 0x800) {
|
|
4656
|
+
length += 2;
|
|
4657
|
+
} else if (code >= 0xd800 && code <= 0xdbff && value.charCodeAt(i + 1) >= 0xdc00 && value.charCodeAt(i + 1) <= 0xdfff) {
|
|
4658
|
+
length += 4;
|
|
4659
|
+
i++;
|
|
4660
|
+
} else {
|
|
4661
|
+
length += 3;
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
4664
|
+
return length;
|
|
4665
|
+
};
|
|
4666
|
+
|
|
4667
|
+
// Describe serialization failures independently of any request library.
|
|
4668
|
+
var FormDataError = /*#__PURE__*/function (_TypeError) {
|
|
4669
|
+
function FormDataError(message, reason) {
|
|
4670
|
+
var _this;
|
|
4671
|
+
_classCallCheck(this, FormDataError);
|
|
4672
|
+
_this = _callSuper(this, FormDataError, [message]);
|
|
4673
|
+
_this.name = 'FormDataError';
|
|
4674
|
+
_this.reason = reason;
|
|
4675
|
+
return _this;
|
|
4676
|
+
}
|
|
4677
|
+
_inherits(FormDataError, _TypeError);
|
|
4678
|
+
return _createClass(FormDataError);
|
|
4679
|
+
}(/*#__PURE__*/_wrapNativeSuper(TypeError));
|
|
4680
|
+
|
|
4681
|
+
// The caller supplies the boundary, Blob implementation, and limit error.
|
|
4682
|
+
function formDataToBlob(form, Blob, limit, limitError, boundary) {
|
|
4683
|
+
if (!utils$1.isFunction(Blob)) {
|
|
4684
|
+
throw new FormDataError('Blob is not supported', 'blob');
|
|
4685
|
+
}
|
|
4686
|
+
if (!utils$1.isString(boundary) || !/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(boundary) || / $/.test(boundary)) {
|
|
4687
|
+
throw new FormDataError('Invalid multipart boundary', 'boundary');
|
|
4688
|
+
}
|
|
4689
|
+
var footer = '--' + boundary + '--' + CRLF;
|
|
4690
|
+
var length = footer.length;
|
|
4691
|
+
var parts = [];
|
|
4692
|
+
var checkLength = function checkLength(extra) {
|
|
4693
|
+
if (length + extra > limit) throw limitError();
|
|
4694
|
+
};
|
|
4695
|
+
checkLength(0);
|
|
4696
|
+
var _iterator = _createForOfIteratorHelper(form),
|
|
4697
|
+
_step;
|
|
4698
|
+
try {
|
|
4699
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
4700
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
4701
|
+
name = _step$value[0],
|
|
4702
|
+
value = _step$value[1];
|
|
4703
|
+
var isString = utils$1.isString(value);
|
|
4704
|
+
var valueLength = isString ? stringBytes(value, true) : value.size;
|
|
4705
|
+
if (!Number.isFinite(valueLength) || valueLength < 0) {
|
|
4706
|
+
throw new FormDataError('Unsupported FormData part size', 'part');
|
|
4707
|
+
}
|
|
4708
|
+
// Reject large values and names before building normalized header strings.
|
|
4709
|
+
checkLength(valueLength + stringBytes(name, true) + (!isString && value.name ? stringBytes(value.name, false) : 0) + (!isString && value.type ? stringBytes(value.type, false) : 0));
|
|
4710
|
+
var header = '--' + boundary + CRLF + 'Content-Disposition: form-data; name="' + escapeName(normalizeLines(name)) + '"';
|
|
4711
|
+
if (!isString) {
|
|
4712
|
+
header += '; filename="' + escapeName(utils$1.isString(value.name) ? value.name : 'blob') + '"' + CRLF + 'Content-Type: ' + String(value.type || 'application/octet-stream').replace(/[\r\n]/g, '');
|
|
4713
|
+
}
|
|
4714
|
+
header += CRLF + CRLF;
|
|
4715
|
+
var partLength = stringBytes(header, false) + valueLength + CRLF.length;
|
|
4716
|
+
checkLength(partLength);
|
|
4717
|
+
length += partLength;
|
|
4718
|
+
parts.push({
|
|
4719
|
+
header: header,
|
|
4720
|
+
value: value,
|
|
4721
|
+
isString: isString
|
|
4722
|
+
});
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
// Native Blob composition retains existing Blob/File data. No file is read
|
|
4726
|
+
// and no complete multipart ArrayBuffer is created to determine its length.
|
|
4727
|
+
} catch (err) {
|
|
4728
|
+
_iterator.e(err);
|
|
4729
|
+
} finally {
|
|
4730
|
+
_iterator.f();
|
|
4731
|
+
}
|
|
4732
|
+
var blobParts = [];
|
|
4733
|
+
for (var _i = 0, _parts = parts; _i < _parts.length; _i++) {
|
|
4734
|
+
var part = _parts[_i];
|
|
4735
|
+
blobParts.push(part.header, part.isString ? normalizeLines(part.value) : part.value, CRLF);
|
|
4736
|
+
}
|
|
4737
|
+
blobParts.push(footer);
|
|
4738
|
+
return new Blob(blobParts, {
|
|
4739
|
+
type: 'multipart/form-data; boundary=' + boundary
|
|
4740
|
+
});
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4743
|
+
function createMultipartBody(form, Blob, limit, limitError, boundary) {
|
|
4744
|
+
// Report missing Blob support before trying to select a random source.
|
|
4745
|
+
if (!utils$1.isFunction(Blob)) {
|
|
4746
|
+
throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
4747
|
+
}
|
|
4748
|
+
if (boundary === undefined) {
|
|
4749
|
+
if (utils$1.isFunction(platform.generateString)) {
|
|
4750
|
+
boundary = 'axios-' + platform.generateString(36, '0123456789abcdef');
|
|
4751
|
+
} else {
|
|
4752
|
+
var crypto = utils$1.global.crypto;
|
|
4753
|
+
if (!crypto || !utils$1.isFunction(crypto.getRandomValues)) {
|
|
4754
|
+
throw new AxiosError('Random byte generation is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
4755
|
+
}
|
|
4756
|
+
var random = new Uint8Array(18);
|
|
4757
|
+
crypto.getRandomValues(random);
|
|
4758
|
+
boundary = 'axios-' + Array.from(random, function (value) {
|
|
4759
|
+
return ('0' + value.toString(16)).slice(-2);
|
|
4760
|
+
}).join('');
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
try {
|
|
4764
|
+
return formDataToBlob(form, Blob, limit, limitError, boundary);
|
|
4765
|
+
} catch (error) {
|
|
4766
|
+
if (error instanceof FormDataError) {
|
|
4767
|
+
var code = error.reason === 'boundary' ? AxiosError.ERR_BAD_OPTION_VALUE : AxiosError.ERR_BAD_REQUEST;
|
|
4768
|
+
throw new AxiosError(error.message, code);
|
|
4769
|
+
}
|
|
4770
|
+
throw error;
|
|
4771
|
+
}
|
|
4772
|
+
}
|
|
4773
|
+
|
|
3600
4774
|
/**
|
|
3601
|
-
* Estimate
|
|
3602
|
-
* -
|
|
3603
|
-
*
|
|
3604
|
-
*
|
|
3605
|
-
*
|
|
3606
|
-
* @param {string} url
|
|
3607
|
-
* @returns {number}
|
|
4775
|
+
* Estimate data: URL byte lengths *without* allocating large buffers.
|
|
4776
|
+
* - Fetch percent-decodes a base64 body before decoding it.
|
|
4777
|
+
* - Node's Buffer.from(body, 'base64') sizes its backing allocation from the
|
|
4778
|
+
* percent-decoded body, including ignored characters and content after padding.
|
|
4779
|
+
* - Non-base64 data is percent-decoded and then encoded as UTF-8.
|
|
3608
4780
|
*/
|
|
3609
|
-
function
|
|
4781
|
+
var isHexDigit = function isHexDigit(charCode) {
|
|
4782
|
+
return charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
|
|
4783
|
+
};
|
|
4784
|
+
var isPercentEncodedByte = function isPercentEncodedByte(str, i, len) {
|
|
4785
|
+
return i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
4786
|
+
};
|
|
4787
|
+
var hexValue = function hexValue(charCode) {
|
|
4788
|
+
return charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55;
|
|
4789
|
+
};
|
|
4790
|
+
var isBase64Char = function isBase64Char(charCode) {
|
|
4791
|
+
return charCode >= 65 && charCode <= 90 ||
|
|
4792
|
+
// A-Z
|
|
4793
|
+
charCode >= 97 && charCode <= 122 ||
|
|
4794
|
+
// a-z
|
|
4795
|
+
charCode >= 48 && charCode <= 57 ||
|
|
4796
|
+
// 0-9
|
|
4797
|
+
charCode === 43 ||
|
|
4798
|
+
// +
|
|
4799
|
+
charCode === 47 ||
|
|
4800
|
+
// /
|
|
4801
|
+
charCode === 45 ||
|
|
4802
|
+
// - (base64url)
|
|
4803
|
+
charCode === 95;
|
|
4804
|
+
}; // _ (base64url)
|
|
4805
|
+
|
|
4806
|
+
var isBase64Whitespace = function isBase64Whitespace(charCode) {
|
|
4807
|
+
return charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;
|
|
4808
|
+
};
|
|
4809
|
+
var base64Bytes = function base64Bytes(significant) {
|
|
4810
|
+
var groups = Math.floor(significant / 4);
|
|
4811
|
+
var remainder = significant % 4;
|
|
4812
|
+
return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);
|
|
4813
|
+
};
|
|
4814
|
+
|
|
4815
|
+
// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation
|
|
4816
|
+
// upper bound even when Buffer.from later ignores characters or stops at '='.
|
|
4817
|
+
var estimateBase64BufferAllocation = function estimateBase64BufferAllocation(body) {
|
|
4818
|
+
var len = body.length;
|
|
4819
|
+
var padding = 0;
|
|
4820
|
+
if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {
|
|
4821
|
+
padding++;
|
|
4822
|
+
if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {
|
|
4823
|
+
padding++;
|
|
4824
|
+
}
|
|
4825
|
+
}
|
|
4826
|
+
return Math.floor((len - padding) * 3 / 4);
|
|
4827
|
+
};
|
|
4828
|
+
var estimatePercentDecodedBase64Bytes = function estimatePercentDecodedBase64Bytes(body) {
|
|
4829
|
+
var len = body.length;
|
|
4830
|
+
var significant = 0;
|
|
4831
|
+
var padding = 0;
|
|
4832
|
+
var invalid = false;
|
|
4833
|
+
for (var i = 0; i < len; i++) {
|
|
4834
|
+
var code = body.charCodeAt(i);
|
|
4835
|
+
if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
4836
|
+
code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
|
|
4837
|
+
i += 2;
|
|
4838
|
+
}
|
|
4839
|
+
if (isBase64Whitespace(code)) {
|
|
4840
|
+
continue;
|
|
4841
|
+
}
|
|
4842
|
+
if (code === 61 /* '=' */) {
|
|
4843
|
+
padding++;
|
|
4844
|
+
continue;
|
|
4845
|
+
}
|
|
4846
|
+
if (!isBase64Char(code) || padding > 0) {
|
|
4847
|
+
invalid = true;
|
|
4848
|
+
continue;
|
|
4849
|
+
}
|
|
4850
|
+
significant++;
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4853
|
+
// Fetch rejects malformed forgiving-base64 input. Returning the raw-size
|
|
4854
|
+
// allocation bound keeps that invalid input from becoming a pre-check bypass.
|
|
4855
|
+
if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) {
|
|
4856
|
+
return estimateBase64BufferAllocation(body);
|
|
4857
|
+
}
|
|
4858
|
+
return base64Bytes(significant);
|
|
4859
|
+
};
|
|
4860
|
+
var estimateDataURLBytes = function estimateDataURLBytes(url, estimateBase64, base64Pattern) {
|
|
3610
4861
|
if (!url || typeof url !== 'string') return 0;
|
|
3611
|
-
if (
|
|
4862
|
+
if (!/^data:/i.test(url)) return 0;
|
|
3612
4863
|
var comma = url.indexOf(',');
|
|
3613
4864
|
if (comma < 0) return 0;
|
|
3614
4865
|
var meta = url.slice(5, comma);
|
|
3615
4866
|
var body = url.slice(comma + 1);
|
|
3616
|
-
var isBase64 =
|
|
4867
|
+
var isBase64 = base64Pattern.test(meta);
|
|
3617
4868
|
if (isBase64) {
|
|
3618
|
-
|
|
3619
|
-
var len = body.length; // cache length
|
|
3620
|
-
|
|
3621
|
-
for (var i = 0; i < len; i++) {
|
|
3622
|
-
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
3623
|
-
var a = body.charCodeAt(i + 1);
|
|
3624
|
-
var b = body.charCodeAt(i + 2);
|
|
3625
|
-
var isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
|
|
3626
|
-
if (isHex) {
|
|
3627
|
-
effectiveLen -= 2;
|
|
3628
|
-
i += 2;
|
|
3629
|
-
}
|
|
3630
|
-
}
|
|
3631
|
-
}
|
|
3632
|
-
var pad = 0;
|
|
3633
|
-
var idx = len - 1;
|
|
3634
|
-
var tailIsPct3D = function tailIsPct3D(j) {
|
|
3635
|
-
return j >= 2 && body.charCodeAt(j - 2) === 37 &&
|
|
3636
|
-
// '%'
|
|
3637
|
-
body.charCodeAt(j - 1) === 51 && (
|
|
3638
|
-
// '3'
|
|
3639
|
-
body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
|
|
3640
|
-
}; // 'D' or 'd'
|
|
3641
|
-
|
|
3642
|
-
if (idx >= 0) {
|
|
3643
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
3644
|
-
pad++;
|
|
3645
|
-
idx--;
|
|
3646
|
-
} else if (tailIsPct3D(idx)) {
|
|
3647
|
-
pad++;
|
|
3648
|
-
idx -= 3;
|
|
3649
|
-
}
|
|
3650
|
-
}
|
|
3651
|
-
if (pad === 1 && idx >= 0) {
|
|
3652
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
3653
|
-
pad++;
|
|
3654
|
-
} else if (tailIsPct3D(idx)) {
|
|
3655
|
-
pad++;
|
|
3656
|
-
}
|
|
3657
|
-
}
|
|
3658
|
-
var groups = Math.floor(effectiveLen / 4);
|
|
3659
|
-
var _bytes = groups * 3 - (pad || 0);
|
|
3660
|
-
return _bytes > 0 ? _bytes : 0;
|
|
3661
|
-
}
|
|
3662
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
|
|
3663
|
-
return Buffer.byteLength(body, 'utf8');
|
|
4869
|
+
return estimateBase64(body);
|
|
3664
4870
|
}
|
|
3665
4871
|
|
|
3666
4872
|
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
3667
4873
|
// a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
|
|
3668
|
-
//
|
|
3669
|
-
//
|
|
4874
|
+
// Valid %XX triplets count as one decoded byte; this matches the bytes that
|
|
4875
|
+
// decodeURIComponent(body) would produce before Buffer re-encodes the string.
|
|
3670
4876
|
var bytes = 0;
|
|
3671
|
-
for (var
|
|
3672
|
-
var c = body.charCodeAt(
|
|
3673
|
-
if (c
|
|
4877
|
+
for (var i = 0, len = body.length; i < len; i++) {
|
|
4878
|
+
var c = body.charCodeAt(i);
|
|
4879
|
+
if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
4880
|
+
bytes += 1;
|
|
4881
|
+
i += 2;
|
|
4882
|
+
} else if (c < 0x80) {
|
|
3674
4883
|
bytes += 1;
|
|
3675
4884
|
} else if (c < 0x800) {
|
|
3676
4885
|
bytes += 2;
|
|
3677
|
-
} else if (c >= 0xd800 && c <= 0xdbff &&
|
|
3678
|
-
var next = body.charCodeAt(
|
|
4886
|
+
} else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
|
|
4887
|
+
var next = body.charCodeAt(i + 1);
|
|
3679
4888
|
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
3680
4889
|
bytes += 4;
|
|
3681
|
-
|
|
4890
|
+
i++;
|
|
3682
4891
|
} else {
|
|
3683
4892
|
bytes += 3;
|
|
3684
4893
|
}
|
|
@@ -3687,11 +4896,34 @@
|
|
|
3687
4896
|
}
|
|
3688
4897
|
}
|
|
3689
4898
|
return bytes;
|
|
4899
|
+
};
|
|
4900
|
+
|
|
4901
|
+
/**
|
|
4902
|
+
* Estimate the percent-decoded payload size used by Fetch data: URLs.
|
|
4903
|
+
*
|
|
4904
|
+
* @param {string} url
|
|
4905
|
+
* @returns {number}
|
|
4906
|
+
*/
|
|
4907
|
+
function estimateDataURLDecodedBytes(url) {
|
|
4908
|
+
// Fetch removes URL fragments before processing a data: URL.
|
|
4909
|
+
var fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;
|
|
4910
|
+
return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes, /; *base64[\t\n\f\r ]*$/i);
|
|
3690
4911
|
}
|
|
3691
4912
|
|
|
3692
|
-
var VERSION = "1.
|
|
4913
|
+
var VERSION = "1.21.1";
|
|
3693
4914
|
|
|
3694
4915
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
4916
|
+
var DEFAULT_REQUEST_OPTIONS = {
|
|
4917
|
+
cache: 'default',
|
|
4918
|
+
redirect: 'follow',
|
|
4919
|
+
referrer: 'about:client',
|
|
4920
|
+
referrerPolicy: '',
|
|
4921
|
+
mode: 'cors',
|
|
4922
|
+
integrity: '',
|
|
4923
|
+
keepalive: false,
|
|
4924
|
+
priority: 'auto',
|
|
4925
|
+
window: null
|
|
4926
|
+
};
|
|
3695
4927
|
var isFunction = utils$1.isFunction;
|
|
3696
4928
|
|
|
3697
4929
|
/**
|
|
@@ -3748,12 +4980,14 @@
|
|
|
3748
4980
|
skipUndefined: true
|
|
3749
4981
|
}, {
|
|
3750
4982
|
Request: globalObject.Request,
|
|
3751
|
-
Response: globalObject.Response
|
|
4983
|
+
Response: globalObject.Response,
|
|
4984
|
+
Blob: globalObject.Blob
|
|
3752
4985
|
}, env);
|
|
4986
|
+
var envFetch = utils$1.hasOwnProp(env, 'fetch') ? env.fetch : undefined;
|
|
3753
4987
|
var _env = env,
|
|
3754
|
-
envFetch = _env.fetch,
|
|
3755
4988
|
Request = _env.Request,
|
|
3756
|
-
Response = _env.Response
|
|
4989
|
+
Response = _env.Response,
|
|
4990
|
+
Blob = _env.Blob;
|
|
3757
4991
|
var isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
3758
4992
|
var isRequestSupported = isFunction(Request);
|
|
3759
4993
|
var isResponseSupported = isFunction(Response);
|
|
@@ -3803,6 +5037,23 @@
|
|
|
3803
5037
|
var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function () {
|
|
3804
5038
|
return utils$1.isReadableStream(new Response('').body);
|
|
3805
5039
|
});
|
|
5040
|
+
|
|
5041
|
+
// Some runtimes reject every explicit cache mode. Use own defaults for both
|
|
5042
|
+
// probes so unrelated polluted options cannot affect cache-mode detection.
|
|
5043
|
+
var requestDefaults = Object.assign(Object.create(null), DEFAULT_REQUEST_OPTIONS);
|
|
5044
|
+
if (isRequestSupported && !test(function () {
|
|
5045
|
+
return new Request(platform.origin, requestDefaults);
|
|
5046
|
+
})) {
|
|
5047
|
+
delete requestDefaults.cache;
|
|
5048
|
+
|
|
5049
|
+
// Only omit cache when that makes Request construction succeed. Otherwise
|
|
5050
|
+
// retain the explicit default that protects supporting runtimes from pollution.
|
|
5051
|
+
if (!test(function () {
|
|
5052
|
+
return new Request(platform.origin, requestDefaults);
|
|
5053
|
+
})) {
|
|
5054
|
+
requestDefaults.cache = DEFAULT_REQUEST_OPTIONS.cache;
|
|
5055
|
+
}
|
|
5056
|
+
}
|
|
3806
5057
|
var resolvers = {
|
|
3807
5058
|
stream: supportsResponseStream && function (res) {
|
|
3808
5059
|
return res.body;
|
|
@@ -3821,7 +5072,6 @@
|
|
|
3821
5072
|
}();
|
|
3822
5073
|
var getBodyLength = /*#__PURE__*/function () {
|
|
3823
5074
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(body) {
|
|
3824
|
-
var _request;
|
|
3825
5075
|
return _regenerator().w(function (_context2) {
|
|
3826
5076
|
while (1) switch (_context2.n) {
|
|
3827
5077
|
case 0:
|
|
@@ -3837,37 +5087,24 @@
|
|
|
3837
5087
|
}
|
|
3838
5088
|
return _context2.a(2, body.size);
|
|
3839
5089
|
case 2:
|
|
3840
|
-
if (!utils$1.isSpecCompliantForm(body)) {
|
|
3841
|
-
_context2.n = 4;
|
|
3842
|
-
break;
|
|
3843
|
-
}
|
|
3844
|
-
_request = new Request(platform.origin, {
|
|
3845
|
-
method: 'POST',
|
|
3846
|
-
body: body
|
|
3847
|
-
});
|
|
3848
|
-
_context2.n = 3;
|
|
3849
|
-
return _request.arrayBuffer();
|
|
3850
|
-
case 3:
|
|
3851
|
-
return _context2.a(2, _context2.v.byteLength);
|
|
3852
|
-
case 4:
|
|
3853
5090
|
if (!(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body))) {
|
|
3854
|
-
_context2.n =
|
|
5091
|
+
_context2.n = 3;
|
|
3855
5092
|
break;
|
|
3856
5093
|
}
|
|
3857
5094
|
return _context2.a(2, body.byteLength);
|
|
3858
|
-
case
|
|
5095
|
+
case 3:
|
|
3859
5096
|
if (utils$1.isURLSearchParams(body)) {
|
|
3860
5097
|
body = body + '';
|
|
3861
5098
|
}
|
|
3862
5099
|
if (!utils$1.isString(body)) {
|
|
3863
|
-
_context2.n =
|
|
5100
|
+
_context2.n = 5;
|
|
3864
5101
|
break;
|
|
3865
5102
|
}
|
|
3866
|
-
_context2.n =
|
|
5103
|
+
_context2.n = 4;
|
|
3867
5104
|
return encodeText(body);
|
|
3868
|
-
case
|
|
5105
|
+
case 4:
|
|
3869
5106
|
return _context2.a(2, _context2.v.byteLength);
|
|
3870
|
-
case
|
|
5107
|
+
case 5:
|
|
3871
5108
|
return _context2.a(2);
|
|
3872
5109
|
}
|
|
3873
5110
|
}, _callee2);
|
|
@@ -3893,11 +5130,11 @@
|
|
|
3893
5130
|
}();
|
|
3894
5131
|
return /*#__PURE__*/function () {
|
|
3895
5132
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(config) {
|
|
3896
|
-
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, _request, contentTypeHeader,
|
|
5133
|
+
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, maxRedirects, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, pendingBodyError, pendingResponseError, maxBodyLengthError, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, formContentType, formBoundary, parameters, outboundLength, mustEnforceStreamBody, trackRequestStream, _request, contentTypeHeader, _ref5, _ref6, onProgress, flush, isCredentialsSupported, contentType, safeFetchOptions, resolvedOptions, response, responseHeaders, declaredLength, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, networkError, _t3, _t4;
|
|
3897
5134
|
return _regenerator().w(function (_context4) {
|
|
3898
5135
|
while (1) switch (_context4.p = _context4.n) {
|
|
3899
5136
|
case 0:
|
|
3900
|
-
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions, maxContentLength = _resolveConfig.maxContentLength, maxBodyLength = _resolveConfig.maxBodyLength;
|
|
5137
|
+
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions, maxContentLength = _resolveConfig.maxContentLength, maxBodyLength = _resolveConfig.maxBodyLength, maxRedirects = _resolveConfig.maxRedirects;
|
|
3901
5138
|
hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
3902
5139
|
hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
3903
5140
|
own = function own(key) {
|
|
@@ -3910,13 +5147,22 @@
|
|
|
3910
5147
|
unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
|
|
3911
5148
|
composedSignal.unsubscribe();
|
|
3912
5149
|
};
|
|
5150
|
+
// AxiosErrors we raise while request or response bodies are being streamed. Captured
|
|
5151
|
+
// by identity so the catch block can surface it directly, regardless of
|
|
5152
|
+
// how the runtime wraps the resulting fetch rejection (undici exposes it
|
|
5153
|
+
// as `err.cause`; some browsers drop the original error entirely).
|
|
5154
|
+
pendingBodyError = null;
|
|
5155
|
+
pendingResponseError = null;
|
|
5156
|
+
maxBodyLengthError = function maxBodyLengthError() {
|
|
5157
|
+
return new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request);
|
|
5158
|
+
};
|
|
3913
5159
|
_context4.p = 1;
|
|
3914
5160
|
// HTTP basic authentication
|
|
3915
5161
|
auth = undefined;
|
|
3916
5162
|
configAuth = own('auth');
|
|
3917
5163
|
if (configAuth) {
|
|
3918
|
-
username = configAuth
|
|
3919
|
-
password = configAuth
|
|
5164
|
+
username = utils$1.getSafeProp(configAuth, 'username') || '';
|
|
5165
|
+
password = utils$1.getSafeProp(configAuth, 'password') || '';
|
|
3920
5166
|
auth = {
|
|
3921
5167
|
username: username,
|
|
3922
5168
|
password: password
|
|
@@ -3946,59 +5192,116 @@
|
|
|
3946
5192
|
// Enforce maxContentLength for data: URLs up-front so we never materialize
|
|
3947
5193
|
// an oversized payload. The HTTP adapter applies the same check (see http.js
|
|
3948
5194
|
// "if (protocol === 'data:')" branch).
|
|
3949
|
-
if (!(hasMaxContentLength &&
|
|
5195
|
+
if (!(hasMaxContentLength && parsedURL && parsedURL.protocol === 'data:')) {
|
|
3950
5196
|
_context4.n = 2;
|
|
3951
5197
|
break;
|
|
3952
5198
|
}
|
|
3953
|
-
estimated = estimateDataURLDecodedBytes(
|
|
5199
|
+
estimated = estimateDataURLDecodedBytes(parsedURL.href);
|
|
3954
5200
|
if (!(estimated > maxContentLength)) {
|
|
3955
5201
|
_context4.n = 2;
|
|
3956
5202
|
break;
|
|
3957
5203
|
}
|
|
3958
5204
|
throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
3959
5205
|
case 2:
|
|
5206
|
+
formContentType = utils$1.isSpecCompliantForm(data) && AxiosHeaders.from(own('headers')).getContentType();
|
|
5207
|
+
if (utils$1.isString(formContentType) && /^multipart\/form-data(?:\s*;|$)/i.test(formContentType.trim())) {
|
|
5208
|
+
parameters = AxiosHeaders.parseParameters(formContentType);
|
|
5209
|
+
if (utils$1.hasOwnProp(parameters, 'boundary')) formBoundary = parameters.boundary;
|
|
5210
|
+
}
|
|
5211
|
+
if (utils$1.isSpecCompliantForm(data) && method !== 'get' && method !== 'head' && (hasMaxBodyLength || onUploadProgress && supportsRequestStream || formBoundary !== undefined)) {
|
|
5212
|
+
data = createMultipartBody(data, Blob, hasMaxBodyLength ? maxBodyLength : Infinity, maxBodyLengthError, formBoundary);
|
|
5213
|
+
// Blob.type lowercases its value, including a case-sensitive boundary.
|
|
5214
|
+
// Retain the caller's header when an explicit boundary was serialized.
|
|
5215
|
+
headers.setContentType(formBoundary === undefined ? data.type : formContentType);
|
|
5216
|
+
requestContentLength = data.size;
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5219
|
+
// Enforce maxBodyLength against known-size bodies before dispatch using
|
|
5220
|
+
// the body's *actual* size — never a caller-declared Content-Length,
|
|
5221
|
+
// which could under-report to slip an oversized body past the check.
|
|
5222
|
+
// Unknown-size streams return undefined here and are counted per-chunk
|
|
5223
|
+
// below as fetch consumes them.
|
|
3960
5224
|
if (!(hasMaxBodyLength && method !== 'get' && method !== 'head')) {
|
|
3961
5225
|
_context4.n = 4;
|
|
3962
5226
|
break;
|
|
3963
5227
|
}
|
|
3964
5228
|
_context4.n = 3;
|
|
3965
|
-
return
|
|
5229
|
+
return getBodyLength(data);
|
|
3966
5230
|
case 3:
|
|
3967
5231
|
outboundLength = _context4.v;
|
|
3968
|
-
if (!(typeof outboundLength === 'number' && isFinite(outboundLength)
|
|
5232
|
+
if (!(typeof outboundLength === 'number' && isFinite(outboundLength))) {
|
|
5233
|
+
_context4.n = 4;
|
|
5234
|
+
break;
|
|
5235
|
+
}
|
|
5236
|
+
requestContentLength = outboundLength;
|
|
5237
|
+
if (!(outboundLength > maxBodyLength)) {
|
|
3969
5238
|
_context4.n = 4;
|
|
3970
5239
|
break;
|
|
3971
5240
|
}
|
|
3972
|
-
throw
|
|
5241
|
+
throw maxBodyLengthError();
|
|
3973
5242
|
case 4:
|
|
3974
|
-
|
|
3975
|
-
|
|
5243
|
+
// A streamed body under maxBodyLength must be counted as fetch consumes
|
|
5244
|
+
// it; its size is never trusted from a caller-declared Content-Length.
|
|
5245
|
+
mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
|
|
5246
|
+
trackRequestStream = function trackRequestStream(stream, onProgress, flush) {
|
|
5247
|
+
return trackStream(stream, DEFAULT_CHUNK_SIZE, function (loadedBytes) {
|
|
5248
|
+
if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
|
|
5249
|
+
throw pendingBodyError = maxBodyLengthError();
|
|
5250
|
+
}
|
|
5251
|
+
onProgress && onProgress(loadedBytes);
|
|
5252
|
+
}, flush);
|
|
5253
|
+
};
|
|
5254
|
+
if (!(supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody))) {
|
|
5255
|
+
_context4.n = 8;
|
|
5256
|
+
break;
|
|
5257
|
+
}
|
|
5258
|
+
if (!(requestContentLength == null)) {
|
|
3976
5259
|
_context4.n = 6;
|
|
3977
5260
|
break;
|
|
3978
5261
|
}
|
|
3979
5262
|
_context4.n = 5;
|
|
3980
5263
|
return resolveBodyLength(headers, data);
|
|
3981
5264
|
case 5:
|
|
3982
|
-
|
|
3983
|
-
|
|
5265
|
+
_t3 = _context4.v;
|
|
5266
|
+
_context4.n = 7;
|
|
5267
|
+
break;
|
|
3984
5268
|
case 6:
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
5269
|
+
_t3 = requestContentLength;
|
|
5270
|
+
case 7:
|
|
5271
|
+
requestContentLength = _t3;
|
|
5272
|
+
// A declared length of 0 is only trusted to skip the wrap when we are
|
|
5273
|
+
// not enforcing a stream limit (which must not rely on that header).
|
|
5274
|
+
if (requestContentLength !== 0 || mustEnforceStreamBody) {
|
|
5275
|
+
_request = new Request(url, {
|
|
5276
|
+
method: 'POST',
|
|
5277
|
+
body: data,
|
|
5278
|
+
duplex: 'half'
|
|
5279
|
+
});
|
|
5280
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
5281
|
+
headers.setContentType(contentTypeHeader);
|
|
5282
|
+
}
|
|
5283
|
+
if (_request.body) {
|
|
5284
|
+
_ref5 = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [], _ref6 = _slicedToArray(_ref5, 2), onProgress = _ref6[0], flush = _ref6[1];
|
|
5285
|
+
data = trackRequestStream(_request.body, onProgress, flush);
|
|
5286
|
+
}
|
|
3988
5287
|
}
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
headers.setContentType(contentTypeHeader);
|
|
5288
|
+
_context4.n = 10;
|
|
5289
|
+
break;
|
|
5290
|
+
case 8:
|
|
5291
|
+
if (!(mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head')) {
|
|
5292
|
+
_context4.n = 9;
|
|
5293
|
+
break;
|
|
3996
5294
|
}
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
5295
|
+
data = trackRequestStream(data);
|
|
5296
|
+
_context4.n = 10;
|
|
5297
|
+
break;
|
|
5298
|
+
case 9:
|
|
5299
|
+
if (!(mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head')) {
|
|
5300
|
+
_context4.n = 10;
|
|
5301
|
+
break;
|
|
4000
5302
|
}
|
|
4001
|
-
|
|
5303
|
+
throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request);
|
|
5304
|
+
case 10:
|
|
4002
5305
|
if (!utils$1.isString(withCredentials)) {
|
|
4003
5306
|
withCredentials = withCredentials ? 'include' : 'omit';
|
|
4004
5307
|
}
|
|
@@ -4016,7 +5319,18 @@
|
|
|
4016
5319
|
|
|
4017
5320
|
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
|
4018
5321
|
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
4019
|
-
|
|
5322
|
+
safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(Object.create(null), fetchOptions);
|
|
5323
|
+
if (safeFetchOptions) {
|
|
5324
|
+
// These options are owned by Axios and are already reflected in the
|
|
5325
|
+
// resolved Request passed to fetch.
|
|
5326
|
+
delete safeFetchOptions.body;
|
|
5327
|
+
delete safeFetchOptions.headers;
|
|
5328
|
+
delete safeFetchOptions.method;
|
|
5329
|
+
delete safeFetchOptions.signal;
|
|
5330
|
+
delete safeFetchOptions.duplex;
|
|
5331
|
+
delete safeFetchOptions.credentials;
|
|
5332
|
+
}
|
|
5333
|
+
resolvedOptions = Object.assign(Object.create(null), safeFetchOptions, {
|
|
4020
5334
|
signal: composedSignal,
|
|
4021
5335
|
method: method.toUpperCase(),
|
|
4022
5336
|
headers: toByteStringHeaderObject(headers.normalize()),
|
|
@@ -4024,36 +5338,57 @@
|
|
|
4024
5338
|
duplex: 'half',
|
|
4025
5339
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
4026
5340
|
});
|
|
5341
|
+
if (isRequestSupported) {
|
|
5342
|
+
utils$1.forEach(requestDefaults, function (value, key) {
|
|
5343
|
+
if (resolvedOptions[key] === undefined) {
|
|
5344
|
+
resolvedOptions[key] = value;
|
|
5345
|
+
}
|
|
5346
|
+
});
|
|
5347
|
+
if (resolvedOptions.signal === undefined) {
|
|
5348
|
+
resolvedOptions.signal = null;
|
|
5349
|
+
}
|
|
5350
|
+
if (resolvedOptions.body === undefined) {
|
|
5351
|
+
resolvedOptions.body = null;
|
|
5352
|
+
}
|
|
5353
|
+
}
|
|
5354
|
+
if (maxRedirects === 0) {
|
|
5355
|
+
resolvedOptions.redirect = 'manual';
|
|
5356
|
+
if (safeFetchOptions) {
|
|
5357
|
+
safeFetchOptions.redirect = 'manual';
|
|
5358
|
+
}
|
|
5359
|
+
}
|
|
4027
5360
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
4028
|
-
_context4.n =
|
|
4029
|
-
return isRequestSupported ? _fetch(request,
|
|
4030
|
-
case
|
|
5361
|
+
_context4.n = 11;
|
|
5362
|
+
return isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url, resolvedOptions);
|
|
5363
|
+
case 11:
|
|
4031
5364
|
response = _context4.v;
|
|
5365
|
+
responseHeaders = AxiosHeaders.from(response.headers); // Cheap pre-check: if the server honestly declares a content-length that
|
|
5366
|
+
// already exceeds the cap, reject before we start streaming.
|
|
4032
5367
|
if (!hasMaxContentLength) {
|
|
4033
|
-
_context4.n =
|
|
5368
|
+
_context4.n = 12;
|
|
4034
5369
|
break;
|
|
4035
5370
|
}
|
|
4036
|
-
declaredLength = utils$1.toFiniteNumber(
|
|
5371
|
+
declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
4037
5372
|
if (!(declaredLength != null && declaredLength > maxContentLength)) {
|
|
4038
|
-
_context4.n =
|
|
5373
|
+
_context4.n = 12;
|
|
4039
5374
|
break;
|
|
4040
5375
|
}
|
|
4041
5376
|
throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
4042
|
-
case
|
|
5377
|
+
case 12:
|
|
4043
5378
|
isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
4044
5379
|
if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) {
|
|
4045
5380
|
options = {};
|
|
4046
5381
|
['status', 'statusText', 'headers'].forEach(function (prop) {
|
|
4047
5382
|
options[prop] = response[prop];
|
|
4048
5383
|
});
|
|
4049
|
-
responseContentLength = utils$1.toFiniteNumber(
|
|
4050
|
-
|
|
5384
|
+
responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
5385
|
+
_ref7 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref8 = _slicedToArray(_ref7, 2), _onProgress = _ref8[0], _flush = _ref8[1];
|
|
4051
5386
|
bytesRead = 0;
|
|
4052
5387
|
onChunkProgress = function onChunkProgress(loadedBytes) {
|
|
4053
5388
|
if (hasMaxContentLength) {
|
|
4054
5389
|
bytesRead = loadedBytes;
|
|
4055
5390
|
if (bytesRead > maxContentLength) {
|
|
4056
|
-
throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
5391
|
+
throw pendingResponseError = new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
4057
5392
|
}
|
|
4058
5393
|
}
|
|
4059
5394
|
_onProgress && _onProgress(loadedBytes);
|
|
@@ -4064,12 +5399,12 @@
|
|
|
4064
5399
|
}), options);
|
|
4065
5400
|
}
|
|
4066
5401
|
responseType = responseType || 'text';
|
|
4067
|
-
_context4.n =
|
|
5402
|
+
_context4.n = 13;
|
|
4068
5403
|
return resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
4069
|
-
case
|
|
5404
|
+
case 13:
|
|
4070
5405
|
responseData = _context4.v;
|
|
4071
5406
|
if (!(hasMaxContentLength && !supportsResponseStream && !isStreamResponse)) {
|
|
4072
|
-
_context4.n =
|
|
5407
|
+
_context4.n = 14;
|
|
4073
5408
|
break;
|
|
4074
5409
|
}
|
|
4075
5410
|
if (responseData != null) {
|
|
@@ -4082,13 +5417,13 @@
|
|
|
4082
5417
|
}
|
|
4083
5418
|
}
|
|
4084
5419
|
if (!(typeof materializedSize === 'number' && materializedSize > maxContentLength)) {
|
|
4085
|
-
_context4.n =
|
|
5420
|
+
_context4.n = 14;
|
|
4086
5421
|
break;
|
|
4087
5422
|
}
|
|
4088
5423
|
throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request);
|
|
4089
|
-
case
|
|
5424
|
+
case 14:
|
|
4090
5425
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
4091
|
-
_context4.n =
|
|
5426
|
+
_context4.n = 15;
|
|
4092
5427
|
return new Promise(function (resolve, reject) {
|
|
4093
5428
|
settle(resolve, reject, {
|
|
4094
5429
|
data: responseData,
|
|
@@ -4099,39 +5434,76 @@
|
|
|
4099
5434
|
request: request
|
|
4100
5435
|
});
|
|
4101
5436
|
});
|
|
4102
|
-
case
|
|
5437
|
+
case 15:
|
|
4103
5438
|
return _context4.a(2, _context4.v);
|
|
4104
|
-
case
|
|
4105
|
-
_context4.p =
|
|
4106
|
-
|
|
5439
|
+
case 16:
|
|
5440
|
+
_context4.p = 16;
|
|
5441
|
+
_t4 = _context4.v;
|
|
4107
5442
|
unsubscribe && unsubscribe();
|
|
4108
5443
|
|
|
4109
5444
|
// Safari can surface fetch aborts as a DOMException-like object whose
|
|
4110
5445
|
// branded getters throw. Prefer our composed signal reason before reading
|
|
4111
5446
|
// the caught error, preserving timeout vs cancellation semantics.
|
|
4112
5447
|
if (!(composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError)) {
|
|
4113
|
-
_context4.n =
|
|
5448
|
+
_context4.n = 17;
|
|
4114
5449
|
break;
|
|
4115
5450
|
}
|
|
4116
5451
|
canceledError = composedSignal.reason;
|
|
4117
5452
|
canceledError.config = config;
|
|
4118
5453
|
request && (canceledError.request = request);
|
|
4119
|
-
|
|
5454
|
+
if (_t4 !== canceledError) {
|
|
5455
|
+
// Non-enumerable to match native Error `cause` semantics so loggers
|
|
5456
|
+
// don't recurse into circular fetch internals (see #7205).
|
|
5457
|
+
Object.defineProperty(canceledError, 'cause', {
|
|
5458
|
+
__proto__: null,
|
|
5459
|
+
value: _t4,
|
|
5460
|
+
writable: true,
|
|
5461
|
+
enumerable: false,
|
|
5462
|
+
configurable: true
|
|
5463
|
+
});
|
|
5464
|
+
}
|
|
4120
5465
|
throw canceledError;
|
|
4121
|
-
case
|
|
4122
|
-
if (!
|
|
4123
|
-
_context4.n =
|
|
5466
|
+
case 17:
|
|
5467
|
+
if (!pendingBodyError) {
|
|
5468
|
+
_context4.n = 18;
|
|
5469
|
+
break;
|
|
5470
|
+
}
|
|
5471
|
+
request && !pendingBodyError.request && (pendingBodyError.request = request);
|
|
5472
|
+
throw pendingBodyError;
|
|
5473
|
+
case 18:
|
|
5474
|
+
if (!pendingResponseError) {
|
|
5475
|
+
_context4.n = 19;
|
|
5476
|
+
break;
|
|
5477
|
+
}
|
|
5478
|
+
throw pendingResponseError;
|
|
5479
|
+
case 19:
|
|
5480
|
+
if (!(_t4 instanceof AxiosError)) {
|
|
5481
|
+
_context4.n = 20;
|
|
4124
5482
|
break;
|
|
4125
5483
|
}
|
|
4126
|
-
|
|
4127
|
-
|
|
5484
|
+
request && !_t4.request && (_t4.request = request);
|
|
5485
|
+
throw _t4;
|
|
5486
|
+
case 20:
|
|
5487
|
+
if (!(_t4 && _t4.name === 'TypeError' && /Load failed|fetch/i.test(_t4.message))) {
|
|
5488
|
+
_context4.n = 21;
|
|
5489
|
+
break;
|
|
5490
|
+
}
|
|
5491
|
+
networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, _t4 && _t4.response); // Non-enumerable to match native Error `cause` semantics so loggers
|
|
5492
|
+
// don't recurse into circular fetch internals (see #7205).
|
|
5493
|
+
Object.defineProperty(networkError, 'cause', {
|
|
5494
|
+
__proto__: null,
|
|
5495
|
+
value: _t4.cause || _t4,
|
|
5496
|
+
writable: true,
|
|
5497
|
+
enumerable: false,
|
|
5498
|
+
configurable: true
|
|
4128
5499
|
});
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
5500
|
+
throw networkError;
|
|
5501
|
+
case 21:
|
|
5502
|
+
throw AxiosError.from(_t4, _t4 && _t4.code, config, request, _t4 && _t4.response);
|
|
5503
|
+
case 22:
|
|
4132
5504
|
return _context4.a(2);
|
|
4133
5505
|
}
|
|
4134
|
-
}, _callee4, null, [[1,
|
|
5506
|
+
}, _callee4, null, [[1, 16]]);
|
|
4135
5507
|
}));
|
|
4136
5508
|
return function (_x5) {
|
|
4137
5509
|
return _ref4.apply(this, arguments);
|
|
@@ -4140,11 +5512,18 @@
|
|
|
4140
5512
|
};
|
|
4141
5513
|
var seedCache = new Map();
|
|
4142
5514
|
var getFetch = function getFetch(config) {
|
|
4143
|
-
var env =
|
|
5515
|
+
var env = Object.create(null);
|
|
5516
|
+
var configuredEnv = config && utils$1.hasOwnProp(config, 'env') && config.env;
|
|
5517
|
+
['fetch', 'Request', 'Response', 'Blob'].forEach(function (key) {
|
|
5518
|
+
if (configuredEnv && utils$1.hasOwnProp(configuredEnv, key)) {
|
|
5519
|
+
env[key] = configuredEnv[key];
|
|
5520
|
+
}
|
|
5521
|
+
});
|
|
4144
5522
|
var fetch = env.fetch,
|
|
4145
5523
|
Request = env.Request,
|
|
4146
|
-
Response = env.Response
|
|
4147
|
-
|
|
5524
|
+
Response = env.Response,
|
|
5525
|
+
Blob = env.Blob;
|
|
5526
|
+
var seeds = [Request, Response, fetch, Blob];
|
|
4148
5527
|
var len = seeds.length,
|
|
4149
5528
|
i = len,
|
|
4150
5529
|
seed,
|
|
@@ -4257,7 +5636,7 @@
|
|
|
4257
5636
|
return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build');
|
|
4258
5637
|
});
|
|
4259
5638
|
var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
|
|
4260
|
-
throw new AxiosError("There is no suitable adapter to dispatch the request " + s,
|
|
5639
|
+
throw new AxiosError("There is no suitable adapter to dispatch the request " + s, AxiosError.ERR_NOT_SUPPORT);
|
|
4261
5640
|
}
|
|
4262
5641
|
return adapter;
|
|
4263
5642
|
}
|
|
@@ -4294,6 +5673,37 @@
|
|
|
4294
5673
|
}
|
|
4295
5674
|
}
|
|
4296
5675
|
|
|
5676
|
+
/**
|
|
5677
|
+
* Resolve the clock used to time adapter execution.
|
|
5678
|
+
*
|
|
5679
|
+
* Prefers the monotonic `performance.now()` so wall-clock adjustments do not
|
|
5680
|
+
* skew the measurement, and so frameworks that forbid reading the current
|
|
5681
|
+
* time during prerendering (e.g. Next.js Cache Components) accept it. Falls
|
|
5682
|
+
* back to `Date.now()` in runtimes without the High Resolution Time API.
|
|
5683
|
+
*
|
|
5684
|
+
* @returns {() => number} Millisecond clock
|
|
5685
|
+
*/
|
|
5686
|
+
function resolveClock() {
|
|
5687
|
+
return typeof performance !== 'undefined' && utils$1.isFunction(performance.now) ? function () {
|
|
5688
|
+
return performance.now();
|
|
5689
|
+
} : Date.now;
|
|
5690
|
+
}
|
|
5691
|
+
|
|
5692
|
+
/**
|
|
5693
|
+
* Whole milliseconds elapsed since `start`, floored at zero.
|
|
5694
|
+
*
|
|
5695
|
+
* Rounded so the value stays an integer as with `Date.now()`. The fallback
|
|
5696
|
+
* wall clock can move backwards mid-request, so the result is clamped.
|
|
5697
|
+
*
|
|
5698
|
+
* @param {() => number} now Clock returned by `resolveClock()`
|
|
5699
|
+
* @param {number} start Timestamp read from `now`
|
|
5700
|
+
*
|
|
5701
|
+
* @returns {number} Non-negative elapsed milliseconds
|
|
5702
|
+
*/
|
|
5703
|
+
function elapsedSince(now, start) {
|
|
5704
|
+
return Math.max(0, Math.round(now() - start));
|
|
5705
|
+
}
|
|
5706
|
+
|
|
4297
5707
|
/**
|
|
4298
5708
|
* Dispatch a request to the server using the configured adapter.
|
|
4299
5709
|
*
|
|
@@ -4301,9 +5711,13 @@
|
|
|
4301
5711
|
*
|
|
4302
5712
|
* @returns {Promise} The Promise to be fulfilled
|
|
4303
5713
|
*/
|
|
4304
|
-
function dispatchRequest(
|
|
5714
|
+
function dispatchRequest(_config) {
|
|
5715
|
+
// Interceptors may replace the merged config with an ordinary object. Flatten
|
|
5716
|
+
// it at the dispatch boundary so shared prototype members cannot become
|
|
5717
|
+
// request behavior, while preserving intentional template/class members.
|
|
5718
|
+
var config = utils$1.toSafeFlatObject(_config);
|
|
4305
5719
|
throwIfCancellationRequested(config);
|
|
4306
|
-
config.headers = AxiosHeaders.from(config
|
|
5720
|
+
config.headers = AxiosHeaders.from(utils$1.getSafeProp(config, 'headers'));
|
|
4307
5721
|
|
|
4308
5722
|
// Transform request data
|
|
4309
5723
|
config.data = transformData.call(config, config.transformRequest);
|
|
@@ -4311,8 +5725,11 @@
|
|
|
4311
5725
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
4312
5726
|
}
|
|
4313
5727
|
var adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
5728
|
+
var now = resolveClock();
|
|
5729
|
+
var start = now();
|
|
4314
5730
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
4315
5731
|
throwIfCancellationRequested(config);
|
|
5732
|
+
response.duration = elapsedSince(now, start);
|
|
4316
5733
|
|
|
4317
5734
|
// Expose the current response on config so that transformResponse can
|
|
4318
5735
|
// attach it to any AxiosError it throws (e.g. on JSON parse failure).
|
|
@@ -4331,6 +5748,7 @@
|
|
|
4331
5748
|
|
|
4332
5749
|
// Transform response data
|
|
4333
5750
|
if (reason && reason.response) {
|
|
5751
|
+
reason.response.duration = elapsedSince(now, start);
|
|
4334
5752
|
config.response = reason.response;
|
|
4335
5753
|
try {
|
|
4336
5754
|
reason.response.data = transformData.call(config, config.transformResponse, reason.response);
|
|
@@ -4400,7 +5818,7 @@
|
|
|
4400
5818
|
*/
|
|
4401
5819
|
|
|
4402
5820
|
function assertOptions(options, schema, allowUnknown) {
|
|
4403
|
-
if (_typeof(options) !== 'object') {
|
|
5821
|
+
if (_typeof(options) !== 'object' || options === null) {
|
|
4404
5822
|
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
4405
5823
|
}
|
|
4406
5824
|
var keys = Object.keys(options);
|
|
@@ -4430,6 +5848,23 @@
|
|
|
4430
5848
|
|
|
4431
5849
|
var validators = validator.validators;
|
|
4432
5850
|
|
|
5851
|
+
// Recognize header maps without consuming objects intended as literal values.
|
|
5852
|
+
// AxiosHeaders from other builds share a brand and header-container interface,
|
|
5853
|
+
// but not constructor identity. A tag and toJSON alone can describe a literal.
|
|
5854
|
+
var isHeadersBucket = function isHeadersBucket(value) {
|
|
5855
|
+
if (value == null || utils$1.isPlainObject(value) || value instanceof AxiosHeaders) {
|
|
5856
|
+
return true;
|
|
5857
|
+
}
|
|
5858
|
+
try {
|
|
5859
|
+
return utils$1.isObject(value) && utils$1.getSafeProp(value, Symbol.toStringTag) === 'AxiosHeaders' && ['toJSON', 'set', 'get', 'has', 'delete', 'clear', 'normalize', 'concat', 'toString', Symbol.iterator].every(function (method) {
|
|
5860
|
+
return utils$1.isFunction(utils$1.getSafeProp(value, method));
|
|
5861
|
+
});
|
|
5862
|
+
} catch (e) {
|
|
5863
|
+
// A failed optional brand probe must not prevent literal header serialization.
|
|
5864
|
+
return false;
|
|
5865
|
+
}
|
|
5866
|
+
};
|
|
5867
|
+
|
|
4433
5868
|
/**
|
|
4434
5869
|
* Create a new instance of Axios
|
|
4435
5870
|
*
|
|
@@ -4459,7 +5894,7 @@
|
|
|
4459
5894
|
key: "request",
|
|
4460
5895
|
value: (function () {
|
|
4461
5896
|
var _request2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(configOrUrl, config) {
|
|
4462
|
-
var dummy, stack, firstNewlineIndex, secondNewlineIndex,
|
|
5897
|
+
var dummy, dummyStack, stack, firstNewlineIndex, _firstNewlineIndex, secondNewlineIndex, duplicateCheckSuffix, currentStack, causeIndex, stackHead, causeSection, _t;
|
|
4463
5898
|
return _regenerator().w(function (_context) {
|
|
4464
5899
|
while (1) switch (_context.p = _context.n) {
|
|
4465
5900
|
case 0:
|
|
@@ -4472,31 +5907,36 @@
|
|
|
4472
5907
|
_context.p = 2;
|
|
4473
5908
|
_t = _context.v;
|
|
4474
5909
|
if (_t instanceof Error) {
|
|
4475
|
-
dummy = {};
|
|
4476
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
4477
|
-
|
|
4478
|
-
// slice off the Error: ... line
|
|
4479
|
-
stack = function () {
|
|
4480
|
-
if (!dummy.stack) {
|
|
4481
|
-
return '';
|
|
4482
|
-
}
|
|
4483
|
-
var firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
4484
|
-
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
4485
|
-
}();
|
|
4486
5910
|
try {
|
|
5911
|
+
dummy = {};
|
|
5912
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
5913
|
+
dummyStack = dummy.stack;
|
|
5914
|
+
stack = ''; // slice off the Error: ... line
|
|
5915
|
+
if (typeof dummyStack === 'string') {
|
|
5916
|
+
firstNewlineIndex = dummyStack.indexOf('\n');
|
|
5917
|
+
stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);
|
|
5918
|
+
}
|
|
4487
5919
|
if (!_t.stack) {
|
|
4488
5920
|
_t.stack = stack;
|
|
4489
|
-
// match without the 2 top stack lines
|
|
4490
5921
|
} else if (stack) {
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
5922
|
+
// Match a common suffix after the 2 top frames when available,
|
|
5923
|
+
// otherwise compare the full reconstructed stack.
|
|
5924
|
+
_firstNewlineIndex = stack.indexOf('\n');
|
|
5925
|
+
secondNewlineIndex = _firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', _firstNewlineIndex + 1);
|
|
5926
|
+
duplicateCheckSuffix = secondNewlineIndex === -1 ? stack : stack.slice(secondNewlineIndex + 1); // `AxiosError.from()` may have already inlined the wrapped error's
|
|
5927
|
+
// stack under a `Caused by:` marker. Keep the reconstructed caller
|
|
5928
|
+
// frames ahead of that marker so stack-only reporters do not read
|
|
5929
|
+
// them as part of the low-level cause.
|
|
5930
|
+
currentStack = String(_t.stack);
|
|
5931
|
+
causeIndex = getCauseStackIndex(_t, currentStack);
|
|
5932
|
+
stackHead = causeIndex === -1 ? currentStack : currentStack.slice(0, causeIndex);
|
|
5933
|
+
causeSection = causeIndex === -1 ? '' : currentStack.slice(causeIndex);
|
|
5934
|
+
if (!stackHead.endsWith(duplicateCheckSuffix)) {
|
|
5935
|
+
_t.stack = stackHead + '\n' + stack + causeSection;
|
|
4496
5936
|
}
|
|
4497
5937
|
}
|
|
4498
5938
|
} catch (e) {
|
|
4499
|
-
//
|
|
5939
|
+
// Ignore failures from custom stack hooks or un-writable stack properties.
|
|
4500
5940
|
}
|
|
4501
5941
|
}
|
|
4502
5942
|
throw _t;
|
|
@@ -4513,6 +5953,7 @@
|
|
|
4513
5953
|
}, {
|
|
4514
5954
|
key: "_request",
|
|
4515
5955
|
value: function _request(configOrUrl, config) {
|
|
5956
|
+
var _this = this;
|
|
4516
5957
|
/*eslint no-param-reassign:0*/
|
|
4517
5958
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
4518
5959
|
if (typeof configOrUrl === 'string') {
|
|
@@ -4532,7 +5973,9 @@
|
|
|
4532
5973
|
forcedJSONParsing: validators.transitional(validators["boolean"]),
|
|
4533
5974
|
clarifyTimeoutError: validators.transitional(validators["boolean"]),
|
|
4534
5975
|
legacyInterceptorReqResOrdering: validators.transitional(validators["boolean"]),
|
|
4535
|
-
advertiseZstdAcceptEncoding: validators.transitional(validators["boolean"])
|
|
5976
|
+
advertiseZstdAcceptEncoding: validators.transitional(validators["boolean"]),
|
|
5977
|
+
validateStatusUndefinedResolves: validators.transitional(validators["boolean"]),
|
|
5978
|
+
encodeBasicAuthUsername: validators.transitional(validators["boolean"])
|
|
4536
5979
|
}, false);
|
|
4537
5980
|
}
|
|
4538
5981
|
if (paramsSerializer != null) {
|
|
@@ -4549,7 +5992,7 @@
|
|
|
4549
5992
|
}
|
|
4550
5993
|
|
|
4551
5994
|
// Set config.allowAbsoluteUrls
|
|
4552
|
-
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
|
5995
|
+
if (config.allowAbsoluteUrls !== undefined) ; else if (utils$1.hasOwnProp(this.defaults, 'allowAbsoluteUrls') && this.defaults.allowAbsoluteUrls !== undefined) {
|
|
4553
5996
|
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
4554
5997
|
} else {
|
|
4555
5998
|
config.allowAbsoluteUrls = true;
|
|
@@ -4560,12 +6003,16 @@
|
|
|
4560
6003
|
}, true);
|
|
4561
6004
|
|
|
4562
6005
|
// Set config.method
|
|
4563
|
-
config.method = (config
|
|
4564
|
-
|
|
4565
|
-
// Flatten headers
|
|
4566
|
-
var
|
|
4567
|
-
|
|
4568
|
-
|
|
6006
|
+
config.method = (utils$1.getSafeProp(config, 'method') || utils$1.getSafeProp(this.defaults, 'method') || 'get').toLowerCase();
|
|
6007
|
+
|
|
6008
|
+
// Flatten header defaults without consuming literal method-named headers.
|
|
6009
|
+
var commonHeaders = utils$1.getSafeProp(headers, 'common');
|
|
6010
|
+
var methodHeaders = utils$1.getSafeProp(headers, config.method);
|
|
6011
|
+
var contextHeaders = headers && utils$1.merge(isHeadersBucket(commonHeaders) ? commonHeaders : undefined, isHeadersBucket(methodHeaders) ? methodHeaders : undefined);
|
|
6012
|
+
headers && utils$1.forEach(methodList.concat('common'), function (method) {
|
|
6013
|
+
if (isHeadersBucket(utils$1.getSafeProp(headers, method))) {
|
|
6014
|
+
delete headers[method];
|
|
6015
|
+
}
|
|
4569
6016
|
});
|
|
4570
6017
|
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
4571
6018
|
|
|
@@ -4609,16 +6056,31 @@
|
|
|
4609
6056
|
var onFulfilled = requestInterceptorChain[i++];
|
|
4610
6057
|
var onRejected = requestInterceptorChain[i++];
|
|
4611
6058
|
try {
|
|
4612
|
-
newConfig = onFulfilled(newConfig);
|
|
6059
|
+
newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;
|
|
4613
6060
|
} catch (error) {
|
|
4614
|
-
onRejected
|
|
6061
|
+
if (!onRejected) {
|
|
6062
|
+
promise = Promise.reject(error);
|
|
6063
|
+
break;
|
|
6064
|
+
}
|
|
6065
|
+
try {
|
|
6066
|
+
var rejectedResult = onRejected.call(this, error);
|
|
6067
|
+
if (utils$1.isThenable(rejectedResult)) {
|
|
6068
|
+
promise = Promise.resolve(rejectedResult).then(function () {
|
|
6069
|
+
return dispatchRequest.call(_this, newConfig);
|
|
6070
|
+
});
|
|
6071
|
+
}
|
|
6072
|
+
} catch (rejectedError) {
|
|
6073
|
+
promise = Promise.reject(rejectedError);
|
|
6074
|
+
}
|
|
4615
6075
|
break;
|
|
4616
6076
|
}
|
|
4617
6077
|
}
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
6078
|
+
if (!promise) {
|
|
6079
|
+
try {
|
|
6080
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
6081
|
+
} catch (error) {
|
|
6082
|
+
promise = Promise.reject(error);
|
|
6083
|
+
}
|
|
4622
6084
|
}
|
|
4623
6085
|
i = 0;
|
|
4624
6086
|
len = responseInterceptorChain.length;
|
|
@@ -4631,33 +6093,54 @@
|
|
|
4631
6093
|
key: "getUri",
|
|
4632
6094
|
value: function getUri(config) {
|
|
4633
6095
|
config = mergeConfig(this.defaults, config);
|
|
4634
|
-
var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
6096
|
+
var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
|
|
4635
6097
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
4636
6098
|
}
|
|
4637
6099
|
}]);
|
|
4638
6100
|
}(); // Provide aliases for supported request methods
|
|
4639
6101
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
4640
6102
|
/*eslint func-names:0*/
|
|
4641
|
-
Axios.prototype[method] = function (
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
6103
|
+
Axios.prototype[method] = /*#__PURE__*/function () {
|
|
6104
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url, config) {
|
|
6105
|
+
return _regenerator().w(function (_context2) {
|
|
6106
|
+
while (1) switch (_context2.n) {
|
|
6107
|
+
case 0:
|
|
6108
|
+
return _context2.a(2, this.request(mergeConfig(config || {}, {
|
|
6109
|
+
method: method,
|
|
6110
|
+
url: url,
|
|
6111
|
+
data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined
|
|
6112
|
+
})));
|
|
6113
|
+
}
|
|
6114
|
+
}, _callee2, this);
|
|
4646
6115
|
}));
|
|
4647
|
-
|
|
6116
|
+
return function (_x3, _x4) {
|
|
6117
|
+
return _ref.apply(this, arguments);
|
|
6118
|
+
};
|
|
6119
|
+
}();
|
|
4648
6120
|
});
|
|
4649
6121
|
utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
|
|
4650
6122
|
function generateHTTPMethod(isForm) {
|
|
4651
|
-
return function
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
6123
|
+
return /*#__PURE__*/function () {
|
|
6124
|
+
var _httpMethod = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(url, data, config) {
|
|
6125
|
+
return _regenerator().w(function (_context3) {
|
|
6126
|
+
while (1) switch (_context3.n) {
|
|
6127
|
+
case 0:
|
|
6128
|
+
return _context3.a(2, this.request(mergeConfig(config || {}, {
|
|
6129
|
+
method: method,
|
|
6130
|
+
headers: isForm ? {
|
|
6131
|
+
'Content-Type': 'multipart/form-data'
|
|
6132
|
+
} : {},
|
|
6133
|
+
url: url,
|
|
6134
|
+
data: data
|
|
6135
|
+
})));
|
|
6136
|
+
}
|
|
6137
|
+
}, _callee3, this);
|
|
4659
6138
|
}));
|
|
4660
|
-
|
|
6139
|
+
function httpMethod(_x5, _x6, _x7) {
|
|
6140
|
+
return _httpMethod.apply(this, arguments);
|
|
6141
|
+
}
|
|
6142
|
+
return httpMethod;
|
|
6143
|
+
}();
|
|
4661
6144
|
}
|
|
4662
6145
|
Axios.prototype[method] = generateHTTPMethod();
|
|
4663
6146
|
|
|
@@ -4871,14 +6354,22 @@
|
|
|
4871
6354
|
Gone: 410,
|
|
4872
6355
|
LengthRequired: 411,
|
|
4873
6356
|
PreconditionFailed: 412,
|
|
6357
|
+
/**
|
|
6358
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
6359
|
+
*/
|
|
4874
6360
|
PayloadTooLarge: 413,
|
|
6361
|
+
ContentTooLarge: 413,
|
|
4875
6362
|
UriTooLong: 414,
|
|
4876
6363
|
UnsupportedMediaType: 415,
|
|
4877
6364
|
RangeNotSatisfiable: 416,
|
|
4878
6365
|
ExpectationFailed: 417,
|
|
4879
6366
|
ImATeapot: 418,
|
|
4880
6367
|
MisdirectedRequest: 421,
|
|
6368
|
+
/**
|
|
6369
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
6370
|
+
*/
|
|
4881
6371
|
UnprocessableEntity: 422,
|
|
6372
|
+
UnprocessableContent: 422,
|
|
4882
6373
|
Locked: 423,
|
|
4883
6374
|
FailedDependency: 424,
|
|
4884
6375
|
TooEarly: 425,
|
|
@@ -4898,6 +6389,7 @@
|
|
|
4898
6389
|
LoopDetected: 508,
|
|
4899
6390
|
NotExtended: 510,
|
|
4900
6391
|
NetworkAuthenticationRequired: 511,
|
|
6392
|
+
WebServerReturnsAnUnknownError: 520,
|
|
4901
6393
|
WebServerIsDown: 521,
|
|
4902
6394
|
ConnectionTimedOut: 522,
|
|
4903
6395
|
OriginIsUnreachable: 523,
|
|
@@ -4909,7 +6401,9 @@
|
|
|
4909
6401
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
4910
6402
|
key = _ref2[0],
|
|
4911
6403
|
value = _ref2[1];
|
|
4912
|
-
HttpStatusCode[value]
|
|
6404
|
+
if (HttpStatusCode[value] === undefined) {
|
|
6405
|
+
HttpStatusCode[value] = key;
|
|
6406
|
+
}
|
|
4913
6407
|
});
|
|
4914
6408
|
|
|
4915
6409
|
/**
|
|
@@ -4981,4 +6475,3 @@
|
|
|
4981
6475
|
return axios;
|
|
4982
6476
|
|
|
4983
6477
|
}));
|
|
4984
|
-
//# sourceMappingURL=axios.js.map
|