@teammy/server 0.1.4 → 0.1.6
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/main.js +11646 -7952
- package/dist/native-pi-entry.js +14 -1
- package/dist/project-pi-entry.js +46 -8
- package/dist/runtime/workflows/task-bootstrap/prompt.md +2 -0
- package/dist/web/assets/{Assistant-B3h2yQF3.css → Assistant-4yZWjYm-.css} +1 -1
- package/dist/web/assets/Assistant-BNVXOHQZ.js +1 -0
- package/dist/web/assets/Dashboard-zKTK6EZD.js +1 -0
- package/dist/web/assets/Files-DI98WkdW.js +1 -0
- package/dist/web/assets/{Markdown-Bq8P_NBV.js → Markdown-D3cU0ani.js} +4 -4
- package/dist/web/assets/Materials-CK-mbNmo.css +1 -0
- package/dist/web/assets/Materials-CWptgAHz.js +6 -0
- package/dist/web/assets/Sessions-DiDwqXLI.js +1 -0
- package/dist/web/assets/WorkspaceTree-DeAA1QtV.js +1 -0
- package/dist/web/assets/{file-links-CFCIacLV.js → file-links-GfCXWkEh.js} +1 -1
- package/dist/web/assets/index-BwEl1PIa.js +66 -0
- package/dist/web/assets/{index-B-MqU_88.css → index-CTIAGUGG.css} +1 -1
- package/dist/web/downloads/teammy-skill.zip +0 -0
- package/dist/web/index.html +2 -2
- package/node_modules/@isaacs/nonrecursive-glob-match/LICENSE.md +55 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/README.md +333 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts +114 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js +762 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts +4 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js +142 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/commonjs/parse-class.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts +114 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js +758 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.min.js.map +7 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts +4 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.d.ts.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js +138 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js.map +1 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/package.json +56 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/src/index.ts +900 -0
- package/node_modules/@isaacs/nonrecursive-glob-match/src/parse-class.ts +158 -0
- package/node_modules/@wecom/aibot-node-sdk/README.md +786 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/api.d.ts +17 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/client.d.ts +217 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/crypto.d.ts +12 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js +1563 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.cjs.js.map +1 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.d.ts +1324 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js +1544 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/index.esm.js.map +1 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/logger.d.ts +14 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/message-handler.d.ts +29 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/api.d.ts +466 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/common.d.ts +30 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/config.d.ts +34 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/event.d.ts +109 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/index.d.ts +10 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/types/message.d.ts +158 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/utils.d.ts +19 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/wecom-crypto/index.d.ts +46 -0
- package/node_modules/@wecom/aibot-node-sdk/dist/ws.d.ts +161 -0
- package/node_modules/@wecom/aibot-node-sdk/package.json +43 -0
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/axios/CHANGELOG.md +1934 -0
- package/node_modules/axios/LICENSE +7 -0
- package/node_modules/axios/MIGRATION_GUIDE.md +877 -0
- package/node_modules/axios/README.md +2786 -0
- package/node_modules/axios/dist/axios.js +6460 -0
- package/node_modules/axios/dist/axios.min.js +5 -0
- package/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/axios/dist/browser/axios.cjs +6509 -0
- package/node_modules/axios/dist/esm/axios.js +6530 -0
- package/node_modules/axios/dist/esm/axios.min.js +3 -0
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/axios/dist/node/axios.cjs +7491 -0
- package/node_modules/axios/index.d.cts +785 -0
- package/node_modules/axios/index.d.ts +804 -0
- package/node_modules/axios/index.js +45 -0
- package/node_modules/axios/lib/adapters/README.md +36 -0
- package/node_modules/axios/lib/adapters/adapters.js +132 -0
- package/node_modules/axios/lib/adapters/fetch.js +749 -0
- package/node_modules/axios/lib/adapters/http.js +1609 -0
- package/node_modules/axios/lib/adapters/xhr.js +384 -0
- package/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/axios/lib/cancel/CancelToken.js +135 -0
- package/node_modules/axios/lib/cancel/CanceledError.js +22 -0
- package/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/axios/lib/core/Axios.js +361 -0
- package/node_modules/axios/lib/core/AxiosError.js +278 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +487 -0
- package/node_modules/axios/lib/core/InterceptorManager.js +182 -0
- package/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/buildFullPath.js +76 -0
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +115 -0
- package/node_modules/axios/lib/core/mergeConfig.js +237 -0
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/axios/lib/defaults/index.js +178 -0
- package/node_modules/axios/lib/defaults/transitional.js +11 -0
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +165 -0
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
- package/node_modules/axios/lib/helpers/Http2Sessions.js +122 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
- package/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/node_modules/axios/lib/helpers/bind.js +14 -0
- package/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/node_modules/axios/lib/helpers/callbackify.js +18 -0
- package/node_modules/axios/lib/helpers/combineURLs.js +23 -0
- package/node_modules/axios/lib/helpers/composeSignals.js +71 -0
- package/node_modules/axios/lib/helpers/cookies.js +88 -0
- package/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +193 -0
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +149 -0
- package/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
- package/node_modules/axios/lib/helpers/fromDataURI.js +75 -0
- package/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
- package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +11 -0
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +72 -0
- package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
- package/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +120 -0
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +520 -0
- package/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/axios/lib/helpers/throttle.js +45 -0
- package/node_modules/axios/lib/helpers/toFormData.js +279 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/node_modules/axios/lib/helpers/trackStream.js +89 -0
- package/node_modules/axios/lib/helpers/validator.js +112 -0
- package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/axios/lib/platform/common/utils.js +52 -0
- package/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/node/index.js +37 -0
- package/node_modules/axios/lib/utils.js +1201 -0
- package/node_modules/axios/node_modules/agent-base/README.md +145 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/package.json +64 -0
- package/node_modules/axios/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/axios/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/axios/package.json +202 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +79 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/eventemitter3/README.md +85 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
- package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
- package/node_modules/eventemitter3/index.d.ts +135 -0
- package/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/eventemitter3/index.mjs +4 -0
- package/node_modules/eventemitter3/package.json +62 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +183 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +714 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/form-data/CHANGELOG.md +686 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md +355 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +4 -0
- package/node_modules/form-data/lib/form_data.js +506 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/package.json +82 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/glob/README.md +388 -214
- package/node_modules/glob/dist/commonjs/glob.d.ts +20 -11
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/glob.js +22 -29
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -1
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +1 -1
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/has-magic.js +1 -4
- package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -1
- package/node_modules/glob/dist/commonjs/ignore.d.ts +16 -4
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/ignore.js +24 -4
- package/node_modules/glob/dist/commonjs/ignore.js.map +1 -1
- package/node_modules/glob/dist/commonjs/index.d.ts +3 -2
- package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/index.js.map +1 -1
- package/node_modules/glob/dist/commonjs/index.min.js +2 -3
- package/node_modules/glob/dist/commonjs/index.min.js.map +4 -4
- package/node_modules/glob/dist/commonjs/pattern.d.ts +10 -3
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/pattern.js +27 -15
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -1
- package/node_modules/glob/dist/commonjs/processor.d.ts +23 -10
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/processor.js +36 -23
- package/node_modules/glob/dist/commonjs/processor.js.map +1 -1
- package/node_modules/glob/dist/commonjs/walker.d.ts +19 -17
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -1
- package/node_modules/glob/dist/commonjs/walker.js +50 -35
- package/node_modules/glob/dist/commonjs/walker.js.map +1 -1
- package/node_modules/glob/dist/esm/glob.d.ts +20 -11
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/glob.js +22 -29
- package/node_modules/glob/dist/esm/glob.js.map +1 -1
- package/node_modules/glob/dist/esm/has-magic.d.ts +1 -1
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/has-magic.js +1 -4
- package/node_modules/glob/dist/esm/has-magic.js.map +1 -1
- package/node_modules/glob/dist/esm/ignore.d.ts +16 -4
- package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/ignore.js +25 -5
- package/node_modules/glob/dist/esm/ignore.js.map +1 -1
- package/node_modules/glob/dist/esm/index.d.ts +3 -2
- package/node_modules/glob/dist/esm/index.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/index.js.map +1 -1
- package/node_modules/glob/dist/esm/index.min.js +2 -3
- package/node_modules/glob/dist/esm/index.min.js.map +4 -4
- package/node_modules/glob/dist/esm/pattern.d.ts +10 -3
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/pattern.js +27 -15
- package/node_modules/glob/dist/esm/pattern.js.map +1 -1
- package/node_modules/glob/dist/esm/processor.d.ts +23 -10
- package/node_modules/glob/dist/esm/processor.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/processor.js +36 -23
- package/node_modules/glob/dist/esm/processor.js.map +1 -1
- package/node_modules/glob/dist/esm/walker.d.ts +19 -17
- package/node_modules/glob/dist/esm/walker.d.ts.map +1 -1
- package/node_modules/glob/dist/esm/walker.js +51 -36
- package/node_modules/glob/dist/esm/walker.js.map +1 -1
- package/node_modules/glob/package.json +28 -12
- package/node_modules/glob/src/glob.ts +655 -0
- package/node_modules/glob/src/has-magic.ts +23 -0
- package/node_modules/glob/src/ignore.ts +162 -0
- package/node_modules/glob/src/index.ts +225 -0
- package/node_modules/glob/src/pattern.ts +286 -0
- package/node_modules/glob/src/processor.ts +333 -0
- package/node_modules/glob/src/walker.ts +523 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +58 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/minimatch/README.md +125 -107
- package/node_modules/minimatch/dist/commonjs/index.d.ts +49 -38
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/minimatch/dist/commonjs/index.js +782 -359
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -1
- package/node_modules/minimatch/dist/esm/index.d.ts +49 -38
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -1
- package/node_modules/minimatch/dist/esm/index.js +781 -356
- package/node_modules/minimatch/dist/esm/index.js.map +1 -1
- package/node_modules/minimatch/package.json +5 -4
- package/node_modules/path-scurry/README.md +0 -1
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +7 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/path-scurry/dist/commonjs/index.js +59 -21
- package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -1
- package/node_modules/path-scurry/dist/esm/index.d.ts +7 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -1
- package/node_modules/path-scurry/dist/esm/index.js +42 -14
- package/node_modules/path-scurry/dist/esm/index.js.map +1 -1
- package/node_modules/path-scurry/package.json +4 -4
- package/node_modules/proxy-from-env/LICENSE +20 -0
- package/node_modules/proxy-from-env/README.md +163 -0
- package/node_modules/proxy-from-env/index.cjs +105 -0
- package/node_modules/proxy-from-env/index.js +103 -0
- package/node_modules/proxy-from-env/package.json +43 -0
- package/package.json +3 -1
- package/dist/web/assets/Assistant-DSQAdSiW.js +0 -1
- package/dist/web/assets/Dashboard-dCu2Cdxd.js +0 -1
- package/dist/web/assets/Files-cRhoWviM.js +0 -1
- package/dist/web/assets/Sessions-BxHsX1C5.js +0 -1
- package/dist/web/assets/WorkspaceTree-CD94JsaJ.js +0 -1
- package/dist/web/assets/index-BXpTaAUz.js +0 -66
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/ast.js +0 -845
- package/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
- package/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/ast.js +0 -841
- package/node_modules/minimatch/dist/esm/ast.js.map +0 -1
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
- package/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import AxiosError from '../core/AxiosError.js';
|
|
5
|
+
import { DEFAULT_FORM_DATA_MAX_DEPTH } from './toFormData.js';
|
|
6
|
+
|
|
7
|
+
const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
|
|
8
|
+
|
|
9
|
+
function throwIfDepthExceeded(index) {
|
|
10
|
+
if (index > MAX_DEPTH) {
|
|
11
|
+
throw new AxiosError(
|
|
12
|
+
'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,
|
|
13
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
20
|
+
*
|
|
21
|
+
* @param {string} name - The name of the property to get.
|
|
22
|
+
*
|
|
23
|
+
* @returns An array of strings.
|
|
24
|
+
*/
|
|
25
|
+
function parsePropPath(name) {
|
|
26
|
+
// foo[x][y][z] -> ['foo', 'x', 'y', 'z']
|
|
27
|
+
// foo.x.y.z -> ['foo', 'x', 'y', 'z']
|
|
28
|
+
// A path is split on `.` and on `[...]` groups. A segment — whether written
|
|
29
|
+
// in dot notation or captured inside brackets — may contain any character
|
|
30
|
+
// except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept
|
|
31
|
+
// literal instead of being split (#5402). `.`, `[` and `]` keep their existing
|
|
32
|
+
// meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.
|
|
33
|
+
// Excluding `[` from the bracket group also makes the match fail fast at the
|
|
34
|
+
// next `[`, so a malformed name cannot rescan to the end of the string from
|
|
35
|
+
// every unmatched `[` — parsing stays linear in the length of the name.
|
|
36
|
+
const path = [];
|
|
37
|
+
const pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
|
|
38
|
+
let match;
|
|
39
|
+
|
|
40
|
+
while ((match = pattern.exec(name)) !== null) {
|
|
41
|
+
throwIfDepthExceeded(path.length);
|
|
42
|
+
path.push(match[0] === '[]' ? '' : match[1] || match[0]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return path;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Convert an array to an object.
|
|
50
|
+
*
|
|
51
|
+
* @param {Array<any>} arr - The array to convert to an object.
|
|
52
|
+
*
|
|
53
|
+
* @returns An object with the same keys and values as the array.
|
|
54
|
+
*/
|
|
55
|
+
function arrayToObject(arr) {
|
|
56
|
+
const obj = {};
|
|
57
|
+
const keys = Object.keys(arr);
|
|
58
|
+
let i;
|
|
59
|
+
const len = keys.length;
|
|
60
|
+
let key;
|
|
61
|
+
for (i = 0; i < len; i++) {
|
|
62
|
+
key = keys[i];
|
|
63
|
+
obj[key] = arr[key];
|
|
64
|
+
}
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function normalizeArray(value) {
|
|
69
|
+
if (!utils.isArray(value)) return value;
|
|
70
|
+
|
|
71
|
+
const keys = Object.keys(value);
|
|
72
|
+
return keys.length !== value.length || keys.some((key, index) => key !== String(index))
|
|
73
|
+
? arrayToObject(value)
|
|
74
|
+
: value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function normalizeArrays(obj) {
|
|
78
|
+
const pending = [obj];
|
|
79
|
+
while (pending.length) {
|
|
80
|
+
const target = pending.pop();
|
|
81
|
+
Object.keys(target).forEach((key) => {
|
|
82
|
+
const value = (target[key] = normalizeArray(target[key]));
|
|
83
|
+
if (utils.isArray(value) || utils.isPlainObject(value)) {
|
|
84
|
+
pending.push(value);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* It takes a FormData object and returns a JavaScript object
|
|
93
|
+
*
|
|
94
|
+
* @param {string} formData The FormData object to convert to JSON.
|
|
95
|
+
*
|
|
96
|
+
* @returns {Object<string, any> | null} The converted object.
|
|
97
|
+
*/
|
|
98
|
+
function formDataToJSON(formData) {
|
|
99
|
+
function buildPath(path, value, target, index) {
|
|
100
|
+
throwIfDepthExceeded(index);
|
|
101
|
+
|
|
102
|
+
let name = path[index++];
|
|
103
|
+
|
|
104
|
+
if (name === '__proto__') return true;
|
|
105
|
+
|
|
106
|
+
const isNumericKey = Number.isFinite(+name);
|
|
107
|
+
const isLast = index >= path.length;
|
|
108
|
+
name = !name && utils.isArray(target) ? target.length : name;
|
|
109
|
+
|
|
110
|
+
if (isLast) {
|
|
111
|
+
if (utils.hasOwnProp(target, name)) {
|
|
112
|
+
target[name] = normalizeArray(target[name]);
|
|
113
|
+
target[name] = utils.isArray(target[name])
|
|
114
|
+
? target[name].concat(value)
|
|
115
|
+
: [target[name], value];
|
|
116
|
+
} else {
|
|
117
|
+
target[name] = value;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return !isNumericKey;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {
|
|
124
|
+
target[name] = [];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const result = buildPath(path, value, target[name], index);
|
|
128
|
+
|
|
129
|
+
if (result && utils.isArray(target[name])) {
|
|
130
|
+
target[name] = arrayToObject(target[name]);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return !isNumericKey;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
|
137
|
+
const obj = {};
|
|
138
|
+
|
|
139
|
+
utils.forEachEntry(formData, (name, value) => {
|
|
140
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
return normalizeArrays(obj);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export default formDataToJSON;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import util from 'util';
|
|
2
|
+
import { Readable } from 'stream';
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import readBlob from './readBlob.js';
|
|
5
|
+
import platform from '../platform/index.js';
|
|
6
|
+
|
|
7
|
+
const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';
|
|
8
|
+
|
|
9
|
+
const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
|
|
10
|
+
|
|
11
|
+
const CRLF = '\r\n';
|
|
12
|
+
const CRLF_BYTES = textEncoder.encode(CRLF);
|
|
13
|
+
const CRLF_BYTES_COUNT = 2;
|
|
14
|
+
|
|
15
|
+
class FormDataPart {
|
|
16
|
+
constructor(name, value) {
|
|
17
|
+
const { escapeName } = this.constructor;
|
|
18
|
+
const isStringValue = utils.isString(value);
|
|
19
|
+
|
|
20
|
+
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
|
|
21
|
+
!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
|
|
22
|
+
}${CRLF}`;
|
|
23
|
+
|
|
24
|
+
if (isStringValue) {
|
|
25
|
+
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
26
|
+
} else {
|
|
27
|
+
const safeType = String(value.type || 'application/octet-stream').replace(/[\r\n]/g, '');
|
|
28
|
+
headers += `Content-Type: ${safeType}${CRLF}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
this.headers = textEncoder.encode(headers + CRLF);
|
|
32
|
+
|
|
33
|
+
this.contentLength = isStringValue ? value.byteLength : value.size;
|
|
34
|
+
|
|
35
|
+
this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
|
|
36
|
+
|
|
37
|
+
this.name = name;
|
|
38
|
+
this.value = value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async *encode() {
|
|
42
|
+
yield this.headers;
|
|
43
|
+
|
|
44
|
+
const { value } = this;
|
|
45
|
+
|
|
46
|
+
if (utils.isTypedArray(value)) {
|
|
47
|
+
yield value;
|
|
48
|
+
} else {
|
|
49
|
+
yield* readBlob(value);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
yield CRLF_BYTES;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static escapeName(name) {
|
|
56
|
+
return String(name).replace(
|
|
57
|
+
/[\r\n"]/g,
|
|
58
|
+
(match) =>
|
|
59
|
+
({
|
|
60
|
+
'\r': '%0D',
|
|
61
|
+
'\n': '%0A',
|
|
62
|
+
'"': '%22',
|
|
63
|
+
})[match]
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const formDataToStream = (form, headersHandler, options) => {
|
|
69
|
+
const {
|
|
70
|
+
tag = 'form-data-boundary',
|
|
71
|
+
size = 25,
|
|
72
|
+
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET),
|
|
73
|
+
} = options || {};
|
|
74
|
+
|
|
75
|
+
if (!utils.isFormData(form)) {
|
|
76
|
+
throw new TypeError('FormData instance required');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (boundary.length < 1 || boundary.length > 70) {
|
|
80
|
+
throw new Error('boundary must be 1-70 characters long');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
|
84
|
+
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
|
|
85
|
+
let contentLength = footerBytes.byteLength;
|
|
86
|
+
|
|
87
|
+
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
88
|
+
const part = new FormDataPart(name, value);
|
|
89
|
+
contentLength += part.size;
|
|
90
|
+
return part;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
contentLength += boundaryBytes.byteLength * parts.length;
|
|
94
|
+
|
|
95
|
+
contentLength = utils.toFiniteNumber(contentLength);
|
|
96
|
+
|
|
97
|
+
const computedHeaders = {
|
|
98
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
if (Number.isFinite(contentLength)) {
|
|
102
|
+
computedHeaders['Content-Length'] = contentLength;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
headersHandler && headersHandler(computedHeaders);
|
|
106
|
+
|
|
107
|
+
return Readable.from(
|
|
108
|
+
(async function* () {
|
|
109
|
+
for (const part of parts) {
|
|
110
|
+
yield boundaryBytes;
|
|
111
|
+
yield* part.encode();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
yield footerBytes;
|
|
115
|
+
})()
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default formDataToStream;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import AxiosError from '../core/AxiosError.js';
|
|
4
|
+
import parseProtocol from './parseProtocol.js';
|
|
5
|
+
import platform from '../platform/index.js';
|
|
6
|
+
|
|
7
|
+
// RFC 2397: data:[<mediatype>][;base64],<data>
|
|
8
|
+
// mediatype = type/subtype followed by optional ;name=value parameters
|
|
9
|
+
// The `i` flag makes the `;base64` token case-insensitive, matching the WHATWG
|
|
10
|
+
// URL/Fetch data URL processor (and therefore the fetch adapter and browsers).
|
|
11
|
+
// The remaining character classes do not depend on letter case.
|
|
12
|
+
const DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/i;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Parse data uri to a Buffer or Blob
|
|
16
|
+
*
|
|
17
|
+
* @param {String} uri
|
|
18
|
+
* @param {?Boolean} asBlob
|
|
19
|
+
* @param {?Object} options
|
|
20
|
+
* @param {?Function} options.Blob
|
|
21
|
+
*
|
|
22
|
+
* @returns {Buffer|Blob}
|
|
23
|
+
*/
|
|
24
|
+
export default function fromDataURI(uri, asBlob, options) {
|
|
25
|
+
const _Blob = (options && options.Blob) || platform.classes.Blob;
|
|
26
|
+
const protocol = parseProtocol(uri);
|
|
27
|
+
|
|
28
|
+
if (asBlob === undefined && _Blob) {
|
|
29
|
+
asBlob = true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (protocol === 'data') {
|
|
33
|
+
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
34
|
+
|
|
35
|
+
const match = DATA_URL_PATTERN.exec(uri);
|
|
36
|
+
|
|
37
|
+
if (!match) {
|
|
38
|
+
throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const type = match[1];
|
|
42
|
+
const params = match[2];
|
|
43
|
+
const encoding = match[3] ? 'base64' : 'utf8';
|
|
44
|
+
const body = match[4];
|
|
45
|
+
|
|
46
|
+
// RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII
|
|
47
|
+
// Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec.
|
|
48
|
+
let mime = '';
|
|
49
|
+
if (type) {
|
|
50
|
+
mime = params ? type + params : type;
|
|
51
|
+
} else if (params) {
|
|
52
|
+
mime = 'text/plain' + params;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const buffer =
|
|
56
|
+
encoding === 'base64'
|
|
57
|
+
? Buffer.from(
|
|
58
|
+
body.replace(/%([\da-f]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))),
|
|
59
|
+
'base64'
|
|
60
|
+
)
|
|
61
|
+
: Buffer.from(decodeURIComponent(body), encoding);
|
|
62
|
+
|
|
63
|
+
if (asBlob) {
|
|
64
|
+
if (!_Blob) {
|
|
65
|
+
throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return new _Blob([buffer], { type: mime });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return buffer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
75
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether the specified URL is absolute
|
|
5
|
+
*
|
|
6
|
+
* @param {string} url The URL to test
|
|
7
|
+
*
|
|
8
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
9
|
+
*/
|
|
10
|
+
export default function isAbsoluteURL(url) {
|
|
11
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
12
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
13
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
14
|
+
if (typeof url !== 'string') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Determines whether the payload is an error thrown by Axios
|
|
7
|
+
*
|
|
8
|
+
* @param {*} payload The value to test
|
|
9
|
+
*
|
|
10
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
11
|
+
*/
|
|
12
|
+
export default function isAxiosError(payload) {
|
|
13
|
+
return utils.isObject(payload) && payload.isAxiosError === true;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import platform from '../platform/index.js';
|
|
2
|
+
|
|
3
|
+
export default platform.hasStandardBrowserEnv
|
|
4
|
+
? ((origin) => (url) => {
|
|
5
|
+
url = new URL(url, document.baseURI || platform.origin);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
origin.protocol === url.protocol && origin.host === url.host && origin.port === url.port
|
|
9
|
+
);
|
|
10
|
+
})(new URL(platform.origin))
|
|
11
|
+
: () => true;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const urlParserControlCharacters = /[\t\n\r]/g;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Match WHATWG URL preprocessing before checking a URL's protocol.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} url
|
|
9
|
+
*
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
export default function normalizeURLForProtocolCheck(url) {
|
|
13
|
+
if (typeof url !== 'string') {
|
|
14
|
+
return url;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let start = 0;
|
|
18
|
+
|
|
19
|
+
while (start < url.length && url.charCodeAt(start) <= 0x20) {
|
|
20
|
+
start++;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return url.slice(start).replace(urlParserControlCharacters, '');
|
|
24
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
|
|
5
|
+
// RawAxiosHeaders whose duplicates are ignored by node
|
|
6
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
7
|
+
const ignoreDuplicateOf = utils.toObjectSet([
|
|
8
|
+
'age',
|
|
9
|
+
'authorization',
|
|
10
|
+
'content-length',
|
|
11
|
+
'content-type',
|
|
12
|
+
'etag',
|
|
13
|
+
'expires',
|
|
14
|
+
'from',
|
|
15
|
+
'host',
|
|
16
|
+
'if-modified-since',
|
|
17
|
+
'if-unmodified-since',
|
|
18
|
+
'last-modified',
|
|
19
|
+
'location',
|
|
20
|
+
'max-forwards',
|
|
21
|
+
'proxy-authorization',
|
|
22
|
+
'referer',
|
|
23
|
+
'retry-after',
|
|
24
|
+
'user-agent',
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Parse headers into an object
|
|
29
|
+
*
|
|
30
|
+
* ```
|
|
31
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
32
|
+
* Content-Type: application/json
|
|
33
|
+
* Connection: keep-alive
|
|
34
|
+
* Transfer-Encoding: chunked
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
38
|
+
*
|
|
39
|
+
* @returns {Object} Headers parsed into an object
|
|
40
|
+
*/
|
|
41
|
+
export default (rawHeaders) => {
|
|
42
|
+
// Header names are data, including __proto__; avoid inherited setters.
|
|
43
|
+
const parsed = Object.create(null);
|
|
44
|
+
let key;
|
|
45
|
+
let val;
|
|
46
|
+
let i;
|
|
47
|
+
|
|
48
|
+
rawHeaders &&
|
|
49
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
50
|
+
i = line.indexOf(':');
|
|
51
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
52
|
+
val = line.substring(i + 1).trim();
|
|
53
|
+
|
|
54
|
+
const hasKey = utils.hasOwnProp(parsed, key);
|
|
55
|
+
|
|
56
|
+
if (!key || (hasKey && utils.hasOwnProp(ignoreDuplicateOf, key))) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (key === 'set-cookie') {
|
|
61
|
+
if (hasKey) {
|
|
62
|
+
parsed[key].push(val);
|
|
63
|
+
} else {
|
|
64
|
+
parsed[key] = [val];
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
parsed[key] = hasKey ? parsed[key] + ', ' + val : val;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return parsed;
|
|
72
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import speedometer from './speedometer.js';
|
|
2
|
+
import throttle from './throttle.js';
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
|
|
5
|
+
export const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
6
|
+
let bytesNotified = 0;
|
|
7
|
+
const _speedometer = speedometer(50, 250);
|
|
8
|
+
|
|
9
|
+
return throttle((e) => {
|
|
10
|
+
if (!e || !utils.isNumber(e.loaded)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const rawLoaded = e.loaded;
|
|
14
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
15
|
+
const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
|
|
16
|
+
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
17
|
+
const rate = _speedometer(progressBytes);
|
|
18
|
+
|
|
19
|
+
bytesNotified = Math.max(bytesNotified, loaded);
|
|
20
|
+
|
|
21
|
+
const data = {
|
|
22
|
+
loaded,
|
|
23
|
+
total,
|
|
24
|
+
progress: total ? loaded / total : undefined,
|
|
25
|
+
bytes: progressBytes,
|
|
26
|
+
rate: rate ? rate : undefined,
|
|
27
|
+
estimated: rate && total ? (total - loaded) / rate : undefined,
|
|
28
|
+
event: e,
|
|
29
|
+
lengthComputable: total != null,
|
|
30
|
+
[isDownloadStream ? 'download' : 'upload']: true,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
listener(data);
|
|
34
|
+
}, freq);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const progressEventDecorator = (total, throttled) => {
|
|
38
|
+
const lengthComputable = total != null;
|
|
39
|
+
|
|
40
|
+
return [
|
|
41
|
+
(loaded) =>
|
|
42
|
+
throttled[0]({
|
|
43
|
+
lengthComputable,
|
|
44
|
+
total,
|
|
45
|
+
loaded,
|
|
46
|
+
}),
|
|
47
|
+
throttled[1],
|
|
48
|
+
];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const asyncDecorator =
|
|
52
|
+
(fn, scheduler = utils.asap) =>
|
|
53
|
+
(...args) =>
|
|
54
|
+
scheduler(() => fn(...args));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { asyncIterator } = Symbol;
|
|
2
|
+
|
|
3
|
+
const readBlob = async function* (blob) {
|
|
4
|
+
if (blob.stream) {
|
|
5
|
+
yield* blob.stream();
|
|
6
|
+
} else if (blob.arrayBuffer) {
|
|
7
|
+
yield await blob.arrayBuffer();
|
|
8
|
+
} else if (blob[asyncIterator]) {
|
|
9
|
+
yield* blob[asyncIterator]();
|
|
10
|
+
} else {
|
|
11
|
+
yield blob;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default readBlob;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import platform from '../platform/index.js';
|
|
2
|
+
import utils from '../utils.js';
|
|
3
|
+
import AxiosError from '../core/AxiosError.js';
|
|
4
|
+
import isURLSameOrigin from './isURLSameOrigin.js';
|
|
5
|
+
import cookies from './cookies.js';
|
|
6
|
+
import buildFullPath from '../core/buildFullPath.js';
|
|
7
|
+
import mergeConfig from '../core/mergeConfig.js';
|
|
8
|
+
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
9
|
+
import setFormDataHeaders from '../core/setFormDataHeaders.js';
|
|
10
|
+
import buildURL from './buildURL.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
|
|
14
|
+
* This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} str The string to encode
|
|
17
|
+
*
|
|
18
|
+
* @returns {string} UTF-8 bytes as a Latin-1 string
|
|
19
|
+
*/
|
|
20
|
+
const encodeUTF8 = (str) =>
|
|
21
|
+
encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
|
|
22
|
+
String.fromCharCode(parseInt(hex, 16))
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const readCookie = (name) => cookies.read(name);
|
|
26
|
+
|
|
27
|
+
function resolveConfig(config, readXsrfCookie = readCookie) {
|
|
28
|
+
const newConfig = mergeConfig({}, config);
|
|
29
|
+
|
|
30
|
+
// Read only own properties to prevent prototype pollution gadgets
|
|
31
|
+
// (e.g. Object.prototype.baseURL = 'https://evil.com').
|
|
32
|
+
const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
|
|
33
|
+
|
|
34
|
+
const data = own('data');
|
|
35
|
+
let withXSRFToken = own('withXSRFToken');
|
|
36
|
+
const xsrfHeaderName = own('xsrfHeaderName');
|
|
37
|
+
const xsrfCookieName = own('xsrfCookieName');
|
|
38
|
+
let headers = own('headers');
|
|
39
|
+
const auth = own('auth');
|
|
40
|
+
const baseURL = own('baseURL');
|
|
41
|
+
const allowAbsoluteUrls = own('allowAbsoluteUrls');
|
|
42
|
+
const url = own('url');
|
|
43
|
+
|
|
44
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
45
|
+
|
|
46
|
+
newConfig.url = buildURL(
|
|
47
|
+
buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
|
|
48
|
+
own('params'),
|
|
49
|
+
own('paramsSerializer')
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
// HTTP basic authentication
|
|
53
|
+
if (auth) {
|
|
54
|
+
const username = utils.getSafeProp(auth, 'username') || '';
|
|
55
|
+
const password = utils.getSafeProp(auth, 'password') || '';
|
|
56
|
+
const transitional = own('transitional');
|
|
57
|
+
const encodeUsername =
|
|
58
|
+
transitional &&
|
|
59
|
+
utils.hasOwnProp(transitional, 'encodeBasicAuthUsername') &&
|
|
60
|
+
transitional.encodeBasicAuthUsername === true;
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
headers.set(
|
|
64
|
+
'Authorization',
|
|
65
|
+
// Preserve legacy username bytes unless the caller opts in to UTF-8.
|
|
66
|
+
'Basic ' +
|
|
67
|
+
btoa(
|
|
68
|
+
(encodeUsername ? encodeUTF8(username) : username) +
|
|
69
|
+
':' +
|
|
70
|
+
(password ? encodeUTF8(password) : '')
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
} catch (e) {
|
|
74
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (utils.isFormData(data)) {
|
|
79
|
+
const getHeaders = utils.getSafeProp(data, 'getHeaders');
|
|
80
|
+
|
|
81
|
+
if (
|
|
82
|
+
platform.hasStandardBrowserEnv ||
|
|
83
|
+
platform.hasStandardBrowserWebWorkerEnv ||
|
|
84
|
+
utils.isReactNative(data)
|
|
85
|
+
) {
|
|
86
|
+
headers.setContentType(undefined); // browser/web worker/RN handles it
|
|
87
|
+
} else if (utils.isFunction(getHeaders)) {
|
|
88
|
+
// Node.js FormData (like form-data package)
|
|
89
|
+
setFormDataHeaders(headers, getHeaders.call(data), own('formDataHeaderPolicy'));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Add xsrf header
|
|
94
|
+
// This is only done if running in a standard browser environment.
|
|
95
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
96
|
+
|
|
97
|
+
if (platform.hasStandardBrowserEnv) {
|
|
98
|
+
if (utils.isFunction(withXSRFToken)) {
|
|
99
|
+
withXSRFToken = withXSRFToken(newConfig);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
103
|
+
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
104
|
+
// the XSRF token cross-origin.
|
|
105
|
+
const shouldSendXSRF =
|
|
106
|
+
withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
107
|
+
|
|
108
|
+
if (shouldSendXSRF) {
|
|
109
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
|
|
110
|
+
|
|
111
|
+
if (xsrfValue) {
|
|
112
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return newConfig;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default resolveConfig;
|