@zuplo/cli 6.69.3 → 6.69.5
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/__tests__/integration/confirm-linked-config.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/confirm-linked-config.integration.test.js +202 -0
- package/dist/__tests__/integration/confirm-linked-config.integration.test.js.map +1 -0
- package/dist/__tests__/integration/info.integration.test.js +49 -2
- package/dist/__tests__/integration/info.integration.test.js.map +1 -1
- package/dist/__tests__/integration/jest-mocks-setup.js +29 -10
- package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
- package/dist/__tests__/integration/linked-config-cascade.integration.test.js +36 -0
- package/dist/__tests__/integration/linked-config-cascade.integration.test.js.map +1 -1
- package/dist/cmds/custom-domain/index.d.ts.map +1 -1
- package/dist/cmds/custom-domain/index.js +6 -10
- package/dist/cmds/custom-domain/index.js.map +1 -1
- package/dist/cmds/delete.d.ts.map +1 -1
- package/dist/cmds/delete.js +2 -0
- package/dist/cmds/delete.js.map +1 -1
- package/dist/cmds/deploy.d.ts.map +1 -1
- package/dist/cmds/deploy.js +2 -0
- package/dist/cmds/deploy.js.map +1 -1
- package/dist/cmds/link.d.ts.map +1 -1
- package/dist/cmds/link.js +2 -0
- package/dist/cmds/link.js.map +1 -1
- package/dist/cmds/list.d.ts.map +1 -1
- package/dist/cmds/list.js +2 -0
- package/dist/cmds/list.js.map +1 -1
- package/dist/cmds/mtls-certificates/create.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/create.js +2 -0
- package/dist/cmds/mtls-certificates/create.js.map +1 -1
- package/dist/cmds/mtls-certificates/delete.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/delete.js +2 -0
- package/dist/cmds/mtls-certificates/delete.js.map +1 -1
- package/dist/cmds/mtls-certificates/describe.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/describe.js +2 -0
- package/dist/cmds/mtls-certificates/describe.js.map +1 -1
- package/dist/cmds/mtls-certificates/disable.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/disable.js +2 -0
- package/dist/cmds/mtls-certificates/disable.js.map +1 -1
- package/dist/cmds/mtls-certificates/index.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/index.js +8 -12
- package/dist/cmds/mtls-certificates/index.js.map +1 -1
- package/dist/cmds/mtls-certificates/list.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/list.js +2 -0
- package/dist/cmds/mtls-certificates/list.js.map +1 -1
- package/dist/cmds/mtls-certificates/update.d.ts.map +1 -1
- package/dist/cmds/mtls-certificates/update.js +2 -0
- package/dist/cmds/mtls-certificates/update.js.map +1 -1
- package/dist/cmds/open-api/index.d.ts.map +1 -1
- package/dist/cmds/open-api/index.js +2 -5
- package/dist/cmds/open-api/index.js.map +1 -1
- package/dist/cmds/project/index.d.ts.map +1 -1
- package/dist/cmds/project/index.js +2 -5
- package/dist/cmds/project/index.js.map +1 -1
- package/dist/cmds/proxies/index.d.ts +4 -4
- package/dist/cmds/proxies/index.d.ts.map +1 -1
- package/dist/cmds/proxies/index.js +6 -10
- package/dist/cmds/proxies/index.js.map +1 -1
- package/dist/cmds/source/index.d.ts.map +1 -1
- package/dist/cmds/source/index.js +2 -9
- package/dist/cmds/source/index.js.map +1 -1
- package/dist/cmds/source/migrate.d.ts +4 -4
- package/dist/cmds/source/migrate.d.ts.map +1 -1
- package/dist/cmds/source/migrate.js +3 -6
- package/dist/cmds/source/migrate.js.map +1 -1
- package/dist/cmds/tunnel/index.d.ts.map +1 -1
- package/dist/cmds/tunnel/index.js +8 -12
- package/dist/cmds/tunnel/index.js.map +1 -1
- package/dist/cmds/tunnel/services/index.d.ts.map +1 -1
- package/dist/cmds/tunnel/services/index.js +2 -5
- package/dist/cmds/tunnel/services/index.js.map +1 -1
- package/dist/cmds/variable/create.d.ts.map +1 -1
- package/dist/cmds/variable/create.js +2 -0
- package/dist/cmds/variable/create.js.map +1 -1
- package/dist/cmds/variable/index.d.ts.map +1 -1
- package/dist/cmds/variable/index.js +2 -5
- package/dist/cmds/variable/index.js.map +1 -1
- package/dist/cmds/variable/update.d.ts.map +1 -1
- package/dist/cmds/variable/update.js +2 -0
- package/dist/cmds/variable/update.js.map +1 -1
- package/dist/common/handler.d.ts +4 -1
- package/dist/common/handler.d.ts.map +1 -1
- package/dist/common/handler.js +11 -2
- package/dist/common/handler.js.map +1 -1
- package/dist/common/middleware/confirm-linked-config.d.ts +4 -0
- package/dist/common/middleware/confirm-linked-config.d.ts.map +1 -0
- package/dist/common/middleware/confirm-linked-config.js +30 -0
- package/dist/common/middleware/confirm-linked-config.js.map +1 -0
- package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
- package/dist/common/middleware/get-environment-param.js +2 -18
- package/dist/common/middleware/get-environment-param.js.map +1 -1
- package/dist/common/utils/build-environment-prompt-choices.d.ts +13 -0
- package/dist/common/utils/build-environment-prompt-choices.d.ts.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.js +66 -0
- package/dist/common/utils/build-environment-prompt-choices.js.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts +2 -0
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +1 -0
- package/dist/common/utils/build-environment-prompt-choices.test.js +97 -0
- package/dist/common/utils/build-environment-prompt-choices.test.js.map +1 -0
- package/dist/common/utils/format-environment-type.d.ts +2 -0
- package/dist/common/utils/format-environment-type.d.ts.map +1 -0
- package/dist/common/utils/format-environment-type.js +12 -0
- package/dist/common/utils/format-environment-type.js.map +1 -0
- package/dist/common/utils/format-environment-type.test.d.ts +2 -0
- package/dist/common/utils/format-environment-type.test.d.ts.map +1 -0
- package/dist/common/utils/format-environment-type.test.js +32 -0
- package/dist/common/utils/format-environment-type.test.js.map +1 -0
- package/dist/common/utils/pretty-print-environment-prompt.d.ts +1 -4
- package/dist/common/utils/pretty-print-environment-prompt.d.ts.map +1 -1
- package/dist/common/utils/pretty-print-environment-prompt.js +6 -14
- package/dist/common/utils/pretty-print-environment-prompt.js.map +1 -1
- package/dist/common/utils/pretty-print-environment-prompt.test.js +15 -17
- package/dist/common/utils/pretty-print-environment-prompt.test.js.map +1 -1
- package/dist/common/utils/sort-environments-for-prompt.d.ts +5 -0
- package/dist/common/utils/sort-environments-for-prompt.d.ts.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.js +27 -0
- package/dist/common/utils/sort-environments-for-prompt.js.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts +2 -0
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +1 -0
- package/dist/common/utils/sort-environments-for-prompt.test.js +82 -0
- package/dist/common/utils/sort-environments-for-prompt.test.js.map +1 -0
- package/dist/project/info/handler.d.ts.map +1 -1
- package/dist/project/info/handler.js +5 -1
- package/dist/project/info/handler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/README.md +1 -5
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -1
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +21 -6
- package/node_modules/@fastify/proxy-addr/node_modules/ipaddr.js/package.json +1 -1
- package/node_modules/@zuplo/core/index.minified.js +141 -137
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/ci.yml +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/LICENSE +1 -3
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/benchmark/bench-cmp-lib.js +60 -44
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/index.js +2 -2
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/package.json +7 -7
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/anyof.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/array.test.js +22 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/debug-mode.test.js +21 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/if-then-else.test.js +72 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/invalidSchema.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/issue-836.test.js +183 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/json-add-comma.test.js +57 -57
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/oneof.test.js +20 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/ref.test.js +31 -0
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/test/typebox.test.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/types/{index.test-d.ts → index.tst.ts} +17 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +10 -16
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +9 -15
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +8 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
- package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +44 -16
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js +54 -54
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +4 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/axios/CHANGELOG.md +32 -6
- package/node_modules/axios/README.md +356 -20
- package/node_modules/axios/dist/axios.js +1389 -1071
- package/node_modules/axios/dist/axios.js.map +1 -1
- 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 +1486 -1123
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +1488 -1124
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- 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 +1230 -871
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +25 -13
- package/node_modules/axios/index.d.ts +21 -4
- package/node_modules/axios/index.js +2 -0
- package/node_modules/axios/lib/adapters/adapters.js +4 -2
- package/node_modules/axios/lib/adapters/fetch.js +126 -10
- package/node_modules/axios/lib/adapters/http.js +178 -59
- package/node_modules/axios/lib/adapters/xhr.js +6 -2
- package/node_modules/axios/lib/core/Axios.js +7 -3
- package/node_modules/axios/lib/core/AxiosError.js +86 -1
- package/node_modules/axios/lib/core/AxiosHeaders.js +3 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
- package/node_modules/axios/lib/core/mergeConfig.js +6 -3
- package/node_modules/axios/lib/core/settle.js +7 -11
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +14 -2
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +1 -1
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +33 -17
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +26 -1
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/utils.js +27 -15
- package/node_modules/axios/package.json +17 -24
- package/node_modules/fast-uri/.github/workflows/ci.yml +12 -7
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +1 -1
- package/node_modules/fast-uri/LICENSE +1 -3
- package/node_modules/fast-uri/README.md +13 -4
- package/node_modules/fast-uri/index.js +90 -24
- package/node_modules/fast-uri/lib/utils.js +129 -22
- package/node_modules/fast-uri/package.json +3 -4
- package/node_modules/fast-uri/test/equal.test.js +9 -0
- package/node_modules/fast-uri/test/parse.test.js +5 -0
- package/node_modules/fast-uri/test/resolve.test.js +9 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
- package/node_modules/fast-uri/test/security.test.js +133 -0
- package/node_modules/is-core-module/CHANGELOG.md +244 -113
- package/node_modules/is-core-module/README.md +1 -1
- package/node_modules/is-core-module/core.json +12 -12
- package/node_modules/is-core-module/package.json +5 -5
- package/node_modules/is-core-module/test/index.js +101 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1380 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +1686 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +2 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +4 -7
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +10 -16
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1380 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +1686 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +11 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +9 -15
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +4 -4
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +8 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
- package/node_modules/rimraf/node_modules/lru-cache/package.json +44 -16
- package/package.json +6 -6
- package/node_modules/@zuplo/editor/node_modules/fast-json-stringify/.github/stale.yml +0 -21
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
- package/node_modules/fast-uri/.github/.stale.yml +0 -21
- package/node_modules/fast-uri/.github/tests_checker.yml +0 -8
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.mts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.mjs.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.mts.map +0 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Axios v1.
|
|
1
|
+
/*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
2
2
|
/**
|
|
3
3
|
* Create a bound version of a function with a specified `this` context
|
|
4
4
|
*
|
|
@@ -202,9 +202,9 @@ const isFile = kindOfTest('File');
|
|
|
202
202
|
* also have a `name` and `type` attribute to specify filename and content type
|
|
203
203
|
*
|
|
204
204
|
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
205
|
-
*
|
|
205
|
+
*
|
|
206
206
|
* @param {*} value The value to test
|
|
207
|
-
*
|
|
207
|
+
*
|
|
208
208
|
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
209
209
|
*/
|
|
210
210
|
const isReactNativeBlob = (value) => {
|
|
@@ -214,9 +214,9 @@ const isReactNativeBlob = (value) => {
|
|
|
214
214
|
/**
|
|
215
215
|
* Determine if environment is React Native
|
|
216
216
|
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
217
|
-
*
|
|
217
|
+
*
|
|
218
218
|
* @param {*} formData The formData to test
|
|
219
|
-
*
|
|
219
|
+
*
|
|
220
220
|
* @returns {boolean} True if environment is React Native, otherwise false
|
|
221
221
|
*/
|
|
222
222
|
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
@@ -235,7 +235,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
235
235
|
*
|
|
236
236
|
* @param {*} val The value to test
|
|
237
237
|
*
|
|
238
|
-
* @returns {boolean} True if value is a
|
|
238
|
+
* @returns {boolean} True if value is a FileList, otherwise false
|
|
239
239
|
*/
|
|
240
240
|
const isFileList = kindOfTest('FileList');
|
|
241
241
|
|
|
@@ -269,14 +269,16 @@ const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
|
269
269
|
const isFormData = (thing) => {
|
|
270
270
|
if (!thing) return false;
|
|
271
271
|
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
272
|
-
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData
|
|
272
|
+
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
|
|
273
273
|
const proto = getPrototypeOf(thing);
|
|
274
274
|
if (!proto || proto === Object.prototype) return false;
|
|
275
275
|
if (!isFunction$1(thing.append)) return false;
|
|
276
276
|
const kind = kindOf(thing);
|
|
277
|
-
return
|
|
277
|
+
return (
|
|
278
|
+
kind === 'formdata' ||
|
|
278
279
|
// detect form-data instance
|
|
279
|
-
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
280
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
281
|
+
);
|
|
280
282
|
};
|
|
281
283
|
|
|
282
284
|
/**
|
|
@@ -411,7 +413,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
411
413
|
*
|
|
412
414
|
* @returns {Object} Result of all merge properties
|
|
413
415
|
*/
|
|
414
|
-
function merge(
|
|
416
|
+
function merge(...objs) {
|
|
415
417
|
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
416
418
|
const result = {};
|
|
417
419
|
const assignValue = (val, key) => {
|
|
@@ -421,8 +423,12 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
421
423
|
}
|
|
422
424
|
|
|
423
425
|
const targetKey = (caseless && findKey(result, key)) || key;
|
|
424
|
-
|
|
425
|
-
|
|
426
|
+
// Read via own-prop only — a bare `result[targetKey]` walks the prototype
|
|
427
|
+
// chain, so a polluted Object.prototype value could surface here and get
|
|
428
|
+
// copied into the merged result.
|
|
429
|
+
const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
|
|
430
|
+
if (isPlainObject(existing) && isPlainObject(val)) {
|
|
431
|
+
result[targetKey] = merge(existing, val);
|
|
426
432
|
} else if (isPlainObject(val)) {
|
|
427
433
|
result[targetKey] = merge({}, val);
|
|
428
434
|
} else if (isArray(val)) {
|
|
@@ -432,8 +438,8 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
432
438
|
}
|
|
433
439
|
};
|
|
434
440
|
|
|
435
|
-
for (let i = 0, l =
|
|
436
|
-
|
|
441
|
+
for (let i = 0, l = objs.length; i < l; i++) {
|
|
442
|
+
objs[i] && forEach(objs[i], assignValue);
|
|
437
443
|
}
|
|
438
444
|
return result;
|
|
439
445
|
}
|
|
@@ -455,6 +461,9 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
455
461
|
(val, key) => {
|
|
456
462
|
if (thisArg && isFunction$1(val)) {
|
|
457
463
|
Object.defineProperty(a, key, {
|
|
464
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot
|
|
465
|
+
// hijack defineProperty's accessor-vs-data resolution.
|
|
466
|
+
__proto__: null,
|
|
458
467
|
value: bind(val, thisArg),
|
|
459
468
|
writable: true,
|
|
460
469
|
enumerable: true,
|
|
@@ -462,6 +471,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
462
471
|
});
|
|
463
472
|
} else {
|
|
464
473
|
Object.defineProperty(a, key, {
|
|
474
|
+
__proto__: null,
|
|
465
475
|
value: val,
|
|
466
476
|
writable: true,
|
|
467
477
|
enumerable: true,
|
|
@@ -500,12 +510,14 @@ const stripBOM = (content) => {
|
|
|
500
510
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
501
511
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
502
512
|
Object.defineProperty(constructor.prototype, 'constructor', {
|
|
513
|
+
__proto__: null,
|
|
503
514
|
value: constructor,
|
|
504
515
|
writable: true,
|
|
505
516
|
enumerable: false,
|
|
506
517
|
configurable: true,
|
|
507
518
|
});
|
|
508
519
|
Object.defineProperty(constructor, 'super', {
|
|
520
|
+
__proto__: null,
|
|
509
521
|
value: superConstructor.prototype,
|
|
510
522
|
});
|
|
511
523
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -687,7 +699,7 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
687
699
|
const freezeMethods = (obj) => {
|
|
688
700
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
689
701
|
// skip restricted props in strict mode
|
|
690
|
-
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].
|
|
702
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
|
|
691
703
|
return false;
|
|
692
704
|
}
|
|
693
705
|
|
|
@@ -928,1312 +940,1399 @@ var utils$1 = {
|
|
|
928
940
|
isIterable,
|
|
929
941
|
};
|
|
930
942
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
943
|
+
// RawAxiosHeaders whose duplicates are ignored by node
|
|
944
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
945
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
946
|
+
'age',
|
|
947
|
+
'authorization',
|
|
948
|
+
'content-length',
|
|
949
|
+
'content-type',
|
|
950
|
+
'etag',
|
|
951
|
+
'expires',
|
|
952
|
+
'from',
|
|
953
|
+
'host',
|
|
954
|
+
'if-modified-since',
|
|
955
|
+
'if-unmodified-since',
|
|
956
|
+
'last-modified',
|
|
957
|
+
'location',
|
|
958
|
+
'max-forwards',
|
|
959
|
+
'proxy-authorization',
|
|
960
|
+
'referer',
|
|
961
|
+
'retry-after',
|
|
962
|
+
'user-agent',
|
|
963
|
+
]);
|
|
936
964
|
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
965
|
+
/**
|
|
966
|
+
* Parse headers into an object
|
|
967
|
+
*
|
|
968
|
+
* ```
|
|
969
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
970
|
+
* Content-Type: application/json
|
|
971
|
+
* Connection: keep-alive
|
|
972
|
+
* Transfer-Encoding: chunked
|
|
973
|
+
* ```
|
|
974
|
+
*
|
|
975
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
976
|
+
*
|
|
977
|
+
* @returns {Object} Headers parsed into an object
|
|
978
|
+
*/
|
|
979
|
+
var parseHeaders = (rawHeaders) => {
|
|
980
|
+
const parsed = {};
|
|
981
|
+
let key;
|
|
982
|
+
let val;
|
|
983
|
+
let i;
|
|
941
984
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
985
|
+
rawHeaders &&
|
|
986
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
987
|
+
i = line.indexOf(':');
|
|
988
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
989
|
+
val = line.substring(i + 1).trim();
|
|
945
990
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
* @param {string} message The error message.
|
|
950
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
951
|
-
* @param {Object} [config] The config.
|
|
952
|
-
* @param {Object} [request] The request.
|
|
953
|
-
* @param {Object} [response] The response.
|
|
954
|
-
*
|
|
955
|
-
* @returns {Error} The created error.
|
|
956
|
-
*/
|
|
957
|
-
constructor(message, code, config, request, response) {
|
|
958
|
-
super(message);
|
|
991
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
959
994
|
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
995
|
+
if (key === 'set-cookie') {
|
|
996
|
+
if (parsed[key]) {
|
|
997
|
+
parsed[key].push(val);
|
|
998
|
+
} else {
|
|
999
|
+
parsed[key] = [val];
|
|
1000
|
+
}
|
|
1001
|
+
} else {
|
|
1002
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
1003
|
+
}
|
|
968
1004
|
});
|
|
969
1005
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1006
|
+
return parsed;
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
const $internals = Symbol('internals');
|
|
1010
|
+
|
|
1011
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
1012
|
+
|
|
1013
|
+
function trimSPorHTAB(str) {
|
|
1014
|
+
let start = 0;
|
|
1015
|
+
let end = str.length;
|
|
1016
|
+
|
|
1017
|
+
while (start < end) {
|
|
1018
|
+
const code = str.charCodeAt(start);
|
|
1019
|
+
|
|
1020
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
1021
|
+
break;
|
|
978
1022
|
}
|
|
979
|
-
}
|
|
980
1023
|
|
|
981
|
-
|
|
982
|
-
return {
|
|
983
|
-
// Standard
|
|
984
|
-
message: this.message,
|
|
985
|
-
name: this.name,
|
|
986
|
-
// Microsoft
|
|
987
|
-
description: this.description,
|
|
988
|
-
number: this.number,
|
|
989
|
-
// Mozilla
|
|
990
|
-
fileName: this.fileName,
|
|
991
|
-
lineNumber: this.lineNumber,
|
|
992
|
-
columnNumber: this.columnNumber,
|
|
993
|
-
stack: this.stack,
|
|
994
|
-
// Axios
|
|
995
|
-
config: utils$1.toJSONObject(this.config),
|
|
996
|
-
code: this.code,
|
|
997
|
-
status: this.status,
|
|
998
|
-
};
|
|
1024
|
+
start += 1;
|
|
999
1025
|
}
|
|
1000
|
-
};
|
|
1001
1026
|
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
1005
|
-
AxiosError$1.ECONNABORTED = 'ECONNABORTED';
|
|
1006
|
-
AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
|
|
1007
|
-
AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
|
|
1008
|
-
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
1009
|
-
AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
1010
|
-
AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
1011
|
-
AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
1012
|
-
AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
|
|
1013
|
-
AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
1014
|
-
AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
1015
|
-
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
1027
|
+
while (end > start) {
|
|
1028
|
+
const code = str.charCodeAt(end - 1);
|
|
1016
1029
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1030
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
1031
|
+
break;
|
|
1032
|
+
}
|
|
1019
1033
|
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
*
|
|
1023
|
-
* @param {string} thing - The object or array to be visited.
|
|
1024
|
-
*
|
|
1025
|
-
* @returns {boolean}
|
|
1026
|
-
*/
|
|
1027
|
-
function isVisitable(thing) {
|
|
1028
|
-
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
1029
|
-
}
|
|
1034
|
+
end -= 1;
|
|
1035
|
+
}
|
|
1030
1036
|
|
|
1031
|
-
|
|
1032
|
-
* It removes the brackets from the end of a string
|
|
1033
|
-
*
|
|
1034
|
-
* @param {string} key - The key of the parameter.
|
|
1035
|
-
*
|
|
1036
|
-
* @returns {string} the key without the brackets.
|
|
1037
|
-
*/
|
|
1038
|
-
function removeBrackets(key) {
|
|
1039
|
-
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
1037
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
1040
1038
|
}
|
|
1041
1039
|
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
*
|
|
1045
|
-
* @param {string} path - The path to the current key.
|
|
1046
|
-
* @param {string} key - The key of the current object being iterated over.
|
|
1047
|
-
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
1048
|
-
*
|
|
1049
|
-
* @returns {string} The path to the current key.
|
|
1050
|
-
*/
|
|
1051
|
-
function renderKey(path, key, dots) {
|
|
1052
|
-
if (!path) return key;
|
|
1053
|
-
return path
|
|
1054
|
-
.concat(key)
|
|
1055
|
-
.map(function each(token, i) {
|
|
1056
|
-
// eslint-disable-next-line no-param-reassign
|
|
1057
|
-
token = removeBrackets(token);
|
|
1058
|
-
return !dots && i ? '[' + token + ']' : token;
|
|
1059
|
-
})
|
|
1060
|
-
.join(dots ? '.' : '');
|
|
1040
|
+
function normalizeHeader(header) {
|
|
1041
|
+
return header && String(header).trim().toLowerCase();
|
|
1061
1042
|
}
|
|
1062
1043
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
*
|
|
1066
|
-
* @param {Array<any>} arr - The array to check
|
|
1067
|
-
*
|
|
1068
|
-
* @returns {boolean}
|
|
1069
|
-
*/
|
|
1070
|
-
function isFlatArray(arr) {
|
|
1071
|
-
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
1044
|
+
function sanitizeHeaderValue(str) {
|
|
1045
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
1072
1046
|
}
|
|
1073
1047
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
/**
|
|
1079
|
-
* Convert a data object to FormData
|
|
1080
|
-
*
|
|
1081
|
-
* @param {Object} obj
|
|
1082
|
-
* @param {?Object} [formData]
|
|
1083
|
-
* @param {?Object} [options]
|
|
1084
|
-
* @param {Function} [options.visitor]
|
|
1085
|
-
* @param {Boolean} [options.metaTokens = true]
|
|
1086
|
-
* @param {Boolean} [options.dots = false]
|
|
1087
|
-
* @param {?Boolean} [options.indexes = false]
|
|
1088
|
-
*
|
|
1089
|
-
* @returns {Object}
|
|
1090
|
-
**/
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* It converts an object into a FormData object
|
|
1094
|
-
*
|
|
1095
|
-
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
1096
|
-
* @param {string} formData - The FormData object to append to.
|
|
1097
|
-
* @param {Object<string, any>} options
|
|
1098
|
-
*
|
|
1099
|
-
* @returns
|
|
1100
|
-
*/
|
|
1101
|
-
function toFormData$1(obj, formData, options) {
|
|
1102
|
-
if (!utils$1.isObject(obj)) {
|
|
1103
|
-
throw new TypeError('target must be an object');
|
|
1048
|
+
function normalizeValue(value) {
|
|
1049
|
+
if (value === false || value == null) {
|
|
1050
|
+
return value;
|
|
1104
1051
|
}
|
|
1105
1052
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1053
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
1054
|
+
}
|
|
1108
1055
|
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
metaTokens: true,
|
|
1114
|
-
dots: false,
|
|
1115
|
-
indexes: false,
|
|
1116
|
-
},
|
|
1117
|
-
false,
|
|
1118
|
-
function defined(option, source) {
|
|
1119
|
-
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
1120
|
-
return !utils$1.isUndefined(source[option]);
|
|
1121
|
-
}
|
|
1122
|
-
);
|
|
1123
|
-
|
|
1124
|
-
const metaTokens = options.metaTokens;
|
|
1125
|
-
// eslint-disable-next-line no-use-before-define
|
|
1126
|
-
const visitor = options.visitor || defaultVisitor;
|
|
1127
|
-
const dots = options.dots;
|
|
1128
|
-
const indexes = options.indexes;
|
|
1129
|
-
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
1130
|
-
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
1131
|
-
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1056
|
+
function parseTokens(str) {
|
|
1057
|
+
const tokens = Object.create(null);
|
|
1058
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1059
|
+
let match;
|
|
1132
1060
|
|
|
1133
|
-
|
|
1134
|
-
|
|
1061
|
+
while ((match = tokensRE.exec(str))) {
|
|
1062
|
+
tokens[match[1]] = match[2];
|
|
1135
1063
|
}
|
|
1136
1064
|
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
if (utils$1.isDate(value)) {
|
|
1141
|
-
return value.toISOString();
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
if (utils$1.isBoolean(value)) {
|
|
1145
|
-
return value.toString();
|
|
1146
|
-
}
|
|
1065
|
+
return tokens;
|
|
1066
|
+
}
|
|
1147
1067
|
|
|
1148
|
-
|
|
1149
|
-
throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
|
|
1150
|
-
}
|
|
1068
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
1151
1069
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1070
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1071
|
+
if (utils$1.isFunction(filter)) {
|
|
1072
|
+
return filter.call(this, value, header);
|
|
1073
|
+
}
|
|
1155
1074
|
|
|
1156
|
-
|
|
1075
|
+
if (isHeaderNameFilter) {
|
|
1076
|
+
value = header;
|
|
1157
1077
|
}
|
|
1158
1078
|
|
|
1159
|
-
|
|
1160
|
-
* Default visitor.
|
|
1161
|
-
*
|
|
1162
|
-
* @param {*} value
|
|
1163
|
-
* @param {String|Number} key
|
|
1164
|
-
* @param {Array<String|Number>} path
|
|
1165
|
-
* @this {FormData}
|
|
1166
|
-
*
|
|
1167
|
-
* @returns {boolean} return true to visit the each prop of the value recursively
|
|
1168
|
-
*/
|
|
1169
|
-
function defaultVisitor(value, key, path) {
|
|
1170
|
-
let arr = value;
|
|
1079
|
+
if (!utils$1.isString(value)) return;
|
|
1171
1080
|
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
}
|
|
1081
|
+
if (utils$1.isString(filter)) {
|
|
1082
|
+
return value.indexOf(filter) !== -1;
|
|
1083
|
+
}
|
|
1176
1084
|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
// eslint-disable-next-line no-param-reassign
|
|
1182
|
-
value = JSON.stringify(value);
|
|
1183
|
-
} else if (
|
|
1184
|
-
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
1185
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
1186
|
-
) {
|
|
1187
|
-
// eslint-disable-next-line no-param-reassign
|
|
1188
|
-
key = removeBrackets(key);
|
|
1085
|
+
if (utils$1.isRegExp(filter)) {
|
|
1086
|
+
return filter.test(value);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1189
1089
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
: key + '[]',
|
|
1199
|
-
convertValue(el)
|
|
1200
|
-
);
|
|
1201
|
-
});
|
|
1202
|
-
return false;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1090
|
+
function formatHeader(header) {
|
|
1091
|
+
return header
|
|
1092
|
+
.trim()
|
|
1093
|
+
.toLowerCase()
|
|
1094
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
1095
|
+
return char.toUpperCase() + str;
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1205
1098
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
}
|
|
1099
|
+
function buildAccessors(obj, header) {
|
|
1100
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
1209
1101
|
|
|
1210
|
-
|
|
1102
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
1103
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
1104
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
1105
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
1106
|
+
__proto__: null,
|
|
1107
|
+
value: function (arg1, arg2, arg3) {
|
|
1108
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
1109
|
+
},
|
|
1110
|
+
configurable: true,
|
|
1111
|
+
});
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1211
1114
|
|
|
1212
|
-
|
|
1115
|
+
let AxiosHeaders$1 = class AxiosHeaders {
|
|
1116
|
+
constructor(headers) {
|
|
1117
|
+
headers && this.set(headers);
|
|
1213
1118
|
}
|
|
1214
1119
|
|
|
1215
|
-
|
|
1120
|
+
set(header, valueOrRewrite, rewrite) {
|
|
1121
|
+
const self = this;
|
|
1216
1122
|
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
convertValue,
|
|
1220
|
-
isVisitable,
|
|
1221
|
-
});
|
|
1123
|
+
function setHeader(_value, _header, _rewrite) {
|
|
1124
|
+
const lHeader = normalizeHeader(_header);
|
|
1222
1125
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1126
|
+
if (!lHeader) {
|
|
1127
|
+
throw new Error('header name must be a non-empty string');
|
|
1128
|
+
}
|
|
1225
1129
|
|
|
1226
|
-
|
|
1227
|
-
throw new AxiosError$1(
|
|
1228
|
-
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1229
|
-
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1230
|
-
);
|
|
1231
|
-
}
|
|
1130
|
+
const key = utils$1.findKey(self, lHeader);
|
|
1232
1131
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1132
|
+
if (
|
|
1133
|
+
!key ||
|
|
1134
|
+
self[key] === undefined ||
|
|
1135
|
+
_rewrite === true ||
|
|
1136
|
+
(_rewrite === undefined && self[key] !== false)
|
|
1137
|
+
) {
|
|
1138
|
+
self[key || _header] = normalizeValue(_value);
|
|
1139
|
+
}
|
|
1235
1140
|
}
|
|
1236
1141
|
|
|
1237
|
-
|
|
1142
|
+
const setHeaders = (headers, _rewrite) =>
|
|
1143
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
1238
1144
|
|
|
1239
|
-
utils$1.
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1145
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
1146
|
+
setHeaders(header, valueOrRewrite);
|
|
1147
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1148
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1149
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
1150
|
+
let obj = {},
|
|
1151
|
+
dest,
|
|
1152
|
+
key;
|
|
1153
|
+
for (const entry of header) {
|
|
1154
|
+
if (!utils$1.isArray(entry)) {
|
|
1155
|
+
throw TypeError('Object iterator must return a key-value pair');
|
|
1156
|
+
}
|
|
1243
1157
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1158
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
1159
|
+
? utils$1.isArray(dest)
|
|
1160
|
+
? [...dest, entry[1]]
|
|
1161
|
+
: [dest, entry[1]]
|
|
1162
|
+
: entry[1];
|
|
1246
1163
|
}
|
|
1247
|
-
});
|
|
1248
1164
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1165
|
+
setHeaders(obj, valueOrRewrite);
|
|
1166
|
+
} else {
|
|
1167
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
1168
|
+
}
|
|
1251
1169
|
|
|
1252
|
-
|
|
1253
|
-
throw new TypeError('data must be an object');
|
|
1170
|
+
return this;
|
|
1254
1171
|
}
|
|
1255
1172
|
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
return formData;
|
|
1259
|
-
}
|
|
1173
|
+
get(header, parser) {
|
|
1174
|
+
header = normalizeHeader(header);
|
|
1260
1175
|
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
* their percent-encoded equivalents
|
|
1264
|
-
*
|
|
1265
|
-
* @param {string} str - The string to encode.
|
|
1266
|
-
*
|
|
1267
|
-
* @returns {string} The encoded string.
|
|
1268
|
-
*/
|
|
1269
|
-
function encode$1(str) {
|
|
1270
|
-
const charMap = {
|
|
1271
|
-
'!': '%21',
|
|
1272
|
-
"'": '%27',
|
|
1273
|
-
'(': '%28',
|
|
1274
|
-
')': '%29',
|
|
1275
|
-
'~': '%7E',
|
|
1276
|
-
'%20': '+',
|
|
1277
|
-
};
|
|
1278
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
1279
|
-
return charMap[match];
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1176
|
+
if (header) {
|
|
1177
|
+
const key = utils$1.findKey(this, header);
|
|
1282
1178
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
*
|
|
1286
|
-
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
|
|
1287
|
-
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
|
|
1288
|
-
*
|
|
1289
|
-
* @returns {void}
|
|
1290
|
-
*/
|
|
1291
|
-
function AxiosURLSearchParams(params, options) {
|
|
1292
|
-
this._pairs = [];
|
|
1179
|
+
if (key) {
|
|
1180
|
+
const value = this[key];
|
|
1293
1181
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1182
|
+
if (!parser) {
|
|
1183
|
+
return value;
|
|
1184
|
+
}
|
|
1296
1185
|
|
|
1297
|
-
|
|
1186
|
+
if (parser === true) {
|
|
1187
|
+
return parseTokens(value);
|
|
1188
|
+
}
|
|
1298
1189
|
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
}
|
|
1190
|
+
if (utils$1.isFunction(parser)) {
|
|
1191
|
+
return parser.call(this, value, key);
|
|
1192
|
+
}
|
|
1302
1193
|
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1194
|
+
if (utils$1.isRegExp(parser)) {
|
|
1195
|
+
return parser.exec(value);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
throw new TypeError('parser must be boolean|regexp|function');
|
|
1307
1199
|
}
|
|
1308
|
-
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1309
1202
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
1313
|
-
}, '')
|
|
1314
|
-
.join('&');
|
|
1315
|
-
};
|
|
1203
|
+
has(header, matcher) {
|
|
1204
|
+
header = normalizeHeader(header);
|
|
1316
1205
|
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
1320
|
-
*
|
|
1321
|
-
* @param {string} val The value to be encoded.
|
|
1322
|
-
*
|
|
1323
|
-
* @returns {string} The encoded value.
|
|
1324
|
-
*/
|
|
1325
|
-
function encode(val) {
|
|
1326
|
-
return encodeURIComponent(val)
|
|
1327
|
-
.replace(/%3A/gi, ':')
|
|
1328
|
-
.replace(/%24/g, '$')
|
|
1329
|
-
.replace(/%2C/gi, ',')
|
|
1330
|
-
.replace(/%20/g, '+');
|
|
1331
|
-
}
|
|
1206
|
+
if (header) {
|
|
1207
|
+
const key = utils$1.findKey(this, header);
|
|
1332
1208
|
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
*/
|
|
1342
|
-
function buildURL(url, params, options) {
|
|
1343
|
-
if (!params) {
|
|
1344
|
-
return url;
|
|
1209
|
+
return !!(
|
|
1210
|
+
key &&
|
|
1211
|
+
this[key] !== undefined &&
|
|
1212
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
return false;
|
|
1345
1217
|
}
|
|
1346
1218
|
|
|
1347
|
-
|
|
1219
|
+
delete(header, matcher) {
|
|
1220
|
+
const self = this;
|
|
1221
|
+
let deleted = false;
|
|
1348
1222
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
serialize: options,
|
|
1352
|
-
}
|
|
1353
|
-
: options;
|
|
1223
|
+
function deleteHeader(_header) {
|
|
1224
|
+
_header = normalizeHeader(_header);
|
|
1354
1225
|
|
|
1355
|
-
|
|
1226
|
+
if (_header) {
|
|
1227
|
+
const key = utils$1.findKey(self, _header);
|
|
1356
1228
|
|
|
1357
|
-
|
|
1229
|
+
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
1230
|
+
delete self[key];
|
|
1358
1231
|
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1232
|
+
deleted = true;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
if (utils$1.isArray(header)) {
|
|
1238
|
+
header.forEach(deleteHeader);
|
|
1239
|
+
} else {
|
|
1240
|
+
deleteHeader(header);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
return deleted;
|
|
1365
1244
|
}
|
|
1366
1245
|
|
|
1367
|
-
|
|
1368
|
-
const
|
|
1246
|
+
clear(matcher) {
|
|
1247
|
+
const keys = Object.keys(this);
|
|
1248
|
+
let i = keys.length;
|
|
1249
|
+
let deleted = false;
|
|
1369
1250
|
|
|
1370
|
-
|
|
1371
|
-
|
|
1251
|
+
while (i--) {
|
|
1252
|
+
const key = keys[i];
|
|
1253
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
1254
|
+
delete this[key];
|
|
1255
|
+
deleted = true;
|
|
1256
|
+
}
|
|
1372
1257
|
}
|
|
1373
|
-
|
|
1258
|
+
|
|
1259
|
+
return deleted;
|
|
1374
1260
|
}
|
|
1375
1261
|
|
|
1376
|
-
|
|
1377
|
-
|
|
1262
|
+
normalize(format) {
|
|
1263
|
+
const self = this;
|
|
1264
|
+
const headers = {};
|
|
1378
1265
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1266
|
+
utils$1.forEach(this, (value, header) => {
|
|
1267
|
+
const key = utils$1.findKey(headers, header);
|
|
1268
|
+
|
|
1269
|
+
if (key) {
|
|
1270
|
+
self[key] = normalizeValue(value);
|
|
1271
|
+
delete self[header];
|
|
1272
|
+
return;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
1276
|
+
|
|
1277
|
+
if (normalized !== header) {
|
|
1278
|
+
delete self[header];
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
self[normalized] = normalizeValue(value);
|
|
1282
|
+
|
|
1283
|
+
headers[normalized] = true;
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
return this;
|
|
1382
1287
|
}
|
|
1383
1288
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
fulfilled,
|
|
1396
|
-
rejected,
|
|
1397
|
-
synchronous: options ? options.synchronous : false,
|
|
1398
|
-
runWhen: options ? options.runWhen : null,
|
|
1289
|
+
concat(...targets) {
|
|
1290
|
+
return this.constructor.concat(this, ...targets);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
toJSON(asStrings) {
|
|
1294
|
+
const obj = Object.create(null);
|
|
1295
|
+
|
|
1296
|
+
utils$1.forEach(this, (value, header) => {
|
|
1297
|
+
value != null &&
|
|
1298
|
+
value !== false &&
|
|
1299
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
1399
1300
|
});
|
|
1400
|
-
|
|
1301
|
+
|
|
1302
|
+
return obj;
|
|
1401
1303
|
}
|
|
1402
1304
|
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
*
|
|
1406
|
-
* @param {Number} id The ID that was returned by `use`
|
|
1407
|
-
*
|
|
1408
|
-
* @returns {void}
|
|
1409
|
-
*/
|
|
1410
|
-
eject(id) {
|
|
1411
|
-
if (this.handlers[id]) {
|
|
1412
|
-
this.handlers[id] = null;
|
|
1413
|
-
}
|
|
1305
|
+
[Symbol.iterator]() {
|
|
1306
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1414
1307
|
}
|
|
1415
1308
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
*/
|
|
1421
|
-
clear() {
|
|
1422
|
-
if (this.handlers) {
|
|
1423
|
-
this.handlers = [];
|
|
1424
|
-
}
|
|
1309
|
+
toString() {
|
|
1310
|
+
return Object.entries(this.toJSON())
|
|
1311
|
+
.map(([header, value]) => header + ': ' + value)
|
|
1312
|
+
.join('\n');
|
|
1425
1313
|
}
|
|
1426
1314
|
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
*
|
|
1430
|
-
* This method is particularly useful for skipping over any
|
|
1431
|
-
* interceptors that may have become `null` calling `eject`.
|
|
1432
|
-
*
|
|
1433
|
-
* @param {Function} fn The function to call for each interceptor
|
|
1434
|
-
*
|
|
1435
|
-
* @returns {void}
|
|
1436
|
-
*/
|
|
1437
|
-
forEach(fn) {
|
|
1438
|
-
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
1439
|
-
if (h !== null) {
|
|
1440
|
-
fn(h);
|
|
1441
|
-
}
|
|
1442
|
-
});
|
|
1315
|
+
getSetCookie() {
|
|
1316
|
+
return this.get('set-cookie') || [];
|
|
1443
1317
|
}
|
|
1444
|
-
}
|
|
1445
1318
|
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
clarifyTimeoutError: false,
|
|
1450
|
-
legacyInterceptorReqResOrdering: true,
|
|
1451
|
-
};
|
|
1319
|
+
get [Symbol.toStringTag]() {
|
|
1320
|
+
return 'AxiosHeaders';
|
|
1321
|
+
}
|
|
1452
1322
|
|
|
1453
|
-
|
|
1323
|
+
static from(thing) {
|
|
1324
|
+
return thing instanceof this ? thing : new this(thing);
|
|
1325
|
+
}
|
|
1454
1326
|
|
|
1455
|
-
|
|
1327
|
+
static concat(first, ...targets) {
|
|
1328
|
+
const computed = new this(first);
|
|
1456
1329
|
|
|
1457
|
-
|
|
1330
|
+
targets.forEach((target) => computed.set(target));
|
|
1458
1331
|
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
classes: {
|
|
1462
|
-
URLSearchParams: URLSearchParams$1,
|
|
1463
|
-
FormData: FormData$1,
|
|
1464
|
-
Blob: Blob$1,
|
|
1465
|
-
},
|
|
1466
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
|
|
1467
|
-
};
|
|
1332
|
+
return computed;
|
|
1333
|
+
}
|
|
1468
1334
|
|
|
1469
|
-
|
|
1335
|
+
static accessor(header) {
|
|
1336
|
+
const internals =
|
|
1337
|
+
(this[$internals] =
|
|
1338
|
+
this[$internals] =
|
|
1339
|
+
{
|
|
1340
|
+
accessors: {},
|
|
1341
|
+
});
|
|
1470
1342
|
|
|
1471
|
-
const
|
|
1343
|
+
const accessors = internals.accessors;
|
|
1344
|
+
const prototype = this.prototype;
|
|
1472
1345
|
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
*
|
|
1476
|
-
* This allows axios to run in a web worker, and react-native.
|
|
1477
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
1478
|
-
*
|
|
1479
|
-
* web workers:
|
|
1480
|
-
* typeof window -> undefined
|
|
1481
|
-
* typeof document -> undefined
|
|
1482
|
-
*
|
|
1483
|
-
* react-native:
|
|
1484
|
-
* navigator.product -> 'ReactNative'
|
|
1485
|
-
* nativescript
|
|
1486
|
-
* navigator.product -> 'NativeScript' or 'NS'
|
|
1487
|
-
*
|
|
1488
|
-
* @returns {boolean}
|
|
1489
|
-
*/
|
|
1490
|
-
const hasStandardBrowserEnv =
|
|
1491
|
-
hasBrowserEnv &&
|
|
1492
|
-
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
1493
|
-
|
|
1494
|
-
/**
|
|
1495
|
-
* Determine if we're running in a standard browser webWorker environment
|
|
1496
|
-
*
|
|
1497
|
-
* Although the `isStandardBrowserEnv` method indicates that
|
|
1498
|
-
* `allows axios to run in a web worker`, the WebWorker will still be
|
|
1499
|
-
* filtered out due to its judgment standard
|
|
1500
|
-
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
1501
|
-
* This leads to a problem when axios post `FormData` in webWorker
|
|
1502
|
-
*/
|
|
1503
|
-
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
1504
|
-
return (
|
|
1505
|
-
typeof WorkerGlobalScope !== 'undefined' &&
|
|
1506
|
-
// eslint-disable-next-line no-undef
|
|
1507
|
-
self instanceof WorkerGlobalScope &&
|
|
1508
|
-
typeof self.importScripts === 'function'
|
|
1509
|
-
);
|
|
1510
|
-
})();
|
|
1346
|
+
function defineAccessor(_header) {
|
|
1347
|
+
const lHeader = normalizeHeader(_header);
|
|
1511
1348
|
|
|
1512
|
-
|
|
1349
|
+
if (!accessors[lHeader]) {
|
|
1350
|
+
buildAccessors(prototype, _header);
|
|
1351
|
+
accessors[lHeader] = true;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1513
1354
|
|
|
1514
|
-
|
|
1515
|
-
__proto__: null,
|
|
1516
|
-
hasBrowserEnv: hasBrowserEnv,
|
|
1517
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
1518
|
-
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1519
|
-
navigator: _navigator,
|
|
1520
|
-
origin: origin
|
|
1521
|
-
});
|
|
1355
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1522
1356
|
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
...platform$1,
|
|
1357
|
+
return this;
|
|
1358
|
+
}
|
|
1526
1359
|
};
|
|
1527
1360
|
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1361
|
+
AxiosHeaders$1.accessor([
|
|
1362
|
+
'Content-Type',
|
|
1363
|
+
'Content-Length',
|
|
1364
|
+
'Accept',
|
|
1365
|
+
'Accept-Encoding',
|
|
1366
|
+
'User-Agent',
|
|
1367
|
+
'Authorization',
|
|
1368
|
+
]);
|
|
1535
1369
|
|
|
1536
|
-
|
|
1370
|
+
// reserved names hotfix
|
|
1371
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
1372
|
+
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
1373
|
+
return {
|
|
1374
|
+
get: () => value,
|
|
1375
|
+
set(headerValue) {
|
|
1376
|
+
this[mapped] = headerValue;
|
|
1537
1377
|
},
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
}
|
|
1378
|
+
};
|
|
1379
|
+
});
|
|
1541
1380
|
|
|
1542
|
-
|
|
1543
|
-
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
1544
|
-
*
|
|
1545
|
-
* @param {string} name - The name of the property to get.
|
|
1546
|
-
*
|
|
1547
|
-
* @returns An array of strings.
|
|
1548
|
-
*/
|
|
1549
|
-
function parsePropPath(name) {
|
|
1550
|
-
// foo[x][y][z]
|
|
1551
|
-
// foo.x.y.z
|
|
1552
|
-
// foo-x-y-z
|
|
1553
|
-
// foo x y z
|
|
1554
|
-
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
1555
|
-
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
1556
|
-
});
|
|
1557
|
-
}
|
|
1381
|
+
utils$1.freezeMethods(AxiosHeaders$1);
|
|
1558
1382
|
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
* @returns An object with the same keys and values as the array.
|
|
1565
|
-
*/
|
|
1566
|
-
function arrayToObject(arr) {
|
|
1567
|
-
const obj = {};
|
|
1568
|
-
const keys = Object.keys(arr);
|
|
1569
|
-
let i;
|
|
1570
|
-
const len = keys.length;
|
|
1571
|
-
let key;
|
|
1572
|
-
for (i = 0; i < len; i++) {
|
|
1573
|
-
key = keys[i];
|
|
1574
|
-
obj[key] = arr[key];
|
|
1383
|
+
const REDACTED = '[REDACTED ****]';
|
|
1384
|
+
|
|
1385
|
+
function hasOwnOrPrototypeToJSON(source) {
|
|
1386
|
+
if (utils$1.hasOwnProp(source, 'toJSON')) {
|
|
1387
|
+
return true;
|
|
1575
1388
|
}
|
|
1576
|
-
|
|
1389
|
+
|
|
1390
|
+
let prototype = Object.getPrototypeOf(source);
|
|
1391
|
+
|
|
1392
|
+
while (prototype && prototype !== Object.prototype) {
|
|
1393
|
+
if (utils$1.hasOwnProp(prototype, 'toJSON')) {
|
|
1394
|
+
return true;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
prototype = Object.getPrototypeOf(prototype);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
return false;
|
|
1577
1401
|
}
|
|
1578
1402
|
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
*/
|
|
1586
|
-
function formDataToJSON(formData) {
|
|
1587
|
-
function buildPath(path, value, target, index) {
|
|
1588
|
-
let name = path[index++];
|
|
1403
|
+
// Build a plain-object snapshot of `config` and replace the value of any key
|
|
1404
|
+
// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
|
|
1405
|
+
// and AxiosHeaders, and short-circuits on circular references.
|
|
1406
|
+
function redactConfig(config, redactKeys) {
|
|
1407
|
+
const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
|
|
1408
|
+
const seen = [];
|
|
1589
1409
|
|
|
1590
|
-
|
|
1410
|
+
const visit = (source) => {
|
|
1411
|
+
if (source === null || typeof source !== 'object') return source;
|
|
1412
|
+
if (utils$1.isBuffer(source)) return source;
|
|
1413
|
+
if (seen.indexOf(source) !== -1) return undefined;
|
|
1591
1414
|
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1415
|
+
if (source instanceof AxiosHeaders$1) {
|
|
1416
|
+
source = source.toJSON();
|
|
1417
|
+
}
|
|
1595
1418
|
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1419
|
+
seen.push(source);
|
|
1420
|
+
|
|
1421
|
+
let result;
|
|
1422
|
+
if (utils$1.isArray(source)) {
|
|
1423
|
+
result = [];
|
|
1424
|
+
source.forEach((v, i) => {
|
|
1425
|
+
const reducedValue = visit(v);
|
|
1426
|
+
if (!utils$1.isUndefined(reducedValue)) {
|
|
1427
|
+
result[i] = reducedValue;
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
} else {
|
|
1431
|
+
if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
|
|
1432
|
+
seen.pop();
|
|
1433
|
+
return source;
|
|
1603
1434
|
}
|
|
1604
1435
|
|
|
1605
|
-
|
|
1436
|
+
result = Object.create(null);
|
|
1437
|
+
for (const [key, value] of Object.entries(source)) {
|
|
1438
|
+
const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
|
|
1439
|
+
if (!utils$1.isUndefined(reducedValue)) {
|
|
1440
|
+
result[key] = reducedValue;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1606
1443
|
}
|
|
1607
1444
|
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1445
|
+
seen.pop();
|
|
1446
|
+
return result;
|
|
1447
|
+
};
|
|
1611
1448
|
|
|
1612
|
-
|
|
1449
|
+
return visit(config);
|
|
1450
|
+
}
|
|
1613
1451
|
|
|
1614
|
-
|
|
1615
|
-
|
|
1452
|
+
let AxiosError$1 = class AxiosError extends Error {
|
|
1453
|
+
static from(error, code, config, request, response, customProps) {
|
|
1454
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
1455
|
+
axiosError.cause = error;
|
|
1456
|
+
axiosError.name = error.name;
|
|
1457
|
+
|
|
1458
|
+
// Preserve status from the original error if not already set from response
|
|
1459
|
+
if (error.status != null && axiosError.status == null) {
|
|
1460
|
+
axiosError.status = error.status;
|
|
1616
1461
|
}
|
|
1617
1462
|
|
|
1618
|
-
|
|
1463
|
+
customProps && Object.assign(axiosError, customProps);
|
|
1464
|
+
return axiosError;
|
|
1619
1465
|
}
|
|
1620
1466
|
|
|
1621
|
-
|
|
1622
|
-
|
|
1467
|
+
/**
|
|
1468
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
1469
|
+
*
|
|
1470
|
+
* @param {string} message The error message.
|
|
1471
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
1472
|
+
* @param {Object} [config] The config.
|
|
1473
|
+
* @param {Object} [request] The request.
|
|
1474
|
+
* @param {Object} [response] The response.
|
|
1475
|
+
*
|
|
1476
|
+
* @returns {Error} The created error.
|
|
1477
|
+
*/
|
|
1478
|
+
constructor(message, code, config, request, response) {
|
|
1479
|
+
super(message);
|
|
1623
1480
|
|
|
1624
|
-
|
|
1625
|
-
|
|
1481
|
+
// Make message enumerable to maintain backward compatibility
|
|
1482
|
+
// The native Error constructor sets message as non-enumerable,
|
|
1483
|
+
// but axios < v1.13.3 had it as enumerable
|
|
1484
|
+
Object.defineProperty(this, 'message', {
|
|
1485
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
1486
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
1487
|
+
__proto__: null,
|
|
1488
|
+
value: message,
|
|
1489
|
+
enumerable: true,
|
|
1490
|
+
writable: true,
|
|
1491
|
+
configurable: true,
|
|
1626
1492
|
});
|
|
1627
1493
|
|
|
1628
|
-
|
|
1494
|
+
this.name = 'AxiosError';
|
|
1495
|
+
this.isAxiosError = true;
|
|
1496
|
+
code && (this.code = code);
|
|
1497
|
+
config && (this.config = config);
|
|
1498
|
+
request && (this.request = request);
|
|
1499
|
+
if (response) {
|
|
1500
|
+
this.response = response;
|
|
1501
|
+
this.status = response.status;
|
|
1502
|
+
}
|
|
1629
1503
|
}
|
|
1630
1504
|
|
|
1631
|
-
|
|
1632
|
-
|
|
1505
|
+
toJSON() {
|
|
1506
|
+
// Opt-in redaction: when the request config carries a `redact` array, the
|
|
1507
|
+
// value of any matching key (case-insensitive, at any depth) is replaced
|
|
1508
|
+
// with REDACTED in the serialized snapshot. Undefined or empty leaves the
|
|
1509
|
+
// existing serialization behavior unchanged.
|
|
1510
|
+
const config = this.config;
|
|
1511
|
+
const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
|
|
1512
|
+
const serializedConfig =
|
|
1513
|
+
utils$1.isArray(redactKeys) && redactKeys.length > 0
|
|
1514
|
+
? redactConfig(config, redactKeys)
|
|
1515
|
+
: utils$1.toJSONObject(config);
|
|
1633
1516
|
|
|
1634
|
-
|
|
1517
|
+
return {
|
|
1518
|
+
// Standard
|
|
1519
|
+
message: this.message,
|
|
1520
|
+
name: this.name,
|
|
1521
|
+
// Microsoft
|
|
1522
|
+
description: this.description,
|
|
1523
|
+
number: this.number,
|
|
1524
|
+
// Mozilla
|
|
1525
|
+
fileName: this.fileName,
|
|
1526
|
+
lineNumber: this.lineNumber,
|
|
1527
|
+
columnNumber: this.columnNumber,
|
|
1528
|
+
stack: this.stack,
|
|
1529
|
+
// Axios
|
|
1530
|
+
config: serializedConfig,
|
|
1531
|
+
code: this.code,
|
|
1532
|
+
status: this.status,
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
1538
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
1539
|
+
AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
1540
|
+
AxiosError$1.ECONNABORTED = 'ECONNABORTED';
|
|
1541
|
+
AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
|
|
1542
|
+
AxiosError$1.ECONNREFUSED = 'ECONNREFUSED';
|
|
1543
|
+
AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
|
|
1544
|
+
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
1545
|
+
AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
1546
|
+
AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
1547
|
+
AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
1548
|
+
AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
|
|
1549
|
+
AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
1550
|
+
AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
1551
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
1552
|
+
|
|
1553
|
+
// eslint-disable-next-line strict
|
|
1554
|
+
var httpAdapter = null;
|
|
1635
1555
|
|
|
1636
1556
|
/**
|
|
1637
|
-
*
|
|
1638
|
-
* of the input
|
|
1557
|
+
* Determines if the given thing is a array or js object.
|
|
1639
1558
|
*
|
|
1640
|
-
* @param {
|
|
1641
|
-
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
1642
|
-
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
1559
|
+
* @param {string} thing - The object or array to be visited.
|
|
1643
1560
|
*
|
|
1644
|
-
* @returns {
|
|
1561
|
+
* @returns {boolean}
|
|
1645
1562
|
*/
|
|
1646
|
-
function
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
(parser || JSON.parse)(rawValue);
|
|
1650
|
-
return utils$1.trim(rawValue);
|
|
1651
|
-
} catch (e) {
|
|
1652
|
-
if (e.name !== 'SyntaxError') {
|
|
1653
|
-
throw e;
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1563
|
+
function isVisitable(thing) {
|
|
1564
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
1565
|
+
}
|
|
1657
1566
|
|
|
1658
|
-
|
|
1567
|
+
/**
|
|
1568
|
+
* It removes the brackets from the end of a string
|
|
1569
|
+
*
|
|
1570
|
+
* @param {string} key - The key of the parameter.
|
|
1571
|
+
*
|
|
1572
|
+
* @returns {string} the key without the brackets.
|
|
1573
|
+
*/
|
|
1574
|
+
function removeBrackets(key) {
|
|
1575
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
1659
1576
|
}
|
|
1660
1577
|
|
|
1661
|
-
|
|
1662
|
-
|
|
1578
|
+
/**
|
|
1579
|
+
* It takes a path, a key, and a boolean, and returns a string
|
|
1580
|
+
*
|
|
1581
|
+
* @param {string} path - The path to the current key.
|
|
1582
|
+
* @param {string} key - The key of the current object being iterated over.
|
|
1583
|
+
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
1584
|
+
*
|
|
1585
|
+
* @returns {string} The path to the current key.
|
|
1586
|
+
*/
|
|
1587
|
+
function renderKey(path, key, dots) {
|
|
1588
|
+
if (!path) return key;
|
|
1589
|
+
return path
|
|
1590
|
+
.concat(key)
|
|
1591
|
+
.map(function each(token, i) {
|
|
1592
|
+
// eslint-disable-next-line no-param-reassign
|
|
1593
|
+
token = removeBrackets(token);
|
|
1594
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
1595
|
+
})
|
|
1596
|
+
.join(dots ? '.' : '');
|
|
1597
|
+
}
|
|
1663
1598
|
|
|
1664
|
-
|
|
1599
|
+
/**
|
|
1600
|
+
* If the array is an array and none of its elements are visitable, then it's a flat array.
|
|
1601
|
+
*
|
|
1602
|
+
* @param {Array<any>} arr - The array to check
|
|
1603
|
+
*
|
|
1604
|
+
* @returns {boolean}
|
|
1605
|
+
*/
|
|
1606
|
+
function isFlatArray(arr) {
|
|
1607
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
1608
|
+
}
|
|
1665
1609
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
1670
|
-
const isObjectPayload = utils$1.isObject(data);
|
|
1610
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
1611
|
+
return /^is[A-Z]/.test(prop);
|
|
1612
|
+
});
|
|
1671
1613
|
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1614
|
+
/**
|
|
1615
|
+
* Convert a data object to FormData
|
|
1616
|
+
*
|
|
1617
|
+
* @param {Object} obj
|
|
1618
|
+
* @param {?Object} [formData]
|
|
1619
|
+
* @param {?Object} [options]
|
|
1620
|
+
* @param {Function} [options.visitor]
|
|
1621
|
+
* @param {Boolean} [options.metaTokens = true]
|
|
1622
|
+
* @param {Boolean} [options.dots = false]
|
|
1623
|
+
* @param {?Boolean} [options.indexes = false]
|
|
1624
|
+
*
|
|
1625
|
+
* @returns {Object}
|
|
1626
|
+
**/
|
|
1675
1627
|
|
|
1676
|
-
|
|
1628
|
+
/**
|
|
1629
|
+
* It converts an object into a FormData object
|
|
1630
|
+
*
|
|
1631
|
+
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
1632
|
+
* @param {string} formData - The FormData object to append to.
|
|
1633
|
+
* @param {Object<string, any>} options
|
|
1634
|
+
*
|
|
1635
|
+
* @returns
|
|
1636
|
+
*/
|
|
1637
|
+
function toFormData$1(obj, formData, options) {
|
|
1638
|
+
if (!utils$1.isObject(obj)) {
|
|
1639
|
+
throw new TypeError('target must be an object');
|
|
1640
|
+
}
|
|
1677
1641
|
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
}
|
|
1642
|
+
// eslint-disable-next-line no-param-reassign
|
|
1643
|
+
formData = formData || new (FormData)();
|
|
1681
1644
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
1697
|
-
return data.toString();
|
|
1698
|
-
}
|
|
1645
|
+
// eslint-disable-next-line no-param-reassign
|
|
1646
|
+
options = utils$1.toFlatObject(
|
|
1647
|
+
options,
|
|
1648
|
+
{
|
|
1649
|
+
metaTokens: true,
|
|
1650
|
+
dots: false,
|
|
1651
|
+
indexes: false,
|
|
1652
|
+
},
|
|
1653
|
+
false,
|
|
1654
|
+
function defined(option, source) {
|
|
1655
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
1656
|
+
return !utils$1.isUndefined(source[option]);
|
|
1657
|
+
}
|
|
1658
|
+
);
|
|
1699
1659
|
|
|
1700
|
-
|
|
1660
|
+
const metaTokens = options.metaTokens;
|
|
1661
|
+
// eslint-disable-next-line no-use-before-define
|
|
1662
|
+
const visitor = options.visitor || defaultVisitor;
|
|
1663
|
+
const dots = options.dots;
|
|
1664
|
+
const indexes = options.indexes;
|
|
1665
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
1666
|
+
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
1667
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1701
1668
|
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
return toURLEncodedForm(data, formSerializer).toString();
|
|
1706
|
-
}
|
|
1669
|
+
if (!utils$1.isFunction(visitor)) {
|
|
1670
|
+
throw new TypeError('visitor must be a function');
|
|
1671
|
+
}
|
|
1707
1672
|
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
contentType.indexOf('multipart/form-data') > -1
|
|
1711
|
-
) {
|
|
1712
|
-
const env = own(this, 'env');
|
|
1713
|
-
const _FormData = env && env.FormData;
|
|
1673
|
+
function convertValue(value) {
|
|
1674
|
+
if (value === null) return '';
|
|
1714
1675
|
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
formSerializer
|
|
1719
|
-
);
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1676
|
+
if (utils$1.isDate(value)) {
|
|
1677
|
+
return value.toISOString();
|
|
1678
|
+
}
|
|
1722
1679
|
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
}
|
|
1680
|
+
if (utils$1.isBoolean(value)) {
|
|
1681
|
+
return value.toString();
|
|
1682
|
+
}
|
|
1727
1683
|
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1684
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
1685
|
+
throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
|
|
1686
|
+
}
|
|
1731
1687
|
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1736
|
-
const responseType = own(this, 'responseType');
|
|
1737
|
-
const JSONRequested = responseType === 'json';
|
|
1688
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
1689
|
+
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
1690
|
+
}
|
|
1738
1691
|
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
}
|
|
1692
|
+
return value;
|
|
1693
|
+
}
|
|
1742
1694
|
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1695
|
+
/**
|
|
1696
|
+
* Default visitor.
|
|
1697
|
+
*
|
|
1698
|
+
* @param {*} value
|
|
1699
|
+
* @param {String|Number} key
|
|
1700
|
+
* @param {Array<String|Number>} path
|
|
1701
|
+
* @this {FormData}
|
|
1702
|
+
*
|
|
1703
|
+
* @returns {boolean} return true to visit the each prop of the value recursively
|
|
1704
|
+
*/
|
|
1705
|
+
function defaultVisitor(value, key, path) {
|
|
1706
|
+
let arr = value;
|
|
1750
1707
|
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
if (e.name === 'SyntaxError') {
|
|
1756
|
-
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
1757
|
-
}
|
|
1758
|
-
throw e;
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1708
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
1709
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
1710
|
+
return false;
|
|
1711
|
+
}
|
|
1762
1712
|
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1713
|
+
if (value && !path && typeof value === 'object') {
|
|
1714
|
+
if (utils$1.endsWith(key, '{}')) {
|
|
1715
|
+
// eslint-disable-next-line no-param-reassign
|
|
1716
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
1717
|
+
// eslint-disable-next-line no-param-reassign
|
|
1718
|
+
value = JSON.stringify(value);
|
|
1719
|
+
} else if (
|
|
1720
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
1721
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
1722
|
+
) {
|
|
1723
|
+
// eslint-disable-next-line no-param-reassign
|
|
1724
|
+
key = removeBrackets(key);
|
|
1766
1725
|
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1726
|
+
arr.forEach(function each(el, index) {
|
|
1727
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
1728
|
+
formData.append(
|
|
1729
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1730
|
+
indexes === true
|
|
1731
|
+
? renderKey([key], index, dots)
|
|
1732
|
+
: indexes === null
|
|
1733
|
+
? key
|
|
1734
|
+
: key + '[]',
|
|
1735
|
+
convertValue(el)
|
|
1736
|
+
);
|
|
1737
|
+
});
|
|
1738
|
+
return false;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1772
1741
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1742
|
+
if (isVisitable(value)) {
|
|
1743
|
+
return true;
|
|
1744
|
+
}
|
|
1775
1745
|
|
|
1776
|
-
|
|
1777
|
-
maxBodyLength: -1,
|
|
1746
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
1778
1747
|
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
Blob: platform.classes.Blob,
|
|
1782
|
-
},
|
|
1748
|
+
return false;
|
|
1749
|
+
}
|
|
1783
1750
|
|
|
1784
|
-
|
|
1785
|
-
return status >= 200 && status < 300;
|
|
1786
|
-
},
|
|
1751
|
+
const stack = [];
|
|
1787
1752
|
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
},
|
|
1794
|
-
};
|
|
1753
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
1754
|
+
defaultVisitor,
|
|
1755
|
+
convertValue,
|
|
1756
|
+
isVisitable,
|
|
1757
|
+
});
|
|
1795
1758
|
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
});
|
|
1759
|
+
function build(value, path, depth = 0) {
|
|
1760
|
+
if (utils$1.isUndefined(value)) return;
|
|
1799
1761
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
'content-type',
|
|
1807
|
-
'etag',
|
|
1808
|
-
'expires',
|
|
1809
|
-
'from',
|
|
1810
|
-
'host',
|
|
1811
|
-
'if-modified-since',
|
|
1812
|
-
'if-unmodified-since',
|
|
1813
|
-
'last-modified',
|
|
1814
|
-
'location',
|
|
1815
|
-
'max-forwards',
|
|
1816
|
-
'proxy-authorization',
|
|
1817
|
-
'referer',
|
|
1818
|
-
'retry-after',
|
|
1819
|
-
'user-agent',
|
|
1820
|
-
]);
|
|
1762
|
+
if (depth > maxDepth) {
|
|
1763
|
+
throw new AxiosError$1(
|
|
1764
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1765
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1766
|
+
);
|
|
1767
|
+
}
|
|
1821
1768
|
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
* ```
|
|
1826
|
-
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
1827
|
-
* Content-Type: application/json
|
|
1828
|
-
* Connection: keep-alive
|
|
1829
|
-
* Transfer-Encoding: chunked
|
|
1830
|
-
* ```
|
|
1831
|
-
*
|
|
1832
|
-
* @param {String} rawHeaders Headers needing to be parsed
|
|
1833
|
-
*
|
|
1834
|
-
* @returns {Object} Headers parsed into an object
|
|
1835
|
-
*/
|
|
1836
|
-
var parseHeaders = (rawHeaders) => {
|
|
1837
|
-
const parsed = {};
|
|
1838
|
-
let key;
|
|
1839
|
-
let val;
|
|
1840
|
-
let i;
|
|
1769
|
+
if (stack.indexOf(value) !== -1) {
|
|
1770
|
+
throw Error('Circular reference detected in ' + path.join('.'));
|
|
1771
|
+
}
|
|
1841
1772
|
|
|
1842
|
-
|
|
1843
|
-
rawHeaders.split('\n').forEach(function parser(line) {
|
|
1844
|
-
i = line.indexOf(':');
|
|
1845
|
-
key = line.substring(0, i).trim().toLowerCase();
|
|
1846
|
-
val = line.substring(i + 1).trim();
|
|
1773
|
+
stack.push(value);
|
|
1847
1774
|
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1775
|
+
utils$1.forEach(value, function each(el, key) {
|
|
1776
|
+
const result =
|
|
1777
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
1778
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
1851
1779
|
|
|
1852
|
-
if (
|
|
1853
|
-
|
|
1854
|
-
parsed[key].push(val);
|
|
1855
|
-
} else {
|
|
1856
|
-
parsed[key] = [val];
|
|
1857
|
-
}
|
|
1858
|
-
} else {
|
|
1859
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
1780
|
+
if (result === true) {
|
|
1781
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
1860
1782
|
}
|
|
1861
1783
|
});
|
|
1862
1784
|
|
|
1863
|
-
|
|
1864
|
-
}
|
|
1785
|
+
stack.pop();
|
|
1786
|
+
}
|
|
1865
1787
|
|
|
1866
|
-
|
|
1788
|
+
if (!utils$1.isObject(obj)) {
|
|
1789
|
+
throw new TypeError('data must be an object');
|
|
1790
|
+
}
|
|
1867
1791
|
|
|
1868
|
-
|
|
1792
|
+
build(obj);
|
|
1869
1793
|
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
let end = str.length;
|
|
1794
|
+
return formData;
|
|
1795
|
+
}
|
|
1873
1796
|
|
|
1874
|
-
|
|
1875
|
-
|
|
1797
|
+
/**
|
|
1798
|
+
* It encodes a string by replacing all characters that are not in the unreserved set with
|
|
1799
|
+
* their percent-encoded equivalents
|
|
1800
|
+
*
|
|
1801
|
+
* @param {string} str - The string to encode.
|
|
1802
|
+
*
|
|
1803
|
+
* @returns {string} The encoded string.
|
|
1804
|
+
*/
|
|
1805
|
+
function encode$1(str) {
|
|
1806
|
+
const charMap = {
|
|
1807
|
+
'!': '%21',
|
|
1808
|
+
"'": '%27',
|
|
1809
|
+
'(': '%28',
|
|
1810
|
+
')': '%29',
|
|
1811
|
+
'~': '%7E',
|
|
1812
|
+
'%20': '+',
|
|
1813
|
+
};
|
|
1814
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
1815
|
+
return charMap[match];
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1876
1818
|
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1819
|
+
/**
|
|
1820
|
+
* It takes a params object and converts it to a FormData object
|
|
1821
|
+
*
|
|
1822
|
+
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
|
|
1823
|
+
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
|
|
1824
|
+
*
|
|
1825
|
+
* @returns {void}
|
|
1826
|
+
*/
|
|
1827
|
+
function AxiosURLSearchParams(params, options) {
|
|
1828
|
+
this._pairs = [];
|
|
1829
|
+
|
|
1830
|
+
params && toFormData$1(params, this, options);
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
1834
|
+
|
|
1835
|
+
prototype.append = function append(name, value) {
|
|
1836
|
+
this._pairs.push([name, value]);
|
|
1837
|
+
};
|
|
1880
1838
|
|
|
1881
|
-
|
|
1882
|
-
|
|
1839
|
+
prototype.toString = function toString(encoder) {
|
|
1840
|
+
const _encode = encoder
|
|
1841
|
+
? function (value) {
|
|
1842
|
+
return encoder.call(this, value, encode$1);
|
|
1843
|
+
}
|
|
1844
|
+
: encode$1;
|
|
1883
1845
|
|
|
1884
|
-
|
|
1885
|
-
|
|
1846
|
+
return this._pairs
|
|
1847
|
+
.map(function each(pair) {
|
|
1848
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
1849
|
+
}, '')
|
|
1850
|
+
.join('&');
|
|
1851
|
+
};
|
|
1886
1852
|
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1853
|
+
/**
|
|
1854
|
+
* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
|
|
1855
|
+
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
1856
|
+
*
|
|
1857
|
+
* @param {string} val The value to be encoded.
|
|
1858
|
+
*
|
|
1859
|
+
* @returns {string} The encoded value.
|
|
1860
|
+
*/
|
|
1861
|
+
function encode(val) {
|
|
1862
|
+
return encodeURIComponent(val)
|
|
1863
|
+
.replace(/%3A/gi, ':')
|
|
1864
|
+
.replace(/%24/g, '$')
|
|
1865
|
+
.replace(/%2C/gi, ',')
|
|
1866
|
+
.replace(/%20/g, '+');
|
|
1867
|
+
}
|
|
1890
1868
|
|
|
1891
|
-
|
|
1869
|
+
/**
|
|
1870
|
+
* Build a URL by appending params to the end
|
|
1871
|
+
*
|
|
1872
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
1873
|
+
* @param {object} [params] The params to be appended
|
|
1874
|
+
* @param {?(object|Function)} options
|
|
1875
|
+
*
|
|
1876
|
+
* @returns {string} The formatted url
|
|
1877
|
+
*/
|
|
1878
|
+
function buildURL(url, params, options) {
|
|
1879
|
+
if (!params) {
|
|
1880
|
+
return url;
|
|
1892
1881
|
}
|
|
1893
1882
|
|
|
1894
|
-
|
|
1895
|
-
}
|
|
1883
|
+
const _encode = (options && options.encode) || encode;
|
|
1896
1884
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1885
|
+
const _options = utils$1.isFunction(options)
|
|
1886
|
+
? {
|
|
1887
|
+
serialize: options,
|
|
1888
|
+
}
|
|
1889
|
+
: options;
|
|
1900
1890
|
|
|
1901
|
-
|
|
1902
|
-
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
1903
|
-
}
|
|
1891
|
+
const serializeFn = _options && _options.serialize;
|
|
1904
1892
|
|
|
1905
|
-
|
|
1906
|
-
if (value === false || value == null) {
|
|
1907
|
-
return value;
|
|
1908
|
-
}
|
|
1893
|
+
let serializedParams;
|
|
1909
1894
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1895
|
+
if (serializeFn) {
|
|
1896
|
+
serializedParams = serializeFn(params, _options);
|
|
1897
|
+
} else {
|
|
1898
|
+
serializedParams = utils$1.isURLSearchParams(params)
|
|
1899
|
+
? params.toString()
|
|
1900
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
1901
|
+
}
|
|
1912
1902
|
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1916
|
-
let match;
|
|
1903
|
+
if (serializedParams) {
|
|
1904
|
+
const hashmarkIndex = url.indexOf('#');
|
|
1917
1905
|
|
|
1918
|
-
|
|
1919
|
-
|
|
1906
|
+
if (hashmarkIndex !== -1) {
|
|
1907
|
+
url = url.slice(0, hashmarkIndex);
|
|
1908
|
+
}
|
|
1909
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
1920
1910
|
}
|
|
1921
1911
|
|
|
1922
|
-
return
|
|
1912
|
+
return url;
|
|
1923
1913
|
}
|
|
1924
1914
|
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
if (utils$1.isFunction(filter)) {
|
|
1929
|
-
return filter.call(this, value, header);
|
|
1915
|
+
class InterceptorManager {
|
|
1916
|
+
constructor() {
|
|
1917
|
+
this.handlers = [];
|
|
1930
1918
|
}
|
|
1931
1919
|
|
|
1932
|
-
|
|
1933
|
-
|
|
1920
|
+
/**
|
|
1921
|
+
* Add a new interceptor to the stack
|
|
1922
|
+
*
|
|
1923
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1924
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1925
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
1926
|
+
*
|
|
1927
|
+
* @return {Number} An ID used to remove interceptor later
|
|
1928
|
+
*/
|
|
1929
|
+
use(fulfilled, rejected, options) {
|
|
1930
|
+
this.handlers.push({
|
|
1931
|
+
fulfilled,
|
|
1932
|
+
rejected,
|
|
1933
|
+
synchronous: options ? options.synchronous : false,
|
|
1934
|
+
runWhen: options ? options.runWhen : null,
|
|
1935
|
+
});
|
|
1936
|
+
return this.handlers.length - 1;
|
|
1934
1937
|
}
|
|
1935
1938
|
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1939
|
+
/**
|
|
1940
|
+
* Remove an interceptor from the stack
|
|
1941
|
+
*
|
|
1942
|
+
* @param {Number} id The ID that was returned by `use`
|
|
1943
|
+
*
|
|
1944
|
+
* @returns {void}
|
|
1945
|
+
*/
|
|
1946
|
+
eject(id) {
|
|
1947
|
+
if (this.handlers[id]) {
|
|
1948
|
+
this.handlers[id] = null;
|
|
1949
|
+
}
|
|
1940
1950
|
}
|
|
1941
1951
|
|
|
1942
|
-
|
|
1943
|
-
|
|
1952
|
+
/**
|
|
1953
|
+
* Clear all interceptors from the stack
|
|
1954
|
+
*
|
|
1955
|
+
* @returns {void}
|
|
1956
|
+
*/
|
|
1957
|
+
clear() {
|
|
1958
|
+
if (this.handlers) {
|
|
1959
|
+
this.handlers = [];
|
|
1960
|
+
}
|
|
1944
1961
|
}
|
|
1945
|
-
}
|
|
1946
1962
|
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1963
|
+
/**
|
|
1964
|
+
* Iterate over all the registered interceptors
|
|
1965
|
+
*
|
|
1966
|
+
* This method is particularly useful for skipping over any
|
|
1967
|
+
* interceptors that may have become `null` calling `eject`.
|
|
1968
|
+
*
|
|
1969
|
+
* @param {Function} fn The function to call for each interceptor
|
|
1970
|
+
*
|
|
1971
|
+
* @returns {void}
|
|
1972
|
+
*/
|
|
1973
|
+
forEach(fn) {
|
|
1974
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
1975
|
+
if (h !== null) {
|
|
1976
|
+
fn(h);
|
|
1977
|
+
}
|
|
1953
1978
|
});
|
|
1979
|
+
}
|
|
1954
1980
|
}
|
|
1955
1981
|
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
1963
|
-
},
|
|
1964
|
-
configurable: true,
|
|
1965
|
-
});
|
|
1966
|
-
});
|
|
1967
|
-
}
|
|
1982
|
+
var transitionalDefaults = {
|
|
1983
|
+
silentJSONParsing: true,
|
|
1984
|
+
forcedJSONParsing: true,
|
|
1985
|
+
clarifyTimeoutError: false,
|
|
1986
|
+
legacyInterceptorReqResOrdering: true,
|
|
1987
|
+
};
|
|
1968
1988
|
|
|
1969
|
-
|
|
1970
|
-
constructor(headers) {
|
|
1971
|
-
headers && this.set(headers);
|
|
1972
|
-
}
|
|
1989
|
+
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
1973
1990
|
|
|
1974
|
-
|
|
1975
|
-
const self = this;
|
|
1991
|
+
var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
1976
1992
|
|
|
1977
|
-
|
|
1978
|
-
const lHeader = normalizeHeader(_header);
|
|
1993
|
+
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
1979
1994
|
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1995
|
+
var platform$1 = {
|
|
1996
|
+
isBrowser: true,
|
|
1997
|
+
classes: {
|
|
1998
|
+
URLSearchParams: URLSearchParams$1,
|
|
1999
|
+
FormData: FormData$1,
|
|
2000
|
+
Blob: Blob$1,
|
|
2001
|
+
},
|
|
2002
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
|
|
2003
|
+
};
|
|
1983
2004
|
|
|
1984
|
-
|
|
2005
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1985
2006
|
|
|
1986
|
-
|
|
1987
|
-
!key ||
|
|
1988
|
-
self[key] === undefined ||
|
|
1989
|
-
_rewrite === true ||
|
|
1990
|
-
(_rewrite === undefined && self[key] !== false)
|
|
1991
|
-
) {
|
|
1992
|
-
self[key || _header] = normalizeValue(_value);
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
2007
|
+
const _navigator = (typeof navigator === 'object' && navigator) || undefined;
|
|
1995
2008
|
|
|
1996
|
-
|
|
1997
|
-
|
|
2009
|
+
/**
|
|
2010
|
+
* Determine if we're running in a standard browser environment
|
|
2011
|
+
*
|
|
2012
|
+
* This allows axios to run in a web worker, and react-native.
|
|
2013
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
2014
|
+
*
|
|
2015
|
+
* web workers:
|
|
2016
|
+
* typeof window -> undefined
|
|
2017
|
+
* typeof document -> undefined
|
|
2018
|
+
*
|
|
2019
|
+
* react-native:
|
|
2020
|
+
* navigator.product -> 'ReactNative'
|
|
2021
|
+
* nativescript
|
|
2022
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
|
2023
|
+
*
|
|
2024
|
+
* @returns {boolean}
|
|
2025
|
+
*/
|
|
2026
|
+
const hasStandardBrowserEnv =
|
|
2027
|
+
hasBrowserEnv &&
|
|
2028
|
+
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
1998
2029
|
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2030
|
+
/**
|
|
2031
|
+
* Determine if we're running in a standard browser webWorker environment
|
|
2032
|
+
*
|
|
2033
|
+
* Although the `isStandardBrowserEnv` method indicates that
|
|
2034
|
+
* `allows axios to run in a web worker`, the WebWorker will still be
|
|
2035
|
+
* filtered out due to its judgment standard
|
|
2036
|
+
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
2037
|
+
* This leads to a problem when axios post `FormData` in webWorker
|
|
2038
|
+
*/
|
|
2039
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
2040
|
+
return (
|
|
2041
|
+
typeof WorkerGlobalScope !== 'undefined' &&
|
|
2042
|
+
// eslint-disable-next-line no-undef
|
|
2043
|
+
self instanceof WorkerGlobalScope &&
|
|
2044
|
+
typeof self.importScripts === 'function'
|
|
2045
|
+
);
|
|
2046
|
+
})();
|
|
2011
2047
|
|
|
2012
|
-
|
|
2013
|
-
? utils$1.isArray(dest)
|
|
2014
|
-
? [...dest, entry[1]]
|
|
2015
|
-
: [dest, entry[1]]
|
|
2016
|
-
: entry[1];
|
|
2017
|
-
}
|
|
2048
|
+
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
2018
2049
|
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2050
|
+
var utils = /*#__PURE__*/Object.freeze({
|
|
2051
|
+
__proto__: null,
|
|
2052
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
2053
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
2054
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
2055
|
+
navigator: _navigator,
|
|
2056
|
+
origin: origin
|
|
2057
|
+
});
|
|
2023
2058
|
|
|
2024
|
-
|
|
2025
|
-
|
|
2059
|
+
var platform = {
|
|
2060
|
+
...utils,
|
|
2061
|
+
...platform$1,
|
|
2062
|
+
};
|
|
2026
2063
|
|
|
2027
|
-
|
|
2028
|
-
|
|
2064
|
+
function toURLEncodedForm(data, options) {
|
|
2065
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
2066
|
+
visitor: function (value, key, path, helpers) {
|
|
2067
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
2068
|
+
this.append(key, value.toString('base64'));
|
|
2069
|
+
return false;
|
|
2070
|
+
}
|
|
2029
2071
|
|
|
2030
|
-
|
|
2031
|
-
|
|
2072
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
2073
|
+
},
|
|
2074
|
+
...options,
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2032
2077
|
|
|
2033
|
-
|
|
2034
|
-
|
|
2078
|
+
/**
|
|
2079
|
+
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
2080
|
+
*
|
|
2081
|
+
* @param {string} name - The name of the property to get.
|
|
2082
|
+
*
|
|
2083
|
+
* @returns An array of strings.
|
|
2084
|
+
*/
|
|
2085
|
+
function parsePropPath(name) {
|
|
2086
|
+
// foo[x][y][z]
|
|
2087
|
+
// foo.x.y.z
|
|
2088
|
+
// foo-x-y-z
|
|
2089
|
+
// foo x y z
|
|
2090
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
2091
|
+
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2035
2094
|
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2095
|
+
/**
|
|
2096
|
+
* Convert an array to an object.
|
|
2097
|
+
*
|
|
2098
|
+
* @param {Array<any>} arr - The array to convert to an object.
|
|
2099
|
+
*
|
|
2100
|
+
* @returns An object with the same keys and values as the array.
|
|
2101
|
+
*/
|
|
2102
|
+
function arrayToObject(arr) {
|
|
2103
|
+
const obj = {};
|
|
2104
|
+
const keys = Object.keys(arr);
|
|
2105
|
+
let i;
|
|
2106
|
+
const len = keys.length;
|
|
2107
|
+
let key;
|
|
2108
|
+
for (i = 0; i < len; i++) {
|
|
2109
|
+
key = keys[i];
|
|
2110
|
+
obj[key] = arr[key];
|
|
2111
|
+
}
|
|
2112
|
+
return obj;
|
|
2113
|
+
}
|
|
2039
2114
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2115
|
+
/**
|
|
2116
|
+
* It takes a FormData object and returns a JavaScript object
|
|
2117
|
+
*
|
|
2118
|
+
* @param {string} formData The FormData object to convert to JSON.
|
|
2119
|
+
*
|
|
2120
|
+
* @returns {Object<string, any> | null} The converted object.
|
|
2121
|
+
*/
|
|
2122
|
+
function formDataToJSON(formData) {
|
|
2123
|
+
function buildPath(path, value, target, index) {
|
|
2124
|
+
let name = path[index++];
|
|
2043
2125
|
|
|
2044
|
-
|
|
2045
|
-
return parser.call(this, value, key);
|
|
2046
|
-
}
|
|
2126
|
+
if (name === '__proto__') return true;
|
|
2047
2127
|
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2128
|
+
const isNumericKey = Number.isFinite(+name);
|
|
2129
|
+
const isLast = index >= path.length;
|
|
2130
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
2051
2131
|
|
|
2052
|
-
|
|
2132
|
+
if (isLast) {
|
|
2133
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
2134
|
+
target[name] = utils$1.isArray(target[name])
|
|
2135
|
+
? target[name].concat(value)
|
|
2136
|
+
: [target[name], value];
|
|
2137
|
+
} else {
|
|
2138
|
+
target[name] = value;
|
|
2053
2139
|
}
|
|
2140
|
+
|
|
2141
|
+
return !isNumericKey;
|
|
2054
2142
|
}
|
|
2055
|
-
}
|
|
2056
2143
|
|
|
2057
|
-
|
|
2058
|
-
|
|
2144
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
2145
|
+
target[name] = [];
|
|
2146
|
+
}
|
|
2059
2147
|
|
|
2060
|
-
|
|
2061
|
-
const key = utils$1.findKey(this, header);
|
|
2148
|
+
const result = buildPath(path, value, target[name], index);
|
|
2062
2149
|
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
this[key] !== undefined &&
|
|
2066
|
-
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
2067
|
-
);
|
|
2150
|
+
if (result && utils$1.isArray(target[name])) {
|
|
2151
|
+
target[name] = arrayToObject(target[name]);
|
|
2068
2152
|
}
|
|
2069
2153
|
|
|
2070
|
-
return
|
|
2154
|
+
return !isNumericKey;
|
|
2071
2155
|
}
|
|
2072
2156
|
|
|
2073
|
-
|
|
2074
|
-
const
|
|
2075
|
-
let deleted = false;
|
|
2076
|
-
|
|
2077
|
-
function deleteHeader(_header) {
|
|
2078
|
-
_header = normalizeHeader(_header);
|
|
2079
|
-
|
|
2080
|
-
if (_header) {
|
|
2081
|
-
const key = utils$1.findKey(self, _header);
|
|
2082
|
-
|
|
2083
|
-
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
2084
|
-
delete self[key];
|
|
2085
|
-
|
|
2086
|
-
deleted = true;
|
|
2087
|
-
}
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2157
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
2158
|
+
const obj = {};
|
|
2090
2159
|
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
}
|
|
2094
|
-
deleteHeader(header);
|
|
2095
|
-
}
|
|
2160
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
2161
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
2162
|
+
});
|
|
2096
2163
|
|
|
2097
|
-
return
|
|
2164
|
+
return obj;
|
|
2098
2165
|
}
|
|
2099
2166
|
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
let i = keys.length;
|
|
2103
|
-
let deleted = false;
|
|
2167
|
+
return null;
|
|
2168
|
+
}
|
|
2104
2169
|
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2170
|
+
const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
2174
|
+
* of the input
|
|
2175
|
+
*
|
|
2176
|
+
* @param {any} rawValue - The value to be stringified.
|
|
2177
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
2178
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
2179
|
+
*
|
|
2180
|
+
* @returns {string} A stringified version of the rawValue.
|
|
2181
|
+
*/
|
|
2182
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
2183
|
+
if (utils$1.isString(rawValue)) {
|
|
2184
|
+
try {
|
|
2185
|
+
(parser || JSON.parse)(rawValue);
|
|
2186
|
+
return utils$1.trim(rawValue);
|
|
2187
|
+
} catch (e) {
|
|
2188
|
+
if (e.name !== 'SyntaxError') {
|
|
2189
|
+
throw e;
|
|
2110
2190
|
}
|
|
2111
2191
|
}
|
|
2112
|
-
|
|
2113
|
-
return deleted;
|
|
2114
2192
|
}
|
|
2115
2193
|
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
const headers = {};
|
|
2194
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
2195
|
+
}
|
|
2119
2196
|
|
|
2120
|
-
|
|
2121
|
-
|
|
2197
|
+
const defaults = {
|
|
2198
|
+
transitional: transitionalDefaults,
|
|
2122
2199
|
|
|
2123
|
-
|
|
2124
|
-
self[key] = normalizeValue(value);
|
|
2125
|
-
delete self[header];
|
|
2126
|
-
return;
|
|
2127
|
-
}
|
|
2200
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
2128
2201
|
|
|
2129
|
-
|
|
2202
|
+
transformRequest: [
|
|
2203
|
+
function transformRequest(data, headers) {
|
|
2204
|
+
const contentType = headers.getContentType() || '';
|
|
2205
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
2206
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
2130
2207
|
|
|
2131
|
-
if (
|
|
2132
|
-
|
|
2208
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
2209
|
+
data = new FormData(data);
|
|
2133
2210
|
}
|
|
2134
2211
|
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
headers[normalized] = true;
|
|
2138
|
-
});
|
|
2212
|
+
const isFormData = utils$1.isFormData(data);
|
|
2139
2213
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2214
|
+
if (isFormData) {
|
|
2215
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
2216
|
+
}
|
|
2142
2217
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2218
|
+
if (
|
|
2219
|
+
utils$1.isArrayBuffer(data) ||
|
|
2220
|
+
utils$1.isBuffer(data) ||
|
|
2221
|
+
utils$1.isStream(data) ||
|
|
2222
|
+
utils$1.isFile(data) ||
|
|
2223
|
+
utils$1.isBlob(data) ||
|
|
2224
|
+
utils$1.isReadableStream(data)
|
|
2225
|
+
) {
|
|
2226
|
+
return data;
|
|
2227
|
+
}
|
|
2228
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
2229
|
+
return data.buffer;
|
|
2230
|
+
}
|
|
2231
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
2232
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
2233
|
+
return data.toString();
|
|
2234
|
+
}
|
|
2146
2235
|
|
|
2147
|
-
|
|
2148
|
-
const obj = Object.create(null);
|
|
2236
|
+
let isFileList;
|
|
2149
2237
|
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2238
|
+
if (isObjectPayload) {
|
|
2239
|
+
const formSerializer = own(this, 'formSerializer');
|
|
2240
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
2241
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
2242
|
+
}
|
|
2155
2243
|
|
|
2156
|
-
|
|
2157
|
-
|
|
2244
|
+
if (
|
|
2245
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
2246
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
2247
|
+
) {
|
|
2248
|
+
const env = own(this, 'env');
|
|
2249
|
+
const _FormData = env && env.FormData;
|
|
2158
2250
|
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2251
|
+
return toFormData$1(
|
|
2252
|
+
isFileList ? { 'files[]': data } : data,
|
|
2253
|
+
_FormData && new _FormData(),
|
|
2254
|
+
formSerializer
|
|
2255
|
+
);
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2162
2258
|
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
}
|
|
2259
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
2260
|
+
headers.setContentType('application/json', false);
|
|
2261
|
+
return stringifySafely(data);
|
|
2262
|
+
}
|
|
2168
2263
|
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2264
|
+
return data;
|
|
2265
|
+
},
|
|
2266
|
+
],
|
|
2172
2267
|
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2268
|
+
transformResponse: [
|
|
2269
|
+
function transformResponse(data) {
|
|
2270
|
+
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
2271
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
2272
|
+
const responseType = own(this, 'responseType');
|
|
2273
|
+
const JSONRequested = responseType === 'json';
|
|
2176
2274
|
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2275
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
2276
|
+
return data;
|
|
2277
|
+
}
|
|
2180
2278
|
|
|
2181
|
-
|
|
2182
|
-
|
|
2279
|
+
if (
|
|
2280
|
+
data &&
|
|
2281
|
+
utils$1.isString(data) &&
|
|
2282
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
2283
|
+
) {
|
|
2284
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
2285
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
2183
2286
|
|
|
2184
|
-
|
|
2287
|
+
try {
|
|
2288
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
2289
|
+
} catch (e) {
|
|
2290
|
+
if (strictJSONParsing) {
|
|
2291
|
+
if (e.name === 'SyntaxError') {
|
|
2292
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
2293
|
+
}
|
|
2294
|
+
throw e;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2185
2298
|
|
|
2186
|
-
|
|
2187
|
-
|
|
2299
|
+
return data;
|
|
2300
|
+
},
|
|
2301
|
+
],
|
|
2188
2302
|
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
accessors: {},
|
|
2195
|
-
});
|
|
2303
|
+
/**
|
|
2304
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2305
|
+
* timeout is not created.
|
|
2306
|
+
*/
|
|
2307
|
+
timeout: 0,
|
|
2196
2308
|
|
|
2197
|
-
|
|
2198
|
-
|
|
2309
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
2310
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
2199
2311
|
|
|
2200
|
-
|
|
2201
|
-
|
|
2312
|
+
maxContentLength: -1,
|
|
2313
|
+
maxBodyLength: -1,
|
|
2202
2314
|
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
}
|
|
2315
|
+
env: {
|
|
2316
|
+
FormData: platform.classes.FormData,
|
|
2317
|
+
Blob: platform.classes.Blob,
|
|
2318
|
+
},
|
|
2208
2319
|
|
|
2209
|
-
|
|
2320
|
+
validateStatus: function validateStatus(status) {
|
|
2321
|
+
return status >= 200 && status < 300;
|
|
2322
|
+
},
|
|
2210
2323
|
|
|
2211
|
-
|
|
2212
|
-
|
|
2324
|
+
headers: {
|
|
2325
|
+
common: {
|
|
2326
|
+
Accept: 'application/json, text/plain, */*',
|
|
2327
|
+
'Content-Type': undefined,
|
|
2328
|
+
},
|
|
2329
|
+
},
|
|
2213
2330
|
};
|
|
2214
2331
|
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
'Content-Length',
|
|
2218
|
-
'Accept',
|
|
2219
|
-
'Accept-Encoding',
|
|
2220
|
-
'User-Agent',
|
|
2221
|
-
'Authorization',
|
|
2222
|
-
]);
|
|
2223
|
-
|
|
2224
|
-
// reserved names hotfix
|
|
2225
|
-
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
2226
|
-
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
2227
|
-
return {
|
|
2228
|
-
get: () => value,
|
|
2229
|
-
set(headerValue) {
|
|
2230
|
-
this[mapped] = headerValue;
|
|
2231
|
-
},
|
|
2232
|
-
};
|
|
2332
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
|
|
2333
|
+
defaults.headers[method] = {};
|
|
2233
2334
|
});
|
|
2234
2335
|
|
|
2235
|
-
utils$1.freezeMethods(AxiosHeaders$1);
|
|
2236
|
-
|
|
2237
2336
|
/**
|
|
2238
2337
|
* Transform the data for a request or a response
|
|
2239
2338
|
*
|
|
@@ -2292,22 +2391,18 @@ function settle(resolve, reject, response) {
|
|
|
2292
2391
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
2293
2392
|
resolve(response);
|
|
2294
2393
|
} else {
|
|
2295
|
-
reject(
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
response.request,
|
|
2303
|
-
response
|
|
2304
|
-
)
|
|
2305
|
-
);
|
|
2394
|
+
reject(new AxiosError$1(
|
|
2395
|
+
'Request failed with status code ' + response.status,
|
|
2396
|
+
response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
|
|
2397
|
+
response.config,
|
|
2398
|
+
response.request,
|
|
2399
|
+
response
|
|
2400
|
+
));
|
|
2306
2401
|
}
|
|
2307
2402
|
}
|
|
2308
2403
|
|
|
2309
2404
|
function parseProtocol(url) {
|
|
2310
|
-
const match = /^([-+\w]{1,25})(
|
|
2405
|
+
const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
2311
2406
|
return (match && match[1]) || '';
|
|
2312
2407
|
}
|
|
2313
2408
|
|
|
@@ -2498,8 +2593,20 @@ var cookies = platform.hasStandardBrowserEnv
|
|
|
2498
2593
|
|
|
2499
2594
|
read(name) {
|
|
2500
2595
|
if (typeof document === 'undefined') return null;
|
|
2501
|
-
|
|
2502
|
-
|
|
2596
|
+
// Match name=value by splitting on the semicolon separator instead of building a
|
|
2597
|
+
// RegExp from `name` — interpolating an unescaped string into a RegExp would let
|
|
2598
|
+
// metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
|
|
2599
|
+
// match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
|
|
2600
|
+
// "; ", so ignore optional whitespace before each cookie name.
|
|
2601
|
+
const cookies = document.cookie.split(';');
|
|
2602
|
+
for (let i = 0; i < cookies.length; i++) {
|
|
2603
|
+
const cookie = cookies[i].replace(/^\s+/, '');
|
|
2604
|
+
const eq = cookie.indexOf('=');
|
|
2605
|
+
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
2606
|
+
return decodeURIComponent(cookie.slice(eq + 1));
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
return null;
|
|
2503
2610
|
},
|
|
2504
2611
|
|
|
2505
2612
|
remove(name) {
|
|
@@ -2581,11 +2688,14 @@ function mergeConfig$1(config1, config2) {
|
|
|
2581
2688
|
config2 = config2 || {};
|
|
2582
2689
|
|
|
2583
2690
|
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
2584
|
-
// or `config.baseURL` cannot inherit polluted values from Object.prototype
|
|
2585
|
-
//
|
|
2586
|
-
//
|
|
2691
|
+
// or `config.baseURL` cannot inherit polluted values from Object.prototype.
|
|
2692
|
+
// `hasOwnProperty` is restored as a non-enumerable own slot to preserve
|
|
2693
|
+
// ergonomics for user code that relies on it.
|
|
2587
2694
|
const config = Object.create(null);
|
|
2588
2695
|
Object.defineProperty(config, 'hasOwnProperty', {
|
|
2696
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
2697
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
2698
|
+
__proto__: null,
|
|
2589
2699
|
value: Object.prototype.hasOwnProperty,
|
|
2590
2700
|
enumerable: false,
|
|
2591
2701
|
writable: true,
|
|
@@ -2682,11 +2792,39 @@ function mergeConfig$1(config1, config2) {
|
|
|
2682
2792
|
return config;
|
|
2683
2793
|
}
|
|
2684
2794
|
|
|
2795
|
+
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
2796
|
+
|
|
2797
|
+
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
2798
|
+
if (policy !== 'content-only') {
|
|
2799
|
+
headers.set(formHeaders);
|
|
2800
|
+
return;
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
2804
|
+
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
2805
|
+
headers.set(key, val);
|
|
2806
|
+
}
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
/**
|
|
2811
|
+
* Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
|
|
2812
|
+
* This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
|
|
2813
|
+
*
|
|
2814
|
+
* @param {string} str The string to encode
|
|
2815
|
+
*
|
|
2816
|
+
* @returns {string} UTF-8 bytes as a Latin-1 string
|
|
2817
|
+
*/
|
|
2818
|
+
const encodeUTF8 = (str) =>
|
|
2819
|
+
encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
|
|
2820
|
+
String.fromCharCode(parseInt(hex, 16))
|
|
2821
|
+
);
|
|
2822
|
+
|
|
2685
2823
|
var resolveConfig = (config) => {
|
|
2686
2824
|
const newConfig = mergeConfig$1({}, config);
|
|
2687
2825
|
|
|
2688
2826
|
// Read only own properties to prevent prototype pollution gadgets
|
|
2689
|
-
// (e.g. Object.prototype.baseURL = 'https://evil.com').
|
|
2827
|
+
// (e.g. Object.prototype.baseURL = 'https://evil.com').
|
|
2690
2828
|
const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
|
|
2691
2829
|
|
|
2692
2830
|
const data = own('data');
|
|
@@ -2712,11 +2850,7 @@ var resolveConfig = (config) => {
|
|
|
2712
2850
|
headers.set(
|
|
2713
2851
|
'Authorization',
|
|
2714
2852
|
'Basic ' +
|
|
2715
|
-
btoa(
|
|
2716
|
-
(auth.username || '') +
|
|
2717
|
-
':' +
|
|
2718
|
-
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
2719
|
-
)
|
|
2853
|
+
btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
|
|
2720
2854
|
);
|
|
2721
2855
|
}
|
|
2722
2856
|
|
|
@@ -2725,14 +2859,7 @@ var resolveConfig = (config) => {
|
|
|
2725
2859
|
headers.setContentType(undefined); // browser handles it
|
|
2726
2860
|
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
2727
2861
|
// Node.js FormData (like form-data package)
|
|
2728
|
-
|
|
2729
|
-
// Only set safe headers to avoid overwriting security headers
|
|
2730
|
-
const allowedHeaders = ['content-type', 'content-length'];
|
|
2731
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
2732
|
-
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
2733
|
-
headers.set(key, val);
|
|
2734
|
-
}
|
|
2735
|
-
});
|
|
2862
|
+
setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
|
|
2736
2863
|
}
|
|
2737
2864
|
}
|
|
2738
2865
|
|
|
@@ -2747,10 +2874,9 @@ var resolveConfig = (config) => {
|
|
|
2747
2874
|
|
|
2748
2875
|
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
2749
2876
|
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
2750
|
-
// the XSRF token cross-origin.
|
|
2877
|
+
// the XSRF token cross-origin.
|
|
2751
2878
|
const shouldSendXSRF =
|
|
2752
|
-
withXSRFToken === true ||
|
|
2753
|
-
(withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
2879
|
+
withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
2754
2880
|
|
|
2755
2881
|
if (shouldSendXSRF) {
|
|
2756
2882
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
@@ -2846,7 +2972,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
2846
2972
|
// will return status as 0 even though it's a successful request
|
|
2847
2973
|
if (
|
|
2848
2974
|
request.status === 0 &&
|
|
2849
|
-
!(request.responseURL && request.responseURL.
|
|
2975
|
+
!(request.responseURL && request.responseURL.startsWith('file:'))
|
|
2850
2976
|
) {
|
|
2851
2977
|
return;
|
|
2852
2978
|
}
|
|
@@ -2863,6 +2989,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
2863
2989
|
}
|
|
2864
2990
|
|
|
2865
2991
|
reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
|
|
2992
|
+
done();
|
|
2866
2993
|
|
|
2867
2994
|
// Clean up request
|
|
2868
2995
|
request = null;
|
|
@@ -2878,6 +3005,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
2878
3005
|
// attach the underlying event for consumers who want details
|
|
2879
3006
|
err.event = event || null;
|
|
2880
3007
|
reject(err);
|
|
3008
|
+
done();
|
|
2881
3009
|
request = null;
|
|
2882
3010
|
};
|
|
2883
3011
|
|
|
@@ -2898,6 +3026,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
2898
3026
|
request
|
|
2899
3027
|
)
|
|
2900
3028
|
);
|
|
3029
|
+
done();
|
|
2901
3030
|
|
|
2902
3031
|
// Clean up request
|
|
2903
3032
|
request = null;
|
|
@@ -2947,6 +3076,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
2947
3076
|
}
|
|
2948
3077
|
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
2949
3078
|
request.abort();
|
|
3079
|
+
done();
|
|
2950
3080
|
request = null;
|
|
2951
3081
|
};
|
|
2952
3082
|
|
|
@@ -2960,7 +3090,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
2960
3090
|
|
|
2961
3091
|
const protocol = parseProtocol(_config.url);
|
|
2962
3092
|
|
|
2963
|
-
if (protocol && platform.protocols.
|
|
3093
|
+
if (protocol && !platform.protocols.includes(protocol)) {
|
|
2964
3094
|
reject(
|
|
2965
3095
|
new AxiosError$1(
|
|
2966
3096
|
'Unsupported protocol ' + protocol + ':',
|
|
@@ -3117,16 +3247,112 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
3117
3247
|
);
|
|
3118
3248
|
};
|
|
3119
3249
|
|
|
3120
|
-
|
|
3250
|
+
/**
|
|
3251
|
+
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
3252
|
+
* - For base64: compute exact decoded size using length and padding;
|
|
3253
|
+
* handle %XX at the character-count level (no string allocation).
|
|
3254
|
+
* - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
|
|
3255
|
+
*
|
|
3256
|
+
* @param {string} url
|
|
3257
|
+
* @returns {number}
|
|
3258
|
+
*/
|
|
3259
|
+
function estimateDataURLDecodedBytes(url) {
|
|
3260
|
+
if (!url || typeof url !== 'string') return 0;
|
|
3261
|
+
if (!url.startsWith('data:')) return 0;
|
|
3262
|
+
|
|
3263
|
+
const comma = url.indexOf(',');
|
|
3264
|
+
if (comma < 0) return 0;
|
|
3265
|
+
|
|
3266
|
+
const meta = url.slice(5, comma);
|
|
3267
|
+
const body = url.slice(comma + 1);
|
|
3268
|
+
const isBase64 = /;base64/i.test(meta);
|
|
3269
|
+
|
|
3270
|
+
if (isBase64) {
|
|
3271
|
+
let effectiveLen = body.length;
|
|
3272
|
+
const len = body.length; // cache length
|
|
3273
|
+
|
|
3274
|
+
for (let i = 0; i < len; i++) {
|
|
3275
|
+
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
3276
|
+
const a = body.charCodeAt(i + 1);
|
|
3277
|
+
const b = body.charCodeAt(i + 2);
|
|
3278
|
+
const isHex =
|
|
3279
|
+
((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
|
|
3280
|
+
((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
|
|
3281
|
+
|
|
3282
|
+
if (isHex) {
|
|
3283
|
+
effectiveLen -= 2;
|
|
3284
|
+
i += 2;
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3121
3288
|
|
|
3122
|
-
|
|
3289
|
+
let pad = 0;
|
|
3290
|
+
let idx = len - 1;
|
|
3291
|
+
|
|
3292
|
+
const tailIsPct3D = (j) =>
|
|
3293
|
+
j >= 2 &&
|
|
3294
|
+
body.charCodeAt(j - 2) === 37 && // '%'
|
|
3295
|
+
body.charCodeAt(j - 1) === 51 && // '3'
|
|
3296
|
+
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
|
|
3297
|
+
|
|
3298
|
+
if (idx >= 0) {
|
|
3299
|
+
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
3300
|
+
pad++;
|
|
3301
|
+
idx--;
|
|
3302
|
+
} else if (tailIsPct3D(idx)) {
|
|
3303
|
+
pad++;
|
|
3304
|
+
idx -= 3;
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
if (pad === 1 && idx >= 0) {
|
|
3309
|
+
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
3310
|
+
pad++;
|
|
3311
|
+
} else if (tailIsPct3D(idx)) {
|
|
3312
|
+
pad++;
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3316
|
+
const groups = Math.floor(effectiveLen / 4);
|
|
3317
|
+
const bytes = groups * 3 - (pad || 0);
|
|
3318
|
+
return bytes > 0 ? bytes : 0;
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
|
|
3322
|
+
return Buffer.byteLength(body, 'utf8');
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
3326
|
+
// a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
|
|
3327
|
+
// Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
|
|
3328
|
+
// but 3 UTF-8 bytes).
|
|
3329
|
+
let bytes = 0;
|
|
3330
|
+
for (let i = 0, len = body.length; i < len; i++) {
|
|
3331
|
+
const c = body.charCodeAt(i);
|
|
3332
|
+
if (c < 0x80) {
|
|
3333
|
+
bytes += 1;
|
|
3334
|
+
} else if (c < 0x800) {
|
|
3335
|
+
bytes += 2;
|
|
3336
|
+
} else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
|
|
3337
|
+
const next = body.charCodeAt(i + 1);
|
|
3338
|
+
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
3339
|
+
bytes += 4;
|
|
3340
|
+
i++;
|
|
3341
|
+
} else {
|
|
3342
|
+
bytes += 3;
|
|
3343
|
+
}
|
|
3344
|
+
} else {
|
|
3345
|
+
bytes += 3;
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3348
|
+
return bytes;
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
const VERSION$1 = "1.16.0";
|
|
3123
3352
|
|
|
3124
|
-
const
|
|
3125
|
-
Request,
|
|
3126
|
-
Response,
|
|
3127
|
-
}))(utils$1.global);
|
|
3353
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3128
3354
|
|
|
3129
|
-
const {
|
|
3355
|
+
const { isFunction } = utils$1;
|
|
3130
3356
|
|
|
3131
3357
|
const test = (fn, ...args) => {
|
|
3132
3358
|
try {
|
|
@@ -3137,11 +3363,17 @@ const test = (fn, ...args) => {
|
|
|
3137
3363
|
};
|
|
3138
3364
|
|
|
3139
3365
|
const factory = (env) => {
|
|
3366
|
+
const globalObject = utils$1.global ?? globalThis;
|
|
3367
|
+
const { ReadableStream, TextEncoder } = globalObject;
|
|
3368
|
+
|
|
3140
3369
|
env = utils$1.merge.call(
|
|
3141
3370
|
{
|
|
3142
3371
|
skipUndefined: true,
|
|
3143
3372
|
},
|
|
3144
|
-
|
|
3373
|
+
{
|
|
3374
|
+
Request: globalObject.Request,
|
|
3375
|
+
Response: globalObject.Response,
|
|
3376
|
+
},
|
|
3145
3377
|
env
|
|
3146
3378
|
);
|
|
3147
3379
|
|
|
@@ -3154,7 +3386,7 @@ const factory = (env) => {
|
|
|
3154
3386
|
return false;
|
|
3155
3387
|
}
|
|
3156
3388
|
|
|
3157
|
-
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream
|
|
3389
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
|
|
3158
3390
|
|
|
3159
3391
|
const encodeText =
|
|
3160
3392
|
isFetchSupported &&
|
|
@@ -3172,7 +3404,7 @@ const factory = (env) => {
|
|
|
3172
3404
|
let duplexAccessed = false;
|
|
3173
3405
|
|
|
3174
3406
|
const request = new Request(platform.origin, {
|
|
3175
|
-
body: new ReadableStream
|
|
3407
|
+
body: new ReadableStream(),
|
|
3176
3408
|
method: 'POST',
|
|
3177
3409
|
get duplex() {
|
|
3178
3410
|
duplexAccessed = true;
|
|
@@ -3268,8 +3500,13 @@ const factory = (env) => {
|
|
|
3268
3500
|
headers,
|
|
3269
3501
|
withCredentials = 'same-origin',
|
|
3270
3502
|
fetchOptions,
|
|
3503
|
+
maxContentLength,
|
|
3504
|
+
maxBodyLength,
|
|
3271
3505
|
} = resolveConfig(config);
|
|
3272
3506
|
|
|
3507
|
+
const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
3508
|
+
const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
3509
|
+
|
|
3273
3510
|
let _fetch = envFetch || fetch;
|
|
3274
3511
|
|
|
3275
3512
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
@@ -3291,6 +3528,41 @@ const factory = (env) => {
|
|
|
3291
3528
|
let requestContentLength;
|
|
3292
3529
|
|
|
3293
3530
|
try {
|
|
3531
|
+
// Enforce maxContentLength for data: URLs up-front so we never materialize
|
|
3532
|
+
// an oversized payload. The HTTP adapter applies the same check (see http.js
|
|
3533
|
+
// "if (protocol === 'data:')" branch).
|
|
3534
|
+
if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
|
|
3535
|
+
const estimated = estimateDataURLDecodedBytes(url);
|
|
3536
|
+
if (estimated > maxContentLength) {
|
|
3537
|
+
throw new AxiosError$1(
|
|
3538
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
3539
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3540
|
+
config,
|
|
3541
|
+
request
|
|
3542
|
+
);
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
// Enforce maxBodyLength against the outbound request body before dispatch.
|
|
3547
|
+
// Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
|
|
3548
|
+
// maxBodyLength limit'). Skip when the body length cannot be determined
|
|
3549
|
+
// (e.g. a live ReadableStream supplied by the caller).
|
|
3550
|
+
if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
|
|
3551
|
+
const outboundLength = await resolveBodyLength(headers, data);
|
|
3552
|
+
if (
|
|
3553
|
+
typeof outboundLength === 'number' &&
|
|
3554
|
+
isFinite(outboundLength) &&
|
|
3555
|
+
outboundLength > maxBodyLength
|
|
3556
|
+
) {
|
|
3557
|
+
throw new AxiosError$1(
|
|
3558
|
+
'Request body larger than maxBodyLength limit',
|
|
3559
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
3560
|
+
config,
|
|
3561
|
+
request
|
|
3562
|
+
);
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3294
3566
|
if (
|
|
3295
3567
|
onUploadProgress &&
|
|
3296
3568
|
supportsRequestStream &&
|
|
@@ -3341,6 +3613,9 @@ const factory = (env) => {
|
|
|
3341
3613
|
}
|
|
3342
3614
|
}
|
|
3343
3615
|
|
|
3616
|
+
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
|
3617
|
+
headers.set('User-Agent', 'axios/' + VERSION$1, false);
|
|
3618
|
+
|
|
3344
3619
|
const resolvedOptions = {
|
|
3345
3620
|
...fetchOptions,
|
|
3346
3621
|
signal: composedSignal,
|
|
@@ -3357,10 +3632,28 @@ const factory = (env) => {
|
|
|
3357
3632
|
? _fetch(request, fetchOptions)
|
|
3358
3633
|
: _fetch(url, resolvedOptions));
|
|
3359
3634
|
|
|
3635
|
+
// Cheap pre-check: if the server honestly declares a content-length that
|
|
3636
|
+
// already exceeds the cap, reject before we start streaming.
|
|
3637
|
+
if (hasMaxContentLength) {
|
|
3638
|
+
const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
3639
|
+
if (declaredLength != null && declaredLength > maxContentLength) {
|
|
3640
|
+
throw new AxiosError$1(
|
|
3641
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
3642
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3643
|
+
config,
|
|
3644
|
+
request
|
|
3645
|
+
);
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3360
3649
|
const isStreamResponse =
|
|
3361
3650
|
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
3362
3651
|
|
|
3363
|
-
if (
|
|
3652
|
+
if (
|
|
3653
|
+
supportsResponseStream &&
|
|
3654
|
+
response.body &&
|
|
3655
|
+
(onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
|
|
3656
|
+
) {
|
|
3364
3657
|
const options = {};
|
|
3365
3658
|
|
|
3366
3659
|
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
@@ -3377,8 +3670,24 @@ const factory = (env) => {
|
|
|
3377
3670
|
)) ||
|
|
3378
3671
|
[];
|
|
3379
3672
|
|
|
3673
|
+
let bytesRead = 0;
|
|
3674
|
+
const onChunkProgress = (loadedBytes) => {
|
|
3675
|
+
if (hasMaxContentLength) {
|
|
3676
|
+
bytesRead = loadedBytes;
|
|
3677
|
+
if (bytesRead > maxContentLength) {
|
|
3678
|
+
throw new AxiosError$1(
|
|
3679
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
3680
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3681
|
+
config,
|
|
3682
|
+
request
|
|
3683
|
+
);
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
onProgress && onProgress(loadedBytes);
|
|
3687
|
+
};
|
|
3688
|
+
|
|
3380
3689
|
response = new Response(
|
|
3381
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE,
|
|
3690
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
|
|
3382
3691
|
flush && flush();
|
|
3383
3692
|
unsubscribe && unsubscribe();
|
|
3384
3693
|
}),
|
|
@@ -3393,6 +3702,33 @@ const factory = (env) => {
|
|
|
3393
3702
|
config
|
|
3394
3703
|
);
|
|
3395
3704
|
|
|
3705
|
+
// Fallback enforcement for environments without ReadableStream support
|
|
3706
|
+
// (legacy runtimes). Detect materialized size from typed output; skip
|
|
3707
|
+
// streams/Response passthrough since the user will read those themselves.
|
|
3708
|
+
if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
|
|
3709
|
+
let materializedSize;
|
|
3710
|
+
if (responseData != null) {
|
|
3711
|
+
if (typeof responseData.byteLength === 'number') {
|
|
3712
|
+
materializedSize = responseData.byteLength;
|
|
3713
|
+
} else if (typeof responseData.size === 'number') {
|
|
3714
|
+
materializedSize = responseData.size;
|
|
3715
|
+
} else if (typeof responseData === 'string') {
|
|
3716
|
+
materializedSize =
|
|
3717
|
+
typeof TextEncoder === 'function'
|
|
3718
|
+
? new TextEncoder().encode(responseData).byteLength
|
|
3719
|
+
: responseData.length;
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
|
|
3723
|
+
throw new AxiosError$1(
|
|
3724
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
3725
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
3726
|
+
config,
|
|
3727
|
+
request
|
|
3728
|
+
);
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3396
3732
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3397
3733
|
|
|
3398
3734
|
return await new Promise((resolve, reject) => {
|
|
@@ -3408,6 +3744,17 @@ const factory = (env) => {
|
|
|
3408
3744
|
} catch (err) {
|
|
3409
3745
|
unsubscribe && unsubscribe();
|
|
3410
3746
|
|
|
3747
|
+
// Safari can surface fetch aborts as a DOMException-like object whose
|
|
3748
|
+
// branded getters throw. Prefer our composed signal reason before reading
|
|
3749
|
+
// the caught error, preserving timeout vs cancellation semantics.
|
|
3750
|
+
if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
|
|
3751
|
+
const canceledError = composedSignal.reason;
|
|
3752
|
+
canceledError.config = config;
|
|
3753
|
+
request && (canceledError.request = request);
|
|
3754
|
+
err !== canceledError && (canceledError.cause = err);
|
|
3755
|
+
throw canceledError;
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3411
3758
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
3412
3759
|
throw Object.assign(
|
|
3413
3760
|
new AxiosError$1(
|
|
@@ -3476,11 +3823,13 @@ const knownAdapters = {
|
|
|
3476
3823
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
3477
3824
|
if (fn) {
|
|
3478
3825
|
try {
|
|
3479
|
-
Object.
|
|
3826
|
+
// Null-proto descriptors so a polluted Object.prototype.get cannot turn
|
|
3827
|
+
// these data descriptors into accessor descriptors on the way in.
|
|
3828
|
+
Object.defineProperty(fn, 'name', { __proto__: null, value });
|
|
3480
3829
|
} catch (e) {
|
|
3481
3830
|
// eslint-disable-next-line no-empty
|
|
3482
3831
|
}
|
|
3483
|
-
Object.defineProperty(fn, 'adapterName', { value });
|
|
3832
|
+
Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
|
|
3484
3833
|
}
|
|
3485
3834
|
});
|
|
3486
3835
|
|
|
@@ -3622,8 +3971,15 @@ function dispatchRequest(config) {
|
|
|
3622
3971
|
function onAdapterResolution(response) {
|
|
3623
3972
|
throwIfCancellationRequested(config);
|
|
3624
3973
|
|
|
3625
|
-
//
|
|
3626
|
-
|
|
3974
|
+
// Expose the current response on config so that transformResponse can
|
|
3975
|
+
// attach it to any AxiosError it throws (e.g. on JSON parse failure).
|
|
3976
|
+
// We clean it up afterwards to avoid polluting the config object.
|
|
3977
|
+
config.response = response;
|
|
3978
|
+
try {
|
|
3979
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
3980
|
+
} finally {
|
|
3981
|
+
delete config.response;
|
|
3982
|
+
}
|
|
3627
3983
|
|
|
3628
3984
|
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3629
3985
|
|
|
@@ -3635,11 +3991,16 @@ function dispatchRequest(config) {
|
|
|
3635
3991
|
|
|
3636
3992
|
// Transform response data
|
|
3637
3993
|
if (reason && reason.response) {
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3994
|
+
config.response = reason.response;
|
|
3995
|
+
try {
|
|
3996
|
+
reason.response.data = transformData.call(
|
|
3997
|
+
config,
|
|
3998
|
+
config.transformResponse,
|
|
3999
|
+
reason.response
|
|
4000
|
+
);
|
|
4001
|
+
} finally {
|
|
4002
|
+
delete config.response;
|
|
4003
|
+
}
|
|
3643
4004
|
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
3644
4005
|
}
|
|
3645
4006
|
}
|
|
@@ -3649,8 +4010,6 @@ function dispatchRequest(config) {
|
|
|
3649
4010
|
);
|
|
3650
4011
|
}
|
|
3651
4012
|
|
|
3652
|
-
const VERSION$1 = "1.15.2";
|
|
3653
|
-
|
|
3654
4013
|
const validators$1 = {};
|
|
3655
4014
|
|
|
3656
4015
|
// eslint-disable-next-line func-names
|
|
@@ -3735,7 +4094,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
3735
4094
|
while (i-- > 0) {
|
|
3736
4095
|
const opt = keys[i];
|
|
3737
4096
|
// Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
|
|
3738
|
-
// a non-function validator and cause a TypeError.
|
|
4097
|
+
// a non-function validator and cause a TypeError.
|
|
3739
4098
|
const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
|
|
3740
4099
|
if (validator) {
|
|
3741
4100
|
const value = options[opt];
|
|
@@ -3895,7 +4254,7 @@ let Axios$1 = class Axios {
|
|
|
3895
4254
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
3896
4255
|
|
|
3897
4256
|
headers &&
|
|
3898
|
-
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
4257
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
|
|
3899
4258
|
delete headers[method];
|
|
3900
4259
|
});
|
|
3901
4260
|
|
|
@@ -3998,7 +4357,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
|
|
|
3998
4357
|
};
|
|
3999
4358
|
});
|
|
4000
4359
|
|
|
4001
|
-
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
4360
|
+
utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
|
|
4002
4361
|
function generateHTTPMethod(isForm) {
|
|
4003
4362
|
return function httpMethod(url, data, config) {
|
|
4004
4363
|
return this.request(
|
|
@@ -4018,7 +4377,11 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
|
|
|
4018
4377
|
|
|
4019
4378
|
Axios$1.prototype[method] = generateHTTPMethod();
|
|
4020
4379
|
|
|
4021
|
-
|
|
4380
|
+
// QUERY is a safe/idempotent read method; multipart form bodies don't fit
|
|
4381
|
+
// its semantics, so no queryForm shorthand is generated.
|
|
4382
|
+
if (method !== 'query') {
|
|
4383
|
+
Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
4384
|
+
}
|
|
4022
4385
|
});
|
|
4023
4386
|
|
|
4024
4387
|
/**
|
|
@@ -4352,7 +4715,8 @@ const {
|
|
|
4352
4715
|
formToJSON,
|
|
4353
4716
|
getAdapter,
|
|
4354
4717
|
mergeConfig,
|
|
4718
|
+
create,
|
|
4355
4719
|
} = axios;
|
|
4356
4720
|
|
|
4357
|
-
export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
|
|
4721
|
+
export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, create, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
|
|
4358
4722
|
//# sourceMappingURL=axios.js.map
|